private _buildCommands()

in desktop/src/app/components/task/action/task-commands.ts [48:99]


    private _buildCommands() {
        this.delete = this.simpleCommand({
            name: "delete",
            label: this.i18n.t("task-commands.delete"),
            icon: "fa fa-trash-o",
            action: (task: Task) => this._deleteTask(task),
            permission: Permission.Write,
        });

        this.terminate = this.simpleCommand({
            name: "terminate",
            label: this.i18n.t("task-commands.terminate"),
            icon: "fa fa-stop",
            action: (task) => this.taskService.terminate(this.params.jobId, task.id),
            enabled: (task) => task.state !== TaskState.completed,
        });

        this.rerun = this.simpleCommand({
            name: "rerun",
            label: this.i18n.t("task-commands.rerun"),
            icon: "fa fa-repeat",
            action: (task) => this.taskService.reactivate(this.params.jobId, task.id),
            visible: (task) => task.executionInfo.result === TaskExecutionResult.Failure,
        });

        this.clone = this.simpleCommand({
            name: "clone",
            ...COMMAND_LABEL_ICON.Clone,
            action: (task) => this._cloneTask(task),
            multiple: false,
            confirm: false,
            notify: false,
            permission: Permission.Write,
        });

        this.exportAsJSON = this.simpleCommand({
            name: "exportAsJSON",
            ...COMMAND_LABEL_ICON.ExportAsJSON,
            action: (task) => this._exportAsJSON(task),
            multiple: false,
            confirm: false,
            notify: false,
        });

        this.commands = [
            this.delete,
            this.terminate,
            this.rerun,
            this.clone,
            this.exportAsJSON,
        ];
    }