@phis/ui 0.4.16 → 0.4.17

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.
Files changed (104) hide show
  1. package/components/controls/phi-table-control.js +15 -0
  2. package/components/forms/compound-form-controls.js +2 -1
  3. package/components/widgets/label-sets/observability-logs.d.ts +2 -0
  4. package/components/widgets/label-sets/observability-logs.js +4 -0
  5. package/components/widgets/label-sets/search.js +2 -0
  6. package/components/widgets/label-types/search.d.ts +2 -0
  7. package/components/widgets/label-types/search.js +1 -0
  8. package/constants/cms-widget-types.js +3 -2
  9. package/helpers/site-runtime.js +3 -0
  10. package/net/log.d.ts +1 -0
  11. package/net/log.js +19 -1
  12. package/net/phi-next-proxy.js +9 -1
  13. package/package.json +1 -1
  14. package/plugins/runtime-modules/app/presets.js +0 -23
  15. package/plugins/runtime-modules/area-contributions/app.d.ts +1 -1
  16. package/plugins/runtime-modules/area-contributions/app.js +2 -0
  17. package/plugins/runtime-modules/area-contributions/public.d.ts +1 -1
  18. package/plugins/runtime-modules/area-contributions/public.js +2 -0
  19. package/plugins/runtime-modules/area-module-defaults.js +21 -2
  20. package/plugins/runtime-modules/client-authoring-providers/app.d.ts +1 -1
  21. package/plugins/runtime-modules/client-authoring-providers/app.js +6 -0
  22. package/plugins/runtime-modules/client-authoring-providers/public.d.ts +1 -1
  23. package/plugins/runtime-modules/client-authoring-providers/public.js +6 -0
  24. package/plugins/runtime-modules/client-manifests/common.js +2 -2
  25. package/plugins/runtime-modules/core/authoring-widgets.js +0 -4
  26. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  27. package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +1 -1
  28. package/plugins/runtime-modules/core/widgets/table/client.js +7 -5
  29. package/plugins/runtime-modules/core/widgets/table/config.js +8 -1
  30. package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
  31. package/plugins/runtime-modules/core/widgets.js +0 -17
  32. package/plugins/runtime-modules/groups/trees/group-tables.d.ts +44 -0
  33. package/plugins/runtime-modules/groups/trees/group-tables.js +150 -0
  34. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +28 -136
  35. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +9 -106
  36. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +17 -5
  37. package/plugins/runtime-modules/observability/data-providers.d.ts +9 -0
  38. package/plugins/runtime-modules/observability/data-providers.js +5 -0
  39. package/plugins/runtime-modules/observability/definition.d.ts +9 -0
  40. package/plugins/runtime-modules/observability/module.d.ts +9 -0
  41. package/plugins/runtime-modules/observability/services/table.js +4 -0
  42. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +13 -0
  43. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +21 -0
  44. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  45. package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
  46. package/plugins/runtime-modules/public/presets.d.ts +0 -16
  47. package/plugins/runtime-modules/public/presets.js +0 -22
  48. package/plugins/runtime-modules/public-base-page-references.d.ts +0 -1
  49. package/plugins/runtime-modules/public-base-page-references.js +0 -1
  50. package/plugins/runtime-modules/search/authoring-widgets.d.ts +2 -0
  51. package/plugins/runtime-modules/search/authoring-widgets.js +8 -0
  52. package/plugins/runtime-modules/search/authoring.d.ts +1 -0
  53. package/plugins/runtime-modules/search/authoring.js +8 -0
  54. package/plugins/runtime-modules/search/definition.d.ts +21 -0
  55. package/plugins/runtime-modules/search/definition.js +23 -0
  56. package/plugins/runtime-modules/search/ids.d.ts +6 -0
  57. package/plugins/runtime-modules/search/ids.js +7 -0
  58. package/plugins/runtime-modules/search/module.d.ts +10 -0
  59. package/plugins/runtime-modules/search/module.js +4 -0
  60. package/plugins/runtime-modules/search/page-references.d.ts +8 -0
  61. package/plugins/runtime-modules/search/page-references.js +17 -0
  62. package/plugins/runtime-modules/{search-page-tree.d.ts → search/page-tree.d.ts} +1 -1
  63. package/plugins/runtime-modules/{search-page-tree.js → search/page-tree.js} +9 -7
  64. package/plugins/runtime-modules/search/presets.d.ts +12 -0
  65. package/plugins/runtime-modules/search/presets.js +33 -0
  66. package/plugins/runtime-modules/search/server.d.ts +1 -0
  67. package/plugins/runtime-modules/search/server.js +16 -0
  68. package/plugins/runtime-modules/search/widgets/search-box/authoring.d.ts +8 -0
  69. package/plugins/runtime-modules/search/widgets/search-box/authoring.js +21 -0
  70. package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +39 -0
  71. package/plugins/runtime-modules/search/widgets/search-box/client.js +114 -0
  72. package/plugins/runtime-modules/search/widgets/search-box/config.d.ts +96 -0
  73. package/plugins/runtime-modules/search/widgets/search-box/config.js +67 -0
  74. package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.js +1 -4
  75. package/plugins/runtime-modules/search/widgets/search-box/server.d.ts +15 -0
  76. package/plugins/runtime-modules/{core → search}/widgets/search-box/server.js +13 -14
  77. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.d.ts +0 -1
  78. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.js +0 -1
  79. package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.js +1 -3
  80. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.d.ts +1 -2
  81. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.js +2 -2
  82. package/plugins/runtime-modules/search/widgets.d.ts +2 -0
  83. package/plugins/runtime-modules/search/widgets.js +20 -0
  84. package/server-helpers/search-index.js +9 -0
  85. package/styles/shell.css +137 -0
  86. package/theme/phi-theme-tokens.d.ts +1 -1
  87. package/theme/phi-theme-tokens.js +2 -0
  88. package/types/table-widget.d.ts +10 -1
  89. package/types/table-widget.js +1 -0
  90. package/plugins/runtime-modules/core/widgets/search-box/authoring.d.ts +0 -6
  91. package/plugins/runtime-modules/core/widgets/search-box/authoring.js +0 -10
  92. package/plugins/runtime-modules/core/widgets/search-box/client.d.ts +0 -21
  93. package/plugins/runtime-modules/core/widgets/search-box/client.js +0 -17
  94. package/plugins/runtime-modules/core/widgets/search-box/config.d.ts +0 -63
  95. package/plugins/runtime-modules/core/widgets/search-box/config.js +0 -48
  96. package/plugins/runtime-modules/core/widgets/search-box/server.d.ts +0 -21
  97. package/plugins/runtime-modules/search-page-references.d.ts +0 -20
  98. package/plugins/runtime-modules/search-page-references.js +0 -35
  99. /package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.d.ts +0 -0
  100. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.d.ts +0 -0
  101. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.js +0 -0
  102. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.d.ts +0 -0
  103. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.js +0 -0
  104. /package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.d.ts +0 -0
@@ -0,0 +1,44 @@
1
+ import type { PhiTableActionDefinition, PhiTableColumnDefinition, PhiTableFooterConfig, PhiTableToolsConfig, PhiTableWidgetFeatures, PhiTableWidgetPresentation } from "../../../../types/table-widget";
2
+ import type { PhiProviderResourceSource } from "../../../../types/runtime-data-provider";
3
+ import type { getPhiGroupFormLabels } from "../labels";
4
+ type PhiGroupLabels = Awaited<ReturnType<typeof getPhiGroupFormLabels>>;
5
+ type PhiGroupRowCondition = {
6
+ valuePath: string;
7
+ operator: "truthy" | "falsy";
8
+ };
9
+ /** A membership level as the word the reader knows it by, for a badge and for the level editor. */
10
+ export declare function buildPhiGroupLevelValueMap(labels: PhiGroupLabels): Record<string, string>;
11
+ /** The switches someone who manages a group sets on it, each with its hint behind the heading. */
12
+ export declare function buildPhiGroupSettingColumns(labels: PhiGroupLabels): PhiTableColumnDefinition[];
13
+ /** How many groups the list holds, under it. */
14
+ export declare function buildPhiGroupsFooter(labels: PhiGroupLabels): PhiTableFooterConfig;
15
+ /**
16
+ * Ending a group, from its row. `blockedWhen` names what makes a row one this reader cannot end -- the
17
+ * two Pages differ in that and in nothing else about the action.
18
+ */
19
+ export declare function buildPhiGroupRetireAction(labels: PhiGroupLabels, blockedWhen: readonly PhiGroupRowCondition[]): PhiTableActionDefinition;
20
+ /**
21
+ * The members of the selected group: source, presentation and features of the Table. The Page adds
22
+ * its own signal routes, because whom the Table speaks to is the Page's arrangement.
23
+ *
24
+ * `audience` is the one real difference. `colleagues` is what a member sees of the others -- a name, a
25
+ * level, the company where the group shows it; no address and no source, because a colleague is
26
+ * recognized by name and where a membership comes from is an administration question. There a row may
27
+ * be removed where the control plane says this reader administers the group (`manageable`).
28
+ * `administration` adds address, source and date, and removes any membership the Site itself holds
29
+ * (`local`); one a Directory contributes is read here and changed at its source.
30
+ *
31
+ * The level is edited in the cell it is read in on both: the provider states per row, through the
32
+ * field's `mutableWhen`, whether this reader may -- a member sees the same table without an editor.
33
+ */
34
+ export declare function buildPhiGroupMembersTable({ labels, audience, tools, toolbar, }: {
35
+ labels: PhiGroupLabels;
36
+ audience: "colleagues" | "administration";
37
+ tools?: PhiTableToolsConfig;
38
+ toolbar?: PhiTableActionDefinition[];
39
+ }): {
40
+ source: PhiProviderResourceSource;
41
+ presentation: PhiTableWidgetPresentation;
42
+ features: PhiTableWidgetFeatures;
43
+ };
44
+ export {};
@@ -0,0 +1,150 @@
1
+ import { PhiGroupMembershipFlags } from "../../../../constants/site-groups";
2
+ import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
3
+ /** A membership level as the word the reader knows it by, for a badge and for the level editor. */
4
+ export function buildPhiGroupLevelValueMap(labels) {
5
+ return {
6
+ [String(PhiGroupMembershipFlags.Member)]: labels.levels.member,
7
+ [String(PhiGroupMembershipFlags.Author)]: labels.levels.author,
8
+ [String(PhiGroupMembershipFlags.Editor)]: labels.levels.editor,
9
+ [String(PhiGroupMembershipFlags.Manager)]: labels.levels.manager,
10
+ };
11
+ }
12
+ /** The switches someone who manages a group sets on it, each with its hint behind the heading. */
13
+ export function buildPhiGroupSettingColumns(labels) {
14
+ const setting = (key, title, description) => ({
15
+ key,
16
+ fieldKey: key,
17
+ title,
18
+ description,
19
+ renderer: "switch",
20
+ editor: { control: "switch" },
21
+ sizing: { mode: "content" },
22
+ });
23
+ return [
24
+ setting("showMemberCompany", labels.columns.showCompany, labels.columns.showCompanyHint),
25
+ setting("threads", labels.columns.threads, labels.columns.threadsHint),
26
+ setting("crossGroupThreads", labels.columns.crossGroupThreads, labels.columns.crossGroupThreadsHint),
27
+ ];
28
+ }
29
+ /** How many groups the list holds, under it. */
30
+ export function buildPhiGroupsFooter(labels) {
31
+ return {
32
+ template: labels.groups.footer,
33
+ values: [{ key: "groups", value: { source: "core", fieldKey: "totalRows" } }],
34
+ align: "start",
35
+ };
36
+ }
37
+ /**
38
+ * Ending a group, from its row. `blockedWhen` names what makes a row one this reader cannot end -- the
39
+ * two Pages differ in that and in nothing else about the action.
40
+ */
41
+ export function buildPhiGroupRetireAction(labels, blockedWhen) {
42
+ return {
43
+ key: "retire",
44
+ label: labels.actions.retire,
45
+ icon: "antd:stop",
46
+ display: "icon",
47
+ mode: "danger",
48
+ execution: "provider",
49
+ disabledWhen: {
50
+ match: "any",
51
+ conditions: blockedWhen.map((condition) => ({
52
+ source: "row",
53
+ ...condition,
54
+ reason: labels.actions.retire,
55
+ })),
56
+ },
57
+ confirm: {
58
+ title: labels.actions.retireConfirmTitle,
59
+ description: labels.actions.retireConfirmText,
60
+ okText: labels.actions.retireConfirmOk,
61
+ cancelText: labels.actions.removeConfirmCancel,
62
+ },
63
+ };
64
+ }
65
+ /**
66
+ * The members of the selected group: source, presentation and features of the Table. The Page adds
67
+ * its own signal routes, because whom the Table speaks to is the Page's arrangement.
68
+ *
69
+ * `audience` is the one real difference. `colleagues` is what a member sees of the others -- a name, a
70
+ * level, the company where the group shows it; no address and no source, because a colleague is
71
+ * recognized by name and where a membership comes from is an administration question. There a row may
72
+ * be removed where the control plane says this reader administers the group (`manageable`).
73
+ * `administration` adds address, source and date, and removes any membership the Site itself holds
74
+ * (`local`); one a Directory contributes is read here and changed at its source.
75
+ *
76
+ * The level is edited in the cell it is read in on both: the provider states per row, through the
77
+ * field's `mutableWhen`, whether this reader may -- a member sees the same table without an editor.
78
+ */
79
+ export function buildPhiGroupMembersTable({ labels, audience, tools, toolbar, }) {
80
+ const administration = audience === "administration";
81
+ const columns = [
82
+ { key: "displayName", fieldKey: "displayName", title: labels.columns.name, sizing: { mode: "fill", minWidth: 200 } },
83
+ administration
84
+ ? { key: "email", fieldKey: "email", title: labels.columns.email, sizing: { mode: "content" } }
85
+ : { key: "companyName", fieldKey: "companyName", title: labels.columns.company, sizing: { mode: "content" } },
86
+ {
87
+ key: "membershipFlags",
88
+ fieldKey: "membershipFlags",
89
+ title: labels.columns.level,
90
+ renderer: "badge",
91
+ valueMap: buildPhiGroupLevelValueMap(labels),
92
+ editor: { control: "select" },
93
+ sizing: { mode: "content" },
94
+ },
95
+ ...(administration ? [
96
+ { key: "sourceProviderId", fieldKey: "sourceProviderId", title: labels.columns.source, renderer: "badge", sizing: { mode: "content" } },
97
+ { key: "createdAt", fieldKey: "createdAt", title: labels.columns.since, renderer: "datetime", sizing: { mode: "content" } },
98
+ ] : []),
99
+ ];
100
+ return {
101
+ source: {
102
+ providerKey: PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS.table,
103
+ resourceKey: "groupMembers",
104
+ },
105
+ presentation: {
106
+ title: labels.members.title,
107
+ description: labels.members.description,
108
+ layout: { mode: "auto", overflowX: "auto" },
109
+ controlSize: "small",
110
+ columns,
111
+ emptyState: { title: labels.members.empty, description: "" },
112
+ footer: {
113
+ template: labels.members.footer,
114
+ values: [{ key: "members", value: { source: "core", fieldKey: "totalRows" } }],
115
+ align: "start",
116
+ },
117
+ },
118
+ features: {
119
+ pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
120
+ sorting: { mode: "none" },
121
+ search: { enabled: false },
122
+ ...(tools ? { tools } : {}),
123
+ editing: { mode: "cell" },
124
+ actions: {
125
+ rowLayout: "compact",
126
+ ...(toolbar ? { toolbar } : {}),
127
+ row: [{
128
+ key: "delete",
129
+ label: labels.actions.remove,
130
+ icon: "antd:delete",
131
+ display: "icon",
132
+ mode: "danger",
133
+ execution: "provider",
134
+ disabledWhen: { match: "any", conditions: [{
135
+ source: "row",
136
+ valuePath: administration ? "local" : "manageable",
137
+ operator: "falsy",
138
+ reason: labels.actions.remove,
139
+ }] },
140
+ confirm: {
141
+ title: labels.actions.removeConfirmTitle,
142
+ description: labels.actions.removeConfirmText,
143
+ okText: labels.actions.removeConfirmOk,
144
+ cancelText: labels.actions.removeConfirmCancel,
145
+ },
146
+ }],
147
+ },
148
+ },
149
+ };
150
+ }
@@ -1,13 +1,13 @@
1
1
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
2
2
  import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
3
  import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
4
- import { PhiGroupMembershipFlags } from "../../../../constants/site-groups";
5
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
6
5
  import { createPhiSignalAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
7
6
  import { createPhiGroupsControllerAddress, PHI_GROUPS_CONTROLLER_INSTANCE_KEY, PHI_GROUPS_CONTROLLER_TYPE, } from "../controller/address";
8
7
  import { PHI_GROUPS_PAGE_LAYOUT_IDS, PHI_GROUPS_PAGE_OVERLAY_IDS, PHI_GROUPS_PAGE_WIDGET_IDS } from "../addresses";
9
8
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
10
9
  import { getPhiGroupFormLabels } from "../labels";
10
+ import { buildPhiGroupMembersTable, buildPhiGroupRetireAction, buildPhiGroupSettingColumns, buildPhiGroupsFooter, } from "./group-tables";
11
11
  import { PHI_GROUPS_FORM_IDS } from "../forms";
12
12
  import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
13
13
  const SYNTHETIC_ADMIN_GROUPS_REGION_IDS = {
@@ -34,12 +34,6 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
34
34
  const createOverlayAddress = createPhiSignalAddress("cms", PHI_GROUPS_PAGE_OVERLAY_IDS.overlayCreate);
35
35
  const membershipOverlayAddress = createPhiSignalAddress("cms", PHI_GROUPS_PAGE_OVERLAY_IDS.overlayMembership);
36
36
  const stateOptions = { active: labels.states.active, retired: labels.states.retired };
37
- const levelOptions = {
38
- [String(PhiGroupMembershipFlags.Member)]: labels.levels.member,
39
- [String(PhiGroupMembershipFlags.Author)]: labels.levels.author,
40
- [String(PhiGroupMembershipFlags.Editor)]: labels.levels.editor,
41
- [String(PhiGroupMembershipFlags.Manager)]: labels.levels.manager,
42
- };
43
37
  const scaffold = buildPhiBasePageContentScaffold({
44
38
  page,
45
39
  regionId: SYNTHETIC_ADMIN_GROUPS_REGION_IDS.regionContent,
@@ -303,33 +297,7 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
303
297
  { key: "spaceUsedBytes", fieldKey: "spaceUsedBytes", title: labels.columns.spaceUsed, sizing: { mode: "content" } },
304
298
  { key: "spaceQuotaBytes", fieldKey: "spaceQuotaBytes", title: labels.columns.spaceQuota, sizing: { mode: "content" } },
305
299
  // Administration always manages every group, so the switch is always here.
306
- {
307
- key: "showMemberCompany",
308
- fieldKey: "showMemberCompany",
309
- title: labels.columns.showCompany,
310
- description: labels.columns.showCompanyHint,
311
- renderer: "switch",
312
- editor: { control: "switch" },
313
- sizing: { mode: "content" },
314
- },
315
- {
316
- key: "threads",
317
- fieldKey: "threads",
318
- title: labels.columns.threads,
319
- description: labels.columns.threadsHint,
320
- renderer: "switch",
321
- editor: { control: "switch" },
322
- sizing: { mode: "content" },
323
- },
324
- {
325
- key: "crossGroupThreads",
326
- fieldKey: "crossGroupThreads",
327
- title: labels.columns.crossGroupThreads,
328
- description: labels.columns.crossGroupThreadsHint,
329
- renderer: "switch",
330
- editor: { control: "switch" },
331
- sizing: { mode: "content" },
332
- },
300
+ ...buildPhiGroupSettingColumns(labels),
333
301
  { key: "providerId", fieldKey: "providerId", title: labels.columns.source, renderer: "badge", sizing: { mode: "content" } },
334
302
  // A retired group is listed here and nowhere else, so this is where its state is read.
335
303
  {
@@ -341,11 +309,7 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
341
309
  sizing: { mode: "content" },
342
310
  },
343
311
  ],
344
- footer: {
345
- template: labels.groups.footer,
346
- values: [{ key: "groups", value: { source: "core", fieldKey: "totalRows" } }],
347
- align: "start",
348
- },
312
+ footer: buildPhiGroupsFooter(labels),
349
313
  },
350
314
  features: {
351
315
  // One group at a time: the membership table below shows exactly what is selected here.
@@ -367,24 +331,10 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
367
331
  execution: "signal",
368
332
  }],
369
333
  row: [
370
- {
371
- key: "retire",
372
- label: labels.actions.retire,
373
- icon: "antd:stop",
374
- display: "icon",
375
- mode: "danger",
376
- execution: "provider",
377
- disabledWhen: { match: "any", conditions: [
378
- { source: "row", valuePath: "local", operator: "falsy", reason: labels.actions.retire },
379
- { source: "row", valuePath: "retired", operator: "truthy", reason: labels.actions.retire },
380
- ] },
381
- confirm: {
382
- title: labels.actions.retireConfirmTitle,
383
- description: labels.actions.retireConfirmText,
384
- okText: labels.actions.retireConfirmOk,
385
- cancelText: labels.actions.removeConfirmCancel,
386
- },
387
- },
334
+ buildPhiGroupRetireAction(labels, [
335
+ { valuePath: "local", operator: "falsy" },
336
+ { valuePath: "retired", operator: "truthy" },
337
+ ]),
388
338
  {
389
339
  key: "reactivate",
390
340
  label: labels.actions.reactivate,
@@ -457,86 +407,28 @@ export async function buildPhiDefaultAdminGroupsPageTree({ page, runtime, }) {
457
407
  sortOrder: 1,
458
408
  label: labels.members.title,
459
409
  config: {
460
- source: {
461
- providerKey: PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS.table,
462
- resourceKey: "groupMembers",
463
- },
464
- presentation: {
465
- title: labels.members.title,
466
- description: labels.members.description,
467
- layout: { mode: "auto", overflowX: "auto" },
468
- controlSize: "small",
469
- columns: [
470
- { key: "displayName", fieldKey: "displayName", title: labels.columns.name, sizing: { mode: "fill", minWidth: 200 } },
471
- { key: "email", fieldKey: "email", title: labels.columns.email, sizing: { mode: "content" } },
472
- {
473
- key: "membershipFlags",
474
- fieldKey: "membershipFlags",
475
- title: labels.columns.level,
476
- renderer: "badge",
477
- valueMap: levelOptions,
478
- // Editable in place: the level is the one thing about a membership that belongs to
479
- // the group rather than to the account. A row a Directory contributes stays read-only,
480
- // which the provider states through the field's `mutableWhen`.
481
- editor: { control: "select" },
482
- sizing: { mode: "content" },
483
- },
484
- { key: "sourceProviderId", fieldKey: "sourceProviderId", title: labels.columns.source, renderer: "badge", sizing: { mode: "content" } },
485
- { key: "createdAt", fieldKey: "createdAt", title: labels.columns.since, renderer: "datetime", sizing: { mode: "content" } },
486
- ],
487
- emptyState: { title: labels.members.empty, description: "" },
488
- footer: {
489
- template: labels.members.footer,
490
- values: [{ key: "members", value: { source: "core", fieldKey: "totalRows" } }],
491
- align: "start",
492
- },
493
- },
494
- features: {
495
- pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
496
- sorting: { mode: "none" },
497
- search: { enabled: false },
410
+ ...buildPhiGroupMembersTable({
411
+ labels,
412
+ audience: "administration",
498
413
  tools: { mode: "self-contained", reset: false, reload: true },
499
- // The level is edited in the cell it is read in; nothing else about a member is editable.
500
- editing: { mode: "cell" },
501
- actions: {
502
- rowLayout: "compact",
503
- // The Form names the group itself, so a member can be added before any group is selected;
504
- // with one selected, it starts there (the Controller answers the Form's `valuesRequest`).
505
- toolbar: [{
506
- key: "addMember",
507
- label: labels.membership.title,
508
- icon: "plus",
509
- display: "icon",
510
- mode: "primary",
511
- execution: "signal",
512
- disabledWhen: { match: "any", conditions: [{
513
- source: "controller",
514
- controllerAddress,
515
- valuePath: "selectedGroupRetired",
516
- operator: "truthy",
517
- reason: labels.membership.retired,
518
- }] },
519
- }],
520
- row: [{
521
- key: "delete",
522
- label: labels.actions.remove,
523
- icon: "antd:delete",
524
- display: "icon",
525
- mode: "danger",
526
- execution: "provider",
527
- // A provider-owned membership is read here and changed at its source.
528
- disabledWhen: { match: "any", conditions: [
529
- { source: "row", valuePath: "local", operator: "falsy", reason: labels.actions.remove },
530
- ] },
531
- confirm: {
532
- title: labels.actions.removeConfirmTitle,
533
- description: labels.actions.removeConfirmText,
534
- okText: labels.actions.removeConfirmOk,
535
- cancelText: labels.actions.removeConfirmCancel,
536
- },
537
- }],
538
- },
539
- },
414
+ // The Form names the group itself, so a member can be added before any group is selected;
415
+ // with one selected, it starts there (the Controller answers the Form's `valuesRequest`).
416
+ toolbar: [{
417
+ key: "addMember",
418
+ label: labels.membership.title,
419
+ icon: "plus",
420
+ display: "icon",
421
+ mode: "primary",
422
+ execution: "signal",
423
+ disabledWhen: { match: "any", conditions: [{
424
+ source: "controller",
425
+ controllerAddress,
426
+ valuePath: "selectedGroupRetired",
427
+ operator: "truthy",
428
+ reason: labels.membership.retired,
429
+ }] },
430
+ }],
431
+ }),
540
432
  signalRoutes: {
541
433
  emits: [{
542
434
  routeKey: "admin-groups-membership-action",
@@ -1,13 +1,13 @@
1
1
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
2
2
  import { PhiCmsPageType } from "../../../../constants/phi-cms";
3
3
  import { PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
4
- import { PhiGroupMembershipFlags } from "../../../../constants/site-groups";
5
4
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
6
5
  import { createPhiSignalAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
7
6
  import { createPhiGroupsControllerAddress, PHI_GROUPS_CONTROLLER_INSTANCE_KEY, PHI_GROUPS_CONTROLLER_TYPE, } from "../controller/address";
8
7
  import { PHI_APP_GROUPS_PAGE_WIDGET_IDS } from "../addresses";
9
8
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
10
9
  import { getPhiGroupFormLabels } from "../labels";
10
+ import { buildPhiGroupLevelValueMap, buildPhiGroupMembersTable, buildPhiGroupRetireAction, buildPhiGroupSettingColumns, buildPhiGroupsFooter, } from "./group-tables";
11
11
  import { canPhiViewerManageSomeGroup } from "../page-visibility";
12
12
  import { canPhiViewerAccess, PHI_VIEWER_ACCESS_DEVELOPER_TOOLS } from "../../../../types/access";
13
13
  import { PHI_GROUPS_FORM_IDS } from "../forms";
@@ -33,12 +33,7 @@ export async function buildPhiDefaultAppGroupsPageTree({ page, runtime, }) {
33
33
  siteWide: canPhiViewerAccess(runtime.viewer, PHI_VIEWER_ACCESS_DEVELOPER_TOOLS),
34
34
  groupClaims: runtime.viewer.groupClaims,
35
35
  });
36
- const levelOptions = {
37
- [String(PhiGroupMembershipFlags.Member)]: labels.levels.member,
38
- [String(PhiGroupMembershipFlags.Author)]: labels.levels.author,
39
- [String(PhiGroupMembershipFlags.Editor)]: labels.levels.editor,
40
- [String(PhiGroupMembershipFlags.Manager)]: labels.levels.manager,
41
- };
36
+ const levelOptions = buildPhiGroupLevelValueMap(labels);
42
37
  const scaffold = buildPhiBasePageContentScaffold({
43
38
  page,
44
39
  regionId: SYNTHETIC_APP_GROUPS_REGION_IDS.regionContent,
@@ -138,33 +133,10 @@ export async function buildPhiDefaultAppGroupsPageTree({ page, runtime, }) {
138
133
  { key: "spaceQuotaBytes", fieldKey: "spaceQuotaBytes", title: labels.columns.spaceQuota, sizing: { mode: "content" } },
139
134
  // Present only for someone who manages a group: a switch nobody here may touch is worse
140
135
  // than no switch, so the column is left out rather than shown disabled.
141
- ...(managesSomeGroup ? [{
142
- key: "showMemberCompany",
143
- fieldKey: "showMemberCompany",
144
- title: labels.columns.showCompany,
145
- description: labels.columns.showCompanyHint,
146
- renderer: "switch",
147
- editor: { control: "switch" },
148
- sizing: { mode: "content" },
149
- }, {
150
- key: "threads",
151
- fieldKey: "threads",
152
- title: labels.columns.threads,
153
- description: labels.columns.threadsHint,
154
- renderer: "switch",
155
- editor: { control: "switch" },
156
- sizing: { mode: "content" },
157
- }, {
158
- key: "crossGroupThreads",
159
- fieldKey: "crossGroupThreads",
160
- title: labels.columns.crossGroupThreads,
161
- description: labels.columns.crossGroupThreadsHint,
162
- renderer: "switch",
163
- editor: { control: "switch" },
164
- sizing: { mode: "content" },
165
- }] : []),
136
+ ...(managesSomeGroup ? buildPhiGroupSettingColumns(labels) : []),
166
137
  ],
167
138
  emptyState: { title: labels.mine.empty, description: labels.mine.emptyHint },
139
+ footer: buildPhiGroupsFooter(labels),
168
140
  },
169
141
  features: {
170
142
  rowSelection: { mode: "single", preserveSelectedRowIdentities: true },
@@ -181,26 +153,10 @@ export async function buildPhiDefaultAppGroupsPageTree({ page, runtime, }) {
181
153
  ...(managesSomeGroup ? {
182
154
  actions: {
183
155
  rowLayout: "compact",
184
- row: [{
185
- key: "retire",
186
- label: labels.actions.retire,
187
- icon: "antd:stop",
188
- display: "icon",
189
- mode: "danger",
190
- execution: "provider",
191
- disabledWhen: { match: "any", conditions: [
192
- { source: "row", valuePath: "manages", operator: "falsy",
193
- reason: labels.actions.retire },
194
- { source: "row", valuePath: "local", operator: "falsy",
195
- reason: labels.actions.retire },
196
- ] },
197
- confirm: {
198
- title: labels.actions.retireConfirmTitle,
199
- description: labels.actions.retireConfirmText,
200
- okText: labels.actions.retireConfirmOk,
201
- cancelText: labels.actions.removeConfirmCancel,
202
- },
203
- }],
156
+ row: [buildPhiGroupRetireAction(labels, [
157
+ { valuePath: "manages", operator: "falsy" },
158
+ { valuePath: "local", operator: "falsy" },
159
+ ])],
204
160
  },
205
161
  } : {}),
206
162
  },
@@ -243,60 +199,7 @@ export async function buildPhiDefaultAppGroupsPageTree({ page, runtime, }) {
243
199
  sortOrder: 1,
244
200
  label: labels.members.title,
245
201
  config: {
246
- source: {
247
- providerKey: PHI_GROUPS_RUNTIME_DATA_PROVIDER_KEYS.table,
248
- resourceKey: "groupMembers",
249
- },
250
- presentation: {
251
- title: labels.members.title,
252
- description: labels.members.description,
253
- layout: { mode: "auto", overflowX: "auto" },
254
- controlSize: "small",
255
- // No address and no source column: a colleague is recognized by name, and where a
256
- // membership comes from is an administration question.
257
- columns: [
258
- { key: "displayName", fieldKey: "displayName", title: labels.columns.name, sizing: { mode: "fill", minWidth: 200 } },
259
- { key: "companyName", fieldKey: "companyName", title: labels.columns.company, sizing: { mode: "content" } },
260
- {
261
- key: "membershipFlags",
262
- fieldKey: "membershipFlags",
263
- title: labels.columns.level,
264
- renderer: "badge",
265
- valueMap: levelOptions,
266
- // Editable only where the control plane says this actor administers this group, which
267
- // it states per row -- a member sees the same table without an editor.
268
- editor: { control: "select" },
269
- sizing: { mode: "content" },
270
- },
271
- ],
272
- emptyState: { title: labels.members.empty, description: "" },
273
- },
274
- features: {
275
- pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
276
- sorting: { mode: "none" },
277
- search: { enabled: false },
278
- editing: { mode: "cell" },
279
- actions: {
280
- rowLayout: "compact",
281
- row: [{
282
- key: "delete",
283
- label: labels.actions.remove,
284
- icon: "antd:delete",
285
- display: "icon",
286
- mode: "danger",
287
- execution: "provider",
288
- disabledWhen: { match: "any", conditions: [
289
- { source: "row", valuePath: "manageable", operator: "falsy", reason: labels.actions.remove },
290
- ] },
291
- confirm: {
292
- title: labels.actions.removeConfirmTitle,
293
- description: labels.actions.removeConfirmText,
294
- okText: labels.actions.removeConfirmOk,
295
- cancelText: labels.actions.removeConfirmCancel,
296
- },
297
- }],
298
- },
299
- },
202
+ ...buildPhiGroupMembersTable({ labels, audience: "colleagues" }),
300
203
  signalRoutes: {
301
204
  listens: [{
302
205
  routeKey: "app-groups-member-filter",
@@ -37,6 +37,15 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
37
37
  regionId: SYNTHETIC_ADMIN_LOCALES_REGION_IDS.regionContent,
38
38
  });
39
39
  const nodes = createPhiCmsPresetNodes(page);
40
+ /*
41
+ * What every site translation starts from, as the Table's heading: the list is the place the source
42
+ * language matters, and a heading saying "Site translations" on a page called Locales told nothing.
43
+ * Under the column's own word, "Source", so the heading and the column name the same thing.
44
+ * Shown and not edited -- a Site's source language is fixed when the Site is created, and the Site
45
+ * config carries it, so no request is needed to name it.
46
+ */
47
+ const sourceLocale = runtime.site.availableLocales.find((option) => option.code === runtime.site.sourceLocale);
48
+ const sourceLocaleText = sourceLocale ? `${sourceLocale.label} (${sourceLocale.code})` : runtime.site.sourceLocale;
40
49
  return {
41
50
  page: nodes.page({ pageType: PhiCmsPageType.Standard }),
42
51
  pageMeta: {
@@ -128,8 +137,7 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
128
137
  resourceKey: "siteTranslations",
129
138
  },
130
139
  presentation: {
131
- title: widgetLabels.translationsTitle,
132
- description: widgetLabels.translationsDescription,
140
+ title: `${widgetLabels.columns.source}: ${sourceLocaleText}`,
133
141
  borders: true,
134
142
  layout: { mode: "auto", overflowX: "auto" },
135
143
  columns: [
@@ -146,7 +154,8 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
146
154
  fieldKey: "translation",
147
155
  title: widgetLabels.columns.translation,
148
156
  sizing: { mode: "fill", minWidth: 320 },
149
- editor: {},
157
+ // A translation is as long as its source: several lines, wrapped, not one cut-off row.
158
+ editor: { control: "textarea" },
150
159
  },
151
160
  { key: "updatedAt", fieldKey: "updatedAt", title: widgetLabels.columns.updated, renderer: "datetime", sizing: { mode: "content" } },
152
161
  ],
@@ -173,6 +182,8 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
173
182
  * it reads as the question the empty filter asks and goes away once one is chosen.
174
183
  */
175
184
  labelPlacement: "none",
185
+ // What the list under it is, said by the choice that decides it rather than under the heading.
186
+ description: widgetLabels.translationsDescription,
176
187
  optionsProvider: { providerKey: PHI_LOCALIZATION_RUNTIME_DATA_PROVIDER_KEYS.adminSiteLocales },
177
188
  }],
178
189
  pagination: { enabled: true, pageSize: 25, pageSizes: [25, 50, 100] },
@@ -186,13 +197,14 @@ export async function buildPhiDefaultAdminLocalesPageTree({ page, runtime, }) {
186
197
  mode: "cell",
187
198
  disabledWhen: { source: "row", valuePath: "protected", operator: "truthy" },
188
199
  },
189
- tools: { mode: "self-contained", reload: true },
200
+ // No reset: one language choice and a search box are cleared faster by hand than found again.
201
+ tools: { mode: "self-contained", reload: true, reset: false },
190
202
  actions: {
191
203
  bulk: [{
192
204
  key: "deleteSelected",
193
205
  label: widgetLabels.deleteSelectedLabel,
194
206
  icon: "antd:delete",
195
- display: "icon-label",
207
+ display: "icon",
196
208
  mode: "danger",
197
209
  execution: "provider",
198
210
  confirm: {
@@ -43,6 +43,15 @@ export declare const PHI_OBSERVABILITY_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
43
43
  pagination: "offset";
44
44
  total: true;
45
45
  };
46
+ summaryFields: ({
47
+ key: string;
48
+ title: string;
49
+ type: "boolean";
50
+ } | {
51
+ key: string;
52
+ title: string;
53
+ type: "number";
54
+ })[];
46
55
  recordRead: true;
47
56
  }[];
48
57
  }[];