@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
package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../cpe/quick-actions/utils", "../../utils/core", "../dialog-factory", "../../i18n", "./simple-quick-action-base", "./dialog-enablement-validator"], function (Component, OverlayRegistry, ____cpe_quick_actions_utils, ____utils_core, ___dialog_factory, ____i18n, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const pageHasControlId = ____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
+
const getControlById = ____utils_core["getControlById"];
|
|
8
|
+
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
9
|
+
const DialogNames = ___dialog_factory["DialogNames"];
|
|
10
|
+
const getTextBundle = ____i18n["getTextBundle"];
|
|
11
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
12
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
13
|
+
const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
|
|
14
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
15
|
+
/**
|
|
16
|
+
* Base Quick Action class for adding a custom page action.
|
|
17
|
+
*/
|
|
18
|
+
class AddNewSubpageBase extends SimpleQuickActionDefinitionBase {
|
|
19
|
+
constructor(context) {
|
|
20
|
+
super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [{
|
|
21
|
+
run: async () => {
|
|
22
|
+
const i18n = await getTextBundle();
|
|
23
|
+
if (this.navProperties.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
type: 'error',
|
|
26
|
+
message: i18n.getText('NO_SUB_PAGES_TO_ADD')
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}, DIALOG_ENABLEMENT_VALIDATOR]);
|
|
32
|
+
this.appReference = context.flexSettings.projectId ?? '';
|
|
33
|
+
this.existingPages = this.getApplicationPages();
|
|
34
|
+
}
|
|
35
|
+
async addNavigationOptionIfAvailable(metaModel, targetEntitySet, navProperty) {
|
|
36
|
+
if (!targetEntitySet) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const pageExists = await this.isPageExists(targetEntitySet, metaModel);
|
|
40
|
+
if (!pageExists) {
|
|
41
|
+
this.navProperties.push({
|
|
42
|
+
entitySet: targetEntitySet,
|
|
43
|
+
navProperty: navProperty ?? targetEntitySet
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async initialize() {
|
|
48
|
+
if (!this.appReference) {
|
|
49
|
+
throw new Error('App reference not defined');
|
|
50
|
+
}
|
|
51
|
+
const allControls = CONTROL_TYPES.flatMap(item => this.context.controlIndex[item] ?? []);
|
|
52
|
+
const control = allControls.find(c => pageHasControlId(this.context.view, c.controlId));
|
|
53
|
+
this.pageType = this.context.view.getViewName().split('.view.')[0];
|
|
54
|
+
const metaModel = this.getODataMetaModel();
|
|
55
|
+
if (!metaModel || !control) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const modifiedControl = getControlById(control.controlId);
|
|
59
|
+
if (!modifiedControl) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
63
|
+
const entitySetName = await this.getEntitySetNameFromPageComponent(component, metaModel);
|
|
64
|
+
if (!entitySetName) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.entitySet = entitySetName;
|
|
68
|
+
this.navProperties = [];
|
|
69
|
+
if (!this.isCurrentObjectPage()) {
|
|
70
|
+
await this.addNavigationOptionIfAvailable(metaModel, this.entitySet);
|
|
71
|
+
} else {
|
|
72
|
+
await this.prepareNavigationData(metaModel);
|
|
73
|
+
}
|
|
74
|
+
this.control = modifiedControl;
|
|
75
|
+
}
|
|
76
|
+
async execute() {
|
|
77
|
+
const overlay = OverlayRegistry.getOverlay(this.control);
|
|
78
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_SUBPAGE, undefined, {
|
|
79
|
+
appReference: this.appReference,
|
|
80
|
+
navProperties: this.navProperties,
|
|
81
|
+
title: 'ADD_SUB_PAGE_DIALOG_TITLE',
|
|
82
|
+
pageDescriptor: this.currentPageDescriptor
|
|
83
|
+
}, {
|
|
84
|
+
actionName: this.type,
|
|
85
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
86
|
+
});
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var __exports = {
|
|
91
|
+
__esModule: true
|
|
92
|
+
};
|
|
93
|
+
__exports.ADD_NEW_OBJECT_PAGE_ACTION = ADD_NEW_OBJECT_PAGE_ACTION;
|
|
94
|
+
__exports.AddNewSubpageBase = AddNewSubpageBase;
|
|
95
|
+
return __exports;
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=add-new-subpage-quick-action-base.js.map
|
package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import Component from 'sap/ui/core/Component';
|
|
2
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
|
+
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
4
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
5
|
+
|
|
6
|
+
import { QuickActionContext, SimpleQuickActionDefinition } from '../../cpe/quick-actions/quick-action-definition';
|
|
7
|
+
import { pageHasControlId } from '../../cpe/quick-actions/utils';
|
|
8
|
+
import { getControlById } from '../../utils/core';
|
|
9
|
+
import { DialogFactory, DialogNames } from '../dialog-factory';
|
|
10
|
+
import { EnablementValidatorResult } from './enablement-validator';
|
|
11
|
+
import { getTextBundle } from '../../i18n';
|
|
12
|
+
import { SimpleQuickActionDefinitionBase } from './simple-quick-action-base';
|
|
13
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from './dialog-enablement-validator';
|
|
14
|
+
import { PageDescriptorV2 } from '../controllers/AddSubpage.controller';
|
|
15
|
+
import { PageDescriptorV4 } from '../controllers/types';
|
|
16
|
+
|
|
17
|
+
export const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
|
|
18
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
19
|
+
|
|
20
|
+
export interface ApplicationPageData {
|
|
21
|
+
id: string;
|
|
22
|
+
entitySet?: string;
|
|
23
|
+
contextPath?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Base Quick Action class for adding a custom page action.
|
|
28
|
+
*/
|
|
29
|
+
export abstract class AddNewSubpageBase<ODataMetaModelType>
|
|
30
|
+
extends SimpleQuickActionDefinitionBase
|
|
31
|
+
implements SimpleQuickActionDefinition
|
|
32
|
+
{
|
|
33
|
+
protected appReference: string;
|
|
34
|
+
protected abstract readonly currentPageDescriptor: PageDescriptorV2 | PageDescriptorV4;
|
|
35
|
+
protected entitySet: string | undefined;
|
|
36
|
+
protected navProperties: { navProperty: string; entitySet: string }[];
|
|
37
|
+
protected existingPages: ApplicationPageData[];
|
|
38
|
+
protected pageType: string | undefined;
|
|
39
|
+
|
|
40
|
+
constructor(context: QuickActionContext) {
|
|
41
|
+
super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [
|
|
42
|
+
{
|
|
43
|
+
run: async (): Promise<EnablementValidatorResult> => {
|
|
44
|
+
const i18n = await getTextBundle();
|
|
45
|
+
if (this.navProperties.length === 0) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'error',
|
|
48
|
+
message: i18n.getText('NO_SUB_PAGES_TO_ADD')
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
this.appReference = context.flexSettings.projectId ?? '';
|
|
58
|
+
this.existingPages = this.getApplicationPages();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
protected abstract getApplicationPages(): ApplicationPageData[];
|
|
62
|
+
protected abstract isPageExists(targetEntitySet: string, metaModel: ODataMetaModelType): boolean | Promise<boolean>;
|
|
63
|
+
protected abstract isCurrentObjectPage(): boolean;
|
|
64
|
+
protected abstract getEntitySetNameFromPageComponent(
|
|
65
|
+
component: Component | undefined,
|
|
66
|
+
metaModel: ODataMetaModelType
|
|
67
|
+
): Promise<string | undefined>;
|
|
68
|
+
protected abstract prepareNavigationData(metaModel: ODataMetaModelType): Promise<void>;
|
|
69
|
+
protected abstract getODataMetaModel(): ODataMetaModelType | undefined;
|
|
70
|
+
|
|
71
|
+
protected async addNavigationOptionIfAvailable(
|
|
72
|
+
metaModel: ODataMetaModelType,
|
|
73
|
+
targetEntitySet?: string,
|
|
74
|
+
navProperty?: string
|
|
75
|
+
) {
|
|
76
|
+
if (!targetEntitySet) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const pageExists = await this.isPageExists(targetEntitySet, metaModel);
|
|
80
|
+
if (!pageExists) {
|
|
81
|
+
this.navProperties.push({
|
|
82
|
+
entitySet: targetEntitySet,
|
|
83
|
+
navProperty: navProperty ?? targetEntitySet
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async initialize(): Promise<void> {
|
|
89
|
+
if (!this.appReference) {
|
|
90
|
+
throw new Error('App reference not defined');
|
|
91
|
+
}
|
|
92
|
+
const allControls = CONTROL_TYPES.flatMap((item) => this.context.controlIndex[item] ?? []);
|
|
93
|
+
const control = allControls.find((c) => pageHasControlId(this.context.view, c.controlId));
|
|
94
|
+
|
|
95
|
+
this.pageType = this.context.view.getViewName().split('.view.')[0];
|
|
96
|
+
|
|
97
|
+
const metaModel = this.getODataMetaModel();
|
|
98
|
+
if (!metaModel || !control) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const modifiedControl = getControlById<ObjectPageLayout>(control.controlId);
|
|
103
|
+
if (!modifiedControl) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
108
|
+
const entitySetName = await this.getEntitySetNameFromPageComponent(component, metaModel);
|
|
109
|
+
if (!entitySetName) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.entitySet = entitySetName;
|
|
113
|
+
|
|
114
|
+
this.navProperties = [];
|
|
115
|
+
if (!this.isCurrentObjectPage()) {
|
|
116
|
+
await this.addNavigationOptionIfAvailable(metaModel, this.entitySet);
|
|
117
|
+
} else {
|
|
118
|
+
await this.prepareNavigationData(metaModel);
|
|
119
|
+
}
|
|
120
|
+
this.control = modifiedControl;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async execute(): Promise<FlexCommand[]> {
|
|
124
|
+
const overlay = OverlayRegistry.getOverlay(this.control!);
|
|
125
|
+
await DialogFactory.createDialog(
|
|
126
|
+
overlay,
|
|
127
|
+
this.context.rta,
|
|
128
|
+
DialogNames.ADD_SUBPAGE,
|
|
129
|
+
undefined,
|
|
130
|
+
{
|
|
131
|
+
appReference: this.appReference,
|
|
132
|
+
navProperties: this.navProperties,
|
|
133
|
+
title: 'ADD_SUB_PAGE_DIALOG_TITLE',
|
|
134
|
+
pageDescriptor: this.currentPageDescriptor
|
|
135
|
+
},
|
|
136
|
+
{ actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
|
|
137
|
+
);
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
}
|
package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/version", "../../utils", "../../../cpe/quick-actions/utils", "../../../i18n", "../../api-handler", "../../dialog-factory", "../../init-dialogs", "../dialog-enablement-validator", "../simple-quick-action-base"], function (OverlayRegistry, _____utils_version, ____utils, _____cpe_quick_actions_utils, _____i18n, ____api_handler, ____dialog_factory, ____init_dialogs, ___dialog_enablement_validator, ___simple_quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
7
|
+
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
8
|
+
const getReuseComponentChecker = ____utils["getReuseComponentChecker"];
|
|
9
|
+
const checkForExistingChange = ____utils["checkForExistingChange"];
|
|
10
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
11
|
+
const getTextBundle = _____i18n["getTextBundle"];
|
|
12
|
+
const getExistingController = ____api_handler["getExistingController"];
|
|
13
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
14
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
15
|
+
const isControllerExtensionEnabledForControl = ____init_dialogs["isControllerExtensionEnabledForControl"];
|
|
16
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
17
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
18
|
+
const ADD_CONTROLLER_TO_PAGE_TYPE = 'add-controller-to-page';
|
|
19
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Quick Action for adding controller to a page.
|
|
23
|
+
*/
|
|
24
|
+
class AddControllerToPageQuickAction extends SimpleQuickActionDefinitionBase {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [DIALOG_ENABLEMENT_VALIDATOR, {
|
|
27
|
+
run: async () => {
|
|
28
|
+
const controllerName = getControllerInfoForControl(this.context.view).controllerName;
|
|
29
|
+
const i18n = await getTextBundle();
|
|
30
|
+
if (checkForExistingChange(this.context.rta, 'codeExt', 'selector.controllerName', controllerName)) {
|
|
31
|
+
return {
|
|
32
|
+
type: 'error',
|
|
33
|
+
message: i18n.getText('ADP_QUICK_ACTION_CONTROLLER_PENDING_CHANGE_EXISTS')
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}]);
|
|
38
|
+
}
|
|
39
|
+
controllerExists = false;
|
|
40
|
+
forceRefreshAfterExecution = true;
|
|
41
|
+
async initialize() {
|
|
42
|
+
const version = await getUi5Version();
|
|
43
|
+
const isReuseComponent = await getReuseComponentChecker(version);
|
|
44
|
+
const control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
45
|
+
if (control) {
|
|
46
|
+
const controlInfo = getControllerInfoForControl(control);
|
|
47
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
48
|
+
this.controllerExists = data?.controllerExists;
|
|
49
|
+
const isActiveAction = isControllerExtensionEnabledForControl(control, isReuseComponent, this.context.flexSettings.isCloud);
|
|
50
|
+
this.control = isActiveAction ? control : undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
get textKey() {
|
|
54
|
+
return this.controllerExists ? 'QUICK_ACTION_SHOW_PAGE_CONTROLLER' : 'QUICK_ACTION_ADD_PAGE_CONTROLLER';
|
|
55
|
+
}
|
|
56
|
+
async execute() {
|
|
57
|
+
if (this.control) {
|
|
58
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
59
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.CONTROLLER_EXTENSION, undefined, {}, {
|
|
60
|
+
actionName: this.type,
|
|
61
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var __exports = {
|
|
68
|
+
__esModule: true
|
|
69
|
+
};
|
|
70
|
+
__exports.ADD_CONTROLLER_TO_PAGE_TYPE = ADD_CONTROLLER_TO_PAGE_TYPE;
|
|
71
|
+
__exports.AddControllerToPageQuickAction = AddControllerToPageQuickAction;
|
|
72
|
+
return __exports;
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=add-controller-to-page.js.map
|
package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
2
|
+
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
|
+
|
|
4
|
+
import { getUi5Version } from '../../../utils/version';
|
|
5
|
+
import { getControllerInfoForControl, getReuseComponentChecker, checkForExistingChange } from '../../utils';
|
|
6
|
+
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
7
|
+
import type {
|
|
8
|
+
QuickActionContext,
|
|
9
|
+
SimpleQuickActionDefinition
|
|
10
|
+
} from '../../../cpe/quick-actions/quick-action-definition';
|
|
11
|
+
import { getTextBundle } from '../../../i18n';
|
|
12
|
+
import { getExistingController } from '../../api-handler';
|
|
13
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
14
|
+
import { isControllerExtensionEnabledForControl } from '../../init-dialogs';
|
|
15
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
16
|
+
import type { EnablementValidatorResult } from '../enablement-validator';
|
|
17
|
+
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
18
|
+
|
|
19
|
+
export const ADD_CONTROLLER_TO_PAGE_TYPE = 'add-controller-to-page';
|
|
20
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Quick Action for adding controller to a page.
|
|
24
|
+
*/
|
|
25
|
+
export class AddControllerToPageQuickAction
|
|
26
|
+
extends SimpleQuickActionDefinitionBase
|
|
27
|
+
implements SimpleQuickActionDefinition
|
|
28
|
+
{
|
|
29
|
+
constructor(context: QuickActionContext) {
|
|
30
|
+
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [
|
|
31
|
+
DIALOG_ENABLEMENT_VALIDATOR,
|
|
32
|
+
{
|
|
33
|
+
run: async (): Promise<EnablementValidatorResult> => {
|
|
34
|
+
const controllerName = getControllerInfoForControl(this.context.view).controllerName;
|
|
35
|
+
const i18n = await getTextBundle();
|
|
36
|
+
if (
|
|
37
|
+
checkForExistingChange(this.context.rta, 'codeExt', 'selector.controllerName', controllerName)
|
|
38
|
+
) {
|
|
39
|
+
return {
|
|
40
|
+
type: 'error',
|
|
41
|
+
message: i18n.getText('ADP_QUICK_ACTION_CONTROLLER_PENDING_CHANGE_EXISTS')
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private controllerExists = false;
|
|
50
|
+
forceRefreshAfterExecution = true;
|
|
51
|
+
|
|
52
|
+
async initialize(): Promise<void> {
|
|
53
|
+
const version = await getUi5Version();
|
|
54
|
+
const isReuseComponent = await getReuseComponentChecker(version);
|
|
55
|
+
|
|
56
|
+
const control = getRelevantControlFromActivePage(
|
|
57
|
+
this.context.controlIndex,
|
|
58
|
+
this.context.view,
|
|
59
|
+
CONTROL_TYPES
|
|
60
|
+
)[0];
|
|
61
|
+
if (control) {
|
|
62
|
+
const controlInfo = getControllerInfoForControl(control);
|
|
63
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
64
|
+
this.controllerExists = data?.controllerExists;
|
|
65
|
+
const isActiveAction = isControllerExtensionEnabledForControl(
|
|
66
|
+
control,
|
|
67
|
+
isReuseComponent,
|
|
68
|
+
this.context.flexSettings.isCloud
|
|
69
|
+
);
|
|
70
|
+
this.control = isActiveAction ? control : undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
protected get textKey() {
|
|
75
|
+
return this.controllerExists ? 'QUICK_ACTION_SHOW_PAGE_CONTROLLER' : 'QUICK_ACTION_ADD_PAGE_CONTROLLER';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async execute(): Promise<FlexCommand[]> {
|
|
79
|
+
if (this.control) {
|
|
80
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
81
|
+
await DialogFactory.createDialog(
|
|
82
|
+
overlay,
|
|
83
|
+
this.context.rta,
|
|
84
|
+
DialogNames.CONTROLLER_EXTENSION,
|
|
85
|
+
undefined,
|
|
86
|
+
{},
|
|
87
|
+
{ actionName: this.type, telemetryEventIdentifier: this.getTelemetryIdentifier() }
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}
|
package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "sap/ui/dt/OverlayRegistry", "sap/ui/rta/command/CommandFactory", "../../../utils/application", "../../../utils/fe-v4", "../../../utils/version", "../../api-handler", "../../dialog-factory", "../dialog-enablement-validator", "../fe-v2/utils", "../quick-action-base"], function (___sap_ux_private_control_property_editor_common, OverlayRegistry, CommandFactory, _____utils_application, _____utils_fe_v4, _____utils_version, ____api_handler, ____dialog_factory, ___dialog_enablement_validator, ___fe_v2_utils, ___quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common["NESTED_QUICK_ACTION_KIND"];
|
|
7
|
+
const getApplicationType = _____utils_application["getApplicationType"];
|
|
8
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
9
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
10
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
11
|
+
const getDataSourceAnnotationFileMap = ____api_handler["getDataSourceAnnotationFileMap"];
|
|
12
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
13
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
14
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
15
|
+
const getV2AppComponent = ___fe_v2_utils["getV2AppComponent"];
|
|
16
|
+
const QuickActionDefinitionBase = ___quick_action_base["QuickActionDefinitionBase"];
|
|
17
|
+
const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
|
|
18
|
+
const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Add New Annotation File.
|
|
22
|
+
*/
|
|
23
|
+
class AddNewAnnotationFile extends QuickActionDefinitionBase {
|
|
24
|
+
children = [];
|
|
25
|
+
get quickActionSteps() {
|
|
26
|
+
return 1;
|
|
27
|
+
}
|
|
28
|
+
kind = NESTED_QUICK_ACTION_KIND;
|
|
29
|
+
type = ADD_NEW_ANNOTATION_FILE;
|
|
30
|
+
forceRefreshAfterExecution = true;
|
|
31
|
+
isApplicable = true;
|
|
32
|
+
get id() {
|
|
33
|
+
return `${this.context.key}-${this.type}`;
|
|
34
|
+
}
|
|
35
|
+
constructor(context) {
|
|
36
|
+
super(ADD_NEW_ANNOTATION_FILE, NESTED_QUICK_ACTION_KIND, '', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
37
|
+
this.context = context;
|
|
38
|
+
}
|
|
39
|
+
async initialize() {
|
|
40
|
+
const version = await getUi5Version();
|
|
41
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
42
|
+
major: 1,
|
|
43
|
+
minor: 108,
|
|
44
|
+
patch: 27
|
|
45
|
+
})) {
|
|
46
|
+
this.isApplicable = false;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
|
|
50
|
+
const {
|
|
51
|
+
annotationDataSourceMap
|
|
52
|
+
} = this.annotationDataSourceData;
|
|
53
|
+
if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
|
|
54
|
+
throw new Error('No data sources found in the manifest');
|
|
55
|
+
}
|
|
56
|
+
for (const key in annotationDataSourceMap) {
|
|
57
|
+
if (Object.prototype.hasOwnProperty.call(annotationDataSourceMap, key)) {
|
|
58
|
+
const source = annotationDataSourceMap[key];
|
|
59
|
+
const {
|
|
60
|
+
annotationExistsInWS
|
|
61
|
+
} = source.annotationDetails;
|
|
62
|
+
if (source.metadataReadErrorMsg) {
|
|
63
|
+
this.children.push({
|
|
64
|
+
path: this.children.length.toString(),
|
|
65
|
+
enabled: false,
|
|
66
|
+
tooltip: source.metadataReadErrorMsg,
|
|
67
|
+
label: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
68
|
+
children: []
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
this.children.push({
|
|
72
|
+
path: this.children.length.toString(),
|
|
73
|
+
enabled: true,
|
|
74
|
+
label: annotationExistsInWS ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key]) : this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
75
|
+
children: []
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
get textKey() {
|
|
82
|
+
let result = ADD_NEW_ANNOTATION_FILE_TITLE;
|
|
83
|
+
const dataSourceIds = Object.keys(this.annotationDataSourceData.annotationDataSourceMap);
|
|
84
|
+
if (dataSourceIds.length === 1) {
|
|
85
|
+
const details = this.annotationDataSourceData.annotationDataSourceMap[dataSourceIds[0]];
|
|
86
|
+
if (details.annotationDetails.annotationExistsInWS) {
|
|
87
|
+
result = 'QUICK_ACTION_SHOW_ANNOTATION_FILE';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
async execute(path) {
|
|
93
|
+
const {
|
|
94
|
+
annotationDataSourceMap,
|
|
95
|
+
isRunningInBAS
|
|
96
|
+
} = this.annotationDataSourceData;
|
|
97
|
+
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
98
|
+
const index = Number(path);
|
|
99
|
+
if (index >= 0) {
|
|
100
|
+
const dataSourceId = Object.keys(annotationDataSourceMap)[index];
|
|
101
|
+
const dataSource = annotationDataSourceMap[dataSourceId];
|
|
102
|
+
if (dataSource?.annotationDetails.annotationExistsInWS) {
|
|
103
|
+
const annotationFileDetails = dataSource.annotationDetails;
|
|
104
|
+
const {
|
|
105
|
+
annotationPath,
|
|
106
|
+
annotationPathFromRoot
|
|
107
|
+
} = annotationFileDetails;
|
|
108
|
+
await DialogFactory.createDialog(OverlayRegistry.getOverlay(this.context.view),
|
|
109
|
+
// this passed only because, for method param is required.
|
|
110
|
+
this.context.rta,
|
|
111
|
+
// same as above
|
|
112
|
+
DialogNames.FILE_EXISTS, undefined, {
|
|
113
|
+
fileName: annotationPathFromRoot,
|
|
114
|
+
filePath: annotationPath,
|
|
115
|
+
isRunningInBAS: isRunningInBAS
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Create annotation file only, if no file exists already for datasource id or if the change file exist and but no annotation file exists in file system.
|
|
119
|
+
else if (dataSource) {
|
|
120
|
+
const timestamp = Date.now();
|
|
121
|
+
const annotationFileNameWithoutExtension = `annotation_${timestamp}`;
|
|
122
|
+
const annotationFileName = `${annotationFileNameWithoutExtension}.xml`;
|
|
123
|
+
const annotationNameSpace = this.context.flexSettings.layer === 'CUSTOMER_BASE' ? `customer.annotation.${annotationFileNameWithoutExtension}` : `annotation.${annotationFileNameWithoutExtension}`;
|
|
124
|
+
const parameters = {
|
|
125
|
+
dataSourceId: dataSourceId,
|
|
126
|
+
annotations: [annotationNameSpace],
|
|
127
|
+
annotationsInsertPosition: 'END',
|
|
128
|
+
dataSource: {
|
|
129
|
+
[annotationNameSpace]: {
|
|
130
|
+
uri: `annotations/${annotationFileName}`,
|
|
131
|
+
type: 'ODataAnnotation'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const modifiedValue = {
|
|
136
|
+
changeType: 'appdescr_app_addAnnotationsToOData',
|
|
137
|
+
appComponent: appType === 'fe-v4' ? getV4AppComponent(this.context.view) : getV2AppComponent(this.context.view),
|
|
138
|
+
generator: this.context.flexSettings.generator,
|
|
139
|
+
reference: this.context.flexSettings.projectId,
|
|
140
|
+
parameters,
|
|
141
|
+
serviceUrl: dataSource.serviceUrl
|
|
142
|
+
};
|
|
143
|
+
const command = await CommandFactory.getCommandFor(this.context.view, 'appDescriptor', modifiedValue, null, this.context.flexSettings);
|
|
144
|
+
return [command];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Prepares nested quick action object
|
|
152
|
+
* @returns action instance
|
|
153
|
+
*/
|
|
154
|
+
getActionObject() {
|
|
155
|
+
return {
|
|
156
|
+
kind: NESTED_QUICK_ACTION_KIND,
|
|
157
|
+
id: this.id,
|
|
158
|
+
enabled: this.isApplicable,
|
|
159
|
+
title: this.context.resourceBundle.getText(this.textKey),
|
|
160
|
+
children: this.children
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var __exports = {
|
|
165
|
+
__esModule: true
|
|
166
|
+
};
|
|
167
|
+
__exports.ADD_NEW_ANNOTATION_FILE = ADD_NEW_ANNOTATION_FILE;
|
|
168
|
+
__exports.AddNewAnnotationFile = AddNewAnnotationFile;
|
|
169
|
+
return __exports;
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=add-new-annotation-file.js.map
|