@things-factory/auth-ui 10.1.220 → 10.1.223
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/bootstrap.js +1 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/pages/role/role-privilege-page.d.ts +7 -5
- package/dist-client/pages/role/role-privilege-page.js +45 -22
- package/dist-client/pages/role/role-privilege-page.js.map +1 -1
- package/dist-client/pages/role/role-task-review.test.js +19 -5
- package/dist-client/pages/role/role-task-review.test.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/translations/en.json +3 -2
- package/translations/es.json +3 -2
- package/translations/ja.json +3 -2
- package/translations/ko.json +3 -2
- package/translations/ms.json +3 -2
- package/translations/zh.json +3 -2
package/dist-client/bootstrap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,iCAAiC,CAAA,CAAC,sDAAsD;AAE/F,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAA;AAC/F,OAAO,EACL,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EACzC,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,+CAA+C,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,O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O,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC/E,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QACvH,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAA;QACxB,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;YACjD,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE,GAAG,EAAE,CACb,MAAM,CAAC,sCAAsC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACvD,SAAS,CACP,IAAI,CAAA;0BACU,MAAM,CAAC,QAAQ;2BACd,MAAM,CAAC,SAAS;+BACZ,MAAM,CAAC,aAAa;qCACd,EACzB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,qCAAqC,CAAC,EAAE,CAC5E,CACF;SACJ,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACpC,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC,CAAC,CAAA;IAEF;;;;MAIE;IACF,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;AACtB,CAAC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport { i18next } from '@operato/i18n'\nimport '@operato/attribute/grist-editor' /* for register data-grist editor type 'attributes' */\n\nimport { html } from 'lit-html'\n\nimport { navigate, removeDraftsOf, store } from '@operato/shell'\nimport { openPopup, registerNotifyAction } from '@operato/layout'\nimport { OxGristEditorPrivilege } from '@operato/app/grist-editor/ox-grist-editor-privilege.js'\nimport {\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer,\n OxGristRendererJson5\n} from '@operato/data-grist'\n\nimport { auth } from '@things-factory/auth-base/dist-client/auth.js'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\nimport { ADD_USER_MENU } from '@things-factory/apptool-base/client'\nimport { registerPersonAuditSection, registerPersonKind } from './entity360/person-360.js'\nimport { requestableFrom } from './utils/access-request.js'\n\nexport default async function bootstrap() {\n /* the person 360 - a User value anywhere opens it (ADR-0067) */\n registerPersonKind()\n\n /* Whose audit a person 360 shows is `audit:query`'s - only those who hold it get the section (ADR-0141 §5). */\n hasPrivilege({ privilege: 'query', category: 'audit', superUserGranted: true }).then(holds => holds && registerPersonAuditSection())\n\n registerGristEditor('privilege', OxGristEditorPrivilege)\n registerGristRenderer('privilege', OxGristRendererJson5)\n\n /*\n * The person's own profile and sign-out are in the menu the header's avatar opens, not among the\n * morendas - those are the app's administration (the rail's 「시스템 › 관리」).\n */\n store.dispatch({\n type: ADD_USER_MENU,\n item: {\n name: 'profile',\n icon: 'account_circle',\n label: 'text.auth profile',\n order: 10,\n action: () => {\n navigate('profile')\n }\n }\n })\n\n store.dispatch({\n type: ADD_USER_MENU,\n item: {\n name: 'sign-out',\n icon: 'exit_to_app',\n label: 'field.sign out',\n order: 15,\n action: () => {\n try {\n if (typeof localStorage !== 'undefined') {\n localStorage.removeItem('i18nextLng')\n localStorage.removeItem('i18next')\n }\n\n ;['i18next', 'i18nextLng'].forEach(name => {\n try {\n document.cookie = `${name}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT;`\n } catch (e) {\n // ignore\n }\n })\n } catch (e) {\n // ignore\n }\n\n auth.signout()\n }\n }\n })\n\n /*\n * Unsaved drafts stay in this browser (ADR-0098). Signing out takes this user's away, so a shared\n * computer keeps none of their edits. Awaited before the page leaves; a browser that keeps no drafts\n * has none to take.\n */\n auth.on('presignout', async () => {\n const user = (auth.credential as any)?.id\n if (user) await removeDraftsOf(user).catch(() => {})\n })\n\n /*\n * A refusal a role would open, of a change the person made, gets one quiet \"request access…\" on its toast. The toast\n * does not know what an error means and @operato/graphql only reports it; this package knows, so it puts the button\n * on (registerNotifyAction, things-factory ADR-0103 decision 5). Where auth-ui is not loaded there is no button.\n */\n registerNotifyAction('access-request', notification => {\n const refusal = Array.isArray(notification.ex) ? notification.ex[0] : undefined\n const detail = requestableFrom(refusal?.extensions, Array.isArray(refusal?.path) ? String(refusal.path[0]) : undefined)\n if (!detail) return null\n return {\n label: i18next.t('access-request.button.request'),\n emphasis: 'quiet',\n callback: () =>\n import('./components/access-request-popup.js').then(() =>\n openPopup(\n html`<access-request-popup\n .category=${detail.category}\n .privilege=${detail.privilege}\n .operationName=${detail.operationName}\n ></access-request-popup>`,\n { size: 'medium', title: i18next.t('access-request.title.request access') }\n )\n )\n }\n })\n\n auth.on('profile', ({ credential }) => {\n if (credential && credential.locale) {\n i18next.changeLanguage(credential.locale)\n }\n })\n\n /* \n Get user profile information from server. \n As soon as response received, auth.on('profile', ...) handlers start to work.\n It's very important point to build UI for the user.\n */\n await auth.profile()\n}\n"]}
|
|
@@ -56,7 +56,6 @@ export declare class RolePrivilegePage extends RolePrivilegePage_base {
|
|
|
56
56
|
private showUnheldTasks;
|
|
57
57
|
/** null until asked for; [] when this person may not read templates (`roleTemplates` asks user:mutation). */
|
|
58
58
|
private templates;
|
|
59
|
-
private templateId;
|
|
60
59
|
private gap;
|
|
61
60
|
/**
|
|
62
61
|
* 부모 도메인의 역할은 여기서 못 고친다 — `updateRole` 의 범위가 `domain.id` 하나다.
|
|
@@ -147,10 +146,11 @@ export declare class RolePrivilegePage extends RolePrivilegePage_base {
|
|
|
147
146
|
private editTask;
|
|
148
147
|
private renderTask;
|
|
149
148
|
/**
|
|
150
|
-
* **The role against
|
|
149
|
+
* **The role against its base template** (ADR-0139 decision 11; ADR-0075 decision 1, amended 2026-10-26).
|
|
151
150
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
151
|
+
* A role keeps one base template (`Role.templateId`), whatever the role is called — a role named in the site's own
|
|
152
|
+
* words (경영지원, 인사급여) is given its base here, once, and the role list counts what it lacks from then on.
|
|
153
|
+
* Picking saves the base at once and touches no privilege. The role is never renamed to make a pair: an approval line
|
|
154
154
|
* holds the role. What the role holds beyond the template is shown as wider, not wrong — the site may have widened it
|
|
155
155
|
* on purpose — and nothing takes it away. What it lacks can be added; adding is the same top-up the template button
|
|
156
156
|
* on the role list runs (`createRoleFromTemplate` onto this role's name).
|
|
@@ -160,7 +160,9 @@ export declare class RolePrivilegePage extends RolePrivilegePage_base {
|
|
|
160
160
|
/** A privilege in words — the sentence the privileges view draws, or its module and axis when there is none. */
|
|
161
161
|
private sentenceOf;
|
|
162
162
|
private fetchTemplates;
|
|
163
|
-
|
|
163
|
+
/** Saves the role's base template - `''` bases it on none. The privileges stay as they are. */
|
|
164
|
+
private setBaseTemplate;
|
|
165
|
+
private readGap;
|
|
164
166
|
/** Adds what the role lacks against the picked template — after showing what it adds. */
|
|
165
167
|
private addMissing;
|
|
166
168
|
/**
|
|
@@ -70,7 +70,6 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
70
70
|
this.showUnheldTasks = false;
|
|
71
71
|
/** null until asked for; [] when this person may not read templates (`roleTemplates` asks user:mutation). */
|
|
72
72
|
this.templates = null;
|
|
73
|
-
this.templateId = '';
|
|
74
73
|
this.gap = null;
|
|
75
74
|
}
|
|
76
75
|
static { this.styles = [
|
|
@@ -915,10 +914,11 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
915
914
|
`;
|
|
916
915
|
}
|
|
917
916
|
/**
|
|
918
|
-
* **The role against
|
|
917
|
+
* **The role against its base template** (ADR-0139 decision 11; ADR-0075 decision 1, amended 2026-10-26).
|
|
919
918
|
*
|
|
920
|
-
*
|
|
921
|
-
*
|
|
919
|
+
* A role keeps one base template (`Role.templateId`), whatever the role is called — a role named in the site's own
|
|
920
|
+
* words (경영지원, 인사급여) is given its base here, once, and the role list counts what it lacks from then on.
|
|
921
|
+
* Picking saves the base at once and touches no privilege. The role is never renamed to make a pair: an approval line
|
|
922
922
|
* holds the role. What the role holds beyond the template is shown as wider, not wrong — the site may have widened it
|
|
923
923
|
* on purpose — and nothing takes it away. What it lacks can be added; adding is the same top-up the template button
|
|
924
924
|
* on the role list runs (`createRoleFromTemplate` onto this role's name).
|
|
@@ -930,14 +930,17 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
930
930
|
if (!this.templates.length) {
|
|
931
931
|
return html `<div review><div empty>${i18next.t('text.no template to compare with')}</div></div>`;
|
|
932
932
|
}
|
|
933
|
-
const
|
|
933
|
+
const baseId = this.subject?.templateId || '';
|
|
934
|
+
const template = this.templates.find(one => one.id === baseId);
|
|
934
935
|
const gap = this.gap;
|
|
935
936
|
return html `
|
|
936
937
|
<div review>
|
|
937
|
-
<select @change=${(event) => this.
|
|
938
|
-
<option value="" ?selected=${!
|
|
939
|
-
${this.templates.map(one => html `<option value=${one.id} ?selected=${one.id ===
|
|
938
|
+
<select ?disabled=${this.inherited || this.saving} @change=${(event) => this.setBaseTemplate(event.target.value)}>
|
|
939
|
+
<option value="" ?selected=${!baseId}>${i18next.t('text.no base template')}</option>
|
|
940
|
+
${this.templates.map(one => html `<option value=${one.id} ?selected=${one.id === baseId}>${one.name}</option>`)}
|
|
941
|
+
${baseId && !template ? html `<option value=${baseId} selected>${baseId}</option>` : nothing}
|
|
940
942
|
</select>
|
|
943
|
+
${baseId && !template ? html `<div note attention>${i18next.t('text.base template not in this installation')}</div>` : nothing}
|
|
941
944
|
${this.dirty ? html `<div stale>${i18next.t('text.counted from the saved privileges')}</div>` : nothing}
|
|
942
945
|
${template?.definitionErrors.length
|
|
943
946
|
? html `<div note attention>${i18next.t('text.template cannot be applied because', { list: template.definitionErrors.join(' · ') })}</div>`
|
|
@@ -990,21 +993,44 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
990
993
|
/* Reading templates asks the same door creating a role does; without it there is nothing to compare with. */
|
|
991
994
|
const templates = response.errors?.length ? [] : response.data?.roleTemplates || [];
|
|
992
995
|
this.templates = templates;
|
|
993
|
-
|
|
994
|
-
await this.pickTemplate(paired?.id || '');
|
|
996
|
+
await this.readGap();
|
|
995
997
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
+
/** Saves the role's base template - `''` bases it on none. The privileges stay as they are. */
|
|
999
|
+
async setBaseTemplate(templateId) {
|
|
1000
|
+
if (this.inherited || this.saving)
|
|
1001
|
+
return;
|
|
1002
|
+
const response = await client.mutate({
|
|
1003
|
+
mutation: gql `
|
|
1004
|
+
mutation ($id: String!, $patch: RolePatch!) {
|
|
1005
|
+
updateRole(id: $id, patch: $patch) {
|
|
1006
|
+
id
|
|
1007
|
+
templateId
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
`,
|
|
1011
|
+
variables: { id: this.subject.id, patch: { templateId: templateId || null } },
|
|
1012
|
+
context: gqlContext()
|
|
1013
|
+
});
|
|
1014
|
+
if (response.errors?.length) {
|
|
1015
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { level: 'error', message: response.errors[0]?.message } }));
|
|
1016
|
+
this.requestUpdate();
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
this.subject = { ...this.subject, templateId: response.data?.updateRole?.templateId || null };
|
|
1020
|
+
await this.readGap();
|
|
1021
|
+
}
|
|
1022
|
+
async readGap() {
|
|
998
1023
|
this.gap = null;
|
|
999
|
-
|
|
1024
|
+
const baseId = this.subject?.templateId;
|
|
1025
|
+
if (!baseId)
|
|
1000
1026
|
return;
|
|
1001
1027
|
const response = await client.query({
|
|
1002
1028
|
query: gql `
|
|
1003
|
-
query ($filters: [Filter!]
|
|
1029
|
+
query ($filters: [Filter!]) {
|
|
1004
1030
|
roles(filters: $filters) {
|
|
1005
1031
|
items {
|
|
1006
1032
|
id
|
|
1007
|
-
templateGap
|
|
1033
|
+
templateGap {
|
|
1008
1034
|
templateId
|
|
1009
1035
|
templateName
|
|
1010
1036
|
missing { ${GRANT_FIELDS} }
|
|
@@ -1016,14 +1042,14 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
1016
1042
|
}
|
|
1017
1043
|
}
|
|
1018
1044
|
`,
|
|
1019
|
-
variables: { filters: [{ name: 'id', operator: 'eq', value: this.subject.id }]
|
|
1045
|
+
variables: { filters: [{ name: 'id', operator: 'eq', value: this.subject.id }] },
|
|
1020
1046
|
context: gqlContext()
|
|
1021
1047
|
});
|
|
1022
1048
|
if (response.errors?.length) {
|
|
1023
1049
|
document.dispatchEvent(new CustomEvent('notify', { detail: { level: 'error', message: response.errors[0]?.message } }));
|
|
1024
1050
|
return;
|
|
1025
1051
|
}
|
|
1026
|
-
if (this.templateId ===
|
|
1052
|
+
if (this.subject?.templateId === baseId)
|
|
1027
1053
|
this.gap = response.data?.roles?.items?.[0]?.templateGap || null;
|
|
1028
1054
|
}
|
|
1029
1055
|
/** Adds what the role lacks against the picked template — after showing what it adds. */
|
|
@@ -1058,7 +1084,7 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
1058
1084
|
}
|
|
1059
1085
|
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.data_updated_successfully') } }));
|
|
1060
1086
|
await this.fetch();
|
|
1061
|
-
await this.
|
|
1087
|
+
await this.readGap();
|
|
1062
1088
|
}
|
|
1063
1089
|
/**
|
|
1064
1090
|
* 한 줄 — 문장과 [떼기].
|
|
@@ -1300,6 +1326,7 @@ let RolePrivilegePage = class RolePrivilegePage extends localize(i18next)(PageVi
|
|
|
1300
1326
|
id
|
|
1301
1327
|
name
|
|
1302
1328
|
description
|
|
1329
|
+
templateId
|
|
1303
1330
|
domain {
|
|
1304
1331
|
id
|
|
1305
1332
|
name
|
|
@@ -1524,10 +1551,6 @@ __decorate([
|
|
|
1524
1551
|
state(),
|
|
1525
1552
|
__metadata("design:type", Object)
|
|
1526
1553
|
], RolePrivilegePage.prototype, "templates", void 0);
|
|
1527
|
-
__decorate([
|
|
1528
|
-
state(),
|
|
1529
|
-
__metadata("design:type", String)
|
|
1530
|
-
], RolePrivilegePage.prototype, "templateId", void 0);
|
|
1531
1554
|
__decorate([
|
|
1532
1555
|
state(),
|
|
1533
1556
|
__metadata("design:type", Object)
|