This is an automated email from the ASF dual-hosted git repository.
pingsutw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push:
new dbcf369a Fix list (#1087)
dbcf369a is described below
commit dbcf369aea89194e68c9b6e22e87974acdd45af5
Author: Thinking Chen <[email protected]>
AuthorDate: Thu Jul 20 19:59:53 2023 +0800
Fix list (#1087)
---
.../experiment-customized-form.component.html | 1 -
.../experiment-customized-form.component.ts | 17 +++++++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
index f78a3a01..c1ed7892 100644
---
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
+++
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
@@ -95,7 +95,6 @@
<nz-option *ngFor="let image of imageList" [nzValue]="image"
[nzLabel]="image"></nz-option>
</nz-select>
<ng-template #renderTemplate>
- <nz-divider></nz-divider>
<div class="container">
<input type="text" nz-input #inputElement />
<a class="add-item" (click)="addItem(inputElement)">
diff --git
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
index bbacaf60..664bfa50 100644
---
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
+++
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
@@ -100,10 +100,14 @@ export class ExperimentCustomizedFormComponent implements
OnInit, OnDestroy {
gitPassword: new FormControl(null, [])
});
+ // Initialise the list of image, the default values of image are from the
current experiment list images
this.experimentService.fetchExperimentList().subscribe(
(list) => {
list.forEach((item) => {
- this.imageList.push(item.spec.environment.image);
+ const envImage = item.spec.environment.image;
+ if (this.imageList.indexOf(envImage) === -1) {
+ this.imageList.push(envImage)
+ }
});
},
(error) => {
@@ -160,9 +164,14 @@ export class ExperimentCustomizedFormComponent implements
OnInit, OnDestroy {
}
addItem(input: HTMLInputElement): void {
- const value = input.value;
- if (this.imageList.indexOf(value) === -1) {
- this.imageList = [...this.imageList, input.value || `New item
${this.imageIndex++}`];
+ let value = input.value;
+ if (value === null || typeof value === "undefined") {
+ return;
+ } else {
+ value = value.replace(/\s+/g, "");
+ if (value !== "" && this.imageList.indexOf(value) === -1) {
+ this.imageList = [...this.imageList, value];
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]