You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by dg...@apache.org on 2021/01/25 13:08:30 UTC
[incubator-datalab] branch DATALAB-2257 created (now 961e0c8)
This is an automated email from the ASF dual-hosted git repository.
dgnatyshyn pushed a change to branch DATALAB-2257
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.
at 961e0c8 [DATALAB-2257]: Trim spaces in library name and version
This branch includes the following new commits:
new 961e0c8 [DATALAB-2257]: Trim spaces in library name and version
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org
[incubator-datalab] 01/01: [DATALAB-2257]: Trim spaces in library
name and version
Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dgnatyshyn pushed a commit to branch DATALAB-2257
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit 961e0c8266640d4d85d30cb1fdb6954a2f5b8437
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Jan 25 15:08:08 2021 +0200
[DATALAB-2257]: Trim spaces in library name and version
---
.../install-libraries/install-libraries.component.html | 6 +++---
.../install-libraries/install-libraries.component.ts | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
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 80f81f1..aa95a91 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
@@ -108,7 +108,7 @@
class="library-input"
[placeholder]="'Enter library version (optional)'"
[(ngModel)]="lib.version"
- [disabled]="!lib.name"
+ [disabled]="!lib.name.trim()"
(keyup)="validateVersion(lib.version)"
(keydown.enter)="addLibrary(lib)"
>
@@ -118,7 +118,7 @@
Library version can only contain Latin letters, numbers and special characters -, _, :, /, ~, ., +.
</span>
<span class="plus-icon"
- [ngClass]="{'not-allow': lib.name?.length < 2
+ [ngClass]="{'not-allow': lib.name?.trim().length < 2
|| (autoComplete === 'ENABLED' && !isLibSelected )
|| this.selectedLib?.isInSelectedList || isVersionInvalid || autoComplete === 'UPDATING'}"
[matTooltip]="this.selectedLib?.isInSelectedList ? 'Library is in selected list' : 'Please select library from autocomplete'"
@@ -126,7 +126,7 @@
>
<mat-icon
(click)="addLibrary(lib)"
- [ngClass]="{'not-allowed': lib.name?.length < 2 || (autoComplete === 'ENABLED' && !isLibSelected)
+ [ngClass]="{'not-allowed': lib.name?.trim().length < 2 || (autoComplete === 'ENABLED' && !isLibSelected)
|| this.selectedLib?.isInSelectedList || isVersionInvalid || autoComplete === 'UPDATING'}">add</mat-icon>
</span>
</div>
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 42ed182..d91ee33 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
@@ -223,7 +223,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
this.selectedLib = {
name: this.lib.name,
version: this.lib.version,
- isInSelectedList: this.model.selectedLibs.some(el => el.name.toLowerCase() === this.lib.name.toLowerCase())
+ isInSelectedList: this.model.selectedLibs.some(el => el.name.toLowerCase() === this.lib.name.toLowerCase().trim())
};
} else {
this.selectedLib = null;
@@ -239,12 +239,12 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
this.isLibSelected = false;
if ( (!this.selectedLib && !this.isVersionInvalid) || (!this.selectedLib.isInSelectedList && !this.isVersionInvalid)) {
if ( this.group !== 'java') {
- this.model.selectedLibs.push({ group: this.group, name: item.name, version: item.version || 'N/A' });
+ this.model.selectedLibs.push({ group: this.group, name: item.name.trim(), version: item.version.trim() || 'N/A' });
} else {
this.model.selectedLibs.push({
group: this.group,
name: item.name.substring(0, item.name.lastIndexOf(':')),
- version: item.name.substring(item.name.lastIndexOf(':') + 1) || 'N/A'
+ version: item.name.substring(item.name.lastIndexOf(':') + 1).trim() || 'N/A'
});
}
this.libSearch.setValue('');
@@ -427,10 +427,10 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
}
private getMatchedLibs() {
- if (!this.lib.name || this.lib.name.length < 2) {
+ if (!this.lib.name || this.lib.name.trim().length < 2) {
return;
}
- this.model.getLibrariesList(this.group, this.lib.name.toLowerCase())
+ this.model.getLibrariesList(this.group, this.lib.name.trim().toLowerCase())
.pipe(
takeUntil(this.unsubscribe$)
)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org