diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 085f0641cc..ac0dc121c9 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -98,6 +98,19 @@ export function TypeIssuePriority (): Type { @Model(tracker.class.TypeIssuePriority, core.class.Type, DOMAIN_MODEL) export class TTypeIssuePriority extends TType {} +/** + * @public + */ +export function TypeProjectStatus (): Type { + return { _class: tracker.class.TypeProjectStatus, label: 'TypeProjectStatus' as IntlString } +} + +/** + * @public + */ +@Model(tracker.class.TypeProjectStatus, core.class.Type, DOMAIN_MODEL) +export class TTypeProjectStatus extends TType {} + /** * @public */ @@ -219,7 +232,7 @@ export class TProject extends TDoc implements Project { @Prop(TypeString(), tracker.string.AssetLabel) icon!: Asset - @Prop(TypeNumber(), tracker.string.Status) + @Prop(TypeProjectStatus(), tracker.string.Status) status!: ProjectStatus @Prop(TypeRef(contact.class.Employee), tracker.string.ProjectLead) @@ -247,7 +260,15 @@ export class TProject extends TDoc implements Project { } export function createModel (builder: Builder): void { - builder.createModel(TTeam, TProject, TIssue, TIssueStatus, TIssueStatusCategory, TTypeIssuePriority) + builder.createModel( + TTeam, + TProject, + TIssue, + TIssueStatus, + TIssueStatusCategory, + TTypeIssuePriority, + TTypeProjectStatus + ) builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: tracker.class.Issue, @@ -376,6 +397,10 @@ export function createModel (builder: Builder): void { builder.mixin(tracker.class.Issue, core.class.Class, setting.mixin.Editable, {}) + builder.mixin(tracker.class.TypeProjectStatus, core.class.Class, view.mixin.AttributeEditor, { + editor: tracker.component.ProjectStatusEditor + }) + builder.createDoc( workbench.class.Application, core.space.Model, diff --git a/plugins/tracker-resources/src/components/projects/ProjectStatusEditor.svelte b/plugins/tracker-resources/src/components/projects/ProjectStatusEditor.svelte new file mode 100644 index 0000000000..513c932314 --- /dev/null +++ b/plugins/tracker-resources/src/components/projects/ProjectStatusEditor.svelte @@ -0,0 +1,8 @@ + + + diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 1c3410cb7d..4dbda69a36 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -45,6 +45,7 @@ import TargetDatePresenter from './components/projects/TargetDatePresenter.svelt import ProjectMembersPresenter from './components/projects/ProjectMembersPresenter.svelte' import ProjectStatusPresenter from './components/projects/ProjectStatusPresenter.svelte' import EditProject from './components/projects/EditProject.svelte' +import ProjectStatusEditor from './components/projects/ProjectStatusEditor.svelte' import ModificationDatePresenter from './components/issues/ModificationDatePresenter.svelte' import EditIssue from './components/issues/edit/EditIssue.svelte' @@ -84,6 +85,7 @@ export default async (): Promise => ({ TargetDatePresenter, ProjectMembersPresenter, ProjectStatusPresenter, + ProjectStatusEditor, SetDueDateActionPopup, SetParentIssueActionPopup, EditProject, diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 6b50c93b39..62889e0e38 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -188,6 +188,7 @@ export default mergeIds(trackerId, tracker, { TargetDatePresenter: '' as AnyComponent, ProjectMembersPresenter: '' as AnyComponent, ProjectStatusPresenter: '' as AnyComponent, + ProjectStatusEditor: '' as AnyComponent, SetDueDateActionPopup: '' as AnyComponent, SetParentIssueActionPopup: '' as AnyComponent, EditProject: '' as AnyComponent, diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index b2c078a9a9..e937587734 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -187,7 +187,8 @@ export default plugin(trackerId, { Project: '' as Ref>, IssueStatus: '' as Ref>, IssueStatusCategory: '' as Ref>, - TypeIssuePriority: '' as Ref>> + TypeIssuePriority: '' as Ref>>, + TypeProjectStatus: '' as Ref>> }, ids: { NoParent: '' as Ref