From f3cc5c2e43af3a2a9fa8557b286abca189ce192a Mon Sep 17 00:00:00 2001 From: IvashchenkoCW Date: Fri, 10 Jul 2020 15:15:56 +0300 Subject: [PATCH] add service name field to add custom dialog --- .../manage-project-dialog.component.ts | 2 +- .../app/core/components/repo-search/dialog-add-custom.html | 7 ++++++- .../core/components/repo-search/repo-search.component.ts | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/composer/src/app/core/components/dialogs/manage-project-dialog/manage-project-dialog.component.ts b/src/composer/src/app/core/components/dialogs/manage-project-dialog/manage-project-dialog.component.ts index 1ead06e..d26ef64 100644 --- a/src/composer/src/app/core/components/dialogs/manage-project-dialog/manage-project-dialog.component.ts +++ b/src/composer/src/app/core/components/dialogs/manage-project-dialog/manage-project-dialog.component.ts @@ -65,7 +65,7 @@ export class ManageProjectDialogComponent implements OnInit, OnDestroy { ) { this.serviceName = this.data.name this.formGeneral = this.formBuilder.group({ - image: new FormControl({ value: this.data.image, disabled: true }, Validators.required), + image: new FormControl( this.data.image, Validators.required), name: new FormControl('', [Validators.required, this.serviceNameAlreadyExistsValidator]), tag: new FormControl('', [Validators.required]), restart: new FormControl('', [Validators.required]), diff --git a/src/composer/src/app/core/components/repo-search/dialog-add-custom.html b/src/composer/src/app/core/components/repo-search/dialog-add-custom.html index 6b06bf3..aeb83df 100644 --- a/src/composer/src/app/core/components/repo-search/dialog-add-custom.html +++ b/src/composer/src/app/core/components/repo-search/dialog-add-custom.html @@ -9,8 +9,13 @@ Tag + + + Service name + +
- +
diff --git a/src/composer/src/app/core/components/repo-search/repo-search.component.ts b/src/composer/src/app/core/components/repo-search/repo-search.component.ts index 9a90dec..92fe07f 100644 --- a/src/composer/src/app/core/components/repo-search/repo-search.component.ts +++ b/src/composer/src/app/core/components/repo-search/repo-search.component.ts @@ -94,7 +94,7 @@ export class RepoSearchComponent implements OnInit, OnDestroy { shm_size: null, stdin_open: null, tty: null, - name: `${data['name']}_${postfix}`, + name: data['serviceName'] ? `${data['serviceName']}_${postfix}` : `${data['name']}_${postfix}`, container_name: null, deploy: null, image: imageName, @@ -250,9 +250,10 @@ export class DialogAddCustom { @Output() onAddProject = new EventEmitter() imageName: string tag: string + serviceName: string constructor(public dialogRef: MatDialogRef) {} addProject() { - this.onAddProject.emit({name: this.imageName, tag: this.tag}) + this.onAddProject.emit({name: this.imageName, tag: this.tag, serviceName: this.serviceName}) } }