This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/develop by this push: new e8f2924 [DLAB-2002]: Improvements for library management (#872) e8f2924 is described below commit e8f292423beff87ce8d74b79cf449673d7bee86c Author: Dmytro Gnatyshyn <42860905+dg1...@users.noreply.github.com> AuthorDate: Tue Aug 25 16:57:32 2020 +0300 [DLAB-2002]: Improvements for library management (#872) [DLAB-2002]: Improvement for library management --- .../src/main/resources/webapp/src/app/core/util/sortUtils.ts | 6 ++++++ .../install-libraries/install-libraries.component.html | 9 +++++---- .../exploratory/install-libraries/install-libraries.component.ts | 3 +++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/sortUtils.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/sortUtils.ts index 2573d0d..3d204ba 100644 --- a/services/self-service/src/main/resources/webapp/src/app/core/util/sortUtils.ts +++ b/services/self-service/src/main/resources/webapp/src/app/core/util/sortUtils.ts @@ -49,6 +49,12 @@ export class SortUtils { return groups.sort((arg1, arg2) => sortOrder.indexOf(arg1) - sortOrder.indexOf(arg2)); } + public static libFilterGroupsSort(groups) { + const sortOrder = ['Apt/Yum', 'Python 2', 'Python 3', 'R packages', 'Java', 'Others']; + + return groups.sort((arg1, arg2) => sortOrder.indexOf(arg1) - sortOrder.indexOf(arg2)); + } + public static flatDeep(arr, d = 1) { return d > 0 ? arr.reduce((acc, val) => acc.concat(Array.isArray(val) ? this.flatDeep(val, d - 1) : val), []) : arr.slice(); diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html index 4eceabf..517d221 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html +++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html @@ -132,14 +132,15 @@ [matAutocomplete]="auto" [formControl]="libSearch" #trigger="matAutocompleteTrigger" - (keyup.enter)="addLibrary(lib)" + (keydown.enter)="addLibrary(lib)" + (keyup)="clearLibSelection($event)" > <span class="plus-icon" - [ngClass]="{'not-allow': !this.selectedLib || this.selectedLib?.isInSelectedList}" - matTooltip="Library is in selected list" matTooltipPosition="above" [matTooltipDisabled]="!this.selectedLib?.isInSelectedList" + [ngClass]="{'not-allow': !this.selectedLib || this.selectedLib?.isInSelectedList || !isLibSelected}" + matTooltip="Library is in selected list" matTooltipPosition="above" [matTooltipDisabled]="!this.selectedLib?.isInSelectedList || !isLibSelected" > - <mat-icon (click)="addLibrary(lib)" (keyup.enter)="addLibrary(lib)" [ngClass]="{'not-allowed': !this.selectedLib || this.selectedLib?.isInSelectedList}">add</mat-icon> + <mat-icon (click)="addLibrary(lib)" (keyup.enter)="addLibrary(lib)" [ngClass]="{'not-allowed': !this.selectedLib || this.selectedLib?.isInSelectedList || !isLibSelected}">add</mat-icon> </span> </div> <mat-autocomplete #auto="matAutocomplete" class="suggestions"> 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 5eb86c4..d7afd5f 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 @@ -238,6 +238,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy { return; } if (this.group === 'java') { + this.isLibSelected = true; this.libSearch.setValue(item.name + ':' + item.version); this.lib.name = item.name + ':' + item.version; } else { @@ -317,6 +318,8 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy { this.filterLibs(); this.changeDetector.markForCheck(); this.filterConfiguration.group = this.createFilterList(this.notebookLibs.map(v => this.groupsListMap[v.group])); + this.filterConfiguration.group = SortUtils.libFilterGroupsSort(this.filterConfiguration.group); + console.log(this.filterConfiguration.group); this.filterConfiguration.resource = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.resource))); this.filterConfiguration.resourceType = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.resourceType))); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org