@things-factory/organization 10.1.47 → 10.1.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,8 +10,10 @@ import { GristEditorRecipients } from './grist-editor/grist-editor-recipients';
10
10
  import { GristRendererRecipients } from './grist-editor/grist-renderer-recipients';
11
11
  import { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line';
12
12
  import { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line';
13
+ import { registerDepartmentKind } from './entity360/department-360.js';
13
14
  import { registerPersonMembershipSection } from './entity360/person-membership-section.js';
14
15
  export default function bootstrap() {
16
+ registerDepartmentKind();
15
17
  registerPersonMembershipSection();
16
18
  /* register grist renderer/editor for id */
17
19
  registerEditor('department-object', GristEditorDepartmentObject);
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAA;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAA;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AAEnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAA;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAA;AACvF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AAE1F,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,+BAA+B,EAAE,CAAA;IAEjC,2CAA2C;IAC3C,cAAc,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,CAAA;IAChE,cAAc,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAA;IACxD,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;IACjD,cAAc,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAA;IAEnD,gBAAgB,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAA;IACpE,gBAAgB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAA;IAC5D,gBAAgB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAA;IACrD,gBAAgB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;IAEvD,sBAAsB,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;IACpD,sBAAsB,CAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACxD,sBAAsB,CAAC,iBAAiB,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACjE,sBAAsB,CAAC,mBAAmB,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import { registerEditor, registerRenderer, registerFilterRenderer } from '@operato/data-grist'\n\nimport { FilterResourceCode } from '@operato/app/filters-form/filter-resource-code.js'\nimport { FilterResourceObject } from '@operato/app/filters-form/filter-resource-object.js'\nimport { FilterDepartmentObject } from './filters-form/filter-department-object.js'\n\nimport { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object'\nimport { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'\nimport { GristEditorAssignees } from './grist-editor/grist-editor-assignees'\nimport { GristRendererAssignees } from './grist-editor/grist-renderer-assignees'\nimport { GristEditorRecipients } from './grist-editor/grist-editor-recipients'\nimport { GristRendererRecipients } from './grist-editor/grist-renderer-recipients'\nimport { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'\nimport { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line'\nimport { registerPersonMembershipSection } from './entity360/person-membership-section.js'\n\nexport default function bootstrap() {\n registerPersonMembershipSection()\n\n /* register grist renderer/editor for id */\n registerEditor('department-object', GristEditorDepartmentObject)\n registerEditor('approval-line', GristEditorApprovalLine)\n registerEditor('assignees', GristEditorAssignees)\n registerEditor('recipients', GristEditorRecipients)\n\n registerRenderer('department-object', GristRendererDepartmentObject)\n registerRenderer('approval-line', GristRendererApprovalLine)\n registerRenderer('assignees', GristRendererAssignees)\n registerRenderer('recipients', GristRendererRecipients)\n\n registerFilterRenderer('code', [FilterResourceCode])\n registerFilterRenderer('object', [FilterResourceObject])\n registerFilterRenderer('resource-object', [FilterResourceObject])\n registerFilterRenderer('department-object', [FilterDepartmentObject])\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAA;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAA;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AAEnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAA;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AAE1F,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,sBAAsB,EAAE,CAAA;IACxB,+BAA+B,EAAE,CAAA;IAEjC,2CAA2C;IAC3C,cAAc,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,CAAA;IAChE,cAAc,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAA;IACxD,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;IACjD,cAAc,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAA;IAEnD,gBAAgB,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAA;IACpE,gBAAgB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAA;IAC5D,gBAAgB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAA;IACrD,gBAAgB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;IAEvD,sBAAsB,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;IACpD,sBAAsB,CAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACxD,sBAAsB,CAAC,iBAAiB,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACjE,sBAAsB,CAAC,mBAAmB,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import { registerEditor, registerRenderer, registerFilterRenderer } from '@operato/data-grist'\n\nimport { FilterResourceCode } from '@operato/app/filters-form/filter-resource-code.js'\nimport { FilterResourceObject } from '@operato/app/filters-form/filter-resource-object.js'\nimport { FilterDepartmentObject } from './filters-form/filter-department-object.js'\n\nimport { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object'\nimport { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'\nimport { GristEditorAssignees } from './grist-editor/grist-editor-assignees'\nimport { GristRendererAssignees } from './grist-editor/grist-renderer-assignees'\nimport { GristEditorRecipients } from './grist-editor/grist-editor-recipients'\nimport { GristRendererRecipients } from './grist-editor/grist-renderer-recipients'\nimport { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'\nimport { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line'\nimport { registerDepartmentKind } from './entity360/department-360.js'\nimport { registerPersonMembershipSection } from './entity360/person-membership-section.js'\n\nexport default function bootstrap() {\n registerDepartmentKind()\n registerPersonMembershipSection()\n\n /* register grist renderer/editor for id */\n registerEditor('department-object', GristEditorDepartmentObject)\n registerEditor('approval-line', GristEditorApprovalLine)\n registerEditor('assignees', GristEditorAssignees)\n registerEditor('recipients', GristEditorRecipients)\n\n registerRenderer('department-object', GristRendererDepartmentObject)\n registerRenderer('approval-line', GristRendererApprovalLine)\n registerRenderer('assignees', GristRendererAssignees)\n registerRenderer('recipients', GristRendererRecipients)\n\n registerFilterRenderer('code', [FilterResourceCode])\n registerFilterRenderer('object', [FilterResourceObject])\n registerFilterRenderer('resource-object', [FilterResourceObject])\n registerFilterRenderer('department-object', [FilterDepartmentObject])\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import { LitElement } from 'lit';
2
+ import { type Entity360DoorAnswer, type Entity360Subject } from '@operato/layout';
3
+ type Department = {
4
+ id: string;
5
+ controlNo?: string;
6
+ name?: string;
7
+ description?: string;
8
+ active?: boolean;
9
+ parent?: {
10
+ id: string;
11
+ name?: string;
12
+ __typename?: string;
13
+ };
14
+ manager?: {
15
+ name?: string;
16
+ };
17
+ };
18
+ /** A department is a shared organizational fact: it can open from a person's membership and from generic object cells. */
19
+ export declare function registerDepartmentKind(): void;
20
+ export declare class DepartmentOverviewSection extends LitElement {
21
+ static styles: import("lit").CSSResult;
22
+ subject?: Entity360Subject;
23
+ answer?: Entity360DoorAnswer<Department | undefined>;
24
+ updated(changed: Map<string, unknown>): void;
25
+ private read;
26
+ render(): import("lit-html").TemplateResult<1>;
27
+ }
28
+ export {};
@@ -0,0 +1,111 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import gql from 'graphql-tag';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property, state } from 'lit/decorators.js';
5
+ import { client } from '@operato/graphql';
6
+ import { i18next } from '@operato/i18n';
7
+ import { entity360Name, readEntity360Door, registerEntity360Kind, registerEntity360Section } from '@operato/layout';
8
+ /** A department is a shared organizational fact: it can open from a person's membership and from generic object cells. */
9
+ export function registerDepartmentKind() {
10
+ registerEntity360Kind({
11
+ kind: 'department',
12
+ typenames: ['Department'],
13
+ title: ({ value }) => value.name || value.controlNo || '',
14
+ context: ({ value }) => value.controlNo || ''
15
+ });
16
+ registerEntity360Section('department', {
17
+ name: 'overview',
18
+ order: 10,
19
+ render: subject => html `<department-overview-section .subject=${subject}></department-overview-section>`
20
+ });
21
+ }
22
+ let DepartmentOverviewSection = class DepartmentOverviewSection extends LitElement {
23
+ static { this.styles = css `
24
+ dl {
25
+ margin: 0;
26
+ display: grid;
27
+ grid-template-columns: max-content 1fr;
28
+ gap: 4px 12px;
29
+ font: 13px/1.5 sans-serif;
30
+ }
31
+ dt {
32
+ color: var(--md-sys-color-on-surface-variant);
33
+ }
34
+ dd {
35
+ margin: 0;
36
+ color: var(--md-sys-color-on-surface);
37
+ overflow-wrap: anywhere;
38
+ }
39
+ `; }
40
+ updated(changed) {
41
+ if (changed.has('subject'))
42
+ this.read();
43
+ }
44
+ async read() {
45
+ const id = this.subject?.id;
46
+ this.answer = undefined;
47
+ if (!id)
48
+ return;
49
+ const response = await client.query({
50
+ query: gql `
51
+ query ($id: String!) {
52
+ department(id: $id) {
53
+ id
54
+ controlNo
55
+ name
56
+ description
57
+ active
58
+ parent {
59
+ id
60
+ __typename
61
+ name
62
+ }
63
+ manager {
64
+ name
65
+ }
66
+ }
67
+ }
68
+ `,
69
+ variables: { id }
70
+ });
71
+ if (this.subject?.id !== id)
72
+ return;
73
+ this.answer = readEntity360Door(response, data => data?.department);
74
+ }
75
+ render() {
76
+ const answer = this.answer;
77
+ const department = answer?.data;
78
+ const none = i18next.t('text.entity360-none', { defaultValue: 'none' });
79
+ return html `<ox-entity360-section
80
+ .heading=${i18next.t('title.department list', { defaultValue: 'department' })}
81
+ .state=${answer?.state ?? 'loading'}
82
+ .message=${answer?.message ?? ''}
83
+ >
84
+ ${department
85
+ ? html `<dl>
86
+ <dt>${i18next.t('label.control-no')}</dt>
87
+ <dd>${department.controlNo || none}</dd>
88
+ <dt>${i18next.t('label.description')}</dt>
89
+ <dd>${department.description || none}</dd>
90
+ <dt>${i18next.t('label.department')}</dt>
91
+ <dd>${department.parent ? entity360Name(department.parent, department.parent.name || none) : none}</dd>
92
+ <dt>${i18next.t('label.manager')}</dt>
93
+ <dd>${department.manager?.name || none}</dd>
94
+ </dl>`
95
+ : ''}
96
+ </ox-entity360-section>`;
97
+ }
98
+ };
99
+ __decorate([
100
+ property({ attribute: false }),
101
+ __metadata("design:type", Object)
102
+ ], DepartmentOverviewSection.prototype, "subject", void 0);
103
+ __decorate([
104
+ state(),
105
+ __metadata("design:type", Object)
106
+ ], DepartmentOverviewSection.prototype, "answer", void 0);
107
+ DepartmentOverviewSection = __decorate([
108
+ customElement('department-overview-section')
109
+ ], DepartmentOverviewSection);
110
+ export { DepartmentOverviewSection };
111
+ //# sourceMappingURL=department-360.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"department-360.js","sourceRoot":"","sources":["../../client/entity360/department-360.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CA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AA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;0DAA2B;AACjD;IAAR,KAAK,EAAE;;yDAAqD;AApBlD,yBAAyB;IADrC,aAAa,CAAC,6BAA6B,CAAC;GAChC,yBAAyB,CAoFrC","sourcesContent":["import gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport {\n entity360Name,\n readEntity360Door,\n registerEntity360Kind,\n registerEntity360Section,\n type Entity360DoorAnswer,\n type Entity360Subject\n} from '@operato/layout'\n\ntype Department = {\n id: string\n controlNo?: string\n name?: string\n description?: string\n active?: boolean\n parent?: { id: string; name?: string; __typename?: string }\n manager?: { name?: string }\n}\n\n/** A department is a shared organizational fact: it can open from a person's membership and from generic object cells. */\nexport function registerDepartmentKind() {\n registerEntity360Kind({\n kind: 'department',\n typenames: ['Department'],\n title: ({ value }) => value.name || value.controlNo || '',\n context: ({ value }) => value.controlNo || ''\n })\n\n registerEntity360Section('department', {\n name: 'overview',\n order: 10,\n render: subject => html`<department-overview-section .subject=${subject}></department-overview-section>`\n })\n}\n\n@customElement('department-overview-section')\nexport class DepartmentOverviewSection extends LitElement {\n static styles = css`\n dl {\n margin: 0;\n display: grid;\n grid-template-columns: max-content 1fr;\n gap: 4px 12px;\n font: 13px/1.5 sans-serif;\n }\n dt {\n color: var(--md-sys-color-on-surface-variant);\n }\n dd {\n margin: 0;\n color: var(--md-sys-color-on-surface);\n overflow-wrap: anywhere;\n }\n `\n\n @property({ attribute: false }) subject?: Entity360Subject\n @state() answer?: Entity360DoorAnswer<Department | undefined>\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('subject')) this.read()\n }\n\n private async read() {\n const id = this.subject?.id\n this.answer = undefined\n if (!id) return\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n department(id: $id) {\n id\n controlNo\n name\n description\n active\n parent {\n id\n __typename\n name\n }\n manager {\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n if (this.subject?.id !== id) return\n this.answer = readEntity360Door(response, data => data?.department)\n }\n\n render() {\n const answer = this.answer\n const department = answer?.data\n const none = i18next.t('text.entity360-none', { defaultValue: 'none' })\n\n return html`<ox-entity360-section\n .heading=${i18next.t('title.department list', { defaultValue: 'department' })}\n .state=${answer?.state ?? 'loading'}\n .message=${answer?.message ?? ''}\n >\n ${\n department\n ? html`<dl>\n <dt>${i18next.t('label.control-no')}</dt>\n <dd>${department.controlNo || none}</dd>\n <dt>${i18next.t('label.description')}</dt>\n <dd>${department.description || none}</dd>\n <dt>${i18next.t('label.department')}</dt>\n <dd>${department.parent ? entity360Name(department.parent, department.parent.name || none) : none}</dd>\n <dt>${i18next.t('label.manager')}</dt>\n <dd>${department.manager?.name || none}</dd>\n </dl>`\n : ''\n }\n </ox-entity360-section>`\n }\n}\n"]}
@@ -13,7 +13,9 @@ type Membership = {
13
13
  name?: string;
14
14
  jobPosition?: string;
15
15
  department?: {
16
+ id: string;
16
17
  name?: string;
18
+ __typename?: string;
17
19
  };
18
20
  supervisor?: {
19
21
  name?: string;
@@ -4,7 +4,7 @@ import { css, html, LitElement } from 'lit';
4
4
  import { customElement, property, state } from 'lit/decorators.js';
5
5
  import { client } from '@operato/graphql';
6
6
  import { i18next } from '@operato/i18n';
7
- import { readEntity360Door, registerEntity360Section } from '@operato/layout';
7
+ import { entity360Name, readEntity360Door, registerEntity360Section } from '@operato/layout';
8
8
  export function registerPersonMembershipSection() {
9
9
  registerEntity360Section('person', {
10
10
  name: 'membership',
@@ -53,6 +53,8 @@ let PersonMembershipSection = class PersonMembershipSection extends LitElement {
53
53
  name
54
54
  jobPosition
55
55
  department {
56
+ id
57
+ __typename
56
58
  name
57
59
  }
58
60
  supervisor {
@@ -79,13 +81,13 @@ let PersonMembershipSection = class PersonMembershipSection extends LitElement {
79
81
  .message=${answer?.message ?? ''}
80
82
  >
81
83
  ${(answer?.data || []).map(one => html `<dl>
82
- <dt>${i18next.t('label.department')}</dt>
83
- <dd>${one.department?.name || none}</dd>
84
- <dt>${i18next.t('label.job-position')}</dt>
85
- <dd>${one.jobPosition || none}</dd>
86
- <dt>${i18next.t('label.supervisor-person', { defaultValue: 'supervisor' })}</dt>
87
- <dd>${one.supervisor?.name || none}</dd>
88
- </dl>`)}
84
+ <dt>${i18next.t('label.department')}</dt>
85
+ <dd>${one.department ? entity360Name(one.department, one.department.name || none) : none}</dd>
86
+ <dt>${i18next.t('label.job-position')}</dt>
87
+ <dd>${one.jobPosition || none}</dd>
88
+ <dt>${i18next.t('label.supervisor-person', { defaultValue: 'supervisor' })}</dt>
89
+ <dd>${one.supervisor?.name || none}</dd>
90
+ </dl>`)}
89
91
  </ox-entity360-section>`;
90
92
  }
91
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"person-membership-section.js","sourceRoot":"","sources":["../../client/entity360/person-membership-section.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAmD,MAAM,iBAAiB,CAAA;AAmB9H,MAAM,UAAU,+BAA+B;IAC7C,wBAAwB,CAAC,QAAQ,EAAE;QACjC,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAA,uCAAuC,OAAO,+BAA+B;KACrG,CAAC,CAAA;AACJ,CAAC;AAGM,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;aAC9C,WAAM,GAAG,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EAAE,CAAC,CAAC,GAAG,CACxB,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;gBACH,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC;gBAC7B,GAAG,CAAC,UAAU,EAAE,IAAI,IAAI,IAAI;gBAC5B,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC;gBAC/B,GAAG,CAAC,WAAW,IAAI,IAAI;gBACvB,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;gBACpE,GAAG,CAAC,UAAU,EAAE,IAAI,IAAI,IAAI;cAC9B,CACP;4BACqB,CAAA;IAC1B,CAAC;;AA3D+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wDAA2B;AACjD;IAAR,KAAK,EAAE;;uDAA2C;AAzBxC,uBAAuB;IADnC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,uBAAuB,CAoFnC","sourcesContent":["import gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { readEntity360Door, registerEntity360Section, type Entity360DoorAnswer, type Entity360Subject } from '@operato/layout'\n\n/**\n * The person 360's membership section (ADR-0067, design/ui/entity360-person.md §3): department,\n * position and supervisor, from the person's employee records in this domain.\n *\n * Read through `employees`, which asks `employee:query` - someone without it is told they may not\n * see this, never \"none\". A user can hold more than one employee record here (there is no unique\n * constraint on domain and user - `myEmployees` says why), so every record is shown.\n */\n\ntype Membership = {\n id: string\n name?: string\n jobPosition?: string\n department?: { name?: string }\n supervisor?: { name?: string }\n}\n\nexport function registerPersonMembershipSection() {\n registerEntity360Section('person', {\n name: 'membership',\n order: 10,\n render: subject => html`<person-membership-section .subject=${subject}></person-membership-section>`\n })\n}\n\n@customElement('person-membership-section')\nexport class PersonMembershipSection extends LitElement {\n static styles = css`\n dl {\n margin: 0;\n display: grid;\n grid-template-columns: max-content 1fr;\n gap: 4px 12px;\n font: 13px/1.5 sans-serif;\n }\n dl + dl {\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px dashed var(--md-sys-color-outline-variant);\n }\n dt {\n color: var(--md-sys-color-on-surface-variant);\n }\n dd {\n margin: 0;\n color: var(--md-sys-color-on-surface);\n overflow-wrap: anywhere;\n }\n `\n\n @property({ attribute: false }) subject?: Entity360Subject\n @state() answer?: Entity360DoorAnswer<Membership[]>\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('subject')) this.read()\n }\n\n private async read() {\n const id = this.subject?.id\n this.answer = undefined\n if (!id) return\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!]) {\n employees(filters: $filters) {\n items {\n id\n name\n jobPosition\n department {\n name\n }\n supervisor {\n name\n }\n }\n }\n }\n `,\n variables: { filters: [{ name: 'userId', operator: 'eq', value: id }] }\n })\n\n /* A later subject may have arrived while this one was being read. */\n if (this.subject?.id !== id) return\n this.answer = readEntity360Door(response, data => data?.employees?.items || [])\n }\n\n render() {\n const answer = this.answer\n /* A blank field says 「없음」 in its own row - leaving it out would read as \"not asked\". */\n const none = i18next.t('text.entity360-none', { defaultValue: 'none' })\n\n return html`<ox-entity360-section\n .heading=${i18next.t('title.person-membership', { defaultValue: 'membership' })}\n .state=${answer?.state ?? 'loading'}\n .message=${answer?.message ?? ''}\n >\n ${(answer?.data || []).map(\n one => html`<dl>\n <dt>${i18next.t('label.department')}</dt>\n <dd>${one.department?.name || none}</dd>\n <dt>${i18next.t('label.job-position')}</dt>\n <dd>${one.jobPosition || none}</dd>\n <dt>${i18next.t('label.supervisor-person', { defaultValue: 'supervisor' })}</dt>\n <dd>${one.supervisor?.name || none}</dd>\n </dl>`\n )}\n </ox-entity360-section>`\n }\n}\n"]}
1
+ {"version":3,"file":"person-membership-section.js","sourceRoot":"","sources":["../../client/entity360/person-membership-section.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;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K,EAAE;;uDAA2C;AAzBxC,uBAAuB;IADnC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,uBAAuB,CAuFnC","sourcesContent":["import gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport {\n entity360Name,\n readEntity360Door,\n registerEntity360Section,\n type Entity360DoorAnswer,\n type Entity360Subject\n} from '@operato/layout'\n\n/**\n * The person 360's membership section (ADR-0067, design/ui/entity360-person.md §3): department,\n * position and supervisor, from the person's employee records in this domain.\n *\n * Read through `employees`, which asks `employee:query` - someone without it is told they may not\n * see this, never \"none\". A user can hold more than one employee record here (there is no unique\n * constraint on domain and user - `myEmployees` says why), so every record is shown.\n */\n\ntype Membership = {\n id: string\n name?: string\n jobPosition?: string\n department?: { id: string; name?: string; __typename?: string }\n supervisor?: { name?: string }\n}\n\nexport function registerPersonMembershipSection() {\n registerEntity360Section('person', {\n name: 'membership',\n order: 10,\n render: subject => html`<person-membership-section .subject=${subject}></person-membership-section>`\n })\n}\n\n@customElement('person-membership-section')\nexport class PersonMembershipSection extends LitElement {\n static styles = css`\n dl {\n margin: 0;\n display: grid;\n grid-template-columns: max-content 1fr;\n gap: 4px 12px;\n font: 13px/1.5 sans-serif;\n }\n dl + dl {\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px dashed var(--md-sys-color-outline-variant);\n }\n dt {\n color: var(--md-sys-color-on-surface-variant);\n }\n dd {\n margin: 0;\n color: var(--md-sys-color-on-surface);\n overflow-wrap: anywhere;\n }\n `\n\n @property({ attribute: false }) subject?: Entity360Subject\n @state() answer?: Entity360DoorAnswer<Membership[]>\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('subject')) this.read()\n }\n\n private async read() {\n const id = this.subject?.id\n this.answer = undefined\n if (!id) return\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!]) {\n employees(filters: $filters) {\n items {\n id\n name\n jobPosition\n department {\n id\n __typename\n name\n }\n supervisor {\n name\n }\n }\n }\n }\n `,\n variables: { filters: [{ name: 'userId', operator: 'eq', value: id }] }\n })\n\n /* A later subject may have arrived while this one was being read. */\n if (this.subject?.id !== id) return\n this.answer = readEntity360Door(response, data => data?.employees?.items || [])\n }\n\n render() {\n const answer = this.answer\n /* A blank field says 「없음」 in its own row - leaving it out would read as \"not asked\". */\n const none = i18next.t('text.entity360-none', { defaultValue: 'none' })\n\n return html`<ox-entity360-section\n .heading=${i18next.t('title.person-membership', { defaultValue: 'membership' })}\n .state=${answer?.state ?? 'loading'}\n .message=${answer?.message ?? ''}\n >\n ${(answer?.data || []).map(\n one =>\n html`<dl>\n <dt>${i18next.t('label.department')}</dt>\n <dd>${one.department ? entity360Name(one.department, one.department.name || none) : none}</dd>\n <dt>${i18next.t('label.job-position')}</dt>\n <dd>${one.jobPosition || none}</dd>\n <dt>${i18next.t('label.supervisor-person', { defaultValue: 'supervisor' })}</dt>\n <dd>${one.supervisor?.name || none}</dd>\n </dl>`\n )}\n </ox-entity360-section>`\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { html } from 'lit-html';
2
+ import { entity360Name } from '@operato/layout';
2
3
  export const GristRendererDepartmentObject = (value, column, record, rowIndex, field) => {
3
4
  if (!value) {
4
5
  return '';
5
6
  }
6
7
  const { name, description } = value;
7
- return html `<span>${name || ''}${(description && `(${description})`) || ''}</span> `;
8
+ return html `<span>${entity360Name(value, name || '')}${(description && `(${description})`) || ''}</span> `;
8
9
  };
9
10
  //# sourceMappingURL=grist-renderer-department-object.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grist-renderer-department-object.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-department-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAI/B,MAAM,CAAC,MAAM,6BAA6B,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACrG,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAEnC,OAAO,IAAI,CAAA,SAAS,IAAI,IAAI,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,CAAA;AACtF,CAAC,CAAA","sourcesContent":["import { html } from 'lit-html'\n\nimport { FieldRenderer } from '@operato/data-grist'\n\nexport const GristRendererDepartmentObject: FieldRenderer = (value, column, record, rowIndex, field) => {\n if (!value) {\n return ''\n }\n\n const { name, description } = value\n\n return html`<span>${name || ''}${(description && `(${description})`) || ''}</span> `\n}\n"]}
1
+ {"version":3,"file":"grist-renderer-department-object.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-department-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,CAAC,MAAM,6BAA6B,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACrG,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAEnC,OAAO,IAAI,CAAA,SAAS,aAAa,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,CAAA;AAC5G,CAAC,CAAA","sourcesContent":["import { html } from 'lit-html'\n\nimport { FieldRenderer } from '@operato/data-grist'\nimport { entity360Name } from '@operato/layout'\n\nexport const GristRendererDepartmentObject: FieldRenderer = (value, column, record, rowIndex, field) => {\n if (!value) {\n return ''\n }\n\n const { name, description } = value\n\n return html`<span>${entity360Name(value, name || '')}${(description && `(${description})`) || ''}</span> `\n}\n"]}
@@ -594,6 +594,7 @@ let EmployeeListPage = class EmployeeListPage extends p13n(localize(i18next)(Sco
594
594
  }
595
595
  department {
596
596
  id
597
+ __typename
597
598
  controlNo
598
599
  name
599
600
  description
@@ -1 +1 @@
1
- {"version":3,"file":"employee-list-page.js","sourceRoot":"","sources":["../../../client/pages/employee/employee-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,sCAAsC,CAAA;AAC7C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,SAAS,EAA4B,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,OAAO,E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MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,MAAM;QAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,MAAM,CAAC,MAAM,CAAC;gBAClB,QAAQ,EAAE,GAAG,CAAA;;;;SAIZ;gBACD,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE;aACrC,CAAC,CAAA;QACJ,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;;AAxsB2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;IAE5C,2EAA2E;;+CAF/B;AAG3B;IAAhB,KAAK,EAAE;;qDAAmC;AAC1B;IAAhB,KAAK,EAAE;8BAA8B,UAAU;4DAAA;AAC/B;IAAhB,KAAK,EAAE;;2DAAkC;AACzB;IAAhB,KAAK,EAAE;;0DAAyC;AAChC;IAAhB,KAAK,EAAE;;oDAA2B;AAhIxB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+zB5B","sourcesContent":["import '@operato/data-grist'\nimport '@operato/data-tree'\nimport '@operato/list-state/ox-empty-note.js'\nimport '@operato/list-state/ox-page-state.js'\nimport '@things-factory/contact/dist-client'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPrompt } from '@operato/popup'\nimport { Contact } from '@operato/contact/ox-contact.js'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport { Department } from '../../types/department'\nimport { EmployeeImporter } from './employee-importer'\n\n@customElement('employee-list-page')\nexport class EmployeeListPage extends p13n(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n --ox-pfp-size: 40px;\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n .header {\n grid-template-areas: 'filters';\n }\n\n /*\n * The rail is how you narrow the list to one department; the list is the content\n * (ADR-0060 decision 8, and the ruling of 2026-09-18 that folded the by-department screen\n * into this one). It folds away, because a screen looking at everyone does not need it.\n */\n [body] {\n flex: 1;\n display: flex;\n flex-direction: row;\n min-height: 0;\n }\n\n [rail] {\n display: flex;\n flex-direction: column;\n width: 240px;\n min-width: 240px;\n border-right: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));\n overflow: auto;\n }\n\n [rail][folded] {\n display: none;\n }\n\n [rail-head] {\n display: flex;\n align-items: center;\n gap: var(--spacing-small, 4px);\n padding: var(--spacing-medium, 8px) var(--spacing-medium, 8px) 0;\n font: var(--label-font, inherit);\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n\n /* The word keeps its line. Sharing the row with a filler let it shrink and break in half. */\n [rail-head] > span {\n flex: 0 0 auto;\n white-space: nowrap;\n }\n\n [rail-head] button,\n /*\n * Going back to everyone. Picking a department narrows the list, and without this there is no\n * way out of that except reloading the screen.\n */\n button[all-departments] {\n width: calc(100% - 16px);\n margin: 4px 8px;\n padding: 6px 10px;\n text-align: left;\n border: 1px solid transparent;\n border-radius: var(--md-sys-shape-corner-small, 6px);\n background: transparent;\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n font: inherit;\n cursor: pointer;\n }\n\n button[all-departments][selected] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n [rail-toggle] {\n display: flex;\n align-items: center;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 2px;\n }\n\n [rail-toggle] {\n align-self: flex-start;\n margin: var(--spacing-medium, 8px) 0 0 var(--spacing-small, 4px);\n }\n\n ox-tree {\n flex: 1;\n overflow: auto;\n }\n\n ox-grist {\n flex: 1;\n min-width: 0;\n }\n\n @media screen and (max-width: 780px) {\n [rail] {\n display: none;\n }\n }\n `\n ]\n\n static get scopedElements() {\n return { 'employee-importer': EmployeeImporter }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n /** The department tree, its selection, and whether the rail is showing. */\n @state() private departments?: Department[]\n @state() private selectedDepartment?: Department\n @state() private departmentsLoaded = false\n @state() private departmentsError: unknown = null\n @state() private railFolded = false\n\n get context() {\n return {\n title: i18next.t('title.employee list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'organization/employee',\n actions: [\n { icon: 'save', title: i18next.t('button.save'), action: this.onUpdateEmployee.bind(this) },\n {\n icon: 'delete',\n title: i18next.t('button.delete'),\n action: this.onDeleteEmployee.bind(this),\n emphasis: { danger: true }\n }\n ],\n exportable: { name: i18next.t('title.employee list'), data: this.exportHandler.bind(this) },\n importable: { handler: this.importHandler.bind(this) }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <div body class=\"page-fill\">\n ${\n this.railFolded\n ? html`<button\n rail-toggle\n title=${i18next.t('title.department list')}\n @click=${() => (this.railFolded = false)}\n >\n <md-icon>account_tree</md-icon>\n </button>`\n : html`<aside rail>\n <div rail-head>\n <span>${i18next.t('title.department list')}</span>\n <div filler style=\"flex: 1\"></div>\n <button title=${i18next.t('label.fold')} @click=${() => (this.railFolded = true)}>\n <md-icon>chevron_left</md-icon>\n </button>\n </div>\n <ox-page-state\n .loading=${!this.departmentsLoaded && !this.departmentsError}\n .error=${this.departmentsError}\n @retry=${() => this.fetchDepartments()}\n >\n ${\n this.departments?.length\n ? html`<button\n all-departments\n ?selected=${!this.selectedDepartment}\n @click=${() => this.onSelectDepartment(undefined)}\n >\n ${i18next.t('text.all departments')}\n </button>\n <ox-tree\n .data=${this.departments}\n .selected=${this.selectedDepartment}\n @select=${(e: CustomEvent) => this.onSelectDepartment(e.detail as Department)}\n id-property=\"controlNo\"\n label-property=\"name\"\n ></ox-tree>`\n : html`<ox-empty-note\n icon=\"account_tree\"\n title=${i18next.t('text.no departments yet')}\n description=${i18next.t('text.departments are made on the department screen')}\n ></ox-empty-note>`\n }\n </ox-page-state>\n </aside>`\n }\n\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form class=\"filter\" autofocus without-search></ox-filters-form>\n </div>\n </div>\n\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n </div>\n `\n }\n\n /**\n * 트리에서 고른 부서가 목록의 부서 조건이다 — 조건은 하나고, 그것을 고르는 자리도 하나다.\n */\n private onSelectDepartment(department?: Department) {\n this.selectedDepartment = department\n this.grist?.fetch()\n this.updateContext()\n }\n\n /**\n * The departments the rail draws. departmentRoots answers with a list, and the tree draws from\n * the first root - a fragment spread straight onto the list is refused by the server.\n */\n private async fetchDepartments() {\n this.departmentsError = null\n\n try {\n const response = await client.query({\n query: gql`\n query {\n responses: departmentRoots {\n items {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n }\n }\n }\n }\n }\n }\n }\n\n fragment EmployeeDepartmentFragment on Department {\n id\n controlNo\n name\n description\n active\n }\n `\n })\n\n if (response.errors?.length) {\n throw response.errors[0]\n }\n\n /* Every root department, not just the first - the rail draws an array. */\n this.departments = response.data.responses?.items\n this.departmentsLoaded = true\n } catch (error) {\n this.departmentsError = error\n }\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n pagination: { pages: [50, 100, 200] },\n list: {\n thumbnail: 'profile',\n fields: ['controlNo', 'name'],\n details: ['email', 'department', 'hiredOn', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence', fixed: true },\n { type: 'gutter', gutterName: 'row-selector', multiple: true, fixed: true },\n {\n type: 'gutter',\n gutterName: 'button',\n header: i18next.t('field.register-account'),\n icon: record => (record.id && !record.user ? 'badge' : ''),\n iconOnly: false,\n title: record => (record.id && !record.user ? i18next.t('button.register-account') : ''),\n width: 80,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.id || record.user) {\n return\n }\n\n this.attachSystemUser(record)\n }\n }\n },\n {\n type: 'image',\n name: 'profile',\n header: i18next.t('button.edit-contact'),\n width: 80,\n record: {\n align: 'center',\n renderer: function (value, column, record, rowIndex, field) {\n return html`<ox-pfp-view .profile=${record.profile} .name=${record.name || '+'}></ox-pfp-view>`\n }\n },\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (record && record.contact) {\n this.openContactPopup(record)\n } else {\n this.openContactSelector(record)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'controlNo',\n fixed: true,\n header: i18next.t('field.control-no'),\n record: { editable: true, mandatory: true },\n filter: 'search',\n sortable: true,\n width: 105\n },\n {\n type: 'string',\n name: 'name',\n fixed: true,\n header: i18next.t('field.name'),\n record: { editable: true, mandatory: true },\n filter: 'search',\n sortable: true,\n width: 100\n },\n {\n type: 'string',\n name: 'alias',\n header: i18next.t('label.alias'),\n record: { editable: true },\n filter: 'search',\n sortable: false,\n width: 110\n },\n {\n type: 'resource-object',\n name: 'user',\n header: i18next.t('field.system-user'),\n record: {\n editable: true,\n options: {\n title: i18next.t('title.lookup system-user'),\n queryName: 'users',\n basicArgs: { filters: [{ name: 'userType', operator: 'eq', value: 'user' }] },\n descriptionField: 'email',\n columns: [\n { name: 'id', hidden: true },\n { name: 'name', header: i18next.t('field.name'), filter: 'search' },\n { name: 'email', header: i18next.t('field.email'), filter: 'search' }\n ],\n list: { fields: ['name', 'email'] }\n }\n },\n sortable: false,\n filter: 'search',\n width: 100\n },\n {\n type: 'code',\n name: 'type',\n header: i18next.t('field.type', { defaultValue: 'type' }),\n width: 115,\n sortable: true,\n filter: true,\n record: { editable: true, codeName: 'EMPLOYEE_TYPE', selectDispOpt: 'name' }\n },\n {\n type: 'department-object',\n name: 'department',\n header: i18next.t('field.department'),\n record: { editable: true },\n sortable: false,\n /* The rail narrows by department; a second department field here would be the same condition twice. */\n filter: false,\n width: 130\n },\n {\n type: 'resource-object',\n name: 'supervisor',\n header: i18next.t('field.supervisor'),\n record: {\n editable: true,\n options: {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n pagination: { pages: [50, 100, 200] },\n basicArgs: { filters: [{ name: 'active', operator: 'eq', value: true }] },\n list: { fields: ['controlNo', 'name', 'alias', 'hiredOn'] },\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n width: 120,\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search',\n sortable: true\n },\n {\n name: 'name',\n width: 120,\n header: { renderer: () => i18next.t('field.name') },\n filter: 'search',\n sortable: true\n },\n {\n name: 'alias',\n width: 150,\n header: { renderer: () => i18next.t('label.alias') },\n filter: 'search',\n sortable: true\n },\n {\n type: 'code',\n name: 'type',\n width: 110,\n header: { renderer: () => i18next.t('label.type', { defaultValue: 'type' }) },\n record: { editable: false, codeName: 'EMPLOYEE_TYPE', selectDispOpt: 'name' }\n },\n {\n type: 'code',\n name: 'jobPosition',\n width: 110,\n header: { renderer: () => i18next.t('label.job-position') },\n record: { editable: false, codeName: 'JOB_POSITION', selectDispOpt: 'name' }\n },\n {\n type: 'code',\n name: 'jobResponsibility',\n width: 200,\n header: { renderer: () => i18next.t('label.job-responsibility') },\n record: { editable: false, codeName: 'JOB_RESPONSIBILITY', selectDispOpt: 'name' }\n },\n { type: 'date', name: 'hiredOn', header: { renderer: () => i18next.t('field.hired-on') }, width: 120 }\n ],\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n sortable: false,\n width: 120\n },\n {\n type: 'string',\n name: 'email',\n header: i18next.t('field.email'),\n width: 200,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n return record.contact ? record.contact.email : ''\n }\n },\n sortable: false\n },\n {\n type: 'string',\n name: 'phone',\n header: i18next.t('field.phone'),\n width: 130,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n return record.contact ? record.contact.phone : ''\n }\n },\n sortable: false\n },\n {\n type: 'code',\n name: 'jobResponsibility',\n header: i18next.t('label.job-responsibility'),\n width: 175,\n record: { editable: true, codeName: 'JOB_RESPONSIBILITY', selectDispOpt: 'name' },\n filter: true\n },\n {\n type: 'code',\n name: 'jobPosition',\n header: i18next.t('label.job-position'),\n width: 100,\n record: { editable: true, codeName: 'JOB_POSITION', selectDispOpt: 'name' },\n filter: true\n },\n {\n type: 'date',\n name: 'hiredOn',\n header: i18next.t('field.hired-on'),\n width: 120,\n record: { editable: true },\n sortable: true\n },\n {\n type: 'date',\n name: 'retiredOn',\n header: i18next.t('label.retired-at'),\n width: 120,\n record: { editable: true }\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n width: 70,\n record: { align: 'center', editable: true },\n filter: true,\n sortable: false\n },\n {\n type: 'string',\n name: 'note',\n header: i18next.t('field.note'),\n width: 200,\n record: { editable: true },\n filter: 'search'\n },\n { type: 'resource-object', name: 'updater', header: i18next.t('field.updater'), width: 90, sortable: false },\n { type: 'datetime', name: 'updatedAt', header: i18next.t('field.updated_at'), width: 180, sortable: true },\n { type: 'resource-object', name: 'contact', hidden: true }\n ],\n rows: { selectable: { multiple: true } },\n sorters: [{ name: 'controlNo' }]\n }\n\n this.fetchDepartments()\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n /* The rail's selection is the department condition; nothing else sets one. */\n if (this.selectedDepartment) {\n filters = [...filters, { name: 'departmentId', operator: 'eq', value: this.selectedDepartment.id }]\n }\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: employees(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n controlNo\n name\n alias\n type\n jobResponsibility\n jobPosition\n active\n email\n phone\n user {\n id\n name\n }\n department {\n id\n controlNo\n name\n description\n }\n supervisor {\n id\n name\n controlNo\n }\n note\n hiredOn\n retiredOn\n contact {\n id\n email\n phone\n address\n }\n profile {\n left\n top\n zoom\n picture\n }\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings }\n })\n\n const records = response.data.responses.items\n\n return { total: response.data.responses.total || 0, records }\n }\n\n async onDeleteEmployee() {\n if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteEmployees(ids: $ids)\n }\n `,\n variables: { ids }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: i18next.t('text.deleted') })\n }\n }\n }\n }\n\n async onUpdateEmployee() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [EmployeePatch!]!) {\n updateMultipleEmployee(patches: $patches) {\n name\n }\n }\n `,\n variables: { patches }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set([\n 'id',\n 'controlNo',\n 'name',\n 'alias',\n 'type',\n 'hiredOn',\n 'retiredOn',\n 'active',\n 'note'\n ])\n\n return exportTargets.map(employee => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = employee[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <employee-importer\n .employees=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></employee-importer>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.import employee') }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n\n async openContactPopup(record: GristRecord) {\n if (!record.contact?.id) {\n return\n }\n\n const popup = openPopup(\n html`\n <contact-popup\n .contactId=${record.contact.id}\n @change=${() => {\n this.grist.fetch()\n }}\n @detach=${() => {\n this.detachContact(record)\n }}\n detachable\n ></contact-popup>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.contact') }\n )\n }\n\n async openContactSelector(record: GristRecord) {\n const popup = openPopup(\n html`\n <contact-selector .confirmCallback=${selected => this.attachContact(record, selected)}></contact-selector>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.contact') }\n )\n }\n\n async attachContact(record: GristRecord, contact: Contact) {\n if (record.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $contactId: String!) {\n attachContact(id: $id, contactId: $contactId) {\n id\n }\n }\n `,\n variables: { id: record.id, contactId: contact.id }\n })\n\n this.grist.fetch()\n } else if (contact?.id) {\n this.grist.addRecord({\n name: contact.name,\n contact: {\n id: contact.id,\n name: contact.name,\n email: (contact as any).email,\n phone: (contact as any).phone,\n address: (contact as any).address\n }\n })\n this.grist.refresh()\n await this.grist.requestUpdate()\n\n this.grist.checkDirties()\n }\n }\n\n async detachContact(record) {\n if (record.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n detachContact(id: $id) {\n id\n }\n }\n `,\n variables: { id: record.id }\n })\n\n this.grist.fetch()\n } else {\n record.contact = null\n this.grist.refresh()\n }\n }\n\n async attachSystemUser(record) {\n if (!record.user) {\n await client.mutate({\n mutation: gql`\n mutation ($employeeId: String!) {\n registerEmployeeAsSystemUser(employeeId: $employeeId)\n }\n `,\n variables: { employeeId: record.id }\n })\n }\n\n this.grist.fetch()\n }\n}\n"]}
1
+ {"version":3,"file":"employee-list-page.js","sourceRoot":"","sources":["../../../client/pages/employee/employee-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,sCAAsC,CAAA;AAC7C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,qCAAqC,CAAA;AAE5C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,SAAS,EAA4B,MAAM,qB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KAAK,EAAE;;0DAAyC;AAChC;IAAhB,KAAK,EAAE;;oDAA2B;AAhIxB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAg0B5B","sourcesContent":["import '@operato/data-grist'\nimport '@operato/data-tree'\nimport '@operato/list-state/ox-empty-note.js'\nimport '@operato/list-state/ox-page-state.js'\nimport '@things-factory/contact/dist-client'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPrompt } from '@operato/popup'\nimport { Contact } from '@operato/contact/ox-contact.js'\nimport { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport { Department } from '../../types/department'\nimport { EmployeeImporter } from './employee-importer'\n\n@customElement('employee-list-page')\nexport class EmployeeListPage extends p13n(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n --ox-pfp-size: 40px;\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n .header {\n grid-template-areas: 'filters';\n }\n\n /*\n * The rail is how you narrow the list to one department; the list is the content\n * (ADR-0060 decision 8, and the ruling of 2026-09-18 that folded the by-department screen\n * into this one). It folds away, because a screen looking at everyone does not need it.\n */\n [body] {\n flex: 1;\n display: flex;\n flex-direction: row;\n min-height: 0;\n }\n\n [rail] {\n display: flex;\n flex-direction: column;\n width: 240px;\n min-width: 240px;\n border-right: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));\n overflow: auto;\n }\n\n [rail][folded] {\n display: none;\n }\n\n [rail-head] {\n display: flex;\n align-items: center;\n gap: var(--spacing-small, 4px);\n padding: var(--spacing-medium, 8px) var(--spacing-medium, 8px) 0;\n font: var(--label-font, inherit);\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n\n /* The word keeps its line. Sharing the row with a filler let it shrink and break in half. */\n [rail-head] > span {\n flex: 0 0 auto;\n white-space: nowrap;\n }\n\n [rail-head] button,\n /*\n * Going back to everyone. Picking a department narrows the list, and without this there is no\n * way out of that except reloading the screen.\n */\n button[all-departments] {\n width: calc(100% - 16px);\n margin: 4px 8px;\n padding: 6px 10px;\n text-align: left;\n border: 1px solid transparent;\n border-radius: var(--md-sys-shape-corner-small, 6px);\n background: transparent;\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n font: inherit;\n cursor: pointer;\n }\n\n button[all-departments][selected] {\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n [rail-toggle] {\n display: flex;\n align-items: center;\n border: none;\n background: transparent;\n color: inherit;\n cursor: pointer;\n padding: 2px;\n }\n\n [rail-toggle] {\n align-self: flex-start;\n margin: var(--spacing-medium, 8px) 0 0 var(--spacing-small, 4px);\n }\n\n ox-tree {\n flex: 1;\n overflow: auto;\n }\n\n ox-grist {\n flex: 1;\n min-width: 0;\n }\n\n @media screen and (max-width: 780px) {\n [rail] {\n display: none;\n }\n }\n `\n ]\n\n static get scopedElements() {\n return { 'employee-importer': EmployeeImporter }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n /** The department tree, its selection, and whether the rail is showing. */\n @state() private departments?: Department[]\n @state() private selectedDepartment?: Department\n @state() private departmentsLoaded = false\n @state() private departmentsError: unknown = null\n @state() private railFolded = false\n\n get context() {\n return {\n title: i18next.t('title.employee list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'organization/employee',\n actions: [\n { icon: 'save', title: i18next.t('button.save'), action: this.onUpdateEmployee.bind(this) },\n {\n icon: 'delete',\n title: i18next.t('button.delete'),\n action: this.onDeleteEmployee.bind(this),\n emphasis: { danger: true }\n }\n ],\n exportable: { name: i18next.t('title.employee list'), data: this.exportHandler.bind(this) },\n importable: { handler: this.importHandler.bind(this) }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <div body class=\"page-fill\">\n ${\n this.railFolded\n ? html`<button\n rail-toggle\n title=${i18next.t('title.department list')}\n @click=${() => (this.railFolded = false)}\n >\n <md-icon>account_tree</md-icon>\n </button>`\n : html`<aside rail>\n <div rail-head>\n <span>${i18next.t('title.department list')}</span>\n <div filler style=\"flex: 1\"></div>\n <button title=${i18next.t('label.fold')} @click=${() => (this.railFolded = true)}>\n <md-icon>chevron_left</md-icon>\n </button>\n </div>\n <ox-page-state\n .loading=${!this.departmentsLoaded && !this.departmentsError}\n .error=${this.departmentsError}\n @retry=${() => this.fetchDepartments()}\n >\n ${\n this.departments?.length\n ? html`<button\n all-departments\n ?selected=${!this.selectedDepartment}\n @click=${() => this.onSelectDepartment(undefined)}\n >\n ${i18next.t('text.all departments')}\n </button>\n <ox-tree\n .data=${this.departments}\n .selected=${this.selectedDepartment}\n @select=${(e: CustomEvent) => this.onSelectDepartment(e.detail as Department)}\n id-property=\"controlNo\"\n label-property=\"name\"\n ></ox-tree>`\n : html`<ox-empty-note\n icon=\"account_tree\"\n title=${i18next.t('text.no departments yet')}\n description=${i18next.t('text.departments are made on the department screen')}\n ></ox-empty-note>`\n }\n </ox-page-state>\n </aside>`\n }\n\n <ox-grist\n .mode=${mode}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form class=\"filter\" autofocus without-search></ox-filters-form>\n </div>\n </div>\n\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n </div>\n `\n }\n\n /**\n * 트리에서 고른 부서가 목록의 부서 조건이다 — 조건은 하나고, 그것을 고르는 자리도 하나다.\n */\n private onSelectDepartment(department?: Department) {\n this.selectedDepartment = department\n this.grist?.fetch()\n this.updateContext()\n }\n\n /**\n * The departments the rail draws. departmentRoots answers with a list, and the tree draws from\n * the first root - a fragment spread straight onto the list is refused by the server.\n */\n private async fetchDepartments() {\n this.departmentsError = null\n\n try {\n const response = await client.query({\n query: gql`\n query {\n responses: departmentRoots {\n items {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n children {\n ...EmployeeDepartmentFragment\n }\n }\n }\n }\n }\n }\n }\n\n fragment EmployeeDepartmentFragment on Department {\n id\n controlNo\n name\n description\n active\n }\n `\n })\n\n if (response.errors?.length) {\n throw response.errors[0]\n }\n\n /* Every root department, not just the first - the rail draws an array. */\n this.departments = response.data.responses?.items\n this.departmentsLoaded = true\n } catch (error) {\n this.departmentsError = error\n }\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n pagination: { pages: [50, 100, 200] },\n list: {\n thumbnail: 'profile',\n fields: ['controlNo', 'name'],\n details: ['email', 'department', 'hiredOn', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence', fixed: true },\n { type: 'gutter', gutterName: 'row-selector', multiple: true, fixed: true },\n {\n type: 'gutter',\n gutterName: 'button',\n header: i18next.t('field.register-account'),\n icon: record => (record.id && !record.user ? 'badge' : ''),\n iconOnly: false,\n title: record => (record.id && !record.user ? i18next.t('button.register-account') : ''),\n width: 80,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.id || record.user) {\n return\n }\n\n this.attachSystemUser(record)\n }\n }\n },\n {\n type: 'image',\n name: 'profile',\n header: i18next.t('button.edit-contact'),\n width: 80,\n record: {\n align: 'center',\n renderer: function (value, column, record, rowIndex, field) {\n return html`<ox-pfp-view .profile=${record.profile} .name=${record.name || '+'}></ox-pfp-view>`\n }\n },\n handlers: {\n click: async (columns, data, column, record, rowIndex) => {\n if (record && record.contact) {\n this.openContactPopup(record)\n } else {\n this.openContactSelector(record)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'controlNo',\n fixed: true,\n header: i18next.t('field.control-no'),\n record: { editable: true, mandatory: true },\n filter: 'search',\n sortable: true,\n width: 105\n },\n {\n type: 'string',\n name: 'name',\n fixed: true,\n header: i18next.t('field.name'),\n record: { editable: true, mandatory: true },\n filter: 'search',\n sortable: true,\n width: 100\n },\n {\n type: 'string',\n name: 'alias',\n header: i18next.t('label.alias'),\n record: { editable: true },\n filter: 'search',\n sortable: false,\n width: 110\n },\n {\n type: 'resource-object',\n name: 'user',\n header: i18next.t('field.system-user'),\n record: {\n editable: true,\n options: {\n title: i18next.t('title.lookup system-user'),\n queryName: 'users',\n basicArgs: { filters: [{ name: 'userType', operator: 'eq', value: 'user' }] },\n descriptionField: 'email',\n columns: [\n { name: 'id', hidden: true },\n { name: 'name', header: i18next.t('field.name'), filter: 'search' },\n { name: 'email', header: i18next.t('field.email'), filter: 'search' }\n ],\n list: { fields: ['name', 'email'] }\n }\n },\n sortable: false,\n filter: 'search',\n width: 100\n },\n {\n type: 'code',\n name: 'type',\n header: i18next.t('field.type', { defaultValue: 'type' }),\n width: 115,\n sortable: true,\n filter: true,\n record: { editable: true, codeName: 'EMPLOYEE_TYPE', selectDispOpt: 'name' }\n },\n {\n type: 'department-object',\n name: 'department',\n header: i18next.t('field.department'),\n record: { editable: true },\n sortable: false,\n /* The rail narrows by department; a second department field here would be the same condition twice. */\n filter: false,\n width: 130\n },\n {\n type: 'resource-object',\n name: 'supervisor',\n header: i18next.t('field.supervisor'),\n record: {\n editable: true,\n options: {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n pagination: { pages: [50, 100, 200] },\n basicArgs: { filters: [{ name: 'active', operator: 'eq', value: true }] },\n list: { fields: ['controlNo', 'name', 'alias', 'hiredOn'] },\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n width: 120,\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search',\n sortable: true\n },\n {\n name: 'name',\n width: 120,\n header: { renderer: () => i18next.t('field.name') },\n filter: 'search',\n sortable: true\n },\n {\n name: 'alias',\n width: 150,\n header: { renderer: () => i18next.t('label.alias') },\n filter: 'search',\n sortable: true\n },\n {\n type: 'code',\n name: 'type',\n width: 110,\n header: { renderer: () => i18next.t('label.type', { defaultValue: 'type' }) },\n record: { editable: false, codeName: 'EMPLOYEE_TYPE', selectDispOpt: 'name' }\n },\n {\n type: 'code',\n name: 'jobPosition',\n width: 110,\n header: { renderer: () => i18next.t('label.job-position') },\n record: { editable: false, codeName: 'JOB_POSITION', selectDispOpt: 'name' }\n },\n {\n type: 'code',\n name: 'jobResponsibility',\n width: 200,\n header: { renderer: () => i18next.t('label.job-responsibility') },\n record: { editable: false, codeName: 'JOB_RESPONSIBILITY', selectDispOpt: 'name' }\n },\n { type: 'date', name: 'hiredOn', header: { renderer: () => i18next.t('field.hired-on') }, width: 120 }\n ],\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n sortable: false,\n width: 120\n },\n {\n type: 'string',\n name: 'email',\n header: i18next.t('field.email'),\n width: 200,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n return record.contact ? record.contact.email : ''\n }\n },\n sortable: false\n },\n {\n type: 'string',\n name: 'phone',\n header: i18next.t('field.phone'),\n width: 130,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, field) {\n return record.contact ? record.contact.phone : ''\n }\n },\n sortable: false\n },\n {\n type: 'code',\n name: 'jobResponsibility',\n header: i18next.t('label.job-responsibility'),\n width: 175,\n record: { editable: true, codeName: 'JOB_RESPONSIBILITY', selectDispOpt: 'name' },\n filter: true\n },\n {\n type: 'code',\n name: 'jobPosition',\n header: i18next.t('label.job-position'),\n width: 100,\n record: { editable: true, codeName: 'JOB_POSITION', selectDispOpt: 'name' },\n filter: true\n },\n {\n type: 'date',\n name: 'hiredOn',\n header: i18next.t('field.hired-on'),\n width: 120,\n record: { editable: true },\n sortable: true\n },\n {\n type: 'date',\n name: 'retiredOn',\n header: i18next.t('label.retired-at'),\n width: 120,\n record: { editable: true }\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n width: 70,\n record: { align: 'center', editable: true },\n filter: true,\n sortable: false\n },\n {\n type: 'string',\n name: 'note',\n header: i18next.t('field.note'),\n width: 200,\n record: { editable: true },\n filter: 'search'\n },\n { type: 'resource-object', name: 'updater', header: i18next.t('field.updater'), width: 90, sortable: false },\n { type: 'datetime', name: 'updatedAt', header: i18next.t('field.updated_at'), width: 180, sortable: true },\n { type: 'resource-object', name: 'contact', hidden: true }\n ],\n rows: { selectable: { multiple: true } },\n sorters: [{ name: 'controlNo' }]\n }\n\n this.fetchDepartments()\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n /* The rail's selection is the department condition; nothing else sets one. */\n if (this.selectedDepartment) {\n filters = [...filters, { name: 'departmentId', operator: 'eq', value: this.selectedDepartment.id }]\n }\n\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: employees(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n controlNo\n name\n alias\n type\n jobResponsibility\n jobPosition\n active\n email\n phone\n user {\n id\n name\n }\n department {\n id\n __typename\n controlNo\n name\n description\n }\n supervisor {\n id\n name\n controlNo\n }\n note\n hiredOn\n retiredOn\n contact {\n id\n email\n phone\n address\n }\n profile {\n left\n top\n zoom\n picture\n }\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings }\n })\n\n const records = response.data.responses.items\n\n return { total: response.data.responses.total || 0, records }\n }\n\n async onDeleteEmployee() {\n if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteEmployees(ids: $ids)\n }\n `,\n variables: { ids }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: i18next.t('text.deleted') })\n }\n }\n }\n }\n\n async onUpdateEmployee() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [EmployeePatch!]!) {\n updateMultipleEmployee(patches: $patches) {\n name\n }\n }\n `,\n variables: { patches }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set([\n 'id',\n 'controlNo',\n 'name',\n 'alias',\n 'type',\n 'hiredOn',\n 'retiredOn',\n 'active',\n 'note'\n ])\n\n return exportTargets.map(employee => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = employee[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <employee-importer\n .employees=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></employee-importer>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.import employee') }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n\n async openContactPopup(record: GristRecord) {\n if (!record.contact?.id) {\n return\n }\n\n const popup = openPopup(\n html`\n <contact-popup\n .contactId=${record.contact.id}\n @change=${() => {\n this.grist.fetch()\n }}\n @detach=${() => {\n this.detachContact(record)\n }}\n detachable\n ></contact-popup>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.contact') }\n )\n }\n\n async openContactSelector(record: GristRecord) {\n const popup = openPopup(\n html`\n <contact-selector .confirmCallback=${selected => this.attachContact(record, selected)}></contact-selector>\n `,\n { backdrop: true, size: 'large', title: i18next.t('title.contact') }\n )\n }\n\n async attachContact(record: GristRecord, contact: Contact) {\n if (record.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $contactId: String!) {\n attachContact(id: $id, contactId: $contactId) {\n id\n }\n }\n `,\n variables: { id: record.id, contactId: contact.id }\n })\n\n this.grist.fetch()\n } else if (contact?.id) {\n this.grist.addRecord({\n name: contact.name,\n contact: {\n id: contact.id,\n name: contact.name,\n email: (contact as any).email,\n phone: (contact as any).phone,\n address: (contact as any).address\n }\n })\n this.grist.refresh()\n await this.grist.requestUpdate()\n\n this.grist.checkDirties()\n }\n }\n\n async detachContact(record) {\n if (record.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n detachContact(id: $id) {\n id\n }\n }\n `,\n variables: { id: record.id }\n })\n\n this.grist.fetch()\n } else {\n record.contact = null\n this.grist.refresh()\n }\n }\n\n async attachSystemUser(record) {\n if (!record.user) {\n await client.mutate({\n mutation: gql`\n mutation ($employeeId: String!) {\n registerEmployeeAsSystemUser(employeeId: $employeeId)\n }\n `,\n variables: { employeeId: record.id }\n })\n }\n\n this.grist.fetch()\n }\n}\n"]}