@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,187 @@
|
|
|
1
|
+
import { getLibrary } from './utils';
|
|
2
|
+
import type { SchemaForApiJsonFiles, Ui5Metadata, Ui5Property } from './api-json';
|
|
3
|
+
import type { Properties } from './utils';
|
|
4
|
+
import Log from 'sap/base/Log';
|
|
5
|
+
import { MessageBarType, PropertiesInfo } from '@sap-ux-private/control-property-editor-common';
|
|
6
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
7
|
+
import { FetchError } from '../utils/error';
|
|
8
|
+
|
|
9
|
+
export interface ControlMetadata {
|
|
10
|
+
baseType: string | undefined;
|
|
11
|
+
doc: string;
|
|
12
|
+
properties: Properties;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get ui5 metadata of given library name.
|
|
17
|
+
*
|
|
18
|
+
* @param libName library name for eg: sap.m
|
|
19
|
+
* @returns Promise<SchemaForApiJsonFiles>
|
|
20
|
+
*/
|
|
21
|
+
export async function getUi5ApiDtMetadata(libName: string): Promise<SchemaForApiJsonFiles> {
|
|
22
|
+
const libUrl = '/test-resources/' + libName.split('.').join('/') + '/designtime/api.json';
|
|
23
|
+
const response = await fetch(libUrl);
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
throw new FetchError(response);
|
|
26
|
+
}
|
|
27
|
+
return response.json();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* load ui5 controls design time metadata api.json for following libraries
|
|
32
|
+
* sap.m, sap.ui.comp, sap.f, sap.ui.core
|
|
33
|
+
* loading libraries(more in file size) in parallel during initialization.
|
|
34
|
+
* Others (less in file size) are loaded dynamically in getControlMetadata method
|
|
35
|
+
*/
|
|
36
|
+
const ui5ApiDtMetadata: Map<string, SchemaForApiJsonFiles> = new Map();
|
|
37
|
+
export function loadDefaultLibraries(): void {
|
|
38
|
+
const allData = Promise.all([
|
|
39
|
+
getUi5ApiDtMetadata('sap.m'),
|
|
40
|
+
getUi5ApiDtMetadata('sap.ui.comp'),
|
|
41
|
+
getUi5ApiDtMetadata('sap.ui.core'),
|
|
42
|
+
getUi5ApiDtMetadata('sap.f')
|
|
43
|
+
]);
|
|
44
|
+
allData
|
|
45
|
+
.then((res) => {
|
|
46
|
+
res.forEach((api: SchemaForApiJsonFiles) => {
|
|
47
|
+
if (api.library) {
|
|
48
|
+
ui5ApiDtMetadata.set(api.library, api);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
.catch((reason) => {
|
|
53
|
+
Log.error('Loading Library Failed: ' + reason);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Format html text.
|
|
59
|
+
*
|
|
60
|
+
* @param sHtml - html string
|
|
61
|
+
* @returns string
|
|
62
|
+
*/
|
|
63
|
+
function formatHtmlText(sHtml: string): string {
|
|
64
|
+
// replaced "sHtml.replace(new RegExp('<[^>]*>', 'g')" due to regex runtime vulnerability
|
|
65
|
+
const parts = (sHtml || '').split('<');
|
|
66
|
+
let result = '';
|
|
67
|
+
for (const part of parts) {
|
|
68
|
+
if (!result) {
|
|
69
|
+
result = part;
|
|
70
|
+
} else {
|
|
71
|
+
const indexClosingBracket = part.indexOf('>');
|
|
72
|
+
result += indexClosingBracket >= 0 ? part.substring(indexClosingBracket + 1) : `<${part}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Method to parse ui5 control metadata.
|
|
80
|
+
*
|
|
81
|
+
* @param controlLibMetadata control library metadata
|
|
82
|
+
* @param controlName name of the control
|
|
83
|
+
* @returns ControlMetadata
|
|
84
|
+
*/
|
|
85
|
+
function parseControlMetaModel(controlLibMetadata: SchemaForApiJsonFiles, controlName: string): ControlMetadata {
|
|
86
|
+
const controlInfo: ControlMetadata = {
|
|
87
|
+
baseType: '',
|
|
88
|
+
doc: '',
|
|
89
|
+
properties: {}
|
|
90
|
+
};
|
|
91
|
+
const selectedControlMetadata = (controlLibMetadata.symbols ?? []).find((control) => control.name === controlName);
|
|
92
|
+
if (selectedControlMetadata) {
|
|
93
|
+
// base type info of control is available on property 'extends'
|
|
94
|
+
controlInfo.baseType = selectedControlMetadata.extends as string | undefined;
|
|
95
|
+
controlInfo.doc = selectedControlMetadata.description ?? '';
|
|
96
|
+
const properties: (Ui5Property & PropertiesInfo)[] | undefined = (
|
|
97
|
+
selectedControlMetadata['ui5-metadata'] as Ui5Metadata
|
|
98
|
+
).properties as (Ui5Property & PropertiesInfo)[] | undefined;
|
|
99
|
+
if (properties) {
|
|
100
|
+
properties.forEach((prop: Ui5Property & PropertiesInfo) => {
|
|
101
|
+
prop.description = formatHtmlText(prop.description || '');
|
|
102
|
+
prop.propertyName = prop.name;
|
|
103
|
+
prop.propertyType = prop.type;
|
|
104
|
+
if (prop.defaultValue === null || prop.defaultValue === '') {
|
|
105
|
+
prop.defaultValue = '-';
|
|
106
|
+
}
|
|
107
|
+
controlInfo.properties[prop.name] = { ...prop };
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return controlInfo;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Get control metadata for a given control.
|
|
116
|
+
*
|
|
117
|
+
* @param controlName name of the control
|
|
118
|
+
* @param contLibName library name of the control
|
|
119
|
+
* @returns Promise<ControlMetadata | undefined>
|
|
120
|
+
*/
|
|
121
|
+
async function getControlMetadata(controlName: string, contLibName: string): Promise<ControlMetadata | undefined> {
|
|
122
|
+
let result: ControlMetadata | undefined;
|
|
123
|
+
let controlLibMetadata = ui5ApiDtMetadata.get(contLibName);
|
|
124
|
+
if (controlLibMetadata) {
|
|
125
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
126
|
+
} else {
|
|
127
|
+
controlLibMetadata = await getUi5ApiDtMetadata(contLibName);
|
|
128
|
+
ui5ApiDtMetadata.set(contLibName, controlLibMetadata);
|
|
129
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Get Control Property Documentation for a give control name and control library.
|
|
136
|
+
*
|
|
137
|
+
* @param controlName name of the control
|
|
138
|
+
* @param contLibName library name of the control
|
|
139
|
+
* @returns Promise<Properties | undefined>
|
|
140
|
+
*/
|
|
141
|
+
async function getControlPropertyDocumentation(
|
|
142
|
+
controlName: string,
|
|
143
|
+
contLibName: string
|
|
144
|
+
): Promise<Properties | undefined> {
|
|
145
|
+
const doc = await getControlMetadata(controlName, contLibName);
|
|
146
|
+
if (doc) {
|
|
147
|
+
const baseControlType = doc.baseType;
|
|
148
|
+
if (baseControlType) {
|
|
149
|
+
const baseContLibName = await getLibrary(baseControlType);
|
|
150
|
+
if (baseContLibName) {
|
|
151
|
+
const baseControlProps = await getControlPropertyDocumentation(baseControlType, baseContLibName);
|
|
152
|
+
return { ...baseControlProps, ...doc.properties };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return { ...doc.properties };
|
|
156
|
+
} else {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get documentation of a given control of a ui5 library.
|
|
163
|
+
*
|
|
164
|
+
* @param controlName name of the control.
|
|
165
|
+
* @param contLibName library name of the control
|
|
166
|
+
* @returns Promise<Properties | undefined>
|
|
167
|
+
*/
|
|
168
|
+
export async function getDocumentation(controlName: string, contLibName: string): Promise<Properties | undefined> {
|
|
169
|
+
let doc: Properties | undefined;
|
|
170
|
+
try {
|
|
171
|
+
doc = await getControlPropertyDocumentation(controlName, contLibName);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
Log.error(`Error in getting documentation for ${contLibName}`);
|
|
174
|
+
// For some UI5 components we do not have an api.json provided instead 404, not found,
|
|
175
|
+
// response is retuned from the server. For such components we do not want to
|
|
176
|
+
// flood the info center with errors.
|
|
177
|
+
if (error instanceof FetchError && error.status === 404) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
await sendInfoCenterMessage({
|
|
181
|
+
title: { key: 'DOCUMENTATION_ERROR_TITLE' },
|
|
182
|
+
description: { key: 'DOCUMENTATION_ERROR_DESCRIPTION', params: [contLibName] },
|
|
183
|
+
type: MessageBarType.error
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return doc;
|
|
187
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
class FeatureService {
|
|
7
|
+
static features = {};
|
|
8
|
+
static {
|
|
9
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access, @sap-ux/fiori-tools/sap-browser-api-warning
|
|
10
|
+
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
11
|
+
const features = bootstrapConfig?.dataset.openUxPreviewFeatures;
|
|
12
|
+
if (features) {
|
|
13
|
+
const featureToggles = JSON.parse(features);
|
|
14
|
+
for (const {
|
|
15
|
+
feature,
|
|
16
|
+
isEnabled
|
|
17
|
+
} of featureToggles) {
|
|
18
|
+
this.features[feature] = isEnabled;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Checks if given feature is enabled.
|
|
25
|
+
*
|
|
26
|
+
* @param featureId - Id of the feature.
|
|
27
|
+
* @returns true if feature is enabled.
|
|
28
|
+
*/
|
|
29
|
+
static isFeatureEnabled(featureId) {
|
|
30
|
+
return this.features[featureId] ?? false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var __exports = {
|
|
34
|
+
__esModule: true
|
|
35
|
+
};
|
|
36
|
+
__exports.FeatureService = FeatureService;
|
|
37
|
+
return __exports;
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=feature-service.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class FeatureService {
|
|
2
|
+
private static features: Record<string, boolean> = {};
|
|
3
|
+
|
|
4
|
+
static {
|
|
5
|
+
// eslint-disable-next-line @sap-ux/fiori-tools/sap-no-dom-access, @sap-ux/fiori-tools/sap-browser-api-warning
|
|
6
|
+
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
|
7
|
+
const features = bootstrapConfig?.dataset.openUxPreviewFeatures;
|
|
8
|
+
if (features) {
|
|
9
|
+
const featureToggles = JSON.parse(features) as { feature: string; isEnabled: boolean }[];
|
|
10
|
+
for (const { feature, isEnabled } of featureToggles) {
|
|
11
|
+
this.features[feature] = isEnabled;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checks if given feature is enabled.
|
|
18
|
+
*
|
|
19
|
+
* @param featureId - Id of the feature.
|
|
20
|
+
* @returns true if feature is enabled.
|
|
21
|
+
*/
|
|
22
|
+
public static isFeatureEnabled(featureId: string): boolean {
|
|
23
|
+
return this.features[featureId] ?? false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/error", "./changes/service", "./communication-service", "./connector-service", "./context-menu-service", "./documentation", "./outline/service", "./quick-actions/quick-action-service", "./rta-service", "./selection", "./ui5-utils", "./odata-health/odata-health-checker", "../utils/info-center-message", "./odata-health/odata-health-status"], function (Log, ___sap_ux_private_control_property_editor_common, ___utils_error, ___changes_service, ___communication_service, ___connector_service, ___context_menu_service, ___documentation, ___outline_service, ___quick_actions_quick_action_service, ___rta_service, ___selection, ___ui5_utils, ___odata_health_odata_health_checker, ___utils_info_center_message, ___odata_health_odata_health_status) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const appLoaded = ___sap_ux_private_control_property_editor_common["appLoaded"];
|
|
7
|
+
const enableTelemetry = ___sap_ux_private_control_property_editor_common["enableTelemetry"];
|
|
8
|
+
const iconsLoaded = ___sap_ux_private_control_property_editor_common["iconsLoaded"];
|
|
9
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
10
|
+
const getError = ___utils_error["getError"];
|
|
11
|
+
const ChangeService = ___changes_service["ChangeService"];
|
|
12
|
+
const CommunicationService = ___communication_service["CommunicationService"];
|
|
13
|
+
const WorkspaceConnectorService = ___connector_service["WorkspaceConnectorService"];
|
|
14
|
+
const ContextMenuService = ___context_menu_service["ContextMenuService"];
|
|
15
|
+
const loadDefaultLibraries = ___documentation["loadDefaultLibraries"];
|
|
16
|
+
const OutlineService = ___outline_service["OutlineService"];
|
|
17
|
+
const QuickActionService = ___quick_actions_quick_action_service["QuickActionService"];
|
|
18
|
+
const RtaService = ___rta_service["RtaService"];
|
|
19
|
+
const SelectionService = ___selection["SelectionService"];
|
|
20
|
+
const getIcons = ___ui5_utils["getIcons"];
|
|
21
|
+
const ODataHealthChecker = ___odata_health_odata_health_checker["ODataHealthChecker"];
|
|
22
|
+
const sendInfoCenterMessage = ___utils_info_center_message["sendInfoCenterMessage"];
|
|
23
|
+
const ODataUpStatus = ___odata_health_odata_health_status["ODataUpStatus"];
|
|
24
|
+
/**
|
|
25
|
+
* Subscribes a handler to the CommunicationService
|
|
26
|
+
*
|
|
27
|
+
* @param handler action handler
|
|
28
|
+
*/
|
|
29
|
+
function subscribe(handler) {
|
|
30
|
+
CommunicationService.subscribe(handler);
|
|
31
|
+
}
|
|
32
|
+
function init(rta, registries = []) {
|
|
33
|
+
Log.info('Initializing Control Property Editor');
|
|
34
|
+
|
|
35
|
+
// enable telemetry if requested
|
|
36
|
+
const flexSettings = rta.getFlexSettings();
|
|
37
|
+
if (flexSettings.telemetry === true) {
|
|
38
|
+
enableTelemetry();
|
|
39
|
+
}
|
|
40
|
+
const rtaService = new RtaService(rta);
|
|
41
|
+
const changesService = new ChangeService({
|
|
42
|
+
rta
|
|
43
|
+
});
|
|
44
|
+
const selectionService = new SelectionService(rta, changesService);
|
|
45
|
+
const connectorService = new WorkspaceConnectorService();
|
|
46
|
+
const contextMenuService = new ContextMenuService(rta);
|
|
47
|
+
const outlineService = new OutlineService(rta, changesService);
|
|
48
|
+
const quickActionService = new QuickActionService(rta, outlineService, registries, changesService);
|
|
49
|
+
const services = [connectorService, selectionService, changesService, contextMenuService, outlineService, rtaService, quickActionService];
|
|
50
|
+
|
|
51
|
+
// Do health check to all available oData service instances.
|
|
52
|
+
const oDataHealthChecker = new ODataHealthChecker(rta);
|
|
53
|
+
oDataHealthChecker.getHealthStatus().then(healthStatus => healthStatus.map(status => status instanceof ODataUpStatus ? Promise.resolve() : sendInfoCenterMessage({
|
|
54
|
+
title: {
|
|
55
|
+
key: 'ADP_ODATA_HEALTH_CHECK_TITLE'
|
|
56
|
+
},
|
|
57
|
+
description: {
|
|
58
|
+
key: 'ADP_ODATA_SERVICE_DOWN_DESCRIPTION',
|
|
59
|
+
params: [status.serviceUrl, status.errorMessage]
|
|
60
|
+
},
|
|
61
|
+
type: MessageBarType.warning
|
|
62
|
+
}))).catch(error => sendInfoCenterMessage({
|
|
63
|
+
title: {
|
|
64
|
+
key: 'ADP_ODATA_HEALTH_CHECK_TITLE'
|
|
65
|
+
},
|
|
66
|
+
description: getError(error).message,
|
|
67
|
+
type: MessageBarType.warning
|
|
68
|
+
}));
|
|
69
|
+
try {
|
|
70
|
+
loadDefaultLibraries();
|
|
71
|
+
const allPromises = services.map(service => {
|
|
72
|
+
return service.init(CommunicationService.sendAction, subscribe)?.catch(error => {
|
|
73
|
+
Log.error('Service Initialization Failed: ', getError(error));
|
|
74
|
+
});
|
|
75
|
+
}).filter(p => p !== undefined);
|
|
76
|
+
Promise.all(allPromises).then(() => {
|
|
77
|
+
CommunicationService.sendAction(appLoaded());
|
|
78
|
+
})
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
80
|
+
.catch(Log.error);
|
|
81
|
+
const icons = getIcons();
|
|
82
|
+
CommunicationService.sendAction(iconsLoaded(icons));
|
|
83
|
+
} catch (error) {
|
|
84
|
+
Log.error('Error during initialization of Control Property Editor', getError(error));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// * This is returned immediately to avoid promise deadlock, preventing services from waiting indefinitely.
|
|
88
|
+
return Promise.resolve();
|
|
89
|
+
}
|
|
90
|
+
return init;
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Log from 'sap/base/Log';
|
|
2
|
+
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
appLoaded,
|
|
6
|
+
enableTelemetry,
|
|
7
|
+
iconsLoaded,
|
|
8
|
+
MessageBarType
|
|
9
|
+
} from '@sap-ux-private/control-property-editor-common';
|
|
10
|
+
|
|
11
|
+
import { getError } from '../utils/error';
|
|
12
|
+
import { ChangeService } from './changes/service';
|
|
13
|
+
import { CommunicationService } from './communication-service';
|
|
14
|
+
import { WorkspaceConnectorService } from './connector-service';
|
|
15
|
+
import { ContextMenuService } from './context-menu-service';
|
|
16
|
+
import { loadDefaultLibraries } from './documentation';
|
|
17
|
+
import { OutlineService } from './outline/service';
|
|
18
|
+
import { QuickActionService } from './quick-actions/quick-action-service';
|
|
19
|
+
import type { QuickActionDefinitionRegistry } from './quick-actions/registry';
|
|
20
|
+
import { RtaService } from './rta-service';
|
|
21
|
+
import { SelectionService } from './selection';
|
|
22
|
+
import type { ActionHandler, Service } from './types';
|
|
23
|
+
import { getIcons } from './ui5-utils';
|
|
24
|
+
import { ODataHealthChecker } from './odata-health/odata-health-checker';
|
|
25
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
26
|
+
import { ODataUpStatus } from './odata-health/odata-health-status';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Subscribes a handler to the CommunicationService
|
|
30
|
+
*
|
|
31
|
+
* @param handler action handler
|
|
32
|
+
*/
|
|
33
|
+
function subscribe(handler: ActionHandler): void {
|
|
34
|
+
CommunicationService.subscribe(handler);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default function init(
|
|
38
|
+
rta: RuntimeAuthoring,
|
|
39
|
+
registries: QuickActionDefinitionRegistry<string>[] = []
|
|
40
|
+
): Promise<void> {
|
|
41
|
+
Log.info('Initializing Control Property Editor');
|
|
42
|
+
|
|
43
|
+
// enable telemetry if requested
|
|
44
|
+
const flexSettings = rta.getFlexSettings();
|
|
45
|
+
if (flexSettings.telemetry === true) {
|
|
46
|
+
enableTelemetry();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const rtaService = new RtaService(rta);
|
|
50
|
+
|
|
51
|
+
const changesService = new ChangeService({ rta });
|
|
52
|
+
const selectionService = new SelectionService(rta, changesService);
|
|
53
|
+
const connectorService = new WorkspaceConnectorService();
|
|
54
|
+
const contextMenuService = new ContextMenuService(rta);
|
|
55
|
+
const outlineService = new OutlineService(rta, changesService);
|
|
56
|
+
const quickActionService = new QuickActionService(rta, outlineService, registries, changesService);
|
|
57
|
+
const services: Service[] = [
|
|
58
|
+
connectorService,
|
|
59
|
+
selectionService,
|
|
60
|
+
changesService,
|
|
61
|
+
contextMenuService,
|
|
62
|
+
outlineService,
|
|
63
|
+
rtaService,
|
|
64
|
+
quickActionService
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// Do health check to all available oData service instances.
|
|
68
|
+
const oDataHealthChecker = new ODataHealthChecker(rta);
|
|
69
|
+
oDataHealthChecker
|
|
70
|
+
.getHealthStatus()
|
|
71
|
+
.then((healthStatus) =>
|
|
72
|
+
healthStatus.map((status) =>
|
|
73
|
+
status instanceof ODataUpStatus
|
|
74
|
+
? Promise.resolve()
|
|
75
|
+
: sendInfoCenterMessage({
|
|
76
|
+
title: { key: 'ADP_ODATA_HEALTH_CHECK_TITLE' },
|
|
77
|
+
description: {
|
|
78
|
+
key: 'ADP_ODATA_SERVICE_DOWN_DESCRIPTION',
|
|
79
|
+
params: [status.serviceUrl, status.errorMessage]
|
|
80
|
+
},
|
|
81
|
+
type: MessageBarType.warning
|
|
82
|
+
})
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
.catch((error) =>
|
|
86
|
+
sendInfoCenterMessage({
|
|
87
|
+
title: { key: 'ADP_ODATA_HEALTH_CHECK_TITLE' },
|
|
88
|
+
description: getError(error).message,
|
|
89
|
+
type: MessageBarType.warning
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
loadDefaultLibraries();
|
|
95
|
+
const allPromises = services.map((service) => {
|
|
96
|
+
return service.init(CommunicationService.sendAction, subscribe)?.catch((error) => {
|
|
97
|
+
Log.error('Service Initialization Failed: ', getError(error));
|
|
98
|
+
});
|
|
99
|
+
}).filter((p): p is Promise<void> => p !== undefined);
|
|
100
|
+
Promise.all(allPromises)
|
|
101
|
+
.then(() => {
|
|
102
|
+
CommunicationService.sendAction(appLoaded());
|
|
103
|
+
})
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
105
|
+
.catch(Log.error);
|
|
106
|
+
const icons = getIcons();
|
|
107
|
+
CommunicationService.sendAction(iconsLoaded(icons));
|
|
108
|
+
} catch (error) {
|
|
109
|
+
Log.error('Error during initialization of Control Property Editor', getError(error));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// * This is returned immediately to avoid promise deadlock, preventing services from waiting indefinitely.
|
|
113
|
+
return Promise.resolve();
|
|
114
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log"], function (Log) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function getString(message) {
|
|
7
|
+
if (typeof message === 'object') {
|
|
8
|
+
return JSON.stringify(message).toString();
|
|
9
|
+
}
|
|
10
|
+
return message;
|
|
11
|
+
}
|
|
12
|
+
const logger = {
|
|
13
|
+
info: message => {
|
|
14
|
+
Log.info(getString(message));
|
|
15
|
+
},
|
|
16
|
+
debug: message => {
|
|
17
|
+
Log.debug(getString(message));
|
|
18
|
+
},
|
|
19
|
+
warn: message => {
|
|
20
|
+
Log.warning(getString(message));
|
|
21
|
+
},
|
|
22
|
+
error: message => {
|
|
23
|
+
Log.error(getString(message));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var __exports = {
|
|
27
|
+
__esModule: true
|
|
28
|
+
};
|
|
29
|
+
__exports.logger = logger;
|
|
30
|
+
return __exports;
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Log from 'sap/base/Log';
|
|
2
|
+
import type { Logger } from '@sap-ux-private/control-property-editor-common';
|
|
3
|
+
|
|
4
|
+
function getString(message: string | object): string {
|
|
5
|
+
if (typeof message === 'object') {
|
|
6
|
+
return JSON.stringify(message).toString();
|
|
7
|
+
}
|
|
8
|
+
return message;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const logger: Logger = {
|
|
12
|
+
info: (message: string | object) => {
|
|
13
|
+
Log.info(getString(message));
|
|
14
|
+
},
|
|
15
|
+
debug: (message: string | object) => {
|
|
16
|
+
Log.debug(getString(message));
|
|
17
|
+
},
|
|
18
|
+
warn: (message: string | object) => {
|
|
19
|
+
Log.warning(getString(message));
|
|
20
|
+
},
|
|
21
|
+
error: (message: string | object) => {
|
|
22
|
+
Log.error(getString(message));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "sap/ui/model/odata/v2/ODataModel", "sap/ui/model/odata/v4/ODataModel", "./odata-health-status"], function (Log, ODataModelV2, ODataModelV4, ___odata_health_status) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const ODataDownStatus = ___odata_health_status["ODataDownStatus"];
|
|
7
|
+
const ODataUpStatus = ___odata_health_status["ODataUpStatus"];
|
|
8
|
+
/**
|
|
9
|
+
* The OData version type.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Describes an OData service instance.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Use this class to do a health check for all available OData services, supports both v2 and v4
|
|
16
|
+
* format. This health checker ensures not only that $metadata is valid, but also that the UI5 framework
|
|
17
|
+
* itself can consume the service via its models.
|
|
18
|
+
*/
|
|
19
|
+
class ODataHealthChecker {
|
|
20
|
+
/**
|
|
21
|
+
* The OData type.
|
|
22
|
+
*/
|
|
23
|
+
static ODATA_TYPE = 'OData';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The default OData version.
|
|
27
|
+
*/
|
|
28
|
+
static DEFAULT_ODATA_VERSION = 'v2';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Use this helper function to filter the OData data source items from the manifest.
|
|
32
|
+
* @param src The service data source.
|
|
33
|
+
* @returns True if the data source represents an OData service.
|
|
34
|
+
*/
|
|
35
|
+
isOdataService = src => src.type === ODataHealthChecker.ODATA_TYPE;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Use this helper function to map the OData data source to the internal structure
|
|
39
|
+
* used in this class.
|
|
40
|
+
* @param src The OData service data source.
|
|
41
|
+
* @returns The OData service info object.
|
|
42
|
+
*/
|
|
43
|
+
toOdataServiceInfo = src => ({
|
|
44
|
+
serviceUrl: src.uri,
|
|
45
|
+
oDataVersion: src.settings?.odataVersion ?? ODataHealthChecker.DEFAULT_ODATA_VERSION
|
|
46
|
+
});
|
|
47
|
+
constructor(rta) {
|
|
48
|
+
this.rta = rta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Does a health check to all available OData services.
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves with an array containing the health
|
|
55
|
+
* status for each OData service.
|
|
56
|
+
*/
|
|
57
|
+
async getHealthStatus() {
|
|
58
|
+
const oDataHealthCheckStartTime = Date.now();
|
|
59
|
+
const services = this.getServices();
|
|
60
|
+
const metadataPromises = await Promise.allSettled(services.map(({
|
|
61
|
+
serviceUrl,
|
|
62
|
+
oDataVersion
|
|
63
|
+
}) => this.getServiceMetadata(serviceUrl, oDataVersion)));
|
|
64
|
+
const oDataHealthCheckDurationInSec = ((Date.now() - oDataHealthCheckStartTime) / 1000).toFixed(2);
|
|
65
|
+
Log.info(`OData service health check took ${oDataHealthCheckDurationInSec} sec.`);
|
|
66
|
+
return metadataPromises.map((metadataPromise, idx) => metadataPromise.status === 'fulfilled' ? new ODataUpStatus(services[idx].serviceUrl) : new ODataDownStatus(services[idx].serviceUrl, metadataPromise.reason));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This method does a strong health check (with the ODataModel). This ensures not only
|
|
71
|
+
* that the $metadata is valid, but also that the UI5 framework itself can consume the service via its models.
|
|
72
|
+
* Some services may have valid $metadata but still fail in the UI5’s ODataModel
|
|
73
|
+
* (e.g., weird annotations, CORS issues, etc.).
|
|
74
|
+
*
|
|
75
|
+
* @param serviceUrl The OData service url.
|
|
76
|
+
* @param oDataVersion The OData version.
|
|
77
|
+
* @returns Resolved with valid metadata.
|
|
78
|
+
*/
|
|
79
|
+
getServiceMetadata(serviceUrl, oDataVersion) {
|
|
80
|
+
switch (oDataVersion) {
|
|
81
|
+
case 'v2':
|
|
82
|
+
case '2.0':
|
|
83
|
+
return this.getServiceV2Metadata(serviceUrl);
|
|
84
|
+
case 'v4':
|
|
85
|
+
case '4.0':
|
|
86
|
+
case '4.01':
|
|
87
|
+
return this.getServiceV4Metadata(serviceUrl);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
getServiceV2Metadata(serviceUrl) {
|
|
91
|
+
const oModel = new ODataModelV2({
|
|
92
|
+
serviceUrl,
|
|
93
|
+
json: true,
|
|
94
|
+
// We do not want the annotations concatenated to the final result.
|
|
95
|
+
loadAnnotationsJoined: false
|
|
96
|
+
});
|
|
97
|
+
// This method actually returns promise which is resolved with the metadata.
|
|
98
|
+
return oModel.metadataLoaded(true).finally(
|
|
99
|
+
// Do clean up in case the helath check is done multiple times.
|
|
100
|
+
() => oModel.destroy());
|
|
101
|
+
}
|
|
102
|
+
getServiceV4Metadata(serviceUrl) {
|
|
103
|
+
const oModel = new ODataModelV4({
|
|
104
|
+
serviceUrl,
|
|
105
|
+
// Only metadata loaded. We only want the model to load $metadata,
|
|
106
|
+
// not fetch entity data or bind to any UI controls.
|
|
107
|
+
synchronizationMode: 'None'
|
|
108
|
+
});
|
|
109
|
+
// This method actually returns promise which is resolved with the metadata.
|
|
110
|
+
return oModel.getMetaModel().requestObject('/').finally(
|
|
111
|
+
// Do clean up in case the helath check is done multiple times.
|
|
112
|
+
() => oModel.destroy());
|
|
113
|
+
}
|
|
114
|
+
getServices() {
|
|
115
|
+
const rootControl = this.rta.getRootControlInstance();
|
|
116
|
+
const manifest = rootControl.getManifest();
|
|
117
|
+
const dataSources = manifest?.['sap.app']?.dataSources;
|
|
118
|
+
const odataServices = Object.values(dataSources ?? {}).filter(this.isOdataService);
|
|
119
|
+
const isCloudFoundry = !!this.rta.getFlexSettings().isCloudFoundry;
|
|
120
|
+
if (isCloudFoundry) {
|
|
121
|
+
const manifestObject = rootControl.getManifestObject();
|
|
122
|
+
return odataServices.map(src => ({
|
|
123
|
+
serviceUrl: manifestObject.resolveUri(src.uri),
|
|
124
|
+
oDataVersion: src.settings?.odataVersion ?? ODataHealthChecker.DEFAULT_ODATA_VERSION
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
return odataServices.map(this.toOdataServiceInfo);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
var __exports = {
|
|
131
|
+
__esModule: true
|
|
132
|
+
};
|
|
133
|
+
__exports.ODataHealthChecker = ODataHealthChecker;
|
|
134
|
+
return __exports;
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=odata-health-checker.js.map
|