@sapui5/sap.fe.core 1.98.0 → 1.99.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/package.json +3 -2
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +3 -2
- package/src/sap/fe/core/AppStateHandler.js +229 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2399
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +3 -2
- package/src/sap/fe/core/PageController.js +84 -125
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -823
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -164
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1664
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +559 -608
- package/src/sap/fe/core/actions/draft.ts +593 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -514
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1215
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +54 -211
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +279 -11
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -6
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +47 -45
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +2 -3
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +29 -26
- package/src/sap/fe/core/controllerextensions/MassEdit.js +101 -8
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +17 -8
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +3 -2
- package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -2
- package/src/sap/fe/core/controllerextensions/Routing.js +9 -4
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +3 -2
- package/src/sap/fe/core/controllerextensions/SideEffects.js +3 -3
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +18 -18
- package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -2
- package/src/sap/fe/core/controls/FieldWrapper.js +11 -22
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -2
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +3 -2
- package/src/sap/fe/core/converters/ConverterContext.js +2 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +4 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +1 -0
- package/src/sap/fe/core/converters/ManifestWrapper.js +39 -26
- package/src/sap/fe/core/converters/ManifestWrapper.ts +9 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -8
- package/src/sap/fe/core/converters/MetaModelConverter.ts +16 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
- package/src/sap/fe/core/converters/controls/Common/Action.js +2 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +4 -2
- package/src/sap/fe/core/converters/controls/Common/Form.ts +16 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +250 -146
- package/src/sap/fe/core/converters/controls/Common/Table.ts +300 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +115 -56
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +120 -74
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +467 -32
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +483 -54
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
- package/src/sap/fe/core/converters/helpers/Aggregation.js +13 -5
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
- package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +7 -6
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +7 -4
- package/src/sap/fe/core/helpers/BindingExpression.js +314 -355
- package/src/sap/fe/core/helpers/BindingExpression.ts +317 -391
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
- package/src/sap/fe/core/helpers/MassEditHelper.js +27 -18
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +4 -3
- package/src/sap/fe/core/library.support.js +3 -2
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +1 -1
- package/src/sap/fe/core/messagebundle.properties +23 -10
- package/src/sap/fe/core/messagebundle_ar.properties +9 -0
- package/src/sap/fe/core/messagebundle_bg.properties +9 -0
- package/src/sap/fe/core/messagebundle_ca.properties +9 -0
- package/src/sap/fe/core/messagebundle_cs.properties +10 -1
- package/src/sap/fe/core/messagebundle_cy.properties +9 -0
- package/src/sap/fe/core/messagebundle_da.properties +9 -0
- package/src/sap/fe/core/messagebundle_de.properties +9 -0
- package/src/sap/fe/core/messagebundle_el.properties +9 -0
- package/src/sap/fe/core/messagebundle_en.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +9 -0
- package/src/sap/fe/core/messagebundle_es.properties +9 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +9 -0
- package/src/sap/fe/core/messagebundle_et.properties +9 -0
- package/src/sap/fe/core/messagebundle_fi.properties +9 -0
- package/src/sap/fe/core/messagebundle_fr.properties +13 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +15 -6
- package/src/sap/fe/core/messagebundle_hi.properties +15 -6
- package/src/sap/fe/core/messagebundle_hr.properties +15 -6
- package/src/sap/fe/core/messagebundle_hu.properties +9 -0
- package/src/sap/fe/core/messagebundle_id.properties +10 -1
- package/src/sap/fe/core/messagebundle_it.properties +9 -0
- package/src/sap/fe/core/messagebundle_iw.properties +9 -0
- package/src/sap/fe/core/messagebundle_ja.properties +9 -0
- package/src/sap/fe/core/messagebundle_kk.properties +15 -6
- package/src/sap/fe/core/messagebundle_ko.properties +9 -0
- package/src/sap/fe/core/messagebundle_lt.properties +9 -0
- package/src/sap/fe/core/messagebundle_lv.properties +15 -6
- package/src/sap/fe/core/messagebundle_ms.properties +14 -5
- package/src/sap/fe/core/messagebundle_nl.properties +9 -0
- package/src/sap/fe/core/messagebundle_no.properties +9 -0
- package/src/sap/fe/core/messagebundle_pl.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +9 -0
- package/src/sap/fe/core/messagebundle_ro.properties +9 -0
- package/src/sap/fe/core/messagebundle_ru.properties +9 -0
- package/src/sap/fe/core/messagebundle_sh.properties +11 -2
- package/src/sap/fe/core/messagebundle_sk.properties +9 -0
- package/src/sap/fe/core/messagebundle_sl.properties +15 -6
- package/src/sap/fe/core/messagebundle_sv.properties +9 -0
- package/src/sap/fe/core/messagebundle_th.properties +9 -0
- package/src/sap/fe/core/messagebundle_tr.properties +9 -0
- package/src/sap/fe/core/messagebundle_uk.properties +9 -0
- package/src/sap/fe/core/messagebundle_vi.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +15 -6
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -899
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
- package/src/sap/fe/core/services/ShellServicesFactory.ts +15 -10
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +35 -81
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +46 -94
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -487
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +138 -72
- package/src/sap/fe/core/templating/FilterHelper.ts +139 -71
- package/src/sap/fe/core/templating/UIFormatters.js +31 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +33 -2
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
|
@@ -55,7 +55,7 @@ export type StandardActionsContext = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Generates context for the standard actions.
|
|
58
|
+
* Generates the context for the standard actions.
|
|
59
59
|
*
|
|
60
60
|
* @param {ConverterContext} converterContext
|
|
61
61
|
* @param {NavigationSettingsConfiguration} navigationSettings
|
|
@@ -100,17 +100,13 @@ export function isExternalCreateConfigured(navigationSettings: NavigationSetting
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
|
-
* Checks if
|
|
103
|
+
* Checks if draft is supported.
|
|
104
104
|
*
|
|
105
105
|
* @param {ConverterContext} converterContext
|
|
106
106
|
* @returns {boolean}
|
|
107
107
|
*/
|
|
108
|
-
export function
|
|
108
|
+
export function isDraftSupported(converterContext: ConverterContext): boolean {
|
|
109
109
|
const currentEntitySet = converterContext.getEntitySet();
|
|
110
|
-
const bIsStickySessionSupported = converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Session
|
|
111
|
-
?.StickySessionSupported
|
|
112
|
-
? true
|
|
113
|
-
: false;
|
|
114
110
|
const bIsDraftRoot = currentEntitySet && currentEntitySet.annotations?.Common?.DraftRoot ? true : false;
|
|
115
111
|
const bIsDraftNode = currentEntitySet && currentEntitySet.annotations?.Common?.DraftNode ? true : false;
|
|
116
112
|
const bIsDraftParentEntityForContainment =
|
|
@@ -120,12 +116,23 @@ export function isDraftOrStickySupported(converterContext: ConverterContext): bo
|
|
|
120
116
|
? true
|
|
121
117
|
: false;
|
|
122
118
|
|
|
123
|
-
return (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
return bIsDraftRoot || bIsDraftNode || (!converterContext.getEntitySet() && bIsDraftParentEntityForContainment);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Checks if sticky or draft is supported.
|
|
124
|
+
*
|
|
125
|
+
* @param {ConverterContext} converterContext
|
|
126
|
+
* @returns {boolean}
|
|
127
|
+
*/
|
|
128
|
+
export function isDraftOrStickySupported(converterContext: ConverterContext): boolean {
|
|
129
|
+
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
130
|
+
const bIsStickySessionSupported = converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Session
|
|
131
|
+
?.StickySessionSupported
|
|
132
|
+
? true
|
|
133
|
+
: false;
|
|
134
|
+
|
|
135
|
+
return bIsDraftSupported || bIsStickySessionSupported;
|
|
129
136
|
}
|
|
130
137
|
|
|
131
138
|
/**
|
|
@@ -152,7 +159,7 @@ export function getNewAction(converterContext: ConverterContext): any {
|
|
|
152
159
|
}
|
|
153
160
|
|
|
154
161
|
/**
|
|
155
|
-
* Gets binding expression for the action visibility configured into annotation.
|
|
162
|
+
* Gets the binding expression for the action visibility configured into annotation.
|
|
156
163
|
*
|
|
157
164
|
* @param {ConverterContext} converterContext
|
|
158
165
|
* @param {string} sAnnotationTerm
|
|
@@ -177,7 +184,7 @@ export function isActionAnnotatedHidden(converterContext: ConverterContext, sAnn
|
|
|
177
184
|
}
|
|
178
185
|
|
|
179
186
|
/**
|
|
180
|
-
* Gets annotated restrictions for actions.
|
|
187
|
+
* Gets the annotated restrictions for the actions.
|
|
181
188
|
*
|
|
182
189
|
* @param {ConverterContext} converterContext
|
|
183
190
|
* @returns {StandardActionsRestrictionsType}
|
|
@@ -214,20 +221,20 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
|
|
|
214
221
|
* Checks if templating for insert/update actions is mandatory.
|
|
215
222
|
*
|
|
216
223
|
* @param {StandardActionsContext} standardActionsContext
|
|
217
|
-
* @param {boolean}
|
|
224
|
+
* @param {boolean} isDraftOrSticky
|
|
218
225
|
* @param {boolean} isCreateAlwaysHidden
|
|
219
226
|
* @returns {boolean}
|
|
220
227
|
*/
|
|
221
228
|
export function getInsertUpdateActionsTemplating(
|
|
222
229
|
standardActionsContext: StandardActionsContext,
|
|
223
|
-
|
|
230
|
+
isDraftOrSticky: boolean,
|
|
224
231
|
isCreateAlwaysHidden: boolean
|
|
225
232
|
): boolean {
|
|
226
|
-
return (
|
|
233
|
+
return (isDraftOrSticky || standardActionsContext.isExternalCreateConfigured) && !isCreateAlwaysHidden;
|
|
227
234
|
}
|
|
228
235
|
|
|
229
236
|
/**
|
|
230
|
-
* Gets binding expressions for the properties of the action Create.
|
|
237
|
+
* Gets the binding expressions for the properties of the action Create.
|
|
231
238
|
*
|
|
232
239
|
* @param {ConverterContext} converterContext
|
|
233
240
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -246,7 +253,7 @@ export function getStandardActionCreate(
|
|
|
246
253
|
}
|
|
247
254
|
|
|
248
255
|
/**
|
|
249
|
-
* Gets binding expressions for the properties of the action Delete.
|
|
256
|
+
* Gets the binding expressions for the properties of the action Delete.
|
|
250
257
|
*
|
|
251
258
|
* @param {ConverterContext} converterContext
|
|
252
259
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -266,50 +273,49 @@ export function getStandardActionDelete(
|
|
|
266
273
|
}
|
|
267
274
|
|
|
268
275
|
/**
|
|
269
|
-
* Gets binding expressions for the properties of the action Paste.
|
|
276
|
+
* Gets the binding expressions for the properties of the action Paste.
|
|
270
277
|
*
|
|
271
278
|
* @param {ConverterContext} converterContext
|
|
272
279
|
* @param {StandardActionsContext} standardActionsContext
|
|
280
|
+
* @param {boolean} isInsertUpdateActionsTemplated
|
|
273
281
|
* @returns {StandardActionConfigType}
|
|
274
282
|
*/
|
|
275
283
|
export function getStandardActionPaste(
|
|
276
284
|
converterContext: ConverterContext,
|
|
277
|
-
standardActionsContext: StandardActionsContext
|
|
285
|
+
standardActionsContext: StandardActionsContext,
|
|
286
|
+
isInsertUpdateActionsTemplated: boolean
|
|
278
287
|
): StandardActionConfigType {
|
|
279
288
|
const createVisibility = getCreateVisibility(converterContext, standardActionsContext);
|
|
280
|
-
const
|
|
281
|
-
|
|
289
|
+
const createEnablement = getCreateEnablement(converterContext, standardActionsContext, createVisibility);
|
|
290
|
+
const pasteVisibility = getPasteVisibility(converterContext, standardActionsContext, createVisibility, isInsertUpdateActionsTemplated);
|
|
282
291
|
return {
|
|
283
|
-
isTemplated: compileBinding(getDefaultTemplating(pasteVisibility)),
|
|
284
292
|
visible: compileBinding(pasteVisibility),
|
|
285
|
-
enabled: compileBinding(pasteVisibility)
|
|
293
|
+
enabled: compileBinding(getPasteEnablement(pasteVisibility, createEnablement))
|
|
286
294
|
};
|
|
287
295
|
}
|
|
288
296
|
|
|
289
297
|
/**
|
|
290
|
-
* Gets binding expressions for the properties of the action MassEdit.
|
|
298
|
+
* Gets the binding expressions for the properties of the action MassEdit.
|
|
291
299
|
*
|
|
292
300
|
* @param {ConverterContext} converterContext
|
|
293
301
|
* @param {StandardActionsContext} standardActionsContext
|
|
294
|
-
* @param {string | undefined} selectionMode
|
|
295
302
|
* @returns {StandardActionConfigType}
|
|
296
303
|
*/
|
|
297
304
|
export function getStandardActionMassEdit(
|
|
298
305
|
converterContext: ConverterContext,
|
|
299
|
-
standardActionsContext: StandardActionsContext
|
|
300
|
-
selectionMode: string | undefined
|
|
306
|
+
standardActionsContext: StandardActionsContext
|
|
301
307
|
): StandardActionConfigType {
|
|
302
|
-
const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext
|
|
308
|
+
const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext);
|
|
303
309
|
|
|
304
310
|
return {
|
|
305
311
|
isTemplated: compileBinding(getDefaultTemplating(massEditVisibility)),
|
|
306
312
|
visible: compileBinding(massEditVisibility),
|
|
307
|
-
enabled: compileBinding(getMassEditEnablement(standardActionsContext, massEditVisibility))
|
|
313
|
+
enabled: compileBinding(getMassEditEnablement(converterContext, standardActionsContext, massEditVisibility))
|
|
308
314
|
};
|
|
309
315
|
}
|
|
310
316
|
|
|
311
317
|
/**
|
|
312
|
-
* Gets binding
|
|
318
|
+
* Gets the binding expression for the templating of the action Create.
|
|
313
319
|
*
|
|
314
320
|
* @param {StandardActionsContext} standardActionsContext
|
|
315
321
|
* @param {Expression<boolean>} createVisibility
|
|
@@ -350,7 +356,7 @@ export function getCreateTemplating(
|
|
|
350
356
|
}
|
|
351
357
|
|
|
352
358
|
/**
|
|
353
|
-
* Gets binding
|
|
359
|
+
* Gets the binding expression for the templating of the non-Create actions.
|
|
354
360
|
*
|
|
355
361
|
* @param {Expression<boolean>} actionVisibility
|
|
356
362
|
* @returns {Expression<boolean> }
|
|
@@ -360,7 +366,7 @@ export function getDefaultTemplating(actionVisibility: Expression<boolean>): Exp
|
|
|
360
366
|
}
|
|
361
367
|
|
|
362
368
|
/**
|
|
363
|
-
* Gets binding
|
|
369
|
+
* Gets the binding expression for the property visible of the action Create.
|
|
364
370
|
*
|
|
365
371
|
* @param {ConverterContext} converterContext
|
|
366
372
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -410,7 +416,7 @@ export function getCreateVisibility(
|
|
|
410
416
|
}
|
|
411
417
|
|
|
412
418
|
/**
|
|
413
|
-
* Gets binding
|
|
419
|
+
* Gets the binding expression for the property visible of the action Delete.
|
|
414
420
|
*
|
|
415
421
|
* @param {ConverterContext} converterContext
|
|
416
422
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -421,7 +427,7 @@ export function getDeleteVisibility(
|
|
|
421
427
|
standardActionsContext: StandardActionsContext
|
|
422
428
|
): Expression<boolean> {
|
|
423
429
|
const isDeleteHidden = standardActionsContext.hiddenAnnotation.delete;
|
|
424
|
-
const
|
|
430
|
+
const pathDeletableExpression = standardActionsContext.restrictions.isDeletable.expression;
|
|
425
431
|
|
|
426
432
|
//Delete Button is visible:
|
|
427
433
|
// Prerequisites:
|
|
@@ -440,7 +446,7 @@ export function getDeleteVisibility(
|
|
|
440
446
|
or(standardActionsContext.isViewWithMultipleVisualizations, converterContext.getTemplateType() === TemplateType.AnalyticalListPage),
|
|
441
447
|
false,
|
|
442
448
|
ifElse(
|
|
443
|
-
and(isConstant(
|
|
449
|
+
and(isConstant(pathDeletableExpression), equal(pathDeletableExpression, false)),
|
|
444
450
|
false,
|
|
445
451
|
ifElse(
|
|
446
452
|
and(isConstant(isDeleteHidden), equal(isDeleteHidden, constant(true))),
|
|
@@ -456,22 +462,29 @@ export function getDeleteVisibility(
|
|
|
456
462
|
}
|
|
457
463
|
|
|
458
464
|
/**
|
|
459
|
-
* Gets binding
|
|
465
|
+
* Gets the binding expression for the property visible of the action Paste.
|
|
460
466
|
*
|
|
461
467
|
* @param {ConverterContext} converterContext
|
|
462
468
|
* @param {StandardActionsContext} standardActionsContext
|
|
463
469
|
* @param {Expression<boolean>} createVisibility
|
|
470
|
+
* @param {boolean} isInsertUpdateActionsTemplated
|
|
464
471
|
* @returns {Expression<boolean> }
|
|
465
472
|
*/
|
|
466
473
|
export function getPasteVisibility(
|
|
467
474
|
converterContext: ConverterContext,
|
|
468
475
|
standardActionsContext: StandardActionsContext,
|
|
469
|
-
createVisibility: Expression<boolean
|
|
476
|
+
createVisibility: Expression<boolean>,
|
|
477
|
+
isInsertUpdateActionsTemplated: boolean
|
|
470
478
|
): Expression<boolean> {
|
|
471
|
-
// If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
|
|
479
|
+
// If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
|
|
480
|
+
// Then button will be visible according to insertable restrictions and create visibility
|
|
472
481
|
// Otherwise it's not visible
|
|
473
482
|
return ifElse(
|
|
474
|
-
and(
|
|
483
|
+
and(
|
|
484
|
+
notEqual(standardActionsContext.tableManifestConfiguration.enablePaste, false),
|
|
485
|
+
createVisibility,
|
|
486
|
+
isInsertUpdateActionsTemplated
|
|
487
|
+
),
|
|
475
488
|
[TemplateType.ListReport, TemplateType.AnalyticalListPage].indexOf(converterContext.getTemplateType()) === -1 &&
|
|
476
489
|
standardActionsContext.restrictions.isInsertable.expression,
|
|
477
490
|
false
|
|
@@ -479,24 +492,23 @@ export function getPasteVisibility(
|
|
|
479
492
|
}
|
|
480
493
|
|
|
481
494
|
/**
|
|
482
|
-
* Gets binding
|
|
495
|
+
* Gets the binding expression for the property visible of the action MassEdit.
|
|
483
496
|
*
|
|
484
497
|
* @param {ConverterContext} converterContext
|
|
485
498
|
* @param {StandardActionsContext} standardActionsContext
|
|
486
|
-
* @param {string | undefined} selectionMode
|
|
487
499
|
* @returns {Expression<boolean> }
|
|
488
500
|
*/
|
|
489
501
|
export function getMassEditVisibility(
|
|
490
502
|
converterContext: ConverterContext,
|
|
491
|
-
standardActionsContext: StandardActionsContext
|
|
492
|
-
selectionMode: string | undefined
|
|
503
|
+
standardActionsContext: StandardActionsContext
|
|
493
504
|
): Expression<boolean> {
|
|
494
505
|
const isUpdateHidden = standardActionsContext.hiddenAnnotation.update,
|
|
495
|
-
|
|
496
|
-
bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
506
|
+
pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression,
|
|
507
|
+
bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false;
|
|
508
|
+
const templateBindingExpression =
|
|
509
|
+
converterContext.getTemplateType() === TemplateType.ObjectPage
|
|
510
|
+
? equal(UI.IsEditable, true)
|
|
511
|
+
: converterContext.getTemplateType() === TemplateType.ListReport;
|
|
500
512
|
//MassEdit is visible
|
|
501
513
|
// If
|
|
502
514
|
// - there is no static restrictions set to false
|
|
@@ -505,18 +517,14 @@ export function getMassEditVisibility(
|
|
|
505
517
|
// Then MassEdit is always visible in LR or dynamically visible in OP according to ui>Editable and hiddenAnnotation
|
|
506
518
|
// Button is hidden for all other cases
|
|
507
519
|
return ifElse(
|
|
508
|
-
and(not(and(isConstant(
|
|
509
|
-
|
|
510
|
-
converterContext.getTemplateType() === TemplateType.ObjectPage,
|
|
511
|
-
and(equal(UI.IsEditable, true), not(isUpdateHidden)),
|
|
512
|
-
converterContext.getTemplateType() === TemplateType.ListReport
|
|
513
|
-
),
|
|
520
|
+
and(not(and(isConstant(pathUpdatableExpression), equal(pathUpdatableExpression, false))), bMassEditEnabledInManifest),
|
|
521
|
+
and(templateBindingExpression, not(isUpdateHidden)),
|
|
514
522
|
false
|
|
515
523
|
);
|
|
516
524
|
}
|
|
517
525
|
|
|
518
526
|
/**
|
|
519
|
-
* Gets binding
|
|
527
|
+
* Gets the binding expression for the property enabled of the action Create.
|
|
520
528
|
*
|
|
521
529
|
* @param {ConverterContext} converterContext
|
|
522
530
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -531,7 +539,7 @@ export function getCreateEnablement(
|
|
|
531
539
|
const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
|
|
532
540
|
const CollectionType = converterContext.resolveAbsolutePath<any>(standardActionsContext.collectionPath).target?._type;
|
|
533
541
|
return and(
|
|
534
|
-
|
|
542
|
+
createVisibility,
|
|
535
543
|
ifElse(
|
|
536
544
|
CollectionType === "EntitySet",
|
|
537
545
|
true,
|
|
@@ -545,7 +553,7 @@ export function getCreateEnablement(
|
|
|
545
553
|
}
|
|
546
554
|
|
|
547
555
|
/**
|
|
548
|
-
* Gets binding
|
|
556
|
+
* Gets the binding expression for the property enabled of the action Delete.
|
|
549
557
|
*
|
|
550
558
|
* @param {ConverterContext} converterContext
|
|
551
559
|
* @param {StandardActionsContext} standardActionsContext
|
|
@@ -565,7 +573,7 @@ export function getDeleteEnablement(
|
|
|
565
573
|
const numberOfUnSavedContexts = bindingExpression("unSavedContexts", "internal");
|
|
566
574
|
|
|
567
575
|
return and(
|
|
568
|
-
|
|
576
|
+
deleteVisibility,
|
|
569
577
|
ifElse(
|
|
570
578
|
or(converterContext.getTemplateType() !== TemplateType.ObjectPage, isOnlyDynamicOnCurrentEntity),
|
|
571
579
|
ifElse(
|
|
@@ -582,28 +590,66 @@ export function getDeleteEnablement(
|
|
|
582
590
|
}
|
|
583
591
|
|
|
584
592
|
/**
|
|
585
|
-
* Gets binding
|
|
593
|
+
* Gets the binding expression for the property enabled of the action Paste.
|
|
594
|
+
*
|
|
595
|
+
* @param {Expression<boolean>} pasteVisibility
|
|
596
|
+
* @param {Expression<boolean>} createEnablement
|
|
597
|
+
* @returns {Expression<boolean> }
|
|
598
|
+
*/
|
|
599
|
+
export function getPasteEnablement(pasteVisibility: Expression<boolean>, createEnablement: Expression<boolean>): Expression<boolean> {
|
|
600
|
+
return and(pasteVisibility, createEnablement);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Gets the binding expression for the property enabled of the action MassEdit.
|
|
586
605
|
*
|
|
606
|
+
* @param {ConverterContext} converterContext
|
|
587
607
|
* @param {StandardActionsContext} standardActionsContext
|
|
588
608
|
* @param {Expression<boolean>} massEditVisibility
|
|
589
609
|
* @returns {Expression<boolean> }
|
|
590
610
|
*/
|
|
591
611
|
export function getMassEditEnablement(
|
|
612
|
+
converterContext: ConverterContext,
|
|
592
613
|
standardActionsContext: StandardActionsContext,
|
|
593
614
|
massEditVisibility: Expression<boolean>
|
|
594
615
|
): Expression<boolean> {
|
|
595
|
-
const
|
|
616
|
+
const pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression;
|
|
596
617
|
const isOnlyDynamicOnCurrentEntity: any =
|
|
597
|
-
standardActionsContext.restrictions.isUpdatable.isOnlyCurrentEntityExpression && !isConstant(
|
|
598
|
-
const numberOfSelectedContexts = greaterOrEqual(bindingExpression("numberOfSelectedContexts", "internal"),
|
|
599
|
-
const numberOfUpdatableContexts = greaterOrEqual(length(bindingExpression("updatableContexts", "internal")),
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
618
|
+
standardActionsContext.restrictions.isUpdatable.isOnlyCurrentEntityExpression && !isConstant(pathUpdatableExpression);
|
|
619
|
+
const numberOfSelectedContexts = greaterOrEqual(bindingExpression("numberOfSelectedContexts", "internal"), 1);
|
|
620
|
+
const numberOfUpdatableContexts = greaterOrEqual(length(bindingExpression("updatableContexts", "internal")), 1);
|
|
621
|
+
const bIsDraftSupported = isDraftSupported(converterContext);
|
|
622
|
+
const bDisplayMode = isInDisplayMode(converterContext);
|
|
623
|
+
|
|
624
|
+
// numberOfUpdatableContexts needs to be added to the binding in case
|
|
625
|
+
// 1. Update is dependent on current entity property (isOnlyDynamicOnCurrentEntity is true).
|
|
626
|
+
// 2. The table is read only and draft enabled(like LR), in this case only active contexts can be mass edited.
|
|
627
|
+
// So, update depends on 'IsActiveEntity' value which needs to be checked runtime.
|
|
628
|
+
const runtimeBinding = ifElse(
|
|
629
|
+
or(and(bDisplayMode, bIsDraftSupported), isOnlyDynamicOnCurrentEntity),
|
|
630
|
+
and(numberOfSelectedContexts, numberOfUpdatableContexts),
|
|
631
|
+
and(numberOfSelectedContexts)
|
|
608
632
|
);
|
|
633
|
+
|
|
634
|
+
return and(massEditVisibility, ifElse(isOnlyDynamicOnCurrentEntity, runtimeBinding, and(runtimeBinding, pathUpdatableExpression)));
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Tells if the table in template is in display mode.
|
|
639
|
+
*
|
|
640
|
+
* @param {ConverterContext} converterContext
|
|
641
|
+
* @param {ViewPathConfiguration} viewConfiguration
|
|
642
|
+
* @returns {boolean}
|
|
643
|
+
*/
|
|
644
|
+
export function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
|
|
645
|
+
const templateType = converterContext.getTemplateType();
|
|
646
|
+
if (
|
|
647
|
+
templateType === TemplateType.ListReport ||
|
|
648
|
+
templateType === TemplateType.AnalyticalListPage ||
|
|
649
|
+
(viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration))
|
|
650
|
+
) {
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
// updatable will be handled at the property level
|
|
654
|
+
return false;
|
|
609
655
|
}
|