From 850ed16fdc0484b17a0787b86ac1c33c0f0ce7bd Mon Sep 17 00:00:00 2001 From: dobestler Date: Wed, 13 Dec 2023 23:17:48 +0100 Subject: [PATCH 1/2] Disable buttons in "publish to live"-modal while publishing is running (after confirm was clicked) --- .../header-nav/header-nav.component.html | 15 +++++++++++++-- .../components/header-nav/header-nav.component.ts | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/header-nav/header-nav.component.html b/frontend/src/app/components/header-nav/header-nav.component.html index feccbf02..5363b7d2 100644 --- a/frontend/src/app/components/header-nav/header-nav.component.html +++ b/frontend/src/app/components/header-nav/header-nav.component.html @@ -175,17 +175,28 @@ class="btn btn-success mr-2" type="button" (click)="requestPublishRulesTxtToSolr('LIVE')" + [attr.disabled]=" + !currentSolrIndexId || deploymentRunningForStage == 'LIVE' + ? '' + : null + " > - Yes, publish to LIVE + {{ publishToLiveButtonText() }} + diff --git a/frontend/src/app/components/header-nav/header-nav.component.ts b/frontend/src/app/components/header-nav/header-nav.component.ts index 8b14fbde..d08c4630 100644 --- a/frontend/src/app/components/header-nav/header-nav.component.ts +++ b/frontend/src/app/components/header-nav/header-nav.component.ts @@ -88,14 +88,14 @@ export class HeaderNavComponent implements OnInit { this.solrService .updateRulesTxtForSolrIndex(this.currentSolrIndexId, targetPlatform) .then(apiResult => { - this.deploymentRunningForStage = undefined this.modalService.close('confirm-publish-live') + this.deploymentRunningForStage = undefined this.showSuccessMsg(apiResult.message) this.loadLatestDeploymentLogInfo() }) .catch(error => { - this.deploymentRunningForStage = undefined this.modalService.close('confirm-publish-live') + this.deploymentRunningForStage = undefined this.showErrorMsg(error.error.message) }); } // TODO handle else-case, if no currentSolrIndexId selected From 8ad0b0d094b894f9beb1ea8a4d31a7cbf6c8eb9c Mon Sep 17 00:00:00 2001 From: dobestler Date: Fri, 15 Dec 2023 21:58:20 +0100 Subject: [PATCH 2/2] Put animated loading spinner into button while deployment is running --- .../src/app/components/header-nav/header-nav.component.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/header-nav/header-nav.component.html b/frontend/src/app/components/header-nav/header-nav.component.html index 5363b7d2..9ea95c15 100644 --- a/frontend/src/app/components/header-nav/header-nav.component.html +++ b/frontend/src/app/components/header-nav/header-nav.component.html @@ -119,6 +119,7 @@ : null " > + {{ publishToPreliveButtonText() }}