From 53f44007315f9de42751a64e2effdd0093787661 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Wed, 4 Oct 2023 14:07:39 +0200 Subject: [PATCH] rename Requests namespace to requests --- .../CorpusAnalysisStaticVisualization.js | 2 +- app/static/js/ResourceDisplays/CorpusDisplay.js | 2 +- app/static/js/ResourceLists/AdminUserList.js | 2 +- app/static/js/ResourceLists/CorpusFileList.js | 8 ++++---- app/static/js/ResourceLists/CorpusFollowerList.js | 6 +++--- app/static/js/ResourceLists/CorpusList.js | 8 ++++---- app/static/js/ResourceLists/JobList.js | 4 ++-- .../js/ResourceLists/SpacyNLPPipelineModelList.js | 4 ++-- .../js/ResourceLists/TesseractOCRPipelineModelList.js | 4 ++-- app/templates/_scripts.html.j2 | 3 ++- app/templates/admin/user_settings.html.j2 | 2 +- app/templates/corpora/corpus.html.j2 | 10 +++++----- app/templates/corpora/public_corpus.html.j2 | 8 ++++---- app/templates/jobs/job.html.j2 | 6 +++--- app/templates/users/settings/settings.html.j2 | 8 ++++---- 15 files changed, 39 insertions(+), 38 deletions(-) diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisStaticVisualization.js b/app/static/js/CorpusAnalysis/CorpusAnalysisStaticVisualization.js index 38c48c3c..a88bd2d0 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisStaticVisualization.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisStaticVisualization.js @@ -75,7 +75,7 @@ class CorpusAnalysisStaticVisualization { getStopwords() { this.data.promises.getStopwords = new Promise((resolve, reject) => { - Requests.corpora.entity.getStopwords() + requests.corpora.entity.getStopwords() .then((response) => { response.json() .then((json) => { diff --git a/app/static/js/ResourceDisplays/CorpusDisplay.js b/app/static/js/ResourceDisplays/CorpusDisplay.js index ef9dc8b8..29e8b205 100644 --- a/app/static/js/ResourceDisplays/CorpusDisplay.js +++ b/app/static/js/ResourceDisplays/CorpusDisplay.js @@ -5,7 +5,7 @@ class CorpusDisplay extends ResourceDisplay { this.displayElement .querySelector('.action-button[data-action="build-request"]') .addEventListener('click', (event) => { - Requests.corpora.entity.build(this.corpusId); + requests.corpora.entity.build(this.corpusId); }); } diff --git a/app/static/js/ResourceLists/AdminUserList.js b/app/static/js/ResourceLists/AdminUserList.js index 0b8f0c16..be159740 100644 --- a/app/static/js/ResourceLists/AdminUserList.js +++ b/app/static/js/ResourceLists/AdminUserList.js @@ -91,7 +91,7 @@ class AdminUserList extends ResourceList { let listAction = listActionElement === null ? 'view' : listActionElement.dataset.listAction; switch (listAction) { case 'delete': { - Requests.users.entity.delete(itemId); + requests.users.entity.delete(itemId); if (itemId === currentUserId) {window.location.href = '/';} break; } diff --git a/app/static/js/ResourceLists/CorpusFileList.js b/app/static/js/ResourceLists/CorpusFileList.js index 9997b061..fc4e9b62 100644 --- a/app/static/js/ResourceLists/CorpusFileList.js +++ b/app/static/js/ResourceLists/CorpusFileList.js @@ -153,12 +153,12 @@ class CorpusFileList extends ResourceList { let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { if (currentUserId != this.userId) { - Requests.corpora.entity.files.ent.delete(this.corpusId, itemId) + requests.corpora.entity.files.ent.delete(this.corpusId, itemId) .then(() => { window.location.reload(); }); } else { - Requests.corpora.entity.files.ent.delete(this.corpusId, itemId) + requests.corpora.entity.files.ent.delete(this.corpusId, itemId) } }); modal.open(); @@ -250,12 +250,12 @@ class CorpusFileList extends ResourceList { confirmElement.addEventListener('click', (event) => { this.selectedItemIds.forEach(selectedItemId => { if (currentUserId != this.userId) { - Requests.corpora.entity.files.ent.delete(this.corpusId, selectedItemId) + requests.corpora.entity.files.ent.delete(this.corpusId, selectedItemId) .then(() => { window.location.reload(); }); } else { - Requests.corpora.entity.files.ent.delete(this.corpusId, selectedItemId); + requests.corpora.entity.files.ent.delete(this.corpusId, selectedItemId); } }); this.selectedItemIds.clear(); diff --git a/app/static/js/ResourceLists/CorpusFollowerList.js b/app/static/js/ResourceLists/CorpusFollowerList.js index ca70a6c7..747719dd 100644 --- a/app/static/js/ResourceLists/CorpusFollowerList.js +++ b/app/static/js/ResourceLists/CorpusFollowerList.js @@ -124,7 +124,7 @@ class CorpusFollowerList extends ResourceList { case 'update-role': { let followerId = listItemElement.dataset.followerId; let roleName = event.target.value; - Requests.corpora.entity.followers.entity.role.update(this.corpusId, followerId, roleName); + requests.corpora.entity.followers.entity.role.update(this.corpusId, followerId, roleName); break; } default: { @@ -144,12 +144,12 @@ class CorpusFollowerList extends ResourceList { case 'unfollow-request': { let followerId = listItemElement.dataset.followerId; if (currentUserId != this.userId) { - Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId) + requests.corpora.entity.followers.entity.delete(this.corpusId, followerId) .then(() => { window.location.reload(); }); } else { - Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId); + requests.corpora.entity.followers.entity.delete(this.corpusId, followerId); } break; } diff --git a/app/static/js/ResourceLists/CorpusList.js b/app/static/js/ResourceLists/CorpusList.js index 985ff1d1..cf1bc6a5 100644 --- a/app/static/js/ResourceLists/CorpusList.js +++ b/app/static/js/ResourceLists/CorpusList.js @@ -171,12 +171,12 @@ class CorpusList extends ResourceList { let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { if (!values['is-owner']) { - Requests.corpora.entity.followers.entity.delete(itemId, currentUserId) + requests.corpora.entity.followers.entity.delete(itemId, currentUserId) .then((response) => { window.location.reload(); }); } else { - Requests.corpora.entity.delete(itemId); + requests.corpora.entity.delete(itemId); } }); modal.open(); @@ -272,9 +272,9 @@ class CorpusList extends ResourceList { let listItem = this.listjs.get('id', selectedItemId)[0].elm; let values = this.listjs.get('id', listItem.dataset.id)[0].values(); if (values['is-owner']) { - Requests.corpora.entity.delete(selectedItemId); + requests.corpora.entity.delete(selectedItemId); } else { - Requests.corpora.entity.followers.entity.delete(selectedItemId, currentUserId); + requests.corpora.entity.followers.entity.delete(selectedItemId, currentUserId); setTimeout(() => { window.location.reload(); }, 1000); diff --git a/app/static/js/ResourceLists/JobList.js b/app/static/js/ResourceLists/JobList.js index 473ae826..be5c85c6 100644 --- a/app/static/js/ResourceLists/JobList.js +++ b/app/static/js/ResourceLists/JobList.js @@ -143,7 +143,7 @@ class JobList extends ResourceList { ); let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { - Requests.jobs.entity.delete(itemId); + requests.jobs.entity.delete(itemId); }); modal.open(); break; @@ -228,7 +228,7 @@ class JobList extends ResourceList { let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { this.selectedItemIds.forEach(selectedItemId => { - Requests.jobs.entity.delete(selectedItemId); + requests.jobs.entity.delete(selectedItemId); }); this.selectedItemIds.clear(); this.renderingItemSelection(); diff --git a/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js b/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js index 46d3739d..9656f40e 100644 --- a/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js +++ b/app/static/js/ResourceLists/SpacyNLPPipelineModelList.js @@ -120,7 +120,7 @@ class SpaCyNLPPipelineModelList extends ResourceList { switch (listAction) { case 'toggle-is-public': { let newIsPublicValue = listActionElement.checked; - Requests.contributions.spacy_nlp_pipeline_models.entity.isPublic.update(itemId, newIsPublicValue) + requests.contributions.spacy_nlp_pipeline_models.entity.isPublic.update(itemId, newIsPublicValue) .catch((response) => { listActionElement.checked = !newIsPublicValue; }); @@ -169,7 +169,7 @@ class SpaCyNLPPipelineModelList extends ResourceList { ); let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { - Requests.contributions.spacy_nlp_pipeline_models.entity.delete(itemId); + requests.contributions.spacy_nlp_pipeline_models.entity.delete(itemId); }); modal.open(); break; diff --git a/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js b/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js index 765f44a6..87f7b8b3 100644 --- a/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js +++ b/app/static/js/ResourceLists/TesseractOCRPipelineModelList.js @@ -129,7 +129,7 @@ class TesseractOCRPipelineModelList extends ResourceList { switch (listAction) { case 'toggle-is-public': { let newIsPublicValue = listActionElement.checked; - Requests.contributions.tesseract_ocr_pipeline_models.entity.isPublic.update(itemId, newIsPublicValue) + requests.contributions.tesseract_ocr_pipeline_models.entity.isPublic.update(itemId, newIsPublicValue) .catch((response) => { listActionElement.checked = !newIsPublicValue; }); @@ -178,7 +178,7 @@ class TesseractOCRPipelineModelList extends ResourceList { ); let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]'); confirmElement.addEventListener('click', (event) => { - Requests.contributions.tesseract_ocr_pipeline_models.entity.delete(itemId); + requests.contributions.tesseract_ocr_pipeline_models.entity.delete(itemId); }); modal.open(); break; diff --git a/app/templates/_scripts.html.j2 b/app/templates/_scripts.html.j2 index 14999fc4..7ebb61c2 100644 --- a/app/templates/_scripts.html.j2 +++ b/app/templates/_scripts.html.j2 @@ -105,6 +105,7 @@ {%- endassets %}