From 69a8d16db4beabb8f5601369857e5ac52825e117 Mon Sep 17 00:00:00 2001 From: Sergei Ogorelkov Date: Fri, 1 Jul 2022 22:24:58 +0700 Subject: [PATCH] Tracker: workflow statuses (#2171) Signed-off-by: Sergei Ogorelkov --- changelog.md | 1 + models/tracker/src/index.ts | 20 + models/tracker/src/plugin.ts | 3 +- .../src/components/MessageBox.svelte | 5 +- plugins/tracker-assets/lang/en.json | 11 + plugins/tracker-assets/lang/ru.json | 11 + .../components/workflow/StatusEditor.svelte | 112 ++++++ .../components/workflow/StatusInput.svelte | 80 ++++ .../workflow/StatusPresenter.svelte | 125 +++++++ .../src/components/workflow/Statuses.svelte | 342 ++++++++++++++++++ plugins/tracker-resources/src/index.ts | 11 +- plugins/tracker-resources/src/plugin.ts | 11 + plugins/tracker/src/index.ts | 3 +- 13 files changed, 731 insertions(+), 4 deletions(-) create mode 100644 plugins/tracker-resources/src/components/workflow/StatusEditor.svelte create mode 100644 plugins/tracker-resources/src/components/workflow/StatusInput.svelte create mode 100644 plugins/tracker-resources/src/components/workflow/StatusPresenter.svelte create mode 100644 plugins/tracker-resources/src/components/workflow/Statuses.svelte diff --git a/changelog.md b/changelog.md index 0456425541..4a092d22c4 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,7 @@ HR: Tracker: - Manual issues ordering - Issue relations +- Issue status management Workbench - Use application aliases in URL diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 4b796185da..c0f71b01cf 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -560,6 +560,26 @@ export function createModel (builder: Builder): void { } }) + createAction( + builder, + { + action: tracker.actionImpl.EditWorkflowStatuses, + label: tracker.string.EditWorkflowStatuses, + icon: view.icon.Statuses, + input: 'focus', + category: tracker.category.Tracker, + target: tracker.class.Team, + query: { + archived: false + }, + context: { + mode: ['context', 'browser'], + group: 'edit' + } + }, + tracker.action.EditWorkflowStatuses + ) + builder.createDoc( view.class.ActionCategory, core.space.Model, diff --git a/models/tracker/src/plugin.ts b/models/tracker/src/plugin.ts index cc24aebeb6..5d9d97353a 100644 --- a/models/tracker/src/plugin.ts +++ b/models/tracker/src/plugin.ts @@ -51,6 +51,7 @@ export default mergeIds(trackerId, tracker, { IssueCategory: '' as Ref }, actionImpl: { - CopyToClipboard: '' as ViewAction + CopyToClipboard: '' as ViewAction, + EditWorkflowStatuses: '' as ViewAction } }) diff --git a/packages/presentation/src/components/MessageBox.svelte b/packages/presentation/src/components/MessageBox.svelte index 26f529faa5..29943fb454 100644 --- a/packages/presentation/src/components/MessageBox.svelte +++ b/packages/presentation/src/components/MessageBox.svelte @@ -21,6 +21,7 @@ export let label: IntlString export let message: IntlString export let params: Record = {} + export let canSubmit = true const dispatch = createEventDispatcher() @@ -36,7 +37,9 @@ kind={'primary'} on:click={() => dispatch('close', true)} /> -