@sap/ux-ui5-tooling 1.20.4 → 1.22.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/CHANGELOG.md +60 -0
- package/dist/adp-tooling/templates/cf/_gitignore +6 -0
- package/dist/adp-tooling/templates/cf/approuter/package.json +13 -0
- package/dist/adp-tooling/templates/cf/approuter/xs-app.json +15 -0
- package/dist/adp-tooling/templates/cf/i18n/i18n.properties +3 -0
- package/dist/adp-tooling/templates/cf/package.json +35 -0
- package/dist/adp-tooling/templates/cf/ui5.yaml +5 -0
- package/dist/adp-tooling/templates/cf/xs-security.json +7 -0
- package/dist/adp-tooling/templates/changes/annotation.xml +18 -0
- package/dist/adp-tooling/templates/project/gitignore.tmpl +5 -0
- package/dist/adp-tooling/templates/project/package.json +31 -0
- package/dist/adp-tooling/templates/project/ui5.yaml +6 -0
- package/dist/adp-tooling/templates/project/webapp/i18n/i18n.properties +6 -0
- package/dist/adp-tooling/templates/project/webapp/manifest.appdescr_variant +10 -0
- package/dist/adp-tooling/templates/rta/common/analytical-custom-column.xml +25 -0
- package/dist/adp-tooling/templates/rta/common/custom-action.xml +8 -0
- package/dist/adp-tooling/templates/rta/common/grid-tree-custom-column.xml +22 -0
- package/dist/adp-tooling/templates/rta/common/header-field.xml +13 -0
- package/dist/adp-tooling/templates/rta/common/op-custom-section.xml +20 -0
- package/dist/adp-tooling/templates/rta/common/v4-table-action.xml +8 -0
- package/dist/adp-tooling/templates/rta/controller.ejs +80 -0
- package/dist/adp-tooling/templates/rta/fragment.xml +7 -0
- package/dist/adp-tooling/templates/rta/ts-controller.ejs +18 -0
- package/dist/adp-tooling/templates/rta/v2/m-table-custom-column-cell.xml +7 -0
- package/dist/adp-tooling/templates/rta/v2/m-table-custom-column.xml +18 -0
- package/dist/adp-tooling/templates/rta/v4/custom-section.xml +12 -0
- package/dist/adp-tooling/templates/rta/v4/mdc-custom-column-config.xml +6 -0
- package/dist/adp-tooling/templates/rta/v4/mdc-custom-column.xml +11 -0
- package/dist/adp-tooling/templates/typescript/tsconfig.json +19 -0
- package/dist/cli/index.js +17761 -11603
- package/dist/control-property-editor/app.css +2 -0
- package/dist/control-property-editor/app.js +175 -0
- package/dist/livereload-js/livereload.js +3795 -0
- package/dist/middlewares/fiori-tools-appreload.js +44007 -41669
- package/dist/middlewares/fiori-tools-preview.js +66889 -4176
- package/dist/middlewares/fiori-tools-proxy.js +38049 -5767
- package/dist/middlewares/fiori-tools-servestatic.js +32893 -347
- package/dist/preview-middleware/dist/client/adp/add-fragment.js +48 -0
- package/dist/preview-middleware/dist/client/adp/add-fragment.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/api-handler.js +165 -0
- package/dist/preview-middleware/dist/client/adp/api-handler.ts +191 -0
- package/dist/preview-middleware/dist/client/adp/command-executor.js +100 -0
- package/dist/preview-middleware/dist/client/adp/command-executor.ts +105 -0
- package/dist/preview-middleware/dist/client/adp/control-utils.js +46 -0
- package/dist/preview-middleware/dist/client/adp/control-utils.ts +48 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.js +198 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.ts +232 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.js +223 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.ts +257 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.js +195 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.ts +264 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.js +146 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.ts +209 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.js +232 -0
- package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +306 -0
- package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.js +187 -0
- package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.ts +254 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.js +330 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.ts +408 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.js +160 -0
- package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.ts +195 -0
- package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.js +68 -0
- package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.ts +86 -0
- package/dist/preview-middleware/dist/client/adp/controllers/types.js +2 -0
- package/dist/preview-middleware/dist/client/adp/controllers/types.ts +10 -0
- package/dist/preview-middleware/dist/client/adp/dialog-factory.js +151 -0
- package/dist/preview-middleware/dist/client/adp/dialog-factory.ts +210 -0
- package/dist/preview-middleware/dist/client/adp/extend-controller.js +48 -0
- package/dist/preview-middleware/dist/client/adp/extend-controller.ts +49 -0
- package/dist/preview-middleware/dist/client/adp/extension-point.js +83 -0
- package/dist/preview-middleware/dist/client/adp/extension-point.ts +116 -0
- package/dist/preview-middleware/dist/client/adp/init-dialogs.js +142 -0
- package/dist/preview-middleware/dist/client/adp/init-dialogs.ts +178 -0
- package/dist/preview-middleware/dist/client/adp/init.js +111 -0
- package/dist/preview-middleware/dist/client/adp/init.ts +92 -0
- package/dist/preview-middleware/dist/client/adp/ovp-window-functions.js +130 -0
- package/dist/preview-middleware/dist/client/adp/ovp-window-functions.ts +171 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +97 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +140 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.ts +92 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.js +171 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +174 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.js +56 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.ts +56 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.js +41 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.js +69 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.ts +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.js +25 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.ts +7 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.js +2 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.ts +19 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +82 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +87 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +69 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +103 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +105 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.js +111 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +110 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +108 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +141 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +80 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +93 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +79 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +102 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +98 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +61 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +77 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +102 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +116 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.js +79 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.ts +121 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.js +138 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.ts +134 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +140 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +181 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +90 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +97 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.js +81 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +98 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +129 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +149 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +142 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +178 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +83 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +96 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +58 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +70 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +55 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +61 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +73 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +91 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +88 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.js +62 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.ts +86 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.js +158 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.ts +175 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/load.js +46 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/load.ts +23 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.js +64 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.ts +71 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.ts +51 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/supported-ui5versions.md +40 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.js +372 -0
- package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.ts +433 -0
- package/dist/preview-middleware/dist/client/adp/sync-views-utils.js +123 -0
- package/dist/preview-middleware/dist/client/adp/sync-views-utils.ts +90 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddAction.fragment.xml +49 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddCustomFragment.fragment.xml +48 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddFragment.fragment.xml +83 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddSubpage.fragment.xml +73 -0
- package/dist/preview-middleware/dist/client/adp/ui/AddTableColumnFragments.fragment.xml +63 -0
- package/dist/preview-middleware/dist/client/adp/ui/ControllerExtension.fragment.xml +63 -0
- package/dist/preview-middleware/dist/client/adp/ui/ExtensionPoint.fragment.xml +61 -0
- package/dist/preview-middleware/dist/client/adp/ui/FileExistsDialog.fragment.xml +43 -0
- package/dist/preview-middleware/dist/client/adp/utils.js +199 -0
- package/dist/preview-middleware/dist/client/adp/utils.ts +200 -0
- package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.js +85 -0
- package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +107 -0
- package/dist/preview-middleware/dist/client/cpe/changes/flex-change.js +66 -0
- package/dist/preview-middleware/dist/client/cpe/changes/flex-change.ts +66 -0
- package/dist/preview-middleware/dist/client/cpe/changes/generic-change.js +321 -0
- package/dist/preview-middleware/dist/client/cpe/changes/generic-change.ts +462 -0
- package/dist/preview-middleware/dist/client/cpe/changes/index.js +12 -0
- package/dist/preview-middleware/dist/client/cpe/changes/index.ts +1 -0
- package/dist/preview-middleware/dist/client/cpe/changes/service.js +527 -0
- package/dist/preview-middleware/dist/client/cpe/changes/service.ts +595 -0
- package/dist/preview-middleware/dist/client/cpe/changes/validator.js +41 -0
- package/dist/preview-middleware/dist/client/cpe/changes/validator.ts +35 -0
- package/dist/preview-middleware/dist/client/cpe/communication-service.js +44 -0
- package/dist/preview-middleware/dist/client/cpe/communication-service.ts +41 -0
- package/dist/preview-middleware/dist/client/cpe/connector-service.js +88 -0
- package/dist/preview-middleware/dist/client/cpe/connector-service.ts +74 -0
- package/dist/preview-middleware/dist/client/cpe/context-menu-service.js +90 -0
- package/dist/preview-middleware/dist/client/cpe/context-menu-service.ts +77 -0
- package/dist/preview-middleware/dist/client/cpe/control-data.js +366 -0
- package/dist/preview-middleware/dist/client/cpe/control-data.ts +400 -0
- package/dist/preview-middleware/dist/client/cpe/documentation.js +191 -0
- package/dist/preview-middleware/dist/client/cpe/documentation.ts +187 -0
- package/dist/preview-middleware/dist/client/cpe/feature-service.js +39 -0
- package/dist/preview-middleware/dist/client/cpe/feature-service.ts +25 -0
- package/dist/preview-middleware/dist/client/cpe/init.js +92 -0
- package/dist/preview-middleware/dist/client/cpe/init.ts +114 -0
- package/dist/preview-middleware/dist/client/cpe/logger.js +32 -0
- package/dist/preview-middleware/dist/client/cpe/logger.ts +24 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.js +136 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.ts +160 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.js +63 -0
- package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.ts +52 -0
- package/dist/preview-middleware/dist/client/cpe/outline/editable.js +38 -0
- package/dist/preview-middleware/dist/client/cpe/outline/editable.ts +30 -0
- package/dist/preview-middleware/dist/client/cpe/outline/nodes.js +212 -0
- package/dist/preview-middleware/dist/client/cpe/outline/nodes.ts +236 -0
- package/dist/preview-middleware/dist/client/cpe/outline/service.js +62 -0
- package/dist/preview-middleware/dist/client/cpe/outline/service.ts +66 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.js +161 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.ts +184 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.js +145 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.ts +157 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.js +94 -0
- package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.ts +113 -0
- package/dist/preview-middleware/dist/client/cpe/rta-service.js +94 -0
- package/dist/preview-middleware/dist/client/cpe/rta-service.ts +86 -0
- package/dist/preview-middleware/dist/client/cpe/selection.js +249 -0
- package/dist/preview-middleware/dist/client/cpe/selection.ts +267 -0
- package/dist/preview-middleware/dist/client/cpe/ui5-utils.js +35 -0
- package/dist/preview-middleware/dist/client/cpe/ui5-utils.ts +28 -0
- package/dist/preview-middleware/dist/client/cpe/utils.js +113 -0
- package/dist/preview-middleware/dist/client/cpe/utils.ts +162 -0
- package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.js +97 -0
- package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.ts +101 -0
- package/dist/preview-middleware/dist/client/flp/common.js +30 -0
- package/dist/preview-middleware/dist/client/flp/common.ts +28 -0
- package/dist/preview-middleware/dist/client/flp/enableFakeConnector.js +92 -0
- package/dist/preview-middleware/dist/client/flp/enableFakeConnector.ts +113 -0
- package/dist/preview-middleware/dist/client/flp/homepage/Component.js +16 -0
- package/dist/preview-middleware/dist/client/flp/homepage/Component.ts +10 -0
- package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.js +54 -0
- package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.ts +41 -0
- package/dist/preview-middleware/dist/client/flp/homepage/css/style.css +3 -0
- package/dist/preview-middleware/dist/client/flp/homepage/manifest.json +41 -0
- package/dist/preview-middleware/dist/client/flp/homepage/view/MyHome.view.xml +18 -0
- package/dist/preview-middleware/dist/client/flp/init.js +418 -0
- package/dist/preview-middleware/dist/client/flp/init.ts +448 -0
- package/dist/preview-middleware/dist/client/flp/initCdm.js +117 -0
- package/dist/preview-middleware/dist/client/flp/initCdm.ts +111 -0
- package/dist/preview-middleware/dist/client/flp/initConnectors.js +31 -0
- package/dist/preview-middleware/dist/client/flp/initConnectors.ts +20 -0
- package/dist/preview-middleware/dist/client/flp/initRta.js +180 -0
- package/dist/preview-middleware/dist/client/flp/initRta.ts +194 -0
- package/dist/preview-middleware/dist/client/i18n.js +56 -0
- package/dist/preview-middleware/dist/client/i18n.ts +49 -0
- package/dist/preview-middleware/dist/client/manifest.json +8 -0
- package/dist/preview-middleware/dist/client/messagebundle.properties +143 -0
- package/dist/preview-middleware/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +486 -0
- package/dist/preview-middleware/dist/client/utils/additional-change-info.js +69 -0
- package/dist/preview-middleware/dist/client/utils/additional-change-info.ts +73 -0
- package/dist/preview-middleware/dist/client/utils/application.js +34 -0
- package/dist/preview-middleware/dist/client/utils/application.ts +27 -0
- package/dist/preview-middleware/dist/client/utils/core.js +144 -0
- package/dist/preview-middleware/dist/client/utils/core.ts +145 -0
- package/dist/preview-middleware/dist/client/utils/error.js +28 -0
- package/dist/preview-middleware/dist/client/utils/error.ts +18 -0
- package/dist/preview-middleware/dist/client/utils/fe-v2.js +58 -0
- package/dist/preview-middleware/dist/client/utils/fe-v2.ts +61 -0
- package/dist/preview-middleware/dist/client/utils/fe-v4.js +168 -0
- package/dist/preview-middleware/dist/client/utils/fe-v4.ts +186 -0
- package/dist/preview-middleware/dist/client/utils/info-center-message.js +60 -0
- package/dist/preview-middleware/dist/client/utils/info-center-message.ts +60 -0
- package/dist/preview-middleware/dist/client/utils/version.js +126 -0
- package/dist/preview-middleware/dist/client/utils/version.ts +138 -0
- package/dist/preview-middleware/templates/flp/cdm.base.json +47 -0
- package/dist/preview-middleware/templates/flp/cdm.ejs +72 -0
- package/dist/preview-middleware/templates/flp/editor.ejs +28 -0
- package/dist/preview-middleware/templates/flp/sandbox.ejs +88 -0
- package/dist/preview-middleware/templates/flp/sandbox2.ejs +86 -0
- package/dist/preview-middleware/templates/test/qunit.ejs +26 -0
- package/dist/preview-middleware/templates/test/qunit.js +29 -0
- package/dist/preview-middleware/templates/test/testsuite.qunit.ejs +10 -0
- package/dist/preview-middleware/templates/test/testsuite.qunit.js +8 -0
- package/dist/tasks/cf-deploy/index.js +3916 -3521
- package/dist/tasks/deploy/index.js +17204 -11133
- package/package.json +36 -39
- package/prebuilds/keyring.darwin-arm64.node +0 -0
- package/prebuilds/keyring.darwin-x64.node +0 -0
- package/prebuilds/keyring.linux-arm-gnueabihf.node +0 -0
- package/prebuilds/keyring.linux-arm64-gnu.node +0 -0
- package/prebuilds/keyring.linux-arm64-musl.node +0 -0
- package/prebuilds/keyring.linux-ia32-gnu.node +0 -0
- package/prebuilds/keyring.linux-x64-gnu.node +0 -0
- package/prebuilds/keyring.linux-x64-musl.node +0 -0
- package/prebuilds/keyring.win32-arm64-msvc.node +0 -0
- package/prebuilds/keyring.win32-ia32-msvc.node +0 -0
- package/prebuilds/keyring.win32-x64-msvc.node +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../simple-quick-action-base", "../../../utils/version", "../dialog-enablement-validator", "../../api-handler", "../../utils", "../../../utils/fe-v4", "../../../utils/core"], function (OverlayRegistry, ____dialog_factory, ___simple_quick_action_base, _____utils_version, ___dialog_enablement_validator, ____api_handler, ____utils, _____utils_fe_v4, _____utils_core) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
10
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
11
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
12
|
+
const getExistingController = ____api_handler["getExistingController"];
|
|
13
|
+
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
14
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
15
|
+
const isA = _____utils_core["isA"];
|
|
16
|
+
const ADD_PAGE_ACTION = 'add-page-action';
|
|
17
|
+
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageLayout'];
|
|
18
|
+
/**
|
|
19
|
+
* Quick Action for adding a custom page action.
|
|
20
|
+
*/
|
|
21
|
+
class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
22
|
+
constructor(context) {
|
|
23
|
+
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
24
|
+
}
|
|
25
|
+
async initialize() {
|
|
26
|
+
this.pageId = this.context.view.getViewData()?.stableId.split('::').pop();
|
|
27
|
+
const version = await getUi5Version();
|
|
28
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
29
|
+
major: 1,
|
|
30
|
+
minor: 120
|
|
31
|
+
})) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await super.initialize();
|
|
35
|
+
}
|
|
36
|
+
async execute() {
|
|
37
|
+
if (this.control) {
|
|
38
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
39
|
+
const controlInfo = getControllerInfoForControl(this.control);
|
|
40
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
41
|
+
const controllerPath = data.controllerPathFromRoot.replaceAll(/\//g, '.').replace(/\.[^.]+$/, '');
|
|
42
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_ACTION, undefined, {
|
|
43
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION',
|
|
44
|
+
controllerReference: controllerPath ? `.extension.${controllerPath}.<REPLACE_WITH_YOUR_HANDLER_NAME>` : '.extension.<ApplicationId.FolderName.ScriptFilename.methodName>',
|
|
45
|
+
appDescriptor: {
|
|
46
|
+
appComponent: getV4AppComponent(this.context.view),
|
|
47
|
+
appType: 'fe-v4',
|
|
48
|
+
pageId: this.pageId,
|
|
49
|
+
projectId: this.context.flexSettings.projectId
|
|
50
|
+
},
|
|
51
|
+
validateActionId: actionId => {
|
|
52
|
+
const headerActions = [...this.context.changeService.getAllPendingConfigPropertyPath()].filter(path => path.includes('content/header/actions/'));
|
|
53
|
+
const idInPendingChanges = headerActions.length && headerActions.includes(`content/header/actions/${actionId}`);
|
|
54
|
+
if (idInPendingChanges) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (isA('sap.f.DynamicPageTitle', this.control) && this.control.getActions().every(action => !action.getId().endsWith(`CustomAction::${actionId}`))) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (isA('sap.uxap.ObjectPageLayout', this.control) && this.control.getHeaderTitle()?.getActions().every(action => !action.getId().endsWith(`CustomAction::${actionId}`))) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
},
|
|
65
|
+
propertyPath: 'content/header/actions/'
|
|
66
|
+
}, {
|
|
67
|
+
actionName: this.type,
|
|
68
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
var __exports = {
|
|
75
|
+
__esModule: true
|
|
76
|
+
};
|
|
77
|
+
__exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
|
|
78
|
+
__exports.AddPageActionQuickAction = AddPageActionQuickAction;
|
|
79
|
+
return __exports;
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=create-page-action.js.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
2
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
|
+
|
|
4
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
5
|
+
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
6
|
+
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
7
|
+
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
8
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
|
+
import { getExistingController } from '../../api-handler';
|
|
10
|
+
import { getControllerInfoForControl } from '../../utils';
|
|
11
|
+
import { getV4AppComponent } from '../../../utils/fe-v4';
|
|
12
|
+
import { isA } from '../../../utils/core';
|
|
13
|
+
import DynamicPageTitle from 'sap/f/DynamicPageTitle';
|
|
14
|
+
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
15
|
+
import ObjectPageDynamicHeaderTitle from 'sap/uxap/ObjectPageDynamicHeaderTitle';
|
|
16
|
+
|
|
17
|
+
export const ADD_PAGE_ACTION = 'add-page-action';
|
|
18
|
+
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageLayout'];
|
|
19
|
+
interface ViewDataType {
|
|
20
|
+
stableId: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Quick Action for adding a custom page action.
|
|
24
|
+
*/
|
|
25
|
+
export class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition {
|
|
26
|
+
protected pageId: string | undefined;
|
|
27
|
+
constructor(context: QuickActionContext) {
|
|
28
|
+
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [
|
|
29
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async initialize(): Promise<void> {
|
|
34
|
+
this.pageId = (this.context.view.getViewData() as ViewDataType)?.stableId.split('::').pop() as string;
|
|
35
|
+
const version = await getUi5Version();
|
|
36
|
+
if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 120 })) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
await super.initialize();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async execute(): Promise<FlexCommand[]> {
|
|
43
|
+
if (this.control) {
|
|
44
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
45
|
+
const controlInfo = getControllerInfoForControl(this.control);
|
|
46
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
47
|
+
const controllerPath = data.controllerPathFromRoot.replaceAll(/\//g, '.').replace(/\.[^.]+$/, '');
|
|
48
|
+
await DialogFactory.createDialog(
|
|
49
|
+
overlay,
|
|
50
|
+
this.context.rta,
|
|
51
|
+
DialogNames.ADD_ACTION,
|
|
52
|
+
undefined,
|
|
53
|
+
{
|
|
54
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION',
|
|
55
|
+
controllerReference: controllerPath
|
|
56
|
+
? `.extension.${controllerPath}.<REPLACE_WITH_YOUR_HANDLER_NAME>`
|
|
57
|
+
: '.extension.<ApplicationId.FolderName.ScriptFilename.methodName>',
|
|
58
|
+
appDescriptor: {
|
|
59
|
+
appComponent: getV4AppComponent(this.context.view)!,
|
|
60
|
+
appType: 'fe-v4',
|
|
61
|
+
pageId: this.pageId!,
|
|
62
|
+
projectId: this.context.flexSettings.projectId
|
|
63
|
+
},
|
|
64
|
+
validateActionId: (actionId) => {
|
|
65
|
+
const headerActions = [...this.context.changeService.getAllPendingConfigPropertyPath()].filter(
|
|
66
|
+
(path) => path.includes('content/header/actions/')
|
|
67
|
+
);
|
|
68
|
+
const idInPendingChanges =
|
|
69
|
+
headerActions.length && headerActions.includes(`content/header/actions/${actionId}`);
|
|
70
|
+
if (idInPendingChanges) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (
|
|
74
|
+
isA('sap.f.DynamicPageTitle', this.control) &&
|
|
75
|
+
(this.control as DynamicPageTitle)
|
|
76
|
+
.getActions()
|
|
77
|
+
.every((action) => !action.getId().endsWith(`CustomAction::${actionId}`))
|
|
78
|
+
) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (
|
|
82
|
+
isA('sap.uxap.ObjectPageLayout', this.control) &&
|
|
83
|
+
((this.control as ObjectPageLayout).getHeaderTitle() as ObjectPageDynamicHeaderTitle)
|
|
84
|
+
?.getActions()
|
|
85
|
+
.every((action) => !action.getId().endsWith(`CustomAction::${actionId}`))
|
|
86
|
+
) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
},
|
|
91
|
+
propertyPath: 'content/header/actions/'
|
|
92
|
+
},
|
|
93
|
+
{ actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/version", "../dialog-enablement-validator", "../../api-handler", "../../utils", "../../../utils/fe-v4", "../table-quick-action-base", "../control-types", "../../../utils/core", "./utils"], function (OverlayRegistry, ____dialog_factory, _____utils_version, ___dialog_enablement_validator, ____api_handler, ____utils, _____utils_fe_v4, ___table_quick_action_base, ___control_types, _____utils_core, ___utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
9
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
10
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
+
const getExistingController = ____api_handler["getExistingController"];
|
|
12
|
+
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
13
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
14
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
15
|
+
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
16
|
+
const isA = _____utils_core["isA"];
|
|
17
|
+
const getPropertyPath = ___utils["getPropertyPath"];
|
|
18
|
+
const CREATE_TABLE_ACTION = 'create-table-action';
|
|
19
|
+
const regexForAnnotationPath = /controlConfiguration\/(?:[^@]+\/)?@com\.sap\.vocabularies\.UI\.v1\.LineItem(?:#[^/]+)?\/actions\//;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Quick Action for adding a custom page action.
|
|
23
|
+
*/
|
|
24
|
+
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
27
|
+
}
|
|
28
|
+
async initialize() {
|
|
29
|
+
this.pageId = this.context.view.getViewData()?.stableId.split('::').pop();
|
|
30
|
+
const version = await getUi5Version();
|
|
31
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
32
|
+
major: 1,
|
|
33
|
+
minor: 120
|
|
34
|
+
})) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
await super.initialize();
|
|
38
|
+
}
|
|
39
|
+
async execute(path) {
|
|
40
|
+
const {
|
|
41
|
+
table
|
|
42
|
+
} = this.tableMap[path];
|
|
43
|
+
const propertyPath = `${getPropertyPath(table)}`;
|
|
44
|
+
if (!table || !propertyPath) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
if (table) {
|
|
48
|
+
const overlay = OverlayRegistry.getOverlay(table) || [];
|
|
49
|
+
const controlInfo = getControllerInfoForControl(table);
|
|
50
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
51
|
+
const controllerPath = data.controllerPathFromRoot.replaceAll('/', '.').replace(/\.[^.]+$/, '');
|
|
52
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_ACTION, undefined, {
|
|
53
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
|
|
54
|
+
controllerReference: controllerPath ? `.extension.${controllerPath}.<methodName>` : '.extension.<ApplicationId.FolderName.ScriptFilename.methodName>',
|
|
55
|
+
actionType: 'tableAction',
|
|
56
|
+
appDescriptor: {
|
|
57
|
+
appComponent: getV4AppComponent(this.context.view),
|
|
58
|
+
appType: 'fe-v4',
|
|
59
|
+
pageId: this.pageId,
|
|
60
|
+
projectId: this.context.flexSettings.projectId
|
|
61
|
+
},
|
|
62
|
+
validateActionId: actionId => {
|
|
63
|
+
const actionPaths = [...this.context.changeService.getAllPendingConfigPropertyPath()].filter(path => regexForAnnotationPath.test(path));
|
|
64
|
+
const idInPendingChanges = actionPaths.includes(`${propertyPath}${actionId}`);
|
|
65
|
+
if (idInPendingChanges) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (isA(MDC_TABLE_TYPE, table) && table.getActions().every(action => !action.getAction().getId().endsWith(`CustomAction::${actionId}`))) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
},
|
|
73
|
+
position: calculatePosition(table, this.context.view),
|
|
74
|
+
propertyPath
|
|
75
|
+
}, {
|
|
76
|
+
actionName: this.type,
|
|
77
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function calculatePosition(table, view) {
|
|
84
|
+
const actions = table.getActions();
|
|
85
|
+
if (!actions.length) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
const annotationAction = actions.findIndex(action => action.getAction().getId().includes('::DataFieldForAction::'));
|
|
89
|
+
const customAction = actions.findIndex(action => action.getAction().getId().includes('::CustomAction::'));
|
|
90
|
+
if (annotationAction === -1 && customAction === -1) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
// determine the least index of either annotation or custom action
|
|
94
|
+
let actionIndex;
|
|
95
|
+
if (annotationAction === -1) {
|
|
96
|
+
actionIndex = customAction;
|
|
97
|
+
} else if (customAction === -1) {
|
|
98
|
+
actionIndex = annotationAction;
|
|
99
|
+
} else {
|
|
100
|
+
actionIndex = Math.min(annotationAction, customAction);
|
|
101
|
+
}
|
|
102
|
+
const actionToolBarAction = actions[actionIndex];
|
|
103
|
+
let anchor;
|
|
104
|
+
let action = actionToolBarAction?.getAction();
|
|
105
|
+
if (action) {
|
|
106
|
+
const localId = view.getLocalId(action.getId()) ?? '';
|
|
107
|
+
if (localId.includes('CustomAction::')) {
|
|
108
|
+
const str = localId.substring(Math.max(0, localId.lastIndexOf('CustomAction::')));
|
|
109
|
+
anchor = str.split('::').pop();
|
|
110
|
+
} else {
|
|
111
|
+
anchor = localId.substring(localId.lastIndexOf('DataFieldForAction::'));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!anchor) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
placement: 'Before',
|
|
119
|
+
anchor
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
var __exports = {
|
|
123
|
+
__esModule: true
|
|
124
|
+
};
|
|
125
|
+
__exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
|
|
126
|
+
__exports.AddTableActionQuickAction = AddTableActionQuickAction;
|
|
127
|
+
return __exports;
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=create-table-action-config-change.js.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
2
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
|
+
|
|
4
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
5
|
+
import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
6
|
+
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
7
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
8
|
+
import { getExistingController } from '../../api-handler';
|
|
9
|
+
import { getControllerInfoForControl } from '../../utils';
|
|
10
|
+
import { getV4AppComponent } from '../../../utils/fe-v4';
|
|
11
|
+
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
12
|
+
import { MDC_TABLE_TYPE } from '../control-types';
|
|
13
|
+
import { isA } from '../../../utils/core';
|
|
14
|
+
import Table from 'sap/ui/mdc/Table';
|
|
15
|
+
import XMLView from 'sap/ui/core/mvc/XMLView';
|
|
16
|
+
import ActionToolbarAction from 'sap/ui/mdc/actiontoolbar/ActionToolbarAction';
|
|
17
|
+
import { getPropertyPath } from './utils';
|
|
18
|
+
|
|
19
|
+
export const CREATE_TABLE_ACTION = 'create-table-action';
|
|
20
|
+
|
|
21
|
+
interface ViewDataType {
|
|
22
|
+
stableId: string;
|
|
23
|
+
}
|
|
24
|
+
const regexForAnnotationPath =
|
|
25
|
+
/controlConfiguration\/(?:[^@]+\/)?@com\.sap\.vocabularies\.UI\.v1\.LineItem(?:#[^/]+)?\/actions\//;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Quick Action for adding a custom page action.
|
|
29
|
+
*/
|
|
30
|
+
export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
|
|
31
|
+
protected pageId: string | undefined;
|
|
32
|
+
constructor(context: QuickActionContext) {
|
|
33
|
+
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
|
|
34
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async initialize(): Promise<void> {
|
|
39
|
+
this.pageId = (this.context.view.getViewData() as ViewDataType)?.stableId.split('::').pop() as string;
|
|
40
|
+
const version = await getUi5Version();
|
|
41
|
+
if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 120 })) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await super.initialize();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
48
|
+
const { table } = this.tableMap[path];
|
|
49
|
+
const propertyPath = `${getPropertyPath(table)}`;
|
|
50
|
+
if (!table || !propertyPath) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
if (table) {
|
|
54
|
+
const overlay = OverlayRegistry.getOverlay(table) || [];
|
|
55
|
+
const controlInfo = getControllerInfoForControl(table);
|
|
56
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
57
|
+
const controllerPath = data.controllerPathFromRoot.replaceAll('/', '.').replace(/\.[^.]+$/, '');
|
|
58
|
+
await DialogFactory.createDialog(
|
|
59
|
+
overlay,
|
|
60
|
+
this.context.rta,
|
|
61
|
+
DialogNames.ADD_ACTION,
|
|
62
|
+
undefined,
|
|
63
|
+
{
|
|
64
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
|
|
65
|
+
controllerReference: controllerPath
|
|
66
|
+
? `.extension.${controllerPath}.<methodName>`
|
|
67
|
+
: '.extension.<ApplicationId.FolderName.ScriptFilename.methodName>',
|
|
68
|
+
actionType: 'tableAction',
|
|
69
|
+
appDescriptor: {
|
|
70
|
+
appComponent: getV4AppComponent(this.context.view)!,
|
|
71
|
+
appType: 'fe-v4',
|
|
72
|
+
pageId: this.pageId!,
|
|
73
|
+
projectId: this.context.flexSettings.projectId
|
|
74
|
+
},
|
|
75
|
+
validateActionId: (actionId) => {
|
|
76
|
+
const actionPaths = [...this.context.changeService.getAllPendingConfigPropertyPath()].filter(
|
|
77
|
+
(path) => regexForAnnotationPath.test(path)
|
|
78
|
+
);
|
|
79
|
+
const idInPendingChanges = actionPaths.includes(`${propertyPath}${actionId}`);
|
|
80
|
+
if (idInPendingChanges) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (
|
|
84
|
+
isA(MDC_TABLE_TYPE, table) &&
|
|
85
|
+
(table as Table).getActions().every(
|
|
86
|
+
(action) =>
|
|
87
|
+
!(action as ActionToolbarAction)
|
|
88
|
+
.getAction()
|
|
89
|
+
.getId()
|
|
90
|
+
.endsWith(`CustomAction::${actionId}`)
|
|
91
|
+
)
|
|
92
|
+
) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
},
|
|
97
|
+
position: calculatePosition(table as Table, this.context.view),
|
|
98
|
+
propertyPath
|
|
99
|
+
},
|
|
100
|
+
{ actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function calculatePosition(table: Table, view: XMLView): { placement: 'Before' | 'After'; anchor: string } | undefined {
|
|
108
|
+
const actions = table.getActions() as ActionToolbarAction[];
|
|
109
|
+
if (!actions.length) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const annotationAction = actions.findIndex((action) =>
|
|
113
|
+
action.getAction().getId().includes('::DataFieldForAction::')
|
|
114
|
+
);
|
|
115
|
+
const customAction = actions.findIndex((action) => action.getAction().getId().includes('::CustomAction::'));
|
|
116
|
+
if (annotationAction === -1 && customAction === -1) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
// determine the least index of either annotation or custom action
|
|
120
|
+
let actionIndex: number;
|
|
121
|
+
if (annotationAction === -1) {
|
|
122
|
+
actionIndex = customAction;
|
|
123
|
+
} else if (customAction === -1) {
|
|
124
|
+
actionIndex = annotationAction;
|
|
125
|
+
} else {
|
|
126
|
+
actionIndex = Math.min(annotationAction, customAction);
|
|
127
|
+
}
|
|
128
|
+
const actionToolBarAction = actions[actionIndex];
|
|
129
|
+
let anchor;
|
|
130
|
+
let action = actionToolBarAction?.getAction();
|
|
131
|
+
|
|
132
|
+
if (action) {
|
|
133
|
+
const localId = view.getLocalId(action.getId()) ?? '';
|
|
134
|
+
if (localId.includes('CustomAction::')) {
|
|
135
|
+
const str = localId.substring(Math.max(0, localId.lastIndexOf('CustomAction::')));
|
|
136
|
+
anchor = str.split('::').pop();
|
|
137
|
+
} else {
|
|
138
|
+
anchor = localId.substring(localId.lastIndexOf('DataFieldForAction::'));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (!anchor) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
placement: 'Before',
|
|
147
|
+
anchor
|
|
148
|
+
};
|
|
149
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../dialog-enablement-validator", "../../../utils/fe-v4", "./utils", "../../../utils/version", "../../../utils/core"], function (OverlayRegistry, ____dialog_factory, ___control_types, ___table_quick_action_base, ___dialog_enablement_validator, _____utils_fe_v4, ___utils, _____utils_version, _____utils_core) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
9
|
+
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
10
|
+
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
11
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
12
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
13
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
14
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
15
|
+
const isMacroTable = _____utils_fe_v4["isMacroTable"];
|
|
16
|
+
const getLineItemAnnotation = ___utils["getLineItemAnnotation"];
|
|
17
|
+
const getPropertyPath = ___utils["getPropertyPath"];
|
|
18
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
19
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
20
|
+
const isA = _____utils_core["isA"];
|
|
21
|
+
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
22
|
+
const regexForAnnotationPath = /controlConfiguration\/(?:entity\/)?@com\.sap\.vocabularies\.UI\.v1\.LineItem(?:#[^/]+)?\/columns\//;
|
|
23
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
24
|
+
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
27
|
+
validateTableColumns: true
|
|
28
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
29
|
+
}
|
|
30
|
+
async initialize() {
|
|
31
|
+
this.pageId = this.context.view.getViewData()?.stableId.split('::').pop();
|
|
32
|
+
const version = await getUi5Version();
|
|
33
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
34
|
+
major: 1,
|
|
35
|
+
minor: 120
|
|
36
|
+
})) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
await super.initialize();
|
|
40
|
+
}
|
|
41
|
+
async execute(path) {
|
|
42
|
+
const {
|
|
43
|
+
table
|
|
44
|
+
} = this.tableMap[path];
|
|
45
|
+
if (!table) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
if (table) {
|
|
49
|
+
const overlay = OverlayRegistry.getOverlay(table) || [];
|
|
50
|
+
const propertyPath = `${getPropertyPath(table, 'columns')}`;
|
|
51
|
+
const anchor = findAnchor(table);
|
|
52
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_CUSTOM_FRAGMENT, undefined, {
|
|
53
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN',
|
|
54
|
+
type: 'tableColumn',
|
|
55
|
+
appDescriptor: {
|
|
56
|
+
appComponent: getV4AppComponent(this.context.view),
|
|
57
|
+
appType: 'fe-v4',
|
|
58
|
+
pageId: this.pageId,
|
|
59
|
+
projectId: this.context.flexSettings.projectId,
|
|
60
|
+
anchor
|
|
61
|
+
},
|
|
62
|
+
validateId: columnId => {
|
|
63
|
+
const customColumnInPending = [...this.context.changeService.getAllPendingConfigPropertyPath()].filter(path => regexForAnnotationPath.test(path));
|
|
64
|
+
const idInPendingChanges = customColumnInPending.includes(`${propertyPath}${columnId}`);
|
|
65
|
+
if (idInPendingChanges) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (isA(MDC_TABLE_TYPE, table) && table.getColumns().every(col => !col.getId().endsWith(`CustomColumn::${columnId}`))) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
},
|
|
73
|
+
propertyPath
|
|
74
|
+
}, {
|
|
75
|
+
actionName: this.type,
|
|
76
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function findAnchor(table) {
|
|
83
|
+
const macroTable = table.getParent();
|
|
84
|
+
let anchor = '';
|
|
85
|
+
if (isMacroTable(macroTable)) {
|
|
86
|
+
let metaPath = '';
|
|
87
|
+
if (macroTable.metaPath.includes('LineItem')) {
|
|
88
|
+
metaPath = macroTable.metaPath;
|
|
89
|
+
} else {
|
|
90
|
+
const segments = macroTable.metaPath.split('/');
|
|
91
|
+
segments.pop();
|
|
92
|
+
const path = segments.join('/');
|
|
93
|
+
metaPath = `${path}/${getLineItemAnnotation(macroTable)}`;
|
|
94
|
+
}
|
|
95
|
+
if (!metaPath) {
|
|
96
|
+
return '';
|
|
97
|
+
}
|
|
98
|
+
const columns = macroTable.getModel()?.getMetaModel()?.getObject(metaPath);
|
|
99
|
+
const filteredColumns = columns.filter(col => ['com.sap.vocabularies.UI.v1.DataField', 'com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation', 'com.sap.vocabularies.UI.v1.DataFieldForAnnotation'].includes(col.$Type) || 'com.sap.vocabularies.UI.v1.DataFieldForAction' === col.$Type && col.Inline);
|
|
100
|
+
const lastColumn = filteredColumns.at(-1);
|
|
101
|
+
if (!lastColumn) {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
anchor = buildColumnAnchor(lastColumn);
|
|
105
|
+
}
|
|
106
|
+
return anchor;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Builds anchor string for different column types
|
|
111
|
+
* @param column - The column object from metadata
|
|
112
|
+
* @returns The anchor string for the column
|
|
113
|
+
*/
|
|
114
|
+
function buildColumnAnchor(column) {
|
|
115
|
+
if (column.$Type === 'com.sap.vocabularies.UI.v1.DataFieldForAction') {
|
|
116
|
+
return `DataFieldForAction::${column.Action}`;
|
|
117
|
+
}
|
|
118
|
+
if (column.$Type === 'com.sap.vocabularies.UI.v1.DataField') {
|
|
119
|
+
return `DataField::${column.Value?.$Path}`;
|
|
120
|
+
}
|
|
121
|
+
if (column.$Type === 'com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation') {
|
|
122
|
+
return `DataFieldForIntentBasedNavigation::${column.SemanticObject}::${column.Action}`;
|
|
123
|
+
}
|
|
124
|
+
if (column.$Type === 'com.sap.vocabularies.UI.v1.DataFieldForAnnotation') {
|
|
125
|
+
const annotationPath = column.Target?.$AnnotationPath;
|
|
126
|
+
if (!annotationPath) {
|
|
127
|
+
return '';
|
|
128
|
+
}
|
|
129
|
+
const annotation = annotationPath.split('.').pop();
|
|
130
|
+
return `DataFieldForAnnotation::${annotation?.split('#').join('::')}`;
|
|
131
|
+
}
|
|
132
|
+
return '';
|
|
133
|
+
}
|
|
134
|
+
var __exports = {
|
|
135
|
+
__esModule: true
|
|
136
|
+
};
|
|
137
|
+
__exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
|
|
138
|
+
__exports.CONTROL_TYPES = CONTROL_TYPES;
|
|
139
|
+
__exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
|
|
140
|
+
return __exports;
|
|
141
|
+
});
|
|
142
|
+
//# sourceMappingURL=create-table-custom-column-config-change.js.map
|