From b083320775d414e4835ec07a36504d9557f4ee30 Mon Sep 17 00:00:00 2001 From: stbychkov Date: Thu, 11 Feb 2021 14:38:38 +0200 Subject: [PATCH] Added change start task command to the pool --- .../components/pool/action/pool-commands.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/components/pool/action/pool-commands.ts b/src/app/components/pool/action/pool-commands.ts index c6a8ffba78..15c9365624 100644 --- a/src/app/components/pool/action/pool-commands.ts +++ b/src/app/components/pool/action/pool-commands.ts @@ -9,6 +9,7 @@ import { Pool, PoolAllocationState } from "app/models"; import { JobService, PinnedEntityService, PoolService } from "app/services"; import { from } from "rxjs"; import { PoolCreateBasicDialogComponent } from "./add/pool-create-basic-dialog.component"; +import { StartTaskEditFormComponent } from "../start-task/start-task-edit-form.component"; import { DeletePoolDialogComponent, DeletePoolOutput } from "./delete"; import { PoolResizeDialogComponent } from "./resize"; @@ -19,6 +20,7 @@ export class PoolCommands extends EntityCommands { public stopResize: EntityCommand; public clone: EntityCommand; public delete: EntityCommand; + public editStartTask: EntityCommand; public exportAsJSON: EntityCommand; public pin: EntityCommand; @@ -101,6 +103,17 @@ export class PoolCommands extends EntityCommands { permission: Permission.Write, }); + this.editStartTask = this.simpleCommand({ + name: "editStartTask", + ...COMMAND_LABEL_ICON.EditStartTask, + action: (pool: Pool) => this._editStartTask(pool), + visible: (pool) => true, + multiple: false, + confirm: false, + notify: false, + permission: Permission.Write + }) + this.exportAsJSON = this.simpleCommand({ name: "exportAsJson", ...COMMAND_LABEL_ICON.ExportAsJSON, @@ -131,6 +144,7 @@ export class PoolCommands extends EntityCommands { this.stopResize, this.clone, this.delete, + this.editStartTask, this.exportAsJSON, this.pin, ]; @@ -158,6 +172,11 @@ export class PoolCommands extends EntityCommands { ref.component.setValueFromEntity(pool); } + private _editStartTask(pool: Pool) { + const ref = this.sidebarManager.open(`edit-start-task-${pool.id}`, StartTaskEditFormComponent); + ref.component.pool = pool; + } + private _exportAsJSON(pool: Pool) { const dialog = this.remote.dialog; const localPath = dialog.showSaveDialogSync({