@phis/ui 0.6.0 → 0.6.1
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/components/controls/phi-form-control.d.ts +6 -0
- package/components/controls/phi-form-control.js +23 -7
- package/components/controls/phi-media-picker-control.d.ts +3 -1
- package/components/controls/phi-media-picker-control.js +2 -2
- package/components/forms/form-descriptor-runtime-client.d.ts +3 -1
- package/components/forms/form-descriptor-runtime-client.js +2 -2
- package/components/forms/form-field-provider-modules.d.ts +23 -0
- package/components/forms/form-field-provider-modules.js +28 -0
- package/components/forms/form-provider-contract.d.ts +7 -0
- package/components/forms/form-provider-contract.js +7 -0
- package/components/forms/lazy-form-field-control.d.ts +14 -0
- package/components/forms/lazy-form-field-control.js +35 -0
- package/components/forms/phi-form-widget.d.ts +3 -2
- package/components/forms/phi-form-widget.js +21 -3
- package/components/forms/shared-form-provider-registry.js +1 -33
- package/components/media/phi-area-upload-widget.js +6 -58
- package/components/media/phi-media-picker-binding.d.ts +16 -1
- package/components/media/phi-media-picker-binding.js +3 -2
- package/components/media/phi-media-upload.d.ts +12 -0
- package/components/media/phi-media-upload.js +22 -0
- package/components/media/phi-upload-drop-area.d.ts +22 -0
- package/components/media/phi-upload-drop-area.js +49 -0
- package/components/widgets/helpers/semantic-html-translation.d.ts +4 -1
- package/components/widgets/helpers/semantic-html-translation.js +4 -2
- package/components/widgets/label-sets/admin-users.d.ts +9 -1
- package/components/widgets/label-sets/admin-users.js +14 -2
- package/components/widgets/label-sets/slot-upload.js +6 -3
- package/components/widgets/label-types/slot-upload.d.ts +7 -1
- package/components/widgets/label-types/slot-upload.js +2 -1
- package/components/widgets/shared/markdown-render.js +6 -6
- package/constants/media-library-provider-keys.d.ts +9 -0
- package/constants/media-library-provider-keys.js +9 -0
- package/constants/runtime-module-ownership.js +2 -0
- package/controls.d.ts +2 -0
- package/controls.js +1 -0
- package/gateway/signet-route.js +11 -6
- package/helpers/phi-signet-head.d.ts +4 -3
- package/helpers/phi-signet-head.js +17 -5
- package/helpers/phi-signet.d.ts +12 -0
- package/helpers/phi-signet.js +11 -0
- package/net/phi-next-proxy.d.ts +10 -8
- package/net/phi-next-proxy.js +27 -84
- package/next/proxy-runtime.js +15 -0
- package/next/site-proxy.js +5 -0
- package/package.json +1 -1
- package/plugins/runtime-modules/asset/definition.d.ts +44 -2
- package/plugins/runtime-modules/asset/definition.js +5 -2
- package/plugins/runtime-modules/asset/form-providers.d.ts +63 -0
- package/plugins/runtime-modules/asset/form-providers.js +54 -0
- package/plugins/runtime-modules/asset/form-ui-provider.js +13 -3
- package/plugins/runtime-modules/asset/media-asset-field.d.ts +20 -0
- package/plugins/runtime-modules/asset/media-asset-field.js +33 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.d.ts +21 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.js +74 -0
- package/plugins/runtime-modules/core/widgets/html/server.js +1 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +28 -23
- package/plugins/runtime-modules/core/widgets/slot-upload/slot.d.ts +19 -0
- package/plugins/runtime-modules/core/widgets/slot-upload/slot.js +16 -0
- package/plugins/runtime-modules/resolver.js +38 -4
- package/plugins/runtime-modules/user-management/addon-roles.d.ts +35 -0
- package/plugins/runtime-modules/user-management/addon-roles.js +76 -0
- package/plugins/runtime-modules/user-management/cards.js +1 -1
- package/plugins/runtime-modules/user-management/client-data-providers.js +6 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +11 -2
- package/plugins/runtime-modules/user-management/data-providers.js +12 -1
- package/plugins/runtime-modules/user-management/definition.d.ts +11 -2
- package/plugins/runtime-modules/user-management/ids.d.ts +1 -0
- package/plugins/runtime-modules/user-management/ids.js +1 -0
- package/plugins/runtime-modules/user-management/services/options.d.ts +8 -0
- package/plugins/runtime-modules/user-management/services/options.js +25 -0
- package/plugins/runtime-modules/user-management/services/table.js +9 -1
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +20 -2
- package/server-helpers/cms-widget-texts.js +1 -1
- package/server-helpers/search-index.js +22 -13
- package/server-helpers/search-text.d.ts +3 -2
- package/server-helpers/search-text.js +6 -5
- package/server-helpers/translate.d.ts +13 -2
- package/server-helpers/translate.js +10 -6
- package/theme/phi-theme-signet.d.ts +6 -0
- package/theme/phi-theme-signet.js +37 -1
- package/theme/phi-tokens.d.ts +1 -1
- package/theme/phi-tokens.js +5 -1
- package/types/cms-plugins.d.ts +10 -1
- package/types/site-theme.d.ts +14 -2
|
@@ -3,10 +3,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { PhiEntryListControl } from "../../../../../components/controls/phi-entry-list-control";
|
|
4
4
|
import { PhiProgressControl } from "../../../../../components/controls/phi-progress-control";
|
|
5
5
|
import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
|
|
6
|
-
import { useCallback, useEffect, useMemo,
|
|
6
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
7
7
|
import { usePhiMediaUpload } from "../../../../../components/media/phi-media-upload";
|
|
8
8
|
import { runPhiAddonAssetUpload, } from "../../../../../components/media/media-upload-flow";
|
|
9
|
-
import {
|
|
9
|
+
import { resolvePhiAreaUploadLabels, resolvePhiUploadStatusLabel } from "../../../../../components/media/phi-media-upload";
|
|
10
|
+
import { PhiUploadDropArea } from "../../../../../components/media/phi-upload-drop-area";
|
|
11
|
+
import { PhiTagControl } from "../../../../../components/controls/phi-tag-control";
|
|
12
|
+
import { readPhiSlotUploadAcceptance } from "./slot";
|
|
10
13
|
import { usePhiSignalListener } from "../../../../../components/runtime/runtime-signal-bus";
|
|
11
14
|
import { emitPhiSignalCapability, usePhiSignalEmitter, usePhiSignalIdentity, } from "../../../../../components/runtime/runtime-signal-identity";
|
|
12
15
|
import { readPhiTableBindingParamsSignalValue } from "../../../../../types/table-signal-values";
|
|
@@ -189,18 +192,11 @@ export function PhiSlotUploadWidgetClient({ config, labels }) {
|
|
|
189
192
|
});
|
|
190
193
|
return { asset: { id: view.mediaAssetId } };
|
|
191
194
|
}, [base, ownerId, read, slotName]);
|
|
192
|
-
const
|
|
195
|
+
const slotUpload = useMemo(() => readPhiSlotUploadAcceptance(slot), [slot]);
|
|
196
|
+
const uploadLabels = useMemo(() => resolvePhiAreaUploadLabels(labels.upload), [labels.upload]);
|
|
193
197
|
const upload = usePhiMediaUpload({
|
|
194
|
-
labels:
|
|
195
|
-
...(
|
|
196
|
-
? {
|
|
197
|
-
acceptance: {
|
|
198
|
-
contentTypes: slot.contentTypes,
|
|
199
|
-
maxBytes: slot.maxBytes,
|
|
200
|
-
multiple: slot.cardinality === "many",
|
|
201
|
-
},
|
|
202
|
-
}
|
|
203
|
-
: {}),
|
|
198
|
+
labels: uploadLabels,
|
|
199
|
+
...(slotUpload ? { acceptance: slotUpload.acceptance } : {}),
|
|
204
200
|
runSession,
|
|
205
201
|
onUploaded: async () => {
|
|
206
202
|
setFailure(null);
|
|
@@ -210,6 +206,20 @@ export function PhiSlotUploadWidgetClient({ config, labels }) {
|
|
|
210
206
|
onRejected: (message) => setFailure(message),
|
|
211
207
|
});
|
|
212
208
|
const files = loaded?.ownerId === ownerId ? loaded.files : [];
|
|
209
|
+
/*
|
|
210
|
+
* A file still on its way or one that failed, as a line above the files that arrived: its name, then
|
|
211
|
+
* the percentage or "Failed" the Media folder's tiles say, a bar while it travels, and Retry for a
|
|
212
|
+
* failure. The reason for a failure is the alert's, which `onRejected` fills for both.
|
|
213
|
+
*/
|
|
214
|
+
const pending = upload.items.filter((item) => item.status !== "done").map((item) => ({
|
|
215
|
+
key: item.localId,
|
|
216
|
+
title: (_jsxs(PhiFlexControl, { vertical: true, gap: 4, children: [_jsxs(PhiFlexControl, { align: "center", gap: 8, wrap: true, children: [_jsx("span", { children: item.file.name }), _jsx(PhiTagControl, { color: item.status === "error" ? "red" : "blue", children: resolvePhiUploadStatusLabel(item, labels.upload) })] }), item.status === "uploading" ? _jsx(PhiProgressControl, { percent: item.progress, size: "small" }) : null] })),
|
|
217
|
+
...(item.status === "error"
|
|
218
|
+
? {
|
|
219
|
+
action: (_jsx(PhiButtonControl, { size: "small", label: labels.upload.retryLabel, onClick: () => { void upload.retry(item.localId); } })),
|
|
220
|
+
}
|
|
221
|
+
: {}),
|
|
222
|
+
}));
|
|
213
223
|
/*
|
|
214
224
|
* The removal and the read after it fail apart: a DELETE that went through and a list that could not
|
|
215
225
|
* be read again are two answers, and saying "That file stayed" for the second was untrue.
|
|
@@ -231,14 +241,9 @@ export function PhiSlotUploadWidgetClient({ config, labels }) {
|
|
|
231
241
|
if (!base || !slotName) {
|
|
232
242
|
return (_jsx(PhiLabeledControl, { label: config?.label, children: _jsx(PhiTypographyControl, { type: "secondary", children: labels.unconfigured }) }));
|
|
233
243
|
}
|
|
234
|
-
return (_jsx(PhiLabeledControl, { label: config?.label, fill: true, children: _jsxs(PhiFlexControl, { vertical: true, gap: 8, "data-phis-slot-upload": slotName, children: [ownerId === null ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.noRow })) : (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
} }), _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "upload", size: "inherit" }), label: labels.choose, onClick: () => fileInputRef.current?.click() })] })), upload.items.filter((item) => item.status === "uploading").map((item) => (_jsx(PhiProgressControl, { percent: item.progress, size: "small" }, item.localId))), slotFailure ?? failure ? (_jsx(PhiTypographyControl, { type: "danger", role: "alert", children: slotFailure ?? failure })) : null, _jsx(PhiEntryListControl, { emptyDescription: labels.empty, entries: [...files].map((file) => ({
|
|
240
|
-
key: String(file.id),
|
|
241
|
-
title: (_jsx(SlotFileTitle, { file: file, text: formatPhiSlotUploadWidgetLabel(labels.fileTitle, file.contentType, file.byteSize) })),
|
|
242
|
-
action: (_jsx(PhiButtonControl, { size: "small", icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: labels.remove, tooltip: labels.remove, onClick: () => { void remove(file.id); } })),
|
|
243
|
-
})) })] }) }));
|
|
244
|
+
return (_jsx(PhiLabeledControl, { label: config?.label, fill: true, children: _jsxs(PhiFlexControl, { vertical: true, gap: 8, "data-phis-slot-upload": slotName, children: [ownerId === null ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.noRow })) : (_jsx(_Fragment, { children: _jsx(PhiUploadDropArea, { ...(slotUpload ? { accept: slotUpload.accept, multiple: slotUpload.multiple } : {}), disabled: !slotUpload, title: labels.upload.dropTitle, hint: labels.upload.dropHint, onFile: (file) => void upload.upload(file) }) })), slotFailure ?? failure ? (_jsx(PhiTypographyControl, { type: "danger", role: "alert", children: slotFailure ?? failure })) : null, _jsx(PhiEntryListControl, { emptyDescription: labels.empty, entries: [...pending, ...files.map((file) => ({
|
|
245
|
+
key: String(file.id),
|
|
246
|
+
title: (_jsx(SlotFileTitle, { file: file, text: formatPhiSlotUploadWidgetLabel(labels.fileTitle, file.contentType, file.byteSize) })),
|
|
247
|
+
action: (_jsx(PhiButtonControl, { size: "small", icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: labels.remove, tooltip: labels.remove, onClick: () => { void remove(file.id); } })),
|
|
248
|
+
}))] })] }) }));
|
|
244
249
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PhiMediaUploadAcceptance } from "../../../../../components/media/phi-media-upload";
|
|
2
|
+
/** One slot as Core's `_assets` manifest declares it. */
|
|
3
|
+
export type PhiSlotDescriptor = {
|
|
4
|
+
name: string;
|
|
5
|
+
cardinality: "one" | "many";
|
|
6
|
+
maxBytes: number;
|
|
7
|
+
contentTypes: string[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What the drop area offers and what the upload checks before it sends, both from the one descriptor:
|
|
11
|
+
* the file dialog's `accept` and `multiple` are the same facts the acceptance holds, so they cannot
|
|
12
|
+
* disagree. A slot that is not known yet takes nothing -- `null` -- rather than an upload that would
|
|
13
|
+
* skip the check.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readPhiSlotUploadAcceptance(slot: PhiSlotDescriptor | null): {
|
|
16
|
+
accept: string;
|
|
17
|
+
multiple: boolean;
|
|
18
|
+
acceptance: PhiMediaUploadAcceptance;
|
|
19
|
+
} | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the drop area offers and what the upload checks before it sends, both from the one descriptor:
|
|
3
|
+
* the file dialog's `accept` and `multiple` are the same facts the acceptance holds, so they cannot
|
|
4
|
+
* disagree. A slot that is not known yet takes nothing -- `null` -- rather than an upload that would
|
|
5
|
+
* skip the check.
|
|
6
|
+
*/
|
|
7
|
+
export function readPhiSlotUploadAcceptance(slot) {
|
|
8
|
+
if (!slot)
|
|
9
|
+
return null;
|
|
10
|
+
const multiple = slot.cardinality === "many";
|
|
11
|
+
return {
|
|
12
|
+
accept: slot.contentTypes.join(","),
|
|
13
|
+
multiple,
|
|
14
|
+
acceptance: { contentTypes: slot.contentTypes, maxBytes: slot.maxBytes, multiple },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -8,6 +8,7 @@ import { PHI_VIEWER_ACCESS_ANYONE, } from "../../types/access";
|
|
|
8
8
|
import { stripRenderableBlockDefaults } from "../../helpers/renderable-block-serialization";
|
|
9
9
|
import { PhiCmsWidgetType } from "../../constants/cms-widget-types";
|
|
10
10
|
import { parsePhiFormWidgetConfig } from "../../components/forms/form-widget-config";
|
|
11
|
+
import { PHI_MEDIA_ASSET_FORM_FIELD_PROVIDER_KEY, PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS, } from "../../constants/media-library-provider-keys";
|
|
11
12
|
import { buildPhiRecordDeclarationsByKey } from "../../helpers/record-fields";
|
|
12
13
|
function loadRuntimeWidgetPlugin(entry) {
|
|
13
14
|
return entry.loadRuntime();
|
|
@@ -72,7 +73,11 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
|
|
|
72
73
|
}
|
|
73
74
|
const installedOwnerModuleIdByWidgetType = new Map();
|
|
74
75
|
const installedOwnerModuleIdByLayoutType = new Map();
|
|
76
|
+
const installedOwnerModuleIdByFormFieldTypeKey = new Map();
|
|
75
77
|
for (const [moduleId, entry] of catalog) {
|
|
78
|
+
for (const descriptor of entry.definition.formProviders?.fieldTypes ?? []) {
|
|
79
|
+
installedOwnerModuleIdByFormFieldTypeKey.set(descriptor.key, moduleId);
|
|
80
|
+
}
|
|
76
81
|
for (const widget of entry.widgets) {
|
|
77
82
|
const type = buildPhiRuntimeModuleWidgetType(widget);
|
|
78
83
|
installedOwnerModuleIdByWidgetType.set(type, moduleId);
|
|
@@ -210,7 +215,13 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
|
|
|
210
215
|
}
|
|
211
216
|
for (const form of formDefinitionsById.values()) {
|
|
212
217
|
for (const field of form.descriptor.fields) {
|
|
213
|
-
|
|
218
|
+
/*
|
|
219
|
+
* A field type that an installed Module owns, but that is not active in this Area, is not an error:
|
|
220
|
+
* the Form still stands there, and the field says that its Module is not available
|
|
221
|
+
* (`PhiFormControl`'s `unavailableFieldKeys`). A key nobody installed declares is one.
|
|
222
|
+
*/
|
|
223
|
+
if (!formFieldTypeProviderDescriptorsByKey.has(field.fieldProviderKey) &&
|
|
224
|
+
!installedOwnerModuleIdByFormFieldTypeKey.has(field.fieldProviderKey)) {
|
|
214
225
|
throw new Error(`Form "${form.formId}" requires unavailable field provider "${field.fieldProviderKey}".`);
|
|
215
226
|
}
|
|
216
227
|
for (const rule of field.validation ?? []) {
|
|
@@ -247,6 +258,7 @@ export async function resolvePhiRuntimeModuleSet({ catalog, moduleIds, area, ser
|
|
|
247
258
|
platformModuleId,
|
|
248
259
|
installedOwnerModuleIdByWidgetType,
|
|
249
260
|
installedOwnerModuleIdByLayoutType,
|
|
261
|
+
installedOwnerModuleIdByFormFieldTypeKey,
|
|
250
262
|
ownerModuleIdByControllerType,
|
|
251
263
|
areaControllerSettings,
|
|
252
264
|
};
|
|
@@ -348,6 +360,15 @@ export function collectPhiRuntimeDataProviderKeys({ moduleSet, trees, }) {
|
|
|
348
360
|
const form = formId ? moduleSet.formDefinitionsById.get(formId) : null;
|
|
349
361
|
if (form) {
|
|
350
362
|
collectDataProviderKeysFromValue(form.descriptor, knownProviderKeys, collected);
|
|
363
|
+
/*
|
|
364
|
+
* A `media-asset` field reads the Media library through the picker, and a field descriptor names
|
|
365
|
+
* no Provider of its own to find it by. The field type is what needs it, so the scan says so
|
|
366
|
+
* once, here, instead of every Form that has one repeating the Provider in its descriptor.
|
|
367
|
+
*/
|
|
368
|
+
if (form.descriptor.fields.some((field) => field.fieldProviderKey === PHI_MEDIA_ASSET_FORM_FIELD_PROVIDER_KEY) &&
|
|
369
|
+
knownProviderKeys.has(PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection)) {
|
|
370
|
+
collected.add(PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection);
|
|
371
|
+
}
|
|
351
372
|
}
|
|
352
373
|
}
|
|
353
374
|
}
|
|
@@ -382,7 +403,12 @@ export function collectPhiRuntimeDataProviderKeys({ moduleSet, trees, }) {
|
|
|
382
403
|
}
|
|
383
404
|
return collected;
|
|
384
405
|
}
|
|
385
|
-
|
|
406
|
+
/**
|
|
407
|
+
* The Modules the Forms on these Pages need mounted: each Form's owner, and the owner of every field
|
|
408
|
+
* type the Form uses, where that Module is active. A field type is a Module's to offer, and the Form
|
|
409
|
+
* widget mounts that Module's field Providers beside the Form owner's (`PhiFormWidget`).
|
|
410
|
+
*/
|
|
411
|
+
function collectPhiRuntimeFormModuleIds({ moduleSet, trees, }) {
|
|
386
412
|
const collected = new Set();
|
|
387
413
|
for (const tree of trees) {
|
|
388
414
|
for (const widget of tree.contentWidgets) {
|
|
@@ -400,6 +426,12 @@ function collectPhiRuntimeFormOwnerModuleIds({ moduleSet, trees, }) {
|
|
|
400
426
|
const form = moduleSet.formDefinitionsById.get(config.formId);
|
|
401
427
|
if (form) {
|
|
402
428
|
collected.add(form.ownerModuleId);
|
|
429
|
+
for (const field of form.descriptor.fields) {
|
|
430
|
+
const fieldOwner = moduleSet.formFieldTypeProviderDescriptorsByKey.get(field.fieldProviderKey)?.ownerModuleId;
|
|
431
|
+
if (fieldOwner) {
|
|
432
|
+
collected.add(fieldOwner);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
403
435
|
}
|
|
404
436
|
}
|
|
405
437
|
}
|
|
@@ -420,7 +452,7 @@ export async function resolvePhiRuntimeRenderRegistry({ catalog, moduleSet, tree
|
|
|
420
452
|
const widgetImplementationModes = collectTreeWidgetImplementationModes({ moduleSet, trees });
|
|
421
453
|
const layoutTypes = collectTreeLayoutTypes(trees);
|
|
422
454
|
const dataProviderKeys = collectPhiRuntimeDataProviderKeys({ moduleSet, trees });
|
|
423
|
-
const
|
|
455
|
+
const formModuleIds = collectPhiRuntimeFormModuleIds({ moduleSet, trees });
|
|
424
456
|
const renderIssuesByWidgetType = new Map();
|
|
425
457
|
const runtimeWidgetRenderIssuesByType = new Map();
|
|
426
458
|
const previewWidgetRenderIssuesByType = new Map();
|
|
@@ -474,7 +506,7 @@ export async function resolvePhiRuntimeRenderRegistry({ catalog, moduleSet, tree
|
|
|
474
506
|
const usedModuleIds = new Set([
|
|
475
507
|
...widgetEntries.map(([, entry]) => entry.ownerModuleId),
|
|
476
508
|
...layoutEntries.map(([, entry]) => entry.ownerModuleId),
|
|
477
|
-
...
|
|
509
|
+
...formModuleIds,
|
|
478
510
|
]);
|
|
479
511
|
const dataProviderDescriptorsByKey = new Map([...dataProviderKeys].flatMap((providerKey) => {
|
|
480
512
|
const descriptor = moduleSet.dataProviderDescriptorsByKey.get(providerKey);
|
|
@@ -604,6 +636,8 @@ export async function resolvePhiRuntimeRenderRegistry({ catalog, moduleSet, tree
|
|
|
604
636
|
})),
|
|
605
637
|
ownerModuleIdByLayoutType: new Map(layoutEntries.map(([type, entry]) => [type, entry.ownerModuleId])),
|
|
606
638
|
uiProviderModuleIds,
|
|
639
|
+
activeModuleIds: moduleSet.activeModuleIds,
|
|
640
|
+
ownerModuleIdByFormFieldTypeKey: moduleSet.installedOwnerModuleIdByFormFieldTypeKey,
|
|
607
641
|
/*
|
|
608
642
|
* Every active Module's published facts, whether or not its Widgets happen to be on this page.
|
|
609
643
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type PhiAddonRole = {
|
|
2
|
+
name: string;
|
|
3
|
+
};
|
|
4
|
+
export type PhiAddonRoleCatalogEntry = {
|
|
5
|
+
addonId: string;
|
|
6
|
+
/** The Add-on's `title`: its id until its manifest carries a display name; shown as stated. */
|
|
7
|
+
title: string;
|
|
8
|
+
roles: readonly PhiAddonRole[];
|
|
9
|
+
};
|
|
10
|
+
export type PhiAddonRoleAssignment = {
|
|
11
|
+
addonId: string;
|
|
12
|
+
role: string;
|
|
13
|
+
};
|
|
14
|
+
/** The catalog of an `GET /api/site/addon-roles` answer; entries and roles that do not read are left out. */
|
|
15
|
+
export declare function readPhiAddonRoleCatalog(payload: unknown): PhiAddonRoleCatalogEntry[];
|
|
16
|
+
/** The stored assignments in a user row's `addonRoles` or an answer's `held`. */
|
|
17
|
+
export declare function readPhiAddonRoleAssignments(value: unknown): PhiAddonRoleAssignment[];
|
|
18
|
+
/** The tag a Site Admin's row carries in place of single roles; the Table maps it to its label. */
|
|
19
|
+
export declare const PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG = "all";
|
|
20
|
+
/**
|
|
21
|
+
* The tags of a row's Add-on roles column: one tag per Add-on with its stored roles, so the column stays
|
|
22
|
+
* narrow, and for a Site Admin the one tag that says every role is held. Stored assignments for a Site Admin
|
|
23
|
+
* are not listed (they apply when the person is no longer one; the dialog shows them).
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildPhiAddonRoleTags(row: Record<string, unknown>): string[];
|
|
26
|
+
/** The filter's options: each Add-on (any role), then each of its roles. Values are `<addonId>` and `<addonId>:<role>`. */
|
|
27
|
+
export declare function buildPhiAddonRoleFilterOptions(catalog: readonly PhiAddonRoleCatalogEntry[]): {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}[];
|
|
31
|
+
/** The Core's `addonId` and optional `addonRole` filters from the one value the Table filter holds. */
|
|
32
|
+
export declare function parsePhiAddonRoleFilter(value: string): {
|
|
33
|
+
addonId: string;
|
|
34
|
+
addonRole: string | null;
|
|
35
|
+
} | null;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { isPhiRecord } from "../../../helpers/is-record";
|
|
2
|
+
const ROLE_NAME = /^[a-z][a-z0-9-]{0,63}$/u;
|
|
3
|
+
function readString(value) {
|
|
4
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
5
|
+
}
|
|
6
|
+
/** The catalog of an `GET /api/site/addon-roles` answer; entries and roles that do not read are left out. */
|
|
7
|
+
export function readPhiAddonRoleCatalog(payload) {
|
|
8
|
+
const addons = isPhiRecord(payload) && Array.isArray(payload.addons) ? payload.addons : [];
|
|
9
|
+
return addons.flatMap((addon) => {
|
|
10
|
+
if (!isPhiRecord(addon))
|
|
11
|
+
return [];
|
|
12
|
+
const addonId = readString(addon.addonId);
|
|
13
|
+
if (!addonId)
|
|
14
|
+
return [];
|
|
15
|
+
const roles = (Array.isArray(addon.roles) ? addon.roles : []).flatMap((role) => {
|
|
16
|
+
if (!isPhiRecord(role))
|
|
17
|
+
return [];
|
|
18
|
+
const name = readString(role.name);
|
|
19
|
+
if (!name || !ROLE_NAME.test(name))
|
|
20
|
+
return [];
|
|
21
|
+
return [{ name }];
|
|
22
|
+
});
|
|
23
|
+
return roles.length > 0 ? [{ addonId, title: readString(addon.title) ?? addonId, roles }] : [];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** The stored assignments in a user row's `addonRoles` or an answer's `held`. */
|
|
27
|
+
export function readPhiAddonRoleAssignments(value) {
|
|
28
|
+
return (Array.isArray(value) ? value : []).flatMap((entry) => {
|
|
29
|
+
if (!isPhiRecord(entry))
|
|
30
|
+
return [];
|
|
31
|
+
const addonId = readString(entry.addonId);
|
|
32
|
+
const role = readString(entry.role);
|
|
33
|
+
return addonId && role ? [{ addonId, role }] : [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** The tag a Site Admin's row carries in place of single roles; the Table maps it to its label. */
|
|
37
|
+
export const PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG = "all";
|
|
38
|
+
/**
|
|
39
|
+
* Whether a list row is a Site Admin, who holds every declared role of every enabled Add-on without a stored
|
|
40
|
+
* assignment: an enabled account whose `roleTags` hold `admin` (the Core states no flag of its own).
|
|
41
|
+
*/
|
|
42
|
+
function isPhiAddonRoleHolderOfAll(row) {
|
|
43
|
+
return row.enabled === true && Array.isArray(row.roleTags) && row.roleTags.includes("admin");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The tags of a row's Add-on roles column: one tag per Add-on with its stored roles, so the column stays
|
|
47
|
+
* narrow, and for a Site Admin the one tag that says every role is held. Stored assignments for a Site Admin
|
|
48
|
+
* are not listed (they apply when the person is no longer one; the dialog shows them).
|
|
49
|
+
*/
|
|
50
|
+
export function buildPhiAddonRoleTags(row) {
|
|
51
|
+
if (isPhiAddonRoleHolderOfAll(row))
|
|
52
|
+
return [PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG];
|
|
53
|
+
const byAddon = new Map();
|
|
54
|
+
for (const { addonId, role } of readPhiAddonRoleAssignments(row.addonRoles)) {
|
|
55
|
+
byAddon.set(addonId, [...(byAddon.get(addonId) ?? []), role]);
|
|
56
|
+
}
|
|
57
|
+
return [...byAddon].map(([addonId, roles]) => `${addonId}: ${roles.join(", ")}`);
|
|
58
|
+
}
|
|
59
|
+
/** The filter's options: each Add-on (any role), then each of its roles. Values are `<addonId>` and `<addonId>:<role>`. */
|
|
60
|
+
export function buildPhiAddonRoleFilterOptions(catalog) {
|
|
61
|
+
return catalog.flatMap((entry) => [
|
|
62
|
+
{ value: entry.addonId, label: entry.title },
|
|
63
|
+
...entry.roles.map((role) => ({ value: `${entry.addonId}:${role.name}`, label: `${entry.title}: ${role.name}` })),
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
/** The Core's `addonId` and optional `addonRole` filters from the one value the Table filter holds. */
|
|
67
|
+
export function parsePhiAddonRoleFilter(value) {
|
|
68
|
+
const trimmed = value.trim();
|
|
69
|
+
if (!trimmed)
|
|
70
|
+
return null;
|
|
71
|
+
const cut = trimmed.lastIndexOf(":");
|
|
72
|
+
const role = cut > 0 ? trimmed.slice(cut + 1) : null;
|
|
73
|
+
if (role !== null && ROLE_NAME.test(role))
|
|
74
|
+
return { addonId: trimmed.slice(0, cut), addonRole: role };
|
|
75
|
+
return { addonId: trimmed, addonRole: null };
|
|
76
|
+
}
|
|
@@ -20,7 +20,7 @@ const PHI_USER_MANAGEMENT_DASHBOARD_CARD_LABEL_SET = definePhiRuntimeModuleLabel
|
|
|
20
20
|
accounts_eyebrow: "Accounts",
|
|
21
21
|
accounts_title: "Site users",
|
|
22
22
|
accounts_description: "User accounts on this site",
|
|
23
|
-
accounts_meta: "Admin, editor, accounting, auth, and
|
|
23
|
+
accounts_meta: "Admin, editor, accounting, auth, and external accounts",
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
const PHI_USER_MANAGEMENT_ACCOUNTS_CARD_ID = createPhiDashboardCardId(PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID, "accounts");
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "./ids";
|
|
3
3
|
import { PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID } from "./ids";
|
|
4
4
|
export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
|
|
5
|
+
{
|
|
6
|
+
key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.addonRoleOptions,
|
|
7
|
+
ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
|
|
8
|
+
loadLive: async () => (await import("../../../plugins/runtime-modules/user-management/services/options"))
|
|
9
|
+
.PhiUserManagementAddonRoleOptionsProviderClient,
|
|
10
|
+
},
|
|
5
11
|
{
|
|
6
12
|
key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
7
13
|
ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export declare const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
1
|
+
export declare const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
2
|
+
key: `${string}/${string}`;
|
|
3
|
+
ownerModuleId: "@phis/ui/modules/user-management";
|
|
4
|
+
kind: "options";
|
|
5
|
+
executionMode: "live";
|
|
6
|
+
authoringMode: "none";
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
resources?: undefined;
|
|
10
|
+
} | {
|
|
2
11
|
key: `${string}/${string}`;
|
|
3
12
|
ownerModuleId: "@phis/ui/modules/user-management";
|
|
4
13
|
kind: "table";
|
|
@@ -156,4 +165,4 @@ export declare const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
|
156
165
|
summaryFields?: undefined;
|
|
157
166
|
actions?: undefined;
|
|
158
167
|
})[];
|
|
159
|
-
}[];
|
|
168
|
+
})[];
|
|
@@ -2,6 +2,15 @@ import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "./ids";
|
|
|
2
2
|
import { PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID } from "./ids";
|
|
3
3
|
import { createPhiUserManagementControllerAddress } from "../../../plugins/runtime-modules/user-management/controller/address";
|
|
4
4
|
export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
5
|
+
{
|
|
6
|
+
key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.addonRoleOptions,
|
|
7
|
+
ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
|
|
8
|
+
kind: "options",
|
|
9
|
+
executionMode: "live",
|
|
10
|
+
authoringMode: "none",
|
|
11
|
+
title: "Add-on roles",
|
|
12
|
+
description: "The Add-ons enabled for the Site and their declared roles, for filtering users by them.",
|
|
13
|
+
},
|
|
5
14
|
{
|
|
6
15
|
key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
7
16
|
ownerModuleId: PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID,
|
|
@@ -35,6 +44,8 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
35
44
|
{ key: "email", title: "Email", type: "string" },
|
|
36
45
|
{ key: "accountType", title: "Account type", type: "string" },
|
|
37
46
|
{ key: "roleTags", title: "Roles", type: "json" },
|
|
47
|
+
{ key: "addonRoles", title: "Add-on role assignments", type: "json" },
|
|
48
|
+
{ key: "addonRoleTags", title: "Add-on roles", type: "json" },
|
|
38
49
|
{ key: "userFlagTags", title: "User flags", type: "json" },
|
|
39
50
|
{ key: "siteFlagTags", title: "Site flags", type: "json" },
|
|
40
51
|
{ key: "lastLoginAt", title: "Last login", type: "datetime" },
|
|
@@ -44,7 +55,7 @@ export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
44
55
|
],
|
|
45
56
|
query: {
|
|
46
57
|
search: true,
|
|
47
|
-
filterFields: ["accountType", "enabled"],
|
|
58
|
+
filterFields: ["accountType", "addonRole", "enabled"],
|
|
48
59
|
sorting: "single",
|
|
49
60
|
pagination: "offset",
|
|
50
61
|
total: true,
|
|
@@ -26,7 +26,16 @@ export declare const PHI_USER_MANAGEMENT_RUNTIME_MODULE_DEFINITION: {
|
|
|
26
26
|
credentialPolicy: "site-session";
|
|
27
27
|
}[];
|
|
28
28
|
};
|
|
29
|
-
dataProviders: {
|
|
29
|
+
dataProviders: ({
|
|
30
|
+
key: `${string}/${string}`;
|
|
31
|
+
ownerModuleId: "@phis/ui/modules/user-management";
|
|
32
|
+
kind: "options";
|
|
33
|
+
executionMode: "live";
|
|
34
|
+
authoringMode: "none";
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
resources?: undefined;
|
|
38
|
+
} | {
|
|
30
39
|
key: `${string}/${string}`;
|
|
31
40
|
ownerModuleId: "@phis/ui/modules/user-management";
|
|
32
41
|
kind: "table";
|
|
@@ -184,6 +193,6 @@ export declare const PHI_USER_MANAGEMENT_RUNTIME_MODULE_DEFINITION: {
|
|
|
184
193
|
summaryFields?: undefined;
|
|
185
194
|
actions?: undefined;
|
|
186
195
|
})[];
|
|
187
|
-
}[];
|
|
196
|
+
})[];
|
|
188
197
|
moduleId: "@phis/ui/modules/user-management";
|
|
189
198
|
};
|
|
@@ -12,4 +12,5 @@ export const PHI_USER_MANAGEMENT_RUNTIME_MODULE_IDENTITY = {
|
|
|
12
12
|
};
|
|
13
13
|
export const PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
14
14
|
table: createPhiSharedRuntimeDataProviderKey("tables", "user-management"),
|
|
15
|
+
addonRoleOptions: createPhiSharedRuntimeDataProviderKey("options", "user-management-addon-roles"),
|
|
15
16
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Add-ons enabled for the Site and their roles, as one filter's options: an Add-on (any role) and each
|
|
3
|
+
* role of it. The Core answers every signed-in caller (`GET /api/site/addon-roles`); who may see the users
|
|
4
|
+
* list at all is settled by the users route itself.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PhiUserManagementAddonRoleOptionsProviderClient: import("react").ComponentType<{
|
|
7
|
+
children: import("react").ReactNode;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createPhiControlOptionsProviderClient } from "../../../../components/controls/phi-options-provider";
|
|
3
|
+
import { buildPhiAddonRoleFilterOptions, readPhiAddonRoleCatalog } from "../addon-roles";
|
|
4
|
+
import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
5
|
+
/**
|
|
6
|
+
* The Add-ons enabled for the Site and their roles, as one filter's options: an Add-on (any role) and each
|
|
7
|
+
* role of it. The Core answers every signed-in caller (`GET /api/site/addon-roles`); who may see the users
|
|
8
|
+
* list at all is settled by the users route itself.
|
|
9
|
+
*/
|
|
10
|
+
export const PhiUserManagementAddonRoleOptionsProviderClient = createPhiControlOptionsProviderClient({
|
|
11
|
+
key: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.addonRoleOptions,
|
|
12
|
+
load: async () => {
|
|
13
|
+
const response = await fetch("/api/site/addon-roles", {
|
|
14
|
+
cache: "no-store",
|
|
15
|
+
credentials: "include",
|
|
16
|
+
headers: { accept: "application/json" },
|
|
17
|
+
});
|
|
18
|
+
const payload = await response.json().catch(() => null);
|
|
19
|
+
if (!response.ok)
|
|
20
|
+
throw new Error("Failed to load the Add-on roles.");
|
|
21
|
+
return payload;
|
|
22
|
+
},
|
|
23
|
+
resolveLoadKey: () => "user-management-addon-roles",
|
|
24
|
+
resolve: (context) => ({ options: buildPhiAddonRoleFilterOptions(readPhiAddonRoleCatalog(context.asyncData)) }),
|
|
25
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
3
3
|
import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
4
|
+
import { buildPhiAddonRoleTags, parsePhiAddonRoleFilter } from "../addon-roles";
|
|
4
5
|
import { buildPhiTablePageParams, createPhiTableProviderRequestInit, readPhiPositiveInteger, readPhiTableRows, readPhiTableStringFilter, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
|
|
5
6
|
import { PhiTableProviderError, } from "../../../../types/table-widget";
|
|
6
7
|
import { createPhiTableProviderClient } from "../../../../components/widgets/client/shared/phi-table-provider";
|
|
@@ -12,11 +13,18 @@ async function loadUsers({ query, signal, }) {
|
|
|
12
13
|
const params = buildPhiTablePageParams(query, 20);
|
|
13
14
|
const search = query.search?.trim() ?? "";
|
|
14
15
|
const accountType = readPhiTableStringFilter(query, "accountType");
|
|
16
|
+
const addonRole = parsePhiAddonRoleFilter(readPhiTableStringFilter(query, "addonRole"));
|
|
15
17
|
const enabled = readPhiTableStringFilter(query, "enabled");
|
|
16
18
|
if (search)
|
|
17
19
|
params.set("search", search);
|
|
18
20
|
if (accountType)
|
|
19
21
|
params.set("accountType", accountType);
|
|
22
|
+
// The Core's two filters: an Add-on, and optionally one of its roles (`addonRole` needs `addonId`).
|
|
23
|
+
if (addonRole) {
|
|
24
|
+
params.set("addonId", addonRole.addonId);
|
|
25
|
+
if (addonRole.addonRole)
|
|
26
|
+
params.set("addonRole", addonRole.addonRole);
|
|
27
|
+
}
|
|
20
28
|
if (enabled)
|
|
21
29
|
params.set("enabled", enabled);
|
|
22
30
|
const primarySort = query.sorts?.[0];
|
|
@@ -25,7 +33,7 @@ async function loadUsers({ query, signal, }) {
|
|
|
25
33
|
params.set("sortOrder", primarySort.direction === "descending" ? "descend" : "ascend");
|
|
26
34
|
}
|
|
27
35
|
const result = await readPhiTableProviderResponse(await fetch(`${API_PATH}?${params.toString()}`, createPhiTableProviderRequestInit(signal)), RESPONSE_OPTIONS);
|
|
28
|
-
const rows = readPhiTableRows(result?.rows);
|
|
36
|
+
const rows = readPhiTableRows(result?.rows).map((row) => ({ ...row, addonRoleTags: buildPhiAddonRoleTags(row) }));
|
|
29
37
|
if (typeof result?.siteTotal !== "number" || !Number.isFinite(result.siteTotal) || result.siteTotal < 0) {
|
|
30
38
|
throw new PhiTableProviderError("invalid-response", "User Management site total is invalid.");
|
|
31
39
|
}
|
|
@@ -6,6 +6,7 @@ import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from ".
|
|
|
6
6
|
import { getPhiAdminUsersPageLabels } from "./admin-users-label-set";
|
|
7
7
|
import { getPhiAdminUsersTableWidgetLabels } from "../../../../components/widgets/label-sets/admin-users";
|
|
8
8
|
import { PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
9
|
+
import { PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG } from "../addon-roles";
|
|
9
10
|
import { createPhiSignalAddress, createPhiSignalSubcontrolAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
10
11
|
import { createPhiUserManagementControllerAddress, PHI_USER_MANAGEMENT_CONTROLLER_INSTANCE_KEY, PHI_USER_MANAGEMENT_CONTROLLER_TYPE, } from "../controller/address";
|
|
11
12
|
import { PHI_USER_MANAGEMENT_FORM_IDS } from "../forms";
|
|
@@ -267,7 +268,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
|
|
|
267
268
|
renderer: "badge",
|
|
268
269
|
sizing: { mode: "content" },
|
|
269
270
|
valueMap: {
|
|
270
|
-
customer: widgetLabels.accountTypes.
|
|
271
|
+
customer: widgetLabels.accountTypes.external,
|
|
271
272
|
roles: widgetLabels.accountTypes.roles,
|
|
272
273
|
auth: widgetLabels.accountTypes.auth,
|
|
273
274
|
},
|
|
@@ -290,6 +291,16 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
|
|
|
290
291
|
accountant: "default",
|
|
291
292
|
},
|
|
292
293
|
},
|
|
294
|
+
{
|
|
295
|
+
key: "addonRoleTags",
|
|
296
|
+
fieldKey: "addonRoleTags",
|
|
297
|
+
title: widgetLabels.columns.addonRoles,
|
|
298
|
+
renderer: "tags",
|
|
299
|
+
sizing: { mode: "content" },
|
|
300
|
+
// A Site Admin holds every role of every Add-on, which one tag says instead of listing them.
|
|
301
|
+
valueMap: { [PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG]: widgetLabels.addonRoles.all },
|
|
302
|
+
tagColorMap: { [PHI_USER_MANAGEMENT_ADDON_ALL_ROLES_TAG]: "error" },
|
|
303
|
+
},
|
|
293
304
|
{ key: "userFlagTags", fieldKey: "userFlagTags", title: widgetLabels.columns.userFlags, renderer: "tags", sizing: { mode: "content" } },
|
|
294
305
|
{ key: "siteFlagTags", fieldKey: "siteFlagTags", title: widgetLabels.columns.siteFlags, renderer: "tags", sizing: { mode: "content" } },
|
|
295
306
|
{ key: "lastLoginAt", fieldKey: "lastLoginAt", title: widgetLabels.columns.lastLogin, renderer: "datetime", sizing: { mode: "content" }, sortable: true },
|
|
@@ -314,11 +325,18 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
|
|
|
314
325
|
label: widgetLabels.columns.account,
|
|
315
326
|
defaultValue: "roles",
|
|
316
327
|
options: [
|
|
317
|
-
{ value: "customer", label: widgetLabels.accountTypes.
|
|
328
|
+
{ value: "customer", label: widgetLabels.accountTypes.external },
|
|
318
329
|
{ value: "roles", label: widgetLabels.accountTypes.roles },
|
|
319
330
|
{ value: "auth", label: widgetLabels.accountTypes.auth },
|
|
320
331
|
],
|
|
321
332
|
},
|
|
333
|
+
{
|
|
334
|
+
key: "addonRole",
|
|
335
|
+
type: "select",
|
|
336
|
+
label: widgetLabels.filters.addonRole,
|
|
337
|
+
description: widgetLabels.filters.addonRoleHint,
|
|
338
|
+
optionsProvider: { providerKey: PHI_USER_MANAGEMENT_RUNTIME_DATA_PROVIDER_KEYS.addonRoleOptions },
|
|
339
|
+
},
|
|
322
340
|
{
|
|
323
341
|
key: "enabled",
|
|
324
342
|
type: "select",
|
|
@@ -82,7 +82,7 @@ export async function translatePhiWidgetConfigTexts(subjects, runtime) {
|
|
|
82
82
|
const ctx = CTX_BY_REGISTER[register];
|
|
83
83
|
const translated = store === "global"
|
|
84
84
|
? await trGlobalBulkForLocale(locale, texts, ctx)
|
|
85
|
-
: await trBulkForLocale(locale, texts, ctx);
|
|
85
|
+
: await trBulkForLocale(locale, texts, ctx, "text", undefined, runtime);
|
|
86
86
|
return [key, translated];
|
|
87
87
|
})));
|
|
88
88
|
pending.forEach((entry, entryIndex) => {
|