diff --git a/models/request/package.json b/models/request/package.json index 9442e53f62..081fa2f57b 100644 --- a/models/request/package.json +++ b/models/request/package.json @@ -32,6 +32,7 @@ "@hcengineering/platform": "^0.6.8", "@hcengineering/model-core": "^0.6.0", "@hcengineering/model-view": "^0.6.0", + "@hcengineering/model-chunter": "^0.6.0", "@hcengineering/request": "^0.6.0", "@hcengineering/activity": "^0.6.0", "@hcengineering/chunter": "^0.6.2", diff --git a/models/request/src/index.ts b/models/request/src/index.ts index 84434f1520..1ba54ac7dc 100644 --- a/models/request/src/index.ts +++ b/models/request/src/index.ts @@ -18,11 +18,24 @@ import chunter from '@hcengineering/chunter' import type { EmployeeAccount } from '@hcengineering/contact' import contact from '@hcengineering/contact' import { Doc, Domain, IndexKind, Ref, TxCUD } from '@hcengineering/core' -import { ArrOf, Builder, Collection, Index, Model, Prop, ReadOnly, TypeRef, TypeString, UX } from '@hcengineering/model' +import { + ArrOf, + Builder, + Collection, + Index, + Mixin, + Model, + Prop, + ReadOnly, + TypeRef, + TypeString, + UX +} from '@hcengineering/model' import core, { TAttachedDoc } from '@hcengineering/model-core' -import { Request, RequestStatus } from '@hcengineering/request' +import { Request, RequestDecisionComment, RequestStatus } from '@hcengineering/request' import request from './plugin' import view from '@hcengineering/model-view' +import { TComment } from '@hcengineering/model-chunter' export const DOMAIN_REQUEST = 'request' as Domain @@ -45,12 +58,19 @@ export class TRequest extends TAttachedDoc implements Request { tx!: TxCUD + @Prop(TypeRef(contact.class.EmployeeAccount), request.string.Rejected) + @ReadOnly() + rejected?: Ref + @Prop(Collection(chunter.class.Comment), chunter.string.Comments) comments?: number } +@Mixin(request.mixin.RequestDecisionComment, chunter.class.Comment) +export class TRequestDecisionComment extends TComment implements RequestDecisionComment {} + export function createModel (builder: Builder): void { - builder.createModel(TRequest) + builder.createModel(TRequest, TRequestDecisionComment) builder.mixin(request.class.Request, core.class.Class, view.mixin.ObjectEditor, { editor: request.component.EditRequest diff --git a/packages/ui/src/components/BooleanIcon.svelte b/packages/ui/src/components/BooleanIcon.svelte new file mode 100644 index 0000000000..6c6a30c008 --- /dev/null +++ b/packages/ui/src/components/BooleanIcon.svelte @@ -0,0 +1,31 @@ + + +
+ + + {#if value === true} + + {:else if value === false} + + {:else} + + {/if} + +
+ + diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 13dcc14e52..60184b85d9 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -154,6 +154,7 @@ export { default as FocusHandler } from './components/FocusHandler.svelte' export { default as ListView } from './components/ListView.svelte' export { default as ToggleButton } from './components/ToggleButton.svelte' export { default as ExpandCollapse } from './components/ExpandCollapse.svelte' +export { default as BooleanIcon } from './components/BooleanIcon.svelte' export { default as Expandable } from './components/Expandable.svelte' export { default as BarDashboard } from './components/BarDashboard.svelte' export { default as Notifications } from './components/notifications/Notifications.svelte' diff --git a/plugins/activity-resources/src/components/TxView.svelte b/plugins/activity-resources/src/components/TxView.svelte index 5eda03639a..503448962c 100644 --- a/plugins/activity-resources/src/components/TxView.svelte +++ b/plugins/activity-resources/src/components/TxView.svelte @@ -257,23 +257,17 @@ {#if hasMessageType}
{/if} - {#if isMessageType(m.attribute)} -
- {#if value.isObjectSet} - - {:else} - - {/if} -
- {:else} -
- {#if value.isObjectSet} - - {:else} - - {/if} -
- {/if} +
+ {#if value.isObjectSet} + + {:else} + + {/if} +
{/if} {/await} {/each} @@ -290,23 +284,17 @@