This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch DLAB-1513 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 1e130f1564b7695bc5d6c7cfa04dba6218f7d2c9 Author: Dmytro Gnatyshyn <[email protected]> AuthorDate: Thu Feb 6 14:49:36 2020 +0200 [DLAB-1522]: Removed libs request after libs window is closed --- .../install-libraries.component.scss | 9 ++++++++ .../install-libraries.component.ts | 10 ++++++--- .../edge-action-dialog.component.ts | 24 +++++++++++++--------- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss index b92177e..2f8e28d 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss +++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss @@ -29,6 +29,10 @@ justify-content: center; flex-direction: initial; margin-bottom: 25px; + bottom: 30px; + left: 0; + right: 0; + position: absolute; } strong{ font-weight: 600; @@ -61,6 +65,7 @@ .install-libraries { height: 100%; + padding-bottom: 130px; .dialog-header { padding-left: 25px; @@ -249,6 +254,10 @@ mat-chip.mat-chip:not(.mat-basic-chip) { padding-left: 5px; } +.mat-dialog-container { + position: relative; +} + .libs-info { padding: 0 20px; display: flex; diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts index 3266238..05956a3 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts @@ -18,7 +18,7 @@ */ -import { Component, OnInit, ViewChild, ViewEncapsulation, ChangeDetectorRef, Inject } from '@angular/core'; +import {Component, OnInit, ViewChild, ViewEncapsulation, ChangeDetectorRef, Inject, OnDestroy} from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { FormControl } from '@angular/forms'; import { ToastrService } from 'ngx-toastr'; @@ -36,7 +36,7 @@ import {FilterLibsModel} from './filter-libs.model'; styleUrls: ['./install-libraries.component.scss'], encapsulation: ViewEncapsulation.None }) -export class InstallLibrariesComponent implements OnInit { +export class InstallLibrariesComponent implements OnInit, OnDestroy { public model: InstallLibrariesModel; public notebook: any; @@ -99,6 +99,10 @@ export class InstallLibrariesComponent implements OnInit { this.open(this.data); } + ngOnDestroy() { + clearTimeout(this.loadLibsTimer); + } + uploadLibGroups(): void { this.librariesInstallationService.getGroupsList(this.notebook.name, this.model.computational_name) .subscribe( @@ -219,7 +223,7 @@ export class InstallLibrariesComponent implements OnInit { const isInstallingNow = this.notebookLibs.some(lib => lib.filteredStatus.some(status => status.status === 'installing')); if (isInstallingNow) { clearTimeout(this.loadLibsTimer); - this.loadLibsTimer = window.setTimeout(() => this.getInstalledLibrariesList(), 1000); + this.loadLibsTimer = window.setTimeout(() => this.getInstalledLibrariesList(), 10000); } } diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts index ffa714a..1466e31 100644 --- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, Inject } from '@angular/core'; +import {Component, Inject, OnDestroy} from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; @@ -8,7 +8,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; <div id="dialog-box" *ngIf="data.type"> <header class="dialog-header"> <h4 class="modal-title"><span class="action">{{data.type | titlecase}}</span> edge node</h4> - <button type="button" class="close" (click)="closeModal()">×</button> + <button type="button" class="close" (click)="this.dialogRef.close()">×</button> </header> <div mat-dialog-content class="content message mat-dialog-content"> <h3 class="strong">Select the edge nodes you want to {{data.type}}</h3> @@ -32,7 +32,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; <p class="m-top-20 action-text"><span class="strong">Do you want to proceed?</span></p> <div class="text-center m-top-30 m-bott-30"> - <button type="button" class="butt" mat-raised-button (click)="closeModal()">No</button> + <button type="button" class="butt" mat-raised-button (click)="this.dialogRef.close()">No</button> <button type="button" class="butt butt-success" mat-raised-button (click)="dialogRef.close(endpointsNewStatus)" [disabled]="!endpointsNewStatus.length">Yes</button> </div> </div> @@ -58,7 +58,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; `] }) -export class EdgeActionDialogComponent { +export class EdgeActionDialogComponent implements OnDestroy { public endpointsNewStatus: Array<object> = []; public isAllChecked: boolean; constructor( @@ -66,11 +66,6 @@ export class EdgeActionDialogComponent { @Inject(MAT_DIALOG_DATA) public data: any) { } - private closeModal() { - this.dialogRef.close(); - this.data.item.forEach(endpoint => endpoint.checked = false); - } - public endpointAction() { this.endpointsNewStatus = this.data.item.filter(endpoint => endpoint.checked); this.isAllChecked = this.endpointsNewStatus.length === this.data.item.length; @@ -80,8 +75,17 @@ export class EdgeActionDialogComponent { if (this.isAllChecked) { this.data.item.forEach(endpoint => endpoint.checked = true); } else { - this.data.item.forEach(endpoint => endpoint.checked = false); + this.clearCheckedNodes(); } this.endpointAction(); } + + public clearCheckedNodes() { + this.data.item.forEach(endpoint => endpoint.checked = false); + } + + ngOnDestroy(): void { + this.clearCheckedNodes(); + this.isAllChecked = false; + } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
