@phis/ui 0.7.7 → 0.8.0
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-address-control.d.ts +23 -0
- package/components/controls/phi-address-control.js +43 -0
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-country-select-control.d.ts +22 -0
- package/components/controls/phi-country-select-control.js +16 -0
- package/components/controls/phi-dialog-control.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +5 -3
- package/components/controls/phi-drawer-control.d.ts +7 -5
- package/components/controls/phi-float-button-control.d.ts +8 -1
- package/components/controls/phi-float-button-control.js +19 -3
- package/components/controls/phi-form-control.js +64 -9
- package/components/controls/phi-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +14 -37
- package/components/controls/phi-modal-control.d.ts +5 -5
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-overlay-control-contract.d.ts +52 -17
- package/components/controls/phi-overlay-control-contract.js +55 -30
- package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
- package/components/controls/phi-reveal-once-dialog-control.js +52 -0
- package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
- package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
- package/components/forms/extended-form-field-controls.d.ts +1 -1
- package/components/forms/extended-form-field-controls.js +23 -7
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- package/components/forms/form-option-flags.d.ts +20 -0
- package/components/forms/form-option-flags.js +38 -0
- package/components/forms/form-provider-contract.d.ts +28 -0
- package/components/forms/form-provider-contract.js +45 -2
- package/components/forms/form-provider-registry.d.ts +11 -1
- package/components/forms/money-field-currency-key.d.ts +6 -0
- package/components/forms/money-field-currency-key.js +14 -0
- package/components/forms/money-field.d.ts +26 -3
- package/components/forms/money-field.js +54 -4
- package/components/forms/shared-form-provider-registry.js +13 -0
- package/components/forms/structured-field-labels.d.ts +24 -0
- package/components/forms/structured-field-labels.js +43 -0
- package/components/forms/structured-form-field-controls.d.ts +12 -0
- package/components/forms/structured-form-field-controls.js +65 -0
- package/components/overlays/phi-overlay-container-client.js +2 -2
- package/components/regions/phi-cms-region-shell.js +2 -2
- package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
- package/components/regions/presets/navigation-redirect.d.ts +4 -1
- package/components/regions/presets/navigation-redirect.js +6 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/shell/phi-antd-icon.d.ts +1 -8
- package/components/shell/phi-antd-icon.js +1 -227
- package/components/shell/phi-icon-names.d.ts +19 -0
- package/components/shell/phi-icon-names.js +264 -0
- package/components/shell/phi-icon.d.ts +2 -11
- package/components/shell/phi-icon.js +4 -32
- package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
- package/components/widgets/client/shared/phi-command-buttons.js +10 -4
- package/components/widgets/client/shared/phi-rendered-value.js +32 -6
- package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
- package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
- package/components/widgets/config/background.d.ts +3 -2
- package/components/widgets/config/choice-shared.d.ts +10 -1
- package/components/widgets/config/choice-shared.js +8 -2
- package/components/widgets/label-sets/admin-locales.js +1 -1
- package/components/widgets/label-sets/admin-users.d.ts +2 -5
- package/components/widgets/label-sets/admin-users.js +4 -10
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -0
- package/components/widgets/label-sets/profile.js +28 -0
- package/components/widgets/label-sets/search-results.js +2 -4
- package/components/widgets/label-sets/table.js +9 -0
- package/components/widgets/label-types/effects.d.ts +3 -2
- package/components/widgets/label-types/effects.js +1 -2
- package/components/widgets/label-types/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/server/builder-chrome.d.ts +4 -1
- package/components/widgets/server/builder-chrome.js +2 -2
- package/components/widgets/shared/markdown-body-client.d.ts +26 -0
- package/components/widgets/shared/markdown-body-client.js +31 -1
- package/components/widgets/shared/markdown-render.d.ts +10 -2
- package/components/widgets/shared/markdown-render.js +35 -13
- package/constants/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +25 -0
- package/constants/customer-file.js +26 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +12 -0
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +1 -0
- package/constants.js +2 -0
- package/gateway/form-handler-request.d.ts +22 -0
- package/gateway/form-handler-request.js +40 -0
- package/gateway/label-set.d.ts +15 -2
- package/gateway/label-set.js +60 -22
- package/gateway/site-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -0
- package/helpers/cms-dialog.d.ts +5 -20
- package/helpers/cms-dialog.js +8 -13
- package/helpers/cms-page-catalog.d.ts +10 -0
- package/helpers/cms-page-catalog.js +19 -0
- package/helpers/cms-preset-nodes.d.ts +4 -4
- package/helpers/cms-preset-nodes.js +1 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/country-names.d.ts +12 -0
- package/helpers/country-names.js +14 -0
- package/helpers/money-amount.d.ts +7 -0
- package/helpers/money-amount.js +15 -0
- package/helpers/phi-metadata.d.ts +33 -1
- package/helpers/phi-metadata.js +62 -1
- package/helpers/preset-table-check.d.ts +34 -0
- package/helpers/preset-table-check.js +124 -0
- package/helpers/preset-text-source-check.d.ts +4 -1
- package/helpers/preset-text-source-check.js +6 -1
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +30 -5
- package/helpers/public-route-claims.d.ts +9 -1
- package/helpers/public-route-claims.js +23 -3
- package/helpers/record-fields.d.ts +1 -5
- package/helpers/record-fields.js +15 -6
- package/helpers/route-address-check.d.ts +22 -2
- package/helpers/route-address-check.js +29 -8
- package/helpers/site-address-row.d.ts +23 -0
- package/helpers/site-address-row.js +36 -0
- package/helpers/surface-style.d.ts +8 -1
- package/helpers/surface-style.js +12 -2
- package/helpers/thread-inbox-row.d.ts +20 -0
- package/helpers/thread-inbox-row.js +26 -0
- package/helpers/translation-format.d.ts +26 -0
- package/helpers/translation-format.js +31 -0
- package/module-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +1 -0
- package/module-page-check.js +1 -0
- package/module-records.d.ts +2 -2
- package/module-records.js +1 -0
- package/next/area-route.js +34 -1
- package/next/root-route.js +4 -5
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
- package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
- package/plugins/runtime-modules/accounting/data-providers.js +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
- package/plugins/runtime-modules/accounting/ids.js +23 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
- package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/app/client-data-providers.js +9 -0
- package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
- package/plugins/runtime-modules/app/data-providers.js +80 -0
- package/plugins/runtime-modules/app/definition.d.ts +131 -0
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +46 -1
- package/plugins/runtime-modules/app/forms.js +195 -1
- package/plugins/runtime-modules/app/ids.d.ts +7 -0
- package/plugins/runtime-modules/app/ids.js +8 -0
- package/plugins/runtime-modules/app/module.d.ts +131 -0
- package/plugins/runtime-modules/app/presets.js +3 -6
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
- package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.d.ts +3 -6
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +4 -7
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
- package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
- package/plugins/runtime-modules/asset/presets.d.ts +4 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
- package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
- package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
- package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
- package/plugins/runtime-modules/blog/presets.d.ts +4 -0
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
- package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
- package/plugins/runtime-modules/builder/controller/client.d.ts +5 -5
- package/plugins/runtime-modules/builder/controller/client.js +2 -1
- package/plugins/runtime-modules/builder/controller/definition.d.ts +4 -4
- package/plugins/runtime-modules/builder/controller/definition.js +7 -0
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +3 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +72 -18
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +4 -4
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +3 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +8 -10
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +10 -0
- package/plugins/runtime-modules/builder/developer-workspace-store.js +35 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +6 -0
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -6
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
- package/plugins/runtime-modules/builder/persistence.d.ts +4 -1
- package/plugins/runtime-modules/builder/persistence.js +14 -3
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
- package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
- package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
- package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
- package/plugins/runtime-modules/client-manifests/app.js +3 -0
- package/plugins/runtime-modules/client-manifests/builder.js +10 -0
- package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +28 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +28 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
- package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
- package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
- package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/spacer/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
- package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
- package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
- package/plugins/runtime-modules/descriptor-compiler.js +44 -16
- package/plugins/runtime-modules/editor/presets.d.ts +4 -0
- package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/localization/presets.d.ts +4 -0
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
- package/plugins/runtime-modules/news/presets.d.ts +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +46 -39
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
- package/plugins/runtime-modules/resolver.js +17 -0
- package/plugins/runtime-modules/revisions/controller/client.js +50 -46
- package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/table.js +16 -5
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/definition.js +1 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
- package/plugins/runtime-modules/threads/data-providers.js +85 -0
- package/plugins/runtime-modules/threads/definition.d.ts +115 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +3 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
- package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
- package/plugins/runtime-modules/user-management/data-providers.js +101 -3
- package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
- package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
- package/plugins/runtime-modules/user-management/ids.js +9 -0
- package/plugins/runtime-modules/user-management/presets.js +17 -1
- package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
- package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
- package/server-helpers/cms-page-record.d.ts +9 -1
- package/server-helpers/cms-page-record.js +11 -1
- package/server-helpers/cms-request.js +8 -5
- package/server-helpers/link-preview-image.d.ts +30 -0
- package/server-helpers/link-preview-image.js +57 -0
- package/server-helpers/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/builder-scaffold.css +7 -1
- package/styles/layout-authoring-scaffold.css +27 -0
- package/styles/shell.css +30 -6
- package/theme/phi-theme-composition.js +9 -0
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.js +103 -0
- package/theme/phi-theme-tokens.d.ts +2 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/cms-module-descriptors.d.ts +14 -0
- package/types/cms-overlay.d.ts +13 -6
- package/types/cms-overlay.js +6 -22
- package/types/cms-plugins.d.ts +14 -2
- package/types/cms.d.ts +10 -0
- package/types/core-widget-placements.d.ts +3 -3
- package/types/link-preview.d.ts +19 -0
- package/types/link-preview.js +19 -0
- package/types/record-provider.d.ts +22 -1
- package/types/site-theme.d.ts +27 -0
- package/types/table-embed.d.ts +48 -0
- package/types/table-embed.js +1 -0
- package/types/table-widget.d.ts +14 -0
- package/types/widget-runtime.d.ts +3 -0
- package/types.d.ts +1 -0
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
|
|
2
|
+
import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
|
|
3
|
+
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
4
|
+
import { canPhiViewerAccess } from "../../../../types/access";
|
|
5
|
+
import { createPhiSignalAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
6
|
+
import { PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS } from "../../../../constants/thread-library-provider-keys";
|
|
7
|
+
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../../constants/core-data-provider-keys";
|
|
8
|
+
import { PhisThreadKind } from "../../../../constants/threads";
|
|
9
|
+
import { PHI_SHARED_FORM_IDS } from "../../../../components/forms/shared-form-ids";
|
|
10
|
+
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
|
|
11
|
+
import { readPhiServerApiCredentials } from "../../../../helpers/phis-server-credentials";
|
|
12
|
+
import { PHI_DIALOG_WIDTH_SINGLE_COLUMN } from "../../../../helpers/cms-dialog";
|
|
13
|
+
import { createPhiThreadsControllerAddress, PHI_THREADS_CONTROLLER_INSTANCE_KEY, PHI_THREADS_CONTROLLER_TYPE, } from "../../../../constants/threads-controller-address";
|
|
14
|
+
import { PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, PHI_CUSTOMER_FILE_OWN_FILE_PARAM, PHI_CUSTOMER_FILE_SUBJECT_PARAM, } from "../../../../constants/customer-file";
|
|
15
|
+
import { PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_IDS } from "../ids";
|
|
16
|
+
import { PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS } from "../customer-file-access";
|
|
17
|
+
import { getPhiAccountingCustomerFilePageLabels } from "./accounting-customer-file-label-set";
|
|
18
|
+
/** The content region of the customer file Page. */
|
|
19
|
+
const SYNTHETIC_CUSTOMER_FILE_REGION_ID = -459;
|
|
20
|
+
/**
|
|
21
|
+
* Staff's customer file on one member (phis-server `GET /api/site/members/{userId}/file`): who they are and
|
|
22
|
+
* how to reach them, where they live, their file and the conversations they are in.
|
|
23
|
+
*
|
|
24
|
+
* A Page of the Accounting Module, beside the product directory, built from what the conversations Page
|
|
25
|
+
* already is and bound by Foundation names only (`constants/customer-file.ts`,
|
|
26
|
+
* `constants/threads-controller-address.ts`): the Table Provider and the Conversations Controller are the
|
|
27
|
+
* conversations Module's, which is active in the Accounting Area by default and has to be for this Page
|
|
28
|
+
* to read anything. The person Table's filter is Core's member picker
|
|
29
|
+
* (the `site-members` options with Core's search, which matches names, e-mail addresses and telephone
|
|
30
|
+
* numbers); its query goes to the addresses and the threads Tables, so one choice fills all three. The
|
|
31
|
+
* threads Table lists the person's file first, and choosing a row is the conversations Page's choreography
|
|
32
|
+
* unchanged: the Conversations Controller makes the selection a thread, the conversation reads it, and its
|
|
33
|
+
* Reply opens Core's Reply Form in a dialog -- with the internal note offered, which is every message of a
|
|
34
|
+
* file anyway.
|
|
35
|
+
*
|
|
36
|
+
* The Page is for the holders of `accounting` (`PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS`), who read every
|
|
37
|
+
* field, the addresses included. A viewer the Area admits without it is told so in the Page and nothing is
|
|
38
|
+
* read for them; a Supporter's file is the Support Module's Page over the same route.
|
|
39
|
+
*/
|
|
40
|
+
export async function buildPhiDefaultAccountingCustomerFilePageTree({ page, runtime, }) {
|
|
41
|
+
const { widgets: widgetIds, overlays: overlayIds, layouts: layoutIds } = PHI_ACCOUNTING_CUSTOMER_FILE_PAGE_IDS;
|
|
42
|
+
const credentials = readPhiServerApiCredentials();
|
|
43
|
+
const labelOptions = {
|
|
44
|
+
apiBaseUrl: credentials.apiBaseUrl,
|
|
45
|
+
internalToken: credentials.internalToken,
|
|
46
|
+
locale: runtime.locale.current,
|
|
47
|
+
};
|
|
48
|
+
const labels = await getPhiAccountingCustomerFilePageLabels(labelOptions);
|
|
49
|
+
const nodes = createPhiCmsPresetNodes(page);
|
|
50
|
+
const scaffold = buildPhiBasePageContentScaffold({ page, regionId: SYNTHETIC_CUSTOMER_FILE_REGION_ID });
|
|
51
|
+
const pageMeta = {
|
|
52
|
+
title: { msgId: 0, source: "Customer file", value: labels.title },
|
|
53
|
+
description: {
|
|
54
|
+
msgId: 0,
|
|
55
|
+
source: "One member of the site: how to reach them, where they are, their file and their conversations.",
|
|
56
|
+
value: labels.description,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
if (!canPhiViewerAccess(runtime.viewer, PHI_ACCOUNTING_CUSTOMER_FILE_ACCESS)) {
|
|
60
|
+
return {
|
|
61
|
+
page: nodes.page({ pageType: PhiCmsPageType.Standard }),
|
|
62
|
+
pageMeta,
|
|
63
|
+
regions: [scaffold.region],
|
|
64
|
+
layoutNodes: [scaffold.layoutNode],
|
|
65
|
+
overlays: [],
|
|
66
|
+
contentWidgets: [nodes.widget({
|
|
67
|
+
id: widgetIds.widgetPerson,
|
|
68
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
69
|
+
typeKey: "simple-text",
|
|
70
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
71
|
+
sortOrder: 0,
|
|
72
|
+
label: labels.title,
|
|
73
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
74
|
+
config: { text: labels.notStaff, tone: "secondary" },
|
|
75
|
+
})],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const controllerAddress = createPhiThreadsControllerAddress();
|
|
79
|
+
const addressesAddress = createPhiSignalAddress("cms", widgetIds.widgetAddresses);
|
|
80
|
+
const threadsAddress = createPhiSignalAddress("cms", widgetIds.widgetThreads);
|
|
81
|
+
const conversationAddress = createPhiSignalAddress("cms", widgetIds.widgetConversation);
|
|
82
|
+
const replyOverlayAddress = createPhiSignalAddress("cms", overlayIds.overlayReply);
|
|
83
|
+
const replyFormAddress = createPhiSignalAddress("cms", widgetIds.widgetReplyForm);
|
|
84
|
+
const route = (routeKey, capabilityId, channel, action, receiver, valueType = "none", valueSchema) => ({
|
|
85
|
+
routeKey,
|
|
86
|
+
capabilityId,
|
|
87
|
+
scope: "page",
|
|
88
|
+
channel,
|
|
89
|
+
action,
|
|
90
|
+
valueType,
|
|
91
|
+
...(valueSchema ? { valueSchema } : {}),
|
|
92
|
+
receiver,
|
|
93
|
+
});
|
|
94
|
+
// The member chosen above, handed on as the query the two lists below read it from.
|
|
95
|
+
const personQueryTo = (routeKey, receiver) => route(routeKey, "queryChange", "query", "change", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery);
|
|
96
|
+
const queryInput = (routeKey, receiver) => route(routeKey, "queryChange", "query", "change", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableQuery);
|
|
97
|
+
const tableAction = (routeKey, capabilityId, receiver) => route(routeKey, capabilityId, "action", "activate", receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableAction);
|
|
98
|
+
const threadRoute = (routeKey, capabilityId, action, receiver) => route(routeKey, capabilityId, "thread", action, receiver, "json", PHI_SIGNAL_VALUE_SCHEMAS.threadSelection);
|
|
99
|
+
const prefix = "accounting-customer-file";
|
|
100
|
+
// What each Table says where its rows would be when the reader chooses themselves (Core refuses that file).
|
|
101
|
+
const ownFile = { [PHI_CUSTOMER_FILE_OWN_FILE_PARAM]: labels.ownFile };
|
|
102
|
+
const replyDialog = nodes.dialog({
|
|
103
|
+
id: overlayIds.overlayReply,
|
|
104
|
+
bodyLayoutNodeId: layoutIds.layoutReply,
|
|
105
|
+
sortOrder: 0,
|
|
106
|
+
label: `${prefix}-reply-modal`,
|
|
107
|
+
config: {
|
|
108
|
+
title: labels.noteLabel,
|
|
109
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
110
|
+
mountPolicy: "remount",
|
|
111
|
+
closeMode: "immediate",
|
|
112
|
+
openActionKey: "reply",
|
|
113
|
+
signalRoutes: {
|
|
114
|
+
listens: [
|
|
115
|
+
tableAction(`${prefix}-reply-open`, "open", replyOverlayAddress),
|
|
116
|
+
route(`${prefix}-reply-close`, "close", "dialog", "close", replyOverlayAddress),
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
commands: {
|
|
121
|
+
footerLayoutNodeId: layoutIds.layoutReplyFooter,
|
|
122
|
+
widgetId: widgetIds.widgetReplyCommands,
|
|
123
|
+
label: labels.noteLabel,
|
|
124
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
125
|
+
config: {
|
|
126
|
+
key: `${prefix}-reply-commands`,
|
|
127
|
+
buttons: [
|
|
128
|
+
{ key: "cancel", emits: [{ capabilityId: "close", value: null }], action: "cancel", icon: "close" },
|
|
129
|
+
{
|
|
130
|
+
key: "submit",
|
|
131
|
+
emits: [{ capabilityId: "submit", value: null }],
|
|
132
|
+
label: labels.replySendLabel,
|
|
133
|
+
variant: "primary",
|
|
134
|
+
icon: "antd:send-outlined",
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
signalRoutes: {
|
|
138
|
+
emits: [
|
|
139
|
+
route(`${prefix}-reply-cancel`, "close", "dialog", "close", replyOverlayAddress),
|
|
140
|
+
route(`${prefix}-reply-commands-submit`, "submit", "submit", "activate", replyFormAddress),
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
const addressColumns = [
|
|
147
|
+
{ key: "name", fieldKey: "name", title: labels.addresses.columns.name, sizing: { mode: "content" } },
|
|
148
|
+
{ key: "lines", fieldKey: "lines", title: labels.addresses.columns.address, sizing: { mode: "fill" } },
|
|
149
|
+
{
|
|
150
|
+
key: "purposes",
|
|
151
|
+
fieldKey: "purposes",
|
|
152
|
+
title: labels.addresses.columns.purposes,
|
|
153
|
+
renderer: "tags",
|
|
154
|
+
sizing: { mode: "content" },
|
|
155
|
+
valueMap: labels.addresses.purposes,
|
|
156
|
+
tagColorMap: { billing: "default", shipping: "default", defaultBilling: "processing", defaultShipping: "processing" },
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
return {
|
|
160
|
+
page: nodes.page({ pageType: PhiCmsPageType.Standard }),
|
|
161
|
+
pageMeta,
|
|
162
|
+
// The Conversations Controller, configured as on the conversations Page: the thread to the reader, and
|
|
163
|
+
// the list read again after a note landed.
|
|
164
|
+
controllerSettings: [{
|
|
165
|
+
type: PHI_THREADS_CONTROLLER_TYPE,
|
|
166
|
+
instanceKey: PHI_THREADS_CONTROLLER_INSTANCE_KEY,
|
|
167
|
+
mountScope: "page",
|
|
168
|
+
config: {
|
|
169
|
+
signalRoutes: {
|
|
170
|
+
emits: [
|
|
171
|
+
threadRoute(`${prefix}-controller-thread`, "threadChange", "change", conversationAddress),
|
|
172
|
+
threadRoute(`${prefix}-controller-thread-reload`, "threadReload", "reload", conversationAddress),
|
|
173
|
+
route(`${prefix}-controller-reload-threads`, "reload", "reload", "activate", threadsAddress),
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
}],
|
|
178
|
+
overlays: [replyDialog.overlay],
|
|
179
|
+
regions: [scaffold.region],
|
|
180
|
+
layoutNodes: [scaffold.layoutNode, ...replyDialog.layouts],
|
|
181
|
+
contentWidgets: [
|
|
182
|
+
nodes.widget({
|
|
183
|
+
id: widgetIds.widgetPerson,
|
|
184
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
185
|
+
typeKey: "table",
|
|
186
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
187
|
+
sortOrder: 0,
|
|
188
|
+
// The Module's Label Set, translated already.
|
|
189
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
190
|
+
label: labels.person.label,
|
|
191
|
+
config: {
|
|
192
|
+
source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.person, params: ownFile },
|
|
193
|
+
presentation: {
|
|
194
|
+
title: labels.person.title,
|
|
195
|
+
controlSize: "small",
|
|
196
|
+
layout: { mode: "auto", overflowX: "auto" },
|
|
197
|
+
columns: [
|
|
198
|
+
{ key: "displayName", fieldKey: "displayName", title: labels.person.columns.displayName, sizing: { mode: "content" } },
|
|
199
|
+
{ key: "fullName", fieldKey: "fullName", title: labels.person.columns.name, sizing: { mode: "content" } },
|
|
200
|
+
{ key: "companyName", fieldKey: "companyName", title: labels.person.columns.company, sizing: { mode: "content" } },
|
|
201
|
+
{ key: "email", fieldKey: "email", title: labels.person.columns.email, renderer: "email", sizing: { mode: "fill" } },
|
|
202
|
+
{ key: "phone", fieldKey: "phone", title: labels.person.columns.phone, sizing: { mode: "content" } },
|
|
203
|
+
{ key: "mobile", fieldKey: "mobile", title: labels.person.columns.mobile, sizing: { mode: "content" } },
|
|
204
|
+
],
|
|
205
|
+
emptyState: { title: labels.person.empty },
|
|
206
|
+
},
|
|
207
|
+
features: {
|
|
208
|
+
// The two lists below take this query, so it pages as they do.
|
|
209
|
+
pagination: { enabled: false, pageSize: 25 },
|
|
210
|
+
sorting: { mode: "none" },
|
|
211
|
+
search: { enabled: false },
|
|
212
|
+
tools: { mode: "self-contained", reset: false, reload: true },
|
|
213
|
+
filters: [{
|
|
214
|
+
key: "userId",
|
|
215
|
+
type: "select",
|
|
216
|
+
label: labels.person.picker,
|
|
217
|
+
description: labels.person.pickerHint,
|
|
218
|
+
optionsProvider: {
|
|
219
|
+
providerKey: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.siteMembers,
|
|
220
|
+
loadMode: "server",
|
|
221
|
+
search: { enabled: true, minChars: 2 },
|
|
222
|
+
},
|
|
223
|
+
}],
|
|
224
|
+
},
|
|
225
|
+
signalRoutes: {
|
|
226
|
+
emits: [
|
|
227
|
+
personQueryTo(`${prefix}-person-to-addresses`, addressesAddress),
|
|
228
|
+
personQueryTo(`${prefix}-person-to-threads`, threadsAddress),
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
}),
|
|
233
|
+
nodes.widget({
|
|
234
|
+
id: widgetIds.widgetAddresses,
|
|
235
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
236
|
+
typeKey: "table",
|
|
237
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 1,
|
|
238
|
+
sortOrder: 1,
|
|
239
|
+
// The Module's Label Set, translated already.
|
|
240
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
241
|
+
label: labels.addresses.label,
|
|
242
|
+
config: {
|
|
243
|
+
source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.addresses, params: ownFile },
|
|
244
|
+
presentation: {
|
|
245
|
+
title: labels.addresses.title,
|
|
246
|
+
controlSize: "small",
|
|
247
|
+
layout: { mode: "auto", overflowX: "auto" },
|
|
248
|
+
columns: addressColumns,
|
|
249
|
+
emptyState: { title: labels.addresses.empty },
|
|
250
|
+
},
|
|
251
|
+
features: {
|
|
252
|
+
pagination: { enabled: false },
|
|
253
|
+
sorting: { mode: "none" },
|
|
254
|
+
search: { enabled: false },
|
|
255
|
+
tools: { mode: "self-contained", reset: false, reload: false },
|
|
256
|
+
},
|
|
257
|
+
signalRoutes: { listens: [queryInput(`${prefix}-addresses-query`, addressesAddress)] },
|
|
258
|
+
},
|
|
259
|
+
}),
|
|
260
|
+
nodes.widget({
|
|
261
|
+
id: widgetIds.widgetThreads,
|
|
262
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
263
|
+
typeKey: "table",
|
|
264
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 2,
|
|
265
|
+
sortOrder: 2,
|
|
266
|
+
// The Module's Label Set, translated already.
|
|
267
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
268
|
+
label: labels.threads.label,
|
|
269
|
+
config: {
|
|
270
|
+
// The file's own subject, which Core does not answer: in the reader's language, from this Page.
|
|
271
|
+
source: { providerKey: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table, resourceKey: RESOURCES.threads, params: { ...ownFile, [PHI_CUSTOMER_FILE_SUBJECT_PARAM]: labels.fileSubject } },
|
|
272
|
+
presentation: {
|
|
273
|
+
title: labels.threads.title,
|
|
274
|
+
controlSize: "small",
|
|
275
|
+
layout: { mode: "fixed", overflowX: "auto" },
|
|
276
|
+
columns: [
|
|
277
|
+
{ key: "subject", fieldKey: "subject", title: labels.threads.columns.subject, ellipsis: true, sizing: { mode: "fill", minWidth: 200 } },
|
|
278
|
+
{
|
|
279
|
+
key: "kind",
|
|
280
|
+
fieldKey: "kind",
|
|
281
|
+
title: labels.threads.columns.kind,
|
|
282
|
+
sizing: { mode: "fixed", width: 140 },
|
|
283
|
+
valueMap: {
|
|
284
|
+
[String(PhisThreadKind.Direct)]: labels.threads.kinds.direct,
|
|
285
|
+
[String(PhisThreadKind.Group)]: labels.threads.kinds.group,
|
|
286
|
+
[String(PhisThreadKind.CrossGroup)]: labels.threads.kinds.crossGroup,
|
|
287
|
+
[String(PhisThreadKind.Support)]: labels.threads.kinds.support,
|
|
288
|
+
[String(PhisThreadKind.File)]: labels.threads.kinds.file,
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: "state",
|
|
293
|
+
fieldKey: "state",
|
|
294
|
+
title: labels.threads.columns.state,
|
|
295
|
+
renderer: "badge",
|
|
296
|
+
sizing: { mode: "fixed", width: 120 },
|
|
297
|
+
valueMap: labels.threads.states,
|
|
298
|
+
tagColorMap: { unread: "processing", open: "default", archived: "default", locked: "warning" },
|
|
299
|
+
},
|
|
300
|
+
{ key: "latestMessageAt", fieldKey: "latestMessageAt", title: labels.threads.columns.activity, renderer: "datetime", sizing: { mode: "fixed", width: 180 } },
|
|
301
|
+
],
|
|
302
|
+
emptyState: { title: labels.threads.empty },
|
|
303
|
+
},
|
|
304
|
+
features: {
|
|
305
|
+
rowSelection: { mode: "single", preserveSelectedRowIdentities: true },
|
|
306
|
+
pagination: { enabled: true, pageSize: 25 },
|
|
307
|
+
sorting: { mode: "none" },
|
|
308
|
+
search: { enabled: false },
|
|
309
|
+
tools: { mode: "self-contained", reset: false, reload: true },
|
|
310
|
+
},
|
|
311
|
+
signalRoutes: {
|
|
312
|
+
emits: [
|
|
313
|
+
route(`${prefix}-threads-selection`, "selectionChange", "selection", "change", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.tableSelection),
|
|
314
|
+
// Asking for the condition state is what mounts the Controller, which is kept on demand.
|
|
315
|
+
route(`${prefix}-threads-condition`, "conditionStateRequest", "condition", "reload", controllerAddress),
|
|
316
|
+
],
|
|
317
|
+
listens: [
|
|
318
|
+
queryInput(`${prefix}-threads-query`, threadsAddress),
|
|
319
|
+
route(`${prefix}-threads-reload`, "reload", "reload", "activate", threadsAddress),
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
}),
|
|
324
|
+
nodes.widget({
|
|
325
|
+
id: widgetIds.widgetConversation,
|
|
326
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
327
|
+
typeKey: "thread-conversation",
|
|
328
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX + 3,
|
|
329
|
+
sortOrder: 3,
|
|
330
|
+
label: labels.title,
|
|
331
|
+
config: {
|
|
332
|
+
reply: true,
|
|
333
|
+
signalRoutes: {
|
|
334
|
+
emits: [
|
|
335
|
+
// A conversation opened from `?thread=` reaches the Controller, which knows it is open.
|
|
336
|
+
route(`${prefix}-conversation-opened`, "opened", "opened", "change", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.threadSelection),
|
|
337
|
+
// Reply: one announcement, two listeners -- the dialog opens on it, the Form reads its row.
|
|
338
|
+
tableAction(`${prefix}-conversation-reply`, "reply", replyOverlayAddress),
|
|
339
|
+
tableAction(`${prefix}-conversation-reply-record`, "reply", replyFormAddress),
|
|
340
|
+
],
|
|
341
|
+
listens: [
|
|
342
|
+
threadRoute(`${prefix}-conversation-select`, "select", "change", conversationAddress),
|
|
343
|
+
threadRoute(`${prefix}-conversation-reload`, "reload", "reload", conversationAddress),
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
}),
|
|
348
|
+
/*
|
|
349
|
+
* Core's Reply Form, reading its thread from the row the conversation's Reply named, as on the
|
|
350
|
+
* conversations Page. Staff may mark a note internal; in the file every message is internal anyway.
|
|
351
|
+
*/
|
|
352
|
+
nodes.widget({
|
|
353
|
+
id: widgetIds.widgetReplyForm,
|
|
354
|
+
parentLayoutNodeId: layoutIds.layoutReply,
|
|
355
|
+
typeKey: "form",
|
|
356
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
357
|
+
label: labels.noteLabel,
|
|
358
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
359
|
+
config: {
|
|
360
|
+
formId: PHI_SHARED_FORM_IDS.threadReply,
|
|
361
|
+
formConfig: { initialValues: { internalAllowed: true } },
|
|
362
|
+
execution: { mode: "handler" },
|
|
363
|
+
source: { providerKey: PHI_THREAD_LIBRARY_DATA_PROVIDER_KEYS.table, resourceKey: "inbox" },
|
|
364
|
+
openActionKey: "reply",
|
|
365
|
+
feedback: { mode: "message" },
|
|
366
|
+
signalRoutes: {
|
|
367
|
+
emits: [
|
|
368
|
+
route(`${prefix}-reply-success`, "submitSuccess", "submit", "activate", controllerAddress, "json", PHI_SIGNAL_VALUE_SCHEMAS.formResult),
|
|
369
|
+
route(`${prefix}-reply-success-close`, "submitSuccess", "dialog", "close", replyOverlayAddress),
|
|
370
|
+
],
|
|
371
|
+
listens: [
|
|
372
|
+
route(`${prefix}-reply-submit`, "submit", "submit", "activate", replyFormAddress),
|
|
373
|
+
tableAction(`${prefix}-reply-record-open`, "recordOpen", replyFormAddress),
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
}),
|
|
378
|
+
...replyDialog.widgets,
|
|
379
|
+
],
|
|
380
|
+
};
|
|
381
|
+
}
|
package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js
CHANGED
|
@@ -212,6 +212,8 @@ export async function buildPhiDefaultAccountingProductsPageTree({ page, runtime,
|
|
|
212
212
|
typeKey: "table",
|
|
213
213
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
214
214
|
sortOrder: 0,
|
|
215
|
+
// The Module's Label Set, translated already.
|
|
216
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
215
217
|
label: labels.widgetLabel,
|
|
216
218
|
config: {
|
|
217
219
|
source: {
|
|
@@ -351,6 +353,8 @@ export async function buildPhiDefaultAccountingProductsPageTree({ page, runtime,
|
|
|
351
353
|
parentLayoutNodeId: PHI_ACCOUNTING_PRODUCTS_PAGE_LAYOUT_IDS.layoutTerms,
|
|
352
354
|
typeKey: "record",
|
|
353
355
|
slotIndex: 1,
|
|
356
|
+
// The Module's Label Set, translated already.
|
|
357
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
354
358
|
label: "accounting product terms record",
|
|
355
359
|
config: {
|
|
356
360
|
source: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PHI_APP_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS: readonly [{
|
|
2
|
+
readonly key: `${string}/${string}`;
|
|
3
|
+
readonly ownerModuleId: "@phis/ui/modules/app";
|
|
4
|
+
readonly loadLive: () => Promise<import("react").ComponentType<{
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
}>>;
|
|
7
|
+
}];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_APP_ADDRESSES_DATA_PROVIDER_KEY, PHI_APP_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
export const PHI_APP_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
|
|
4
|
+
{
|
|
5
|
+
key: PHI_APP_ADDRESSES_DATA_PROVIDER_KEY,
|
|
6
|
+
ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
|
|
7
|
+
loadLive: async () => (await import("./services/addresses-table")).PhiAppAddressesTableProviderClient,
|
|
8
|
+
},
|
|
9
|
+
];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The account's own address book on this Site (`users:v1`, phis-server SERVER_ADDONS.md): the current
|
|
3
|
+
* addresses only, never a `Superseded` or `Removed` one.
|
|
4
|
+
*
|
|
5
|
+
* `live` and `authoringMode: "none"`: they are the signed-in person's, and nobody composing a Page has any
|
|
6
|
+
* business reading them. An address never changes in Core -- a change is a new version that replaces it --
|
|
7
|
+
* so the row's id moves with every edit, which is why every write reads the view again. Adding and editing
|
|
8
|
+
* are the Module's two Forms; the Table runs removal and the two defaults itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
11
|
+
key: `${string}/${string}`;
|
|
12
|
+
ownerModuleId: "@phis/ui/modules/app";
|
|
13
|
+
kind: "table";
|
|
14
|
+
executionMode: "live";
|
|
15
|
+
authoringMode: "none";
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
resources: {
|
|
19
|
+
resourceKey: string;
|
|
20
|
+
title: string;
|
|
21
|
+
rowIdentityPath: string;
|
|
22
|
+
recordRead: true;
|
|
23
|
+
fields: ({
|
|
24
|
+
key: string;
|
|
25
|
+
title: string;
|
|
26
|
+
type: "number";
|
|
27
|
+
required: true;
|
|
28
|
+
options?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
key: string;
|
|
31
|
+
title: string;
|
|
32
|
+
type: "string";
|
|
33
|
+
required?: undefined;
|
|
34
|
+
options?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
key: string;
|
|
37
|
+
title: string;
|
|
38
|
+
type: "enum[]";
|
|
39
|
+
options: {
|
|
40
|
+
value: "billing" | "shipping" | "defaultBilling" | "defaultShipping";
|
|
41
|
+
label: "billing" | "shipping" | "defaultBilling" | "defaultShipping";
|
|
42
|
+
}[];
|
|
43
|
+
required?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
key: string;
|
|
46
|
+
title: string;
|
|
47
|
+
type: "boolean";
|
|
48
|
+
required?: undefined;
|
|
49
|
+
options?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
key: string;
|
|
52
|
+
title: string;
|
|
53
|
+
type: "datetime";
|
|
54
|
+
required?: undefined;
|
|
55
|
+
options?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
key: string;
|
|
58
|
+
title: string;
|
|
59
|
+
type: "json";
|
|
60
|
+
required?: undefined;
|
|
61
|
+
options?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
key: string;
|
|
64
|
+
title: string;
|
|
65
|
+
type: "number";
|
|
66
|
+
required?: undefined;
|
|
67
|
+
options?: undefined;
|
|
68
|
+
})[];
|
|
69
|
+
query: {
|
|
70
|
+
search: false;
|
|
71
|
+
filterFields: never[];
|
|
72
|
+
sorting: "none";
|
|
73
|
+
pagination: "none";
|
|
74
|
+
};
|
|
75
|
+
actions: ({
|
|
76
|
+
key: string;
|
|
77
|
+
title: string;
|
|
78
|
+
scope: "row";
|
|
79
|
+
intent: "write";
|
|
80
|
+
disabledWhen: {
|
|
81
|
+
match: "any";
|
|
82
|
+
conditions: {
|
|
83
|
+
source: "row";
|
|
84
|
+
valuePath: string;
|
|
85
|
+
operator: "truthy";
|
|
86
|
+
}[];
|
|
87
|
+
};
|
|
88
|
+
confirmation?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
key: string;
|
|
91
|
+
title: string;
|
|
92
|
+
scope: "row";
|
|
93
|
+
intent: "destructive";
|
|
94
|
+
confirmation: "required";
|
|
95
|
+
disabledWhen?: undefined;
|
|
96
|
+
})[];
|
|
97
|
+
}[];
|
|
98
|
+
}[];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PHI_APP_ADDRESSES_DATA_PROVIDER_KEY, PHI_APP_ADDRESSES_RESOURCE_KEY, PHI_APP_RUNTIME_MODULE_ID, } from "./ids";
|
|
2
|
+
/** What an address is for, as the Table's tags name it; the bits are `PhisSiteAddressFlags`. */
|
|
3
|
+
const PHI_APP_ADDRESS_PURPOSES = ["billing", "shipping", "defaultBilling", "defaultShipping"];
|
|
4
|
+
/**
|
|
5
|
+
* The account's own address book on this Site (`users:v1`, phis-server SERVER_ADDONS.md): the current
|
|
6
|
+
* addresses only, never a `Superseded` or `Removed` one.
|
|
7
|
+
*
|
|
8
|
+
* `live` and `authoringMode: "none"`: they are the signed-in person's, and nobody composing a Page has any
|
|
9
|
+
* business reading them. An address never changes in Core -- a change is a new version that replaces it --
|
|
10
|
+
* so the row's id moves with every edit, which is why every write reads the view again. Adding and editing
|
|
11
|
+
* are the Module's two Forms; the Table runs removal and the two defaults itself.
|
|
12
|
+
*/
|
|
13
|
+
export const PHI_APP_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
14
|
+
{
|
|
15
|
+
key: PHI_APP_ADDRESSES_DATA_PROVIDER_KEY,
|
|
16
|
+
ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
|
|
17
|
+
kind: "table",
|
|
18
|
+
executionMode: "live",
|
|
19
|
+
authoringMode: "none",
|
|
20
|
+
title: "My addresses",
|
|
21
|
+
description: "The signed-in person's current billing and shipping addresses on this Site.",
|
|
22
|
+
resources: [
|
|
23
|
+
{
|
|
24
|
+
resourceKey: PHI_APP_ADDRESSES_RESOURCE_KEY,
|
|
25
|
+
title: "Addresses",
|
|
26
|
+
rowIdentityPath: "id",
|
|
27
|
+
recordRead: true,
|
|
28
|
+
fields: [
|
|
29
|
+
{ key: "id", title: "ID", type: "number", required: true },
|
|
30
|
+
{ key: "name", title: "Name", type: "string" },
|
|
31
|
+
{ key: "companyName", title: "Company", type: "string" },
|
|
32
|
+
{ key: "line1", title: "Address line 1", type: "string" },
|
|
33
|
+
{ key: "line2", title: "Address line 2", type: "string" },
|
|
34
|
+
{ key: "postalCode", title: "Postal code", type: "string" },
|
|
35
|
+
{ key: "city", title: "City", type: "string" },
|
|
36
|
+
{ key: "region", title: "Region", type: "string" },
|
|
37
|
+
{ key: "country", title: "Country", type: "string" },
|
|
38
|
+
// The parts after the name on one line, for a list that is read rather than edited.
|
|
39
|
+
{ key: "lines", title: "Address", type: "string" },
|
|
40
|
+
{
|
|
41
|
+
key: "purposes",
|
|
42
|
+
title: "Purposes",
|
|
43
|
+
type: "enum[]",
|
|
44
|
+
options: PHI_APP_ADDRESS_PURPOSES.map((value) => ({ value, label: value })),
|
|
45
|
+
},
|
|
46
|
+
{ key: "billing", title: "Billing", type: "boolean" },
|
|
47
|
+
{ key: "shipping", title: "Shipping", type: "boolean" },
|
|
48
|
+
{ key: "defaultBilling", title: "Default billing", type: "boolean" },
|
|
49
|
+
{ key: "defaultShipping", title: "Default shipping", type: "boolean" },
|
|
50
|
+
{ key: "createdAt", title: "Added", type: "datetime" },
|
|
51
|
+
// What the edit Form opens on: the parts as the `address` field holds them, the purposes as `flags`.
|
|
52
|
+
{ key: "address", title: "Address parts", type: "json" },
|
|
53
|
+
{ key: "flags", title: "Flags", type: "number" },
|
|
54
|
+
],
|
|
55
|
+
query: { search: false, filterFields: [], sorting: "none", pagination: "none" },
|
|
56
|
+
actions: [
|
|
57
|
+
{
|
|
58
|
+
key: "makeDefaultBilling",
|
|
59
|
+
title: "Use for billing by default",
|
|
60
|
+
scope: "row",
|
|
61
|
+
intent: "write",
|
|
62
|
+
disabledWhen: { match: "any", conditions: [
|
|
63
|
+
{ source: "row", valuePath: "defaultBilling", operator: "truthy" },
|
|
64
|
+
] },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "makeDefaultShipping",
|
|
68
|
+
title: "Use for shipping by default",
|
|
69
|
+
scope: "row",
|
|
70
|
+
intent: "write",
|
|
71
|
+
disabledWhen: { match: "any", conditions: [
|
|
72
|
+
{ source: "row", valuePath: "defaultShipping", operator: "truthy" },
|
|
73
|
+
] },
|
|
74
|
+
},
|
|
75
|
+
{ key: "delete", title: "Remove", scope: "row", intent: "destructive", confirmation: "required" },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
];
|