This is an automated email from the ASF dual-hosted git repository. hshpak pushed a commit to branch hot-fix/configuration-page/disabled-endpoint in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit 5c0412e730876430fd72080a9d10b7302cc1e1f7 Author: Hennadii_Shpak <[email protected]> AuthorDate: Mon May 23 17:43:21 2022 +0300 fixed endpoint dropdown --- .../configuration/configuration.component.html | 111 ++++++++++----------- .../configuration/configuration.component.ts | 6 +- 2 files changed, 58 insertions(+), 59 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html index e70ecadee..a69ebe6c5 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html +++ b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html @@ -26,19 +26,18 @@ <div class="control selector-wrapper" [ngClass]="{ 'disabled-select' : !isEndpointsMoreTheOne}"> <mat-form-field [ngClass]="{ 'not-active' : services['provisioning'].isConfigChanged || services['self-service'].isConfigChanged || services['billing'].isConfigChanged }"> <mat-label>Select endpoint</mat-label> - <mat-select - [disabled]="true" - disableOptionCentering - [(value)]="activeEndpoint" - panelClass="top-select scrolling" - [disabled]="services['provisioning'].isConfigChanged - || services['self-service'].isConfigChanged - || services['billing'].isConfigChanged - || !isEndpointsMoreTheOne" + <mat-select + disableOptionCentering + [(value)]="activeEndpoint" + panelClass="top-select scrolling" + [disabled]="services['provisioning'].isConfigChanged + || services['self-service'].isConfigChanged + || services['billing'].isConfigChanged + || !isEndpointsMoreThanOne" > - <mat-option - *ngFor="let endpoint of endpoints" - [value]="endpoint.name" + <mat-option + *ngFor="let endpoint of endpoints" + [value]="endpoint.name" (click)="setActiveEndpoint(endpoint.name)"> {{ endpoint.name === 'local' ? endpoint.name : endpoint.name + ' (external endpoint)'}}{{endpoint.status !== 'ACTIVE' ? ', inactive' : ''}} </mat-option> @@ -53,14 +52,14 @@ </div> <div> <ng-template [ngIf]="activeTab.index !== 0"> - <button + <button mat-raised-button class="butt" (click)="action('save')" [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged" > Save </button> - <button + <button mat-raised-button class="butt" (click)="action('discard')" [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged" @@ -76,9 +75,9 @@ > Restart </button> - <button - mat-raised-button - class="butt" + <button + mat-raised-button + class="butt" (click)="refreshConfig()" > <i class="material-icons refresh-icon">autorenew</i>Refresh @@ -87,16 +86,16 @@ </div> <mat-divider></mat-divider> <div class="configuration-wrapper"> - <mat-tab-group - animationDuration="0.5ms" - (selectedTabChange)="tabChanged($event)" + <mat-tab-group + animationDuration="0.5ms" + (selectedTabChange)="tabChanged($event)" [selectedIndex]="activeTab.index" > - <mat-tab + <mat-tab label="Main" - [disabled]="!(!services['provisioning'].isConfigChanged && - !services['self-service'].isConfigChanged && - !services['billing'].isConfigChanged) && + [disabled]="!(!services['provisioning'].isConfigChanged && + !services['self-service'].isConfigChanged && + !services['billing'].isConfigChanged) && activeTab.index !== 0" > <h4>Main settings</h4> @@ -106,12 +105,12 @@ <div class="section-content"> <ul class="list-menu selection-list"> <li *ngFor="let service of services | keys"> - <p - *ngIf="(activeEndpoint !== 'local' - && (service.key === 'provisioning' || service.key === 'billing') + <p + *ngIf="(activeEndpoint !== 'local' + && (service.key === 'provisioning' || service.key === 'billing') || activeEndpoint === 'local')" - class="list-item" - role="menuitem" + class="list-item" + role="menuitem" > <span (click)="toggleSettings(service.key);$event.stopPropagation()" class="d-flex"> <div class="checkbox-wrap"> @@ -130,28 +129,28 @@ </div> </mat-tab> - <mat-tab + <mat-tab label="Self-service" *ngIf="activeEndpoint === 'local'" - [disabled]="!(!services['provisioning'].isConfigChanged - && !services['self-service'].isConfigChanged - && !services['billing'].isConfigChanged) + [disabled]="!(!services['provisioning'].isConfigChanged + && !services['self-service'].isConfigChanged + && !services['billing'].isConfigChanged) && activeTab.index !== 1" > <h4>Edit self-service.yml</h4> <div class="editor-wrap"> - <div - #selfEditor - ace-editor - mode="yaml" - [(text)]="services['self-service'].config" - [autoUpdateContent]="true" + <div + #selfEditor + ace-editor + mode="yaml" + [(text)]="services['self-service'].config" + [autoUpdateContent]="true" (textChange)="configUpdate('self-service')" ></div> </div> </mat-tab> - <mat-tab + <mat-tab label="Provisioning" [disabled]="!(!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged @@ -160,32 +159,32 @@ > <h4>Edit provisioning.yml</h4> <div class="editor-wrap"> - <div - #provEditor - ace-editor - mode="yaml" - [(text)]="services['provisioning'].config" - [autoUpdateContent]="true" + <div + #provEditor + ace-editor + mode="yaml" + [(text)]="services['provisioning'].config" + [autoUpdateContent]="true" (textChange)="configUpdate('provisioning')" ></div> </div> </mat-tab> - <mat-tab + <mat-tab label="Billing" - [disabled]="!(!services['provisioning'].isConfigChanged - && !services['self-service'].isConfigChanged - && !services['billing'].isConfigChanged) + [disabled]="!(!services['provisioning'].isConfigChanged + && !services['self-service'].isConfigChanged + && !services['billing'].isConfigChanged) && activeTab.index !== 3" > <h4>Edit billing.yml</h4> <div class="editor-wrap"> - <div - #billingEditor - ace-editor - mode="yaml" - [(text)]="services['billing'].config" - [autoUpdateContent]="true" + <div + #billingEditor + ace-editor + mode="yaml" + [(text)]="services['billing'].config" + [autoUpdateContent]="true" (textChange)="configUpdate('billing')" ></div> </div> diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts index 79b12250d..d3930f08f 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts @@ -351,7 +351,7 @@ export class ConfigurationComponent implements OnInit, OnDestroy { this.activeTab.index = 0; } - get isEndpointsMoreTheOne() { + get isEndpointsMoreThanOne() { return this.endpoints.length > 1; } } @@ -369,13 +369,13 @@ export class ConfigurationComponent implements OnInit, OnDestroy { <div mat-dialog-content class="content"> <ng-template [ngIf]="data.action === 'restart' && !data.environmentStatuses[data.activeEndpoint]?.length" ]> - <span class="strong">{{data.services.join(', ') | titlecase}}</span> + <span class="strong">{{data.services.join(', ') | titlecase}}</span> <span class="strong" *ngIf="data.services.length > 1 || (data.services.length === 1 && data.services[0] !== 'self-service')"> service</span> <span class="strong" [hidden]="(data.services.length < 2) || data.services.length === 2 && data.services[0] === 'self-service'">s</span>: restarting will make DataLab unavailable for some time. </ng-template> <ng-template [ngIf]="data.action === 'restart' && data.environmentStatuses[data.activeEndpoint]?.length && filterProvisioning.length" ]> - <span class="strong" >{{filterProvisioning.join(', ') | titlecase}}</span> + <span class="strong" >{{filterProvisioning.join(', ') | titlecase}}</span> <span class="strong" *ngIf="filterProvisioning.length > 1 || (filterProvisioning.length === 1 && filterProvisioning[0] !== 'self-service')"> service</span> <span [hidden]="(filterProvisioning.length < 2) || filterProvisioning.length === 2 && filterProvisioning[0] === 'self-service'">s</span>: restarting will make DataLab unavailable for some time. </ng-template> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
