@things-factory/organization 10.1.258 → 10.1.260
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.
- package/dist-client/pages/department/department-list-page.d.ts +8 -4
- package/dist-client/pages/department/department-list-page.js +28 -33
- package/dist-client/pages/department/department-list-page.js.map +1 -1
- package/dist-client/pages/employee/employee-list-page.d.ts +20 -6
- package/dist-client/pages/employee/employee-list-page.js +154 -97
- package/dist-client/pages/employee/employee-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -7
- package/tests/department-query-shape.test.ts +1 -1
|
@@ -21,17 +21,21 @@ export declare class DepartmentListPage extends DepartmentListPage_base {
|
|
|
21
21
|
title: string;
|
|
22
22
|
help: string;
|
|
23
23
|
actions: ({
|
|
24
|
+
id: string;
|
|
24
25
|
icon: string;
|
|
25
26
|
title: string;
|
|
26
|
-
action: () =>
|
|
27
|
-
emphasis?: undefined;
|
|
27
|
+
action: () => import("@operato/data-grist").GristRecord;
|
|
28
28
|
} | {
|
|
29
29
|
icon: string;
|
|
30
|
-
title: string;
|
|
31
|
-
action: () => Promise<void>;
|
|
32
30
|
emphasis: {
|
|
31
|
+
raised: boolean;
|
|
32
|
+
outlined: boolean;
|
|
33
|
+
dense: boolean;
|
|
33
34
|
danger: boolean;
|
|
34
35
|
};
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
action: () => Promise<void>;
|
|
35
39
|
})[];
|
|
36
40
|
};
|
|
37
41
|
gristConfig: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@operato/data-tree';
|
|
3
3
|
import '@operato/data-grist/ox-record-creator.js';
|
|
4
|
-
import { CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
4
|
+
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
5
5
|
import { PageView } from '@operato/shell';
|
|
6
6
|
import { css, html } from 'lit';
|
|
7
7
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
@@ -76,31 +76,22 @@ let DepartmentListPage = class DepartmentListPage extends localize(i18next)(Scop
|
|
|
76
76
|
}, title: i18next.t('title.department list'),
|
|
77
77
|
help: 'organization/department',
|
|
78
78
|
actions: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// { // icon: 'add',
|
|
79
|
+
/* A department starts at the top of the tree, its first cell focused - there is no empty row under the records. */
|
|
80
|
+
{ id: 'add-row', icon: 'add', title: i18next.t('button.add-row'), action: () => this.grist.addNewRecord() },
|
|
81
|
+
// {
|
|
82
|
+
// icon: 'add',
|
|
84
83
|
// title: i18next.t('button.add-sibling-dept'),
|
|
85
84
|
// action: () => this.grist.addSiblingNodes()
|
|
86
85
|
// },
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
action: this.save.bind(this)
|
|
90
|
-
},
|
|
91
|
-
{ icon: 'delete',
|
|
92
|
-
title: i18next.t('button.delete'),
|
|
93
|
-
action: this.delete.bind(this),
|
|
94
|
-
emphasis: { danger: true
|
|
95
|
-
}
|
|
96
|
-
}
|
|
86
|
+
{ id: 'delete', title: i18next.t('button.delete'), action: this.delete.bind(this), ...CommonButtonStyles.delete },
|
|
87
|
+
{ id: 'save', title: i18next.t('button.save'), action: this.save.bind(this), ...CommonButtonStyles.save }
|
|
97
88
|
].filter(Boolean)
|
|
98
89
|
};
|
|
99
90
|
}
|
|
100
91
|
render() {
|
|
101
92
|
const mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
102
93
|
return html `
|
|
103
|
-
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
94
|
+
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
|
104
95
|
<div slot="headroom" class="header">
|
|
105
96
|
<div class="filters">
|
|
106
97
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
|
@@ -284,7 +275,9 @@ let DepartmentListPage = class DepartmentListPage extends localize(i18next)(Scop
|
|
|
284
275
|
hidden: true
|
|
285
276
|
}
|
|
286
277
|
],
|
|
278
|
+
/* A tree: rows start with 「행 추가」 only - a paste past the last row would not know which parent it belongs under. */
|
|
287
279
|
rows: { appendable: false,
|
|
280
|
+
pasteAppendable: false,
|
|
288
281
|
selectable: { multiple: true
|
|
289
282
|
}
|
|
290
283
|
},
|
|
@@ -337,22 +330,24 @@ let DepartmentListPage = class DepartmentListPage extends localize(i18next)(Scop
|
|
|
337
330
|
}
|
|
338
331
|
}
|
|
339
332
|
async save() {
|
|
340
|
-
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
333
|
+
const dirty = this.grist.dirtyRecords;
|
|
334
|
+
if (!dirty?.length) {
|
|
335
|
+
notify({ level: 'info', message: i18next.t('text.nothing-to-save') });
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const response = await client.mutate({
|
|
339
|
+
mutation: gql `
|
|
340
|
+
mutation ($patches: [DepartmentPatch!]!) {
|
|
341
|
+
updateMultipleDepartment(patches: $patches) {
|
|
342
|
+
name
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`,
|
|
346
|
+
variables: { patches: dirty.map(toDepartmentPatch) },
|
|
347
|
+
context: { hasUpload: true }
|
|
348
|
+
});
|
|
349
|
+
if (!response.errors) {
|
|
350
|
+
this.grist.fetch();
|
|
356
351
|
}
|
|
357
352
|
}
|
|
358
353
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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D,CAAC;IAEA,KAAK,CAAC,IAAI;QAAS,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAA;QACtD,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAAO,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;YAE7E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,EAAU,QAAQ,EAAE,GAAG,CAAA;;;;SAIzD;gBACD,SAAS,EAAE,EAAY,OAAO;iBACpC;gBACM,OAAO,EAAE,EAAY,SAAS,EAAE,IAAI;iBAC1C;aACA,CAAC,CAAA;YAEG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;YACvD,CAAC;QACD,CAAC;IACD,CAAC;;AA/SS;IAAR,KAAK,EAAE;8BAAQ,UAAU;gDAAA;AACjB;IAAR,KAAK,EAAE;8BAAY,UAAU;oDAAA;AAEH;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AAsChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAiB;AA7DjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAoU9B","sourcesContent":["import '@operato/data-tree'\nimport '@operato/data-grist/ox-record-creator.js'\n\nimport { CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport gql from 'graphql-tag'\n\nimport { DepartmentImporter } from './department-importer'\nimport { toDepartmentPatch } from './department-patch'\nimport { Department } from '../../types/department'\n\nconst SubDepartmentFragment = gql`\n fragment SubDepartmentFragment on Department { id\n controlNo\n name\n description\n\n parent { id\n name\n }\n\n manager { id\n name\n controlNo\n photo\n email\n }\n active\n picture\n\n updater { id\n name\n }\n updatedAt\n }\n`\n\n@customElement('department-list-page')\nexport class DepartmentListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n .header { grid-template-areas: 'filters';\n }\n `\n ]\n\n static get scopedElements() { return { 'department-importer': DepartmentImporter\n }\n }\n\n @state() root?: Department\n @state() selected?: Department\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return {\n /*\n * Full text search sits in the title bar, the way these applications carry it\n * (ADR-0060 decision 9; user instruction 2026-09-18 - framework screens included).\n * It searches the columns that declare a search filter.\n */\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n }, title: i18next.t('title.department list'),\n help: 'organization/department',\n actions: [\n { icon: 'add',\n title: i18next.t('button.add', { defaultValue: 'add' }),\n action: () => this.grist.addRecord()\n },\n // { // icon: 'add',\n // title: i18next.t('button.add-sibling-dept'),\n // action: () => this.grist.addSiblingNodes()\n // },\n { icon: 'save',\n title: i18next.t('button.save'),\n action: this.save.bind(this)\n },\n { icon: 'delete',\n title: i18next.t('button.delete'),\n action: this.delete.bind(this),\n emphasis: { danger: true\n }\n }\n ].filter(Boolean)\n }\n }\n\n @property({ type: Object }) gristConfig: any\n\n render() { const mode = isMobileDevice() ? 'CARD' : 'GRID'\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\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 </ox-grist>\n `\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: departmentRoots(filters: $filters, pagination: $pagination, sortings: $sortings) { total\n items { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n ${SubDepartmentFragment}\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n const { items: records } = response.data.responses\n\n /*\n * Count every row the screen draws, not the roots.\n *\n * `departmentRoots` counts what it returns - top level departments - and this screen draws each\n * root with its whole subtree underneath. With one root and thirty eight departments the pager\n * said \"1 in total\" under thirty eight visible rows.\n */\n const countTree = (list: any[]): number =>\n (list || []).reduce((sum, record) => sum + 1 + countTree(record.children), 0)\n\n return { total: countTree(records),\n records\n }\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { pagination: { pages: [50, 100, 200] },\n list: { thumbnail: 'profile',\n fields: ['controlNo', 'name'],\n details: ['email', 'manager', 'updatedAt']\n },\n columns: [\n { type: 'gutter',\n gutterName: 'dirty',\n fixed: true\n },\n { type: 'tree',\n name: 'name',\n label: true,\n header: i18next.t('label.name', { defaultValue: 'name' }),\n record: { editable: true,\n options: { selectable: true\n }\n },\n filter: 'search',\n sortable: true,\n width: 200,\n fixed: true,\n handlers: { contextmenu: 'contextmenu-tree-mutation'\n }\n },\n { name: 'id', hidden: true },\n { type: 'string',\n name: 'controlNo',\n header: i18next.t('label.control-no'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n /* 부서 코드는 본부-팀-조까지 이어 붙는다(MFG-ASSY-A) — 110px 에서는 잘렸다. */\n width: 150\n },\n { type: 'department-object',\n name: 'parent',\n header: i18next.t('field.parent-department'),\n record: { editable: true\n },\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('label.description', { defaultValue: 'description' }),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n { type: 'resource-object',\n name: 'manager',\n header: i18next.t('label.manager'),\n record: { editable: true,\n options: { title: i18next.t('title.employee list'),\n queryName: 'employees',\n pagination: { pages: [50, 100, 200] },\n basicArgs: { filters: [\n { name: 'active',\n operator: 'eq',\n value: true\n }\n ]\n },\n list: { fields: ['controlNo', 'name', 'email'] },\n columns: [\n { name: 'id', hidden: true },\n { name: 'controlNo',\n width: 120,\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search',\n sortable: true\n },\n { name: 'name',\n width: 120,\n header: { renderer: () => i18next.t('field.name') },\n filter: 'search',\n sortable: true\n },\n { name: 'email',\n width: 150,\n header: { renderer: () => i18next.t('label.email', { defaultValue: 'email' }) },\n filter: false,\n sortable: true\n }\n ],\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n sortable: false,\n width: 120\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n width: 70,\n record: { align: 'center',\n editable: true\n },\n filter: true,\n sortable: true\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n width: 90,\n sortable: false\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n width: 180,\n sortable: true\n },\n { type: 'image',\n name: 'picture',\n record: { renderer: function (value, column, record, rowIndex, field) { return html`<ox-pfp-view\n style=\"height:90%; width: unset; aspect-ratio: 1 / 1;\"\n .profile=${record.picture}\n .name=${record.name}\n ></ox-pfp-view>`\n }\n },\n hidden: true\n }\n ],\n rows: { appendable: false,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'controlNo'\n }\n ],\n tree: { childrenProperty: 'children',\n expanded: () => true\n }\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async delete() { if (!this.grist.selected || this.grist.selected.length == 0) { await OxPrompt.open({ title: i18next.t('text.department-not-selected'),\n confirmButton: { text: i18next.t('button.confirm', { defaultValue: 'confirm' }) }\n })\n return\n }\n\n if (this.grist.selected.find(selected => selected.children && selected.children.length > 0)) { await OxPrompt.open({ title: i18next.t('text.department-with-children-cannot-be-deleted'),\n confirmButton: { text: i18next.t('button.confirm', { defaultValue: 'confirm' }) }\n })\n return\n }\n\n if (await OxPrompt.confirmDelete({ count: this.grist.selected.length })) { const temporaries = this.grist.selected.filter(record => !record.id)\n\n if (temporaries && temporaries.length > 0) { this.grist.fetch()\n }\n\n const ids = this.grist.selected.filter(record => record.id).map(record => record.id)\n\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteDepartments(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.deleted')\n })\n }\n }\n }\n }\n\n async save() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(toDepartmentPatch)\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [DepartmentPatch!]!) { updateMultipleDepartment(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n },\n context: { hasUpload: true\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"department-list-page.js","sourceRoot":"","sources":["../../../client/pages/department/department-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AA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D,CAAC;IACD,CAAC;IAEA,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YACnB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAA;YACrE,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;OAMZ;YACD,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YACpD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC;IACH,CAAC;;AA7SQ;IAAR,KAAK,EAAE;8BAAQ,UAAU;gDAAA;AACjB;IAAR,KAAK,EAAE;8BAAY,UAAU;oDAAA;AAEH;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AA6BhB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAiB;AApDjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAkU9B","sourcesContent":["import '@operato/data-tree'\nimport '@operato/data-grist/ox-record-creator.js'\n\nimport { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport gql from 'graphql-tag'\n\nimport { DepartmentImporter } from './department-importer'\nimport { toDepartmentPatch } from './department-patch'\nimport { Department } from '../../types/department'\n\nconst SubDepartmentFragment = gql`\n fragment SubDepartmentFragment on Department { id\n controlNo\n name\n description\n\n parent { id\n name\n }\n\n manager { id\n name\n controlNo\n photo\n email\n }\n active\n picture\n\n updater { id\n name\n }\n updatedAt\n }\n`\n\n@customElement('department-list-page')\nexport class DepartmentListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n .header { grid-template-areas: 'filters';\n }\n `\n ]\n\n static get scopedElements() { return { 'department-importer': DepartmentImporter\n }\n }\n\n @state() root?: Department\n @state() selected?: Department\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return {\n /*\n * Full text search sits in the title bar, the way these applications carry it\n * (ADR-0060 decision 9; user instruction 2026-09-18 - framework screens included).\n * It searches the columns that declare a search filter.\n */\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n }, title: i18next.t('title.department list'),\n help: 'organization/department',\n actions: [\n /* A department starts at the top of the tree, its first cell focused - there is no empty row under the records. */\n { id: 'add-row', icon: 'add', title: i18next.t('button.add-row'), action: () => this.grist.addNewRecord() },\n // {\n // icon: 'add',\n // title: i18next.t('button.add-sibling-dept'),\n // action: () => this.grist.addSiblingNodes()\n // },\n { id: 'delete', title: i18next.t('button.delete'), action: this.delete.bind(this), ...CommonButtonStyles.delete },\n { id: 'save', title: i18next.t('button.save'), action: this.save.bind(this), ...CommonButtonStyles.save }\n ].filter(Boolean)\n }\n }\n\n @property({ type: Object }) gristConfig: any\n\n render() { const mode = isMobileDevice() ? 'CARD' : 'GRID'\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>\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 </ox-grist>\n `\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: departmentRoots(filters: $filters, pagination: $pagination, sortings: $sortings) { total\n items { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n children(filters: $filters, sortings: $sortings) { ...SubDepartmentFragment\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n ${SubDepartmentFragment}\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n const { items: records } = response.data.responses\n\n /*\n * Count every row the screen draws, not the roots.\n *\n * `departmentRoots` counts what it returns - top level departments - and this screen draws each\n * root with its whole subtree underneath. With one root and thirty eight departments the pager\n * said \"1 in total\" under thirty eight visible rows.\n */\n const countTree = (list: any[]): number =>\n (list || []).reduce((sum, record) => sum + 1 + countTree(record.children), 0)\n\n return { total: countTree(records),\n records\n }\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { pagination: { pages: [50, 100, 200] },\n list: { thumbnail: 'profile',\n fields: ['controlNo', 'name'],\n details: ['email', 'manager', 'updatedAt']\n },\n columns: [\n { type: 'gutter',\n gutterName: 'dirty',\n fixed: true\n },\n { type: 'tree',\n name: 'name',\n label: true,\n header: i18next.t('label.name', { defaultValue: 'name' }),\n record: { editable: true,\n options: { selectable: true\n }\n },\n filter: 'search',\n sortable: true,\n width: 200,\n fixed: true,\n handlers: { contextmenu: 'contextmenu-tree-mutation'\n }\n },\n { name: 'id', hidden: true },\n { type: 'string',\n name: 'controlNo',\n header: i18next.t('label.control-no'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n /* 부서 코드는 본부-팀-조까지 이어 붙는다(MFG-ASSY-A) — 110px 에서는 잘렸다. */\n width: 150\n },\n { type: 'department-object',\n name: 'parent',\n header: i18next.t('field.parent-department'),\n record: { editable: true\n },\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('label.description', { defaultValue: 'description' }),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n { type: 'resource-object',\n name: 'manager',\n header: i18next.t('label.manager'),\n record: { editable: true,\n options: { title: i18next.t('title.employee list'),\n queryName: 'employees',\n pagination: { pages: [50, 100, 200] },\n basicArgs: { filters: [\n { name: 'active',\n operator: 'eq',\n value: true\n }\n ]\n },\n list: { fields: ['controlNo', 'name', 'email'] },\n columns: [\n { name: 'id', hidden: true },\n { name: 'controlNo',\n width: 120,\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search',\n sortable: true\n },\n { name: 'name',\n width: 120,\n header: { renderer: () => i18next.t('field.name') },\n filter: 'search',\n sortable: true\n },\n { name: 'email',\n width: 150,\n header: { renderer: () => i18next.t('label.email', { defaultValue: 'email' }) },\n filter: false,\n sortable: true\n }\n ],\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n sortable: false,\n width: 120\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n width: 70,\n record: { align: 'center',\n editable: true\n },\n filter: true,\n sortable: true\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n width: 90,\n sortable: false\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n width: 180,\n sortable: true\n },\n { type: 'image',\n name: 'picture',\n record: { renderer: function (value, column, record, rowIndex, field) { return html`<ox-pfp-view\n style=\"height:90%; width: unset; aspect-ratio: 1 / 1;\"\n .profile=${record.picture}\n .name=${record.name}\n ></ox-pfp-view>`\n }\n },\n hidden: true\n }\n ],\n /* A tree: rows start with 「행 추가」 only - a paste past the last row would not know which parent it belongs under. */\n rows: { appendable: false,\n pasteAppendable: false,\n selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'controlNo'\n }\n ],\n tree: { childrenProperty: 'children',\n expanded: () => true\n }\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async delete() { if (!this.grist.selected || this.grist.selected.length == 0) { await OxPrompt.open({ title: i18next.t('text.department-not-selected'),\n confirmButton: { text: i18next.t('button.confirm', { defaultValue: 'confirm' }) }\n })\n return\n }\n\n if (this.grist.selected.find(selected => selected.children && selected.children.length > 0)) { await OxPrompt.open({ title: i18next.t('text.department-with-children-cannot-be-deleted'),\n confirmButton: { text: i18next.t('button.confirm', { defaultValue: 'confirm' }) }\n })\n return\n }\n\n if (await OxPrompt.confirmDelete({ count: this.grist.selected.length })) { const temporaries = this.grist.selected.filter(record => !record.id)\n\n if (temporaries && temporaries.length > 0) { this.grist.fetch()\n }\n\n const ids = this.grist.selected.filter(record => record.id).map(record => record.id)\n\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteDepartments(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.deleted')\n })\n }\n }\n }\n }\n\n async save() {\n const dirty = this.grist.dirtyRecords\n if (!dirty?.length) {\n notify({ level: 'info', message: i18next.t('text.nothing-to-save') })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [DepartmentPatch!]!) {\n updateMultipleDepartment(patches: $patches) {\n name\n }\n }\n `,\n variables: { patches: dirty.map(toDepartmentPatch) },\n context: { hasUpload: true }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import '@operato/data-tree';
|
|
|
3
3
|
import '@operato/list-state/ox-empty-note.js';
|
|
4
4
|
import '@operato/list-state/ox-page-state.js';
|
|
5
5
|
import '@things-factory/contact/dist-client';
|
|
6
|
+
import '@things-factory/ai-assistant/dist-client/index.js';
|
|
6
7
|
import { Contact } from '@operato/contact/ox-contact.js';
|
|
7
8
|
import { FetchOption, GristRecord } from '@operato/data-grist';
|
|
8
9
|
import { PageView } from '@operato/shell';
|
|
@@ -21,8 +22,7 @@ export declare class EmployeeListPage extends EmployeeListPage_base {
|
|
|
21
22
|
gristConfig: any;
|
|
22
23
|
mode: 'CARD' | 'GRID' | 'LIST';
|
|
23
24
|
private grist;
|
|
24
|
-
/** The department chosen on the
|
|
25
|
-
private selectedDepartment?;
|
|
25
|
+
/** Whether the rail is showing. The department chosen on it is the grid's own filter (`departmentId`), kept in the address. */
|
|
26
26
|
private railFolded;
|
|
27
27
|
/** Whether this person issues employees' certificates. */
|
|
28
28
|
private issuesCertificates;
|
|
@@ -32,6 +32,8 @@ export declare class EmployeeListPage extends EmployeeListPage_base {
|
|
|
32
32
|
*/
|
|
33
33
|
private departmentsRead;
|
|
34
34
|
private get departments();
|
|
35
|
+
/** The department the list is narrowed to: the grid's `departmentId` filter, found in the rail's tree. */
|
|
36
|
+
private get selectedDepartment();
|
|
35
37
|
get context(): {
|
|
36
38
|
title: string;
|
|
37
39
|
search: {
|
|
@@ -43,17 +45,21 @@ export declare class EmployeeListPage extends EmployeeListPage_base {
|
|
|
43
45
|
};
|
|
44
46
|
help: string;
|
|
45
47
|
actions: ({
|
|
48
|
+
id: string;
|
|
46
49
|
icon: string;
|
|
47
50
|
title: string;
|
|
48
|
-
action: () =>
|
|
49
|
-
emphasis?: undefined;
|
|
51
|
+
action: () => GristRecord;
|
|
50
52
|
} | {
|
|
51
53
|
icon: string;
|
|
52
|
-
title: string;
|
|
53
|
-
action: () => Promise<void>;
|
|
54
54
|
emphasis: {
|
|
55
|
+
raised: boolean;
|
|
56
|
+
outlined: boolean;
|
|
57
|
+
dense: boolean;
|
|
55
58
|
danger: boolean;
|
|
56
59
|
};
|
|
60
|
+
id: string;
|
|
61
|
+
title: string;
|
|
62
|
+
action: () => Promise<void>;
|
|
57
63
|
})[];
|
|
58
64
|
exportable: {
|
|
59
65
|
name: string;
|
|
@@ -63,14 +69,22 @@ export declare class EmployeeListPage extends EmployeeListPage_base {
|
|
|
63
69
|
handler: (records: any) => Promise<void>;
|
|
64
70
|
};
|
|
65
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* What is done with the picked employees, on the selection bar over the list (FOOTER-BUTTON-REVIEW F06): certificates
|
|
74
|
+
* of one employee - for whoever issues them (`employee-certificate`, ADR-0176 decision 5) - and deleting.
|
|
75
|
+
*/
|
|
76
|
+
private get selectionActions();
|
|
66
77
|
render(): import("lit-html").TemplateResult<1>;
|
|
67
78
|
/**
|
|
68
79
|
* 트리에서 고른 부서가 목록의 부서 조건이다 — 조건은 하나고, 그것을 고르는 자리도 하나다.
|
|
80
|
+
* The condition is the grid's hidden `departmentId` filter, so the address keeps it and a change reads page 1.
|
|
69
81
|
*/
|
|
70
82
|
private onSelectDepartment;
|
|
71
83
|
/** One certificate of the one employee selected. */
|
|
72
84
|
private issueCertificate;
|
|
73
85
|
pageInitialized(lifecycle: any): Promise<void>;
|
|
86
|
+
/** A new employee starts in the department picked on the rail. */
|
|
87
|
+
private draft;
|
|
74
88
|
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
75
89
|
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
76
90
|
total: any;
|