diff --git a/models/task/src/index.ts b/models/task/src/index.ts
index c9d6528597..82edbe5a8f 100644
--- a/models/task/src/index.ts
+++ b/models/task/src/index.ts
@@ -428,6 +428,14 @@ export function createModel (builder: Builder): void {
presenter: task.component.StatePresenter
})
+ builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributeEditor, {
+ editor: task.component.DoneStateEditor
+ })
+
+ builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributePresenter, {
+ presenter: task.component.DoneStatePresenter
+ })
+
builder.createDoc(
view.class.ViewletDescriptor,
core.space.Model,
diff --git a/models/task/src/plugin.ts b/models/task/src/plugin.ts
index 04de2c60b5..51a5f667a9 100644
--- a/models/task/src/plugin.ts
+++ b/models/task/src/plugin.ts
@@ -55,6 +55,7 @@ export default mergeIds(taskId, task, {
StatePresenter: '' as AnyComponent,
DoneStatePresenter: '' as AnyComponent,
StateEditor: '' as AnyComponent,
+ DoneStateEditor: '' as AnyComponent,
KanbanView: '' as AnyComponent,
Todos: '' as AnyComponent,
TodoItemPresenter: '' as AnyComponent,
diff --git a/packages/presentation/src/components/AttributeBarEditor.svelte b/packages/presentation/src/components/AttributeBarEditor.svelte
index 5c35cc6562..7305b3670c 100644
--- a/packages/presentation/src/components/AttributeBarEditor.svelte
+++ b/packages/presentation/src/components/AttributeBarEditor.svelte
@@ -13,7 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
-
+
+
{
+ if (!opened) {
+ opened = true
+ showPopup(DoneStatesPopup, { space }, container, (result) => {
+ if (result) {
+ value = result._id
+ onChange(value)
+ } else if (result == null) {
+ value = null
+ onChange(value)
+ }
+
+ opened = false
+ })
+ }
+ }}
+>
+ {#if state}
+
+ {:else}
+
+ {/if}
+
diff --git a/plugins/task-resources/src/components/state/DoneStatePresenter.svelte b/plugins/task-resources/src/components/state/DoneStatePresenter.svelte
index dec21f59f0..eae69effcb 100644
--- a/plugins/task-resources/src/components/state/DoneStatePresenter.svelte
+++ b/plugins/task-resources/src/components/state/DoneStatePresenter.svelte
@@ -17,16 +17,21 @@
{#if value }
-
+
+ {#if showTitle}
+ {value.title}
+ {/if}
{/if}
@@ -36,4 +41,7 @@
height: .5rem;
border-radius: .5rem;
}
+ .state-container-title {
+ margin-right: 0.75rem;
+ }
diff --git a/plugins/task-resources/src/components/state/DoneStatesPopup.svelte b/plugins/task-resources/src/components/state/DoneStatesPopup.svelte
new file mode 100644
index 0000000000..cd7b3b90de
--- /dev/null
+++ b/plugins/task-resources/src/components/state/DoneStatesPopup.svelte
@@ -0,0 +1,100 @@
+
+
+
+
+ {#each states as state}
+
{
+ dispatch('close', state)
+ }}
+ >
+
+ {state.title}
+
+ {/each}
+
{
+ dispatch('close', null)
+ }}
+ >
+
+
+
+
+
+
diff --git a/plugins/task-resources/src/index.ts b/plugins/task-resources/src/index.ts
index dd6c048dc7..ed0392da70 100644
--- a/plugins/task-resources/src/index.ts
+++ b/plugins/task-resources/src/index.ts
@@ -26,6 +26,7 @@ import EditIssue from './components/EditIssue.svelte'
import KanbanView from './components/kanban/KanbanView.svelte'
import KanbanCard from './components/KanbanCard.svelte'
import DoneStatePresenter from './components/state/DoneStatePresenter.svelte'
+import DoneStateEditor from './components/state/DoneStateEditor.svelte'
import EditStatuses from './components/state/EditStatuses.svelte'
import StateEditor from './components/state/StateEditor.svelte'
import StatePresenter from './components/state/StatePresenter.svelte'
@@ -140,7 +141,8 @@ export default async (): Promise => ({
TodoItemPresenter,
TodoStatePresenter,
StatusTableView,
- TaskHeader
+ TaskHeader,
+ DoneStateEditor
},
actionImpl: {
CreateTask: createTask,
diff --git a/plugins/task-resources/src/plugin.ts b/plugins/task-resources/src/plugin.ts
index f3ae5f5d45..690117cf6d 100644
--- a/plugins/task-resources/src/plugin.ts
+++ b/plugins/task-resources/src/plugin.ts
@@ -58,7 +58,8 @@ export default mergeIds(taskId, task, {
DoneStatesWon: '' as IntlString,
DoneStatesLost: '' as IntlString,
AllStates: '' as IntlString,
- ChooseAColor: '' as IntlString
+ ChooseAColor: '' as IntlString,
+ NoDoneState: '' as IntlString
},
status: {
AssigneeRequired: '' as IntlString