@openui5/sap.ui.fl 1.121.4 → 1.121.5
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 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +1 -2
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
- package/src/sap/ui/fl/FlexController.js +10 -6
- package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +74 -60
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +11 -30
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +6 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantModel.js +18 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +5 -1
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/restricted/_omit",
|
|
9
|
+
"sap/base/util/Deferred",
|
|
9
10
|
"sap/base/util/each",
|
|
10
11
|
"sap/base/util/merge",
|
|
11
12
|
"sap/base/util/ObjectPath",
|
|
@@ -24,6 +25,7 @@ sap.ui.define([
|
|
|
24
25
|
"sap/ui/fl/requireAsync"
|
|
25
26
|
], function(
|
|
26
27
|
_omit,
|
|
28
|
+
Deferred,
|
|
27
29
|
each,
|
|
28
30
|
merge,
|
|
29
31
|
ObjectPath,
|
|
@@ -83,7 +85,7 @@ sap.ui.define([
|
|
|
83
85
|
*
|
|
84
86
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
85
87
|
* @since 1.73
|
|
86
|
-
* @version 1.121.
|
|
88
|
+
* @version 1.121.5
|
|
87
89
|
* @private
|
|
88
90
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
89
91
|
*/
|
|
@@ -352,30 +354,25 @@ sap.ui.define([
|
|
|
352
354
|
return mFilteredReturn;
|
|
353
355
|
}
|
|
354
356
|
|
|
355
|
-
function loadFlexData(mPropertyBag) {
|
|
356
|
-
|
|
357
|
-
.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
componentData: mPropertyBag.componentData,
|
|
367
|
-
partialFlexState: mPropertyBag.partialFlexState
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
storeInfoInSession(mPropertyBag.reference, mResponse);
|
|
371
|
-
|
|
372
|
-
// no further changes to storageResponse properties allowed
|
|
373
|
-
Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
|
|
374
|
-
Object.freeze(_mInstances[mPropertyBag.reference].unfilteredStorageResponse);
|
|
375
|
-
return mResponse;
|
|
357
|
+
async function loadFlexData(mPropertyBag) {
|
|
358
|
+
const mResponse = await Loader.loadFlexData(mPropertyBag);
|
|
359
|
+
mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
|
|
360
|
+
|
|
361
|
+
// The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
|
|
362
|
+
_mInstances[mPropertyBag.reference] = merge({}, {
|
|
363
|
+
unfilteredStorageResponse: mResponse,
|
|
364
|
+
preparedMaps: {},
|
|
365
|
+
componentId: mPropertyBag.componentId,
|
|
366
|
+
componentData: mPropertyBag.componentData,
|
|
367
|
+
partialFlexState: mPropertyBag.partialFlexState
|
|
376
368
|
});
|
|
377
369
|
|
|
378
|
-
|
|
370
|
+
storeInfoInSession(mPropertyBag.reference, mResponse);
|
|
371
|
+
|
|
372
|
+
// no further changes to storageResponse properties allowed
|
|
373
|
+
Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
|
|
374
|
+
Object.freeze(_mInstances[mPropertyBag.reference].unfilteredStorageResponse);
|
|
375
|
+
return mResponse;
|
|
379
376
|
}
|
|
380
377
|
|
|
381
378
|
function storeInfoInSession(sReference, mResponse) {
|
|
@@ -438,30 +435,45 @@ sap.ui.define([
|
|
|
438
435
|
* @param {boolean} [mPropertyBag.partialFlexState=false] - if true state is initialized partially and does not include flex bundles
|
|
439
436
|
* @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized
|
|
440
437
|
*/
|
|
441
|
-
FlexState.initialize = function(mPropertyBag) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
: _mInstances[sFlexReference].unfilteredStorageResponse;
|
|
457
|
-
});
|
|
438
|
+
FlexState.initialize = async function(mPropertyBag) {
|
|
439
|
+
enhancePropertyBag(mPropertyBag);
|
|
440
|
+
const sFlexReference = mPropertyBag.reference;
|
|
441
|
+
|
|
442
|
+
const oOldInitPromise = _mInitPromises[sFlexReference];
|
|
443
|
+
const oNewInitPromise = new Deferred();
|
|
444
|
+
_mInitPromises[sFlexReference] = oNewInitPromise;
|
|
445
|
+
await lazyLoadModules();
|
|
446
|
+
|
|
447
|
+
if (oOldInitPromise) {
|
|
448
|
+
await oOldInitPromise.promise;
|
|
449
|
+
checkPartialFlexState(mPropertyBag);
|
|
450
|
+
checkComponentId(mPropertyBag);
|
|
451
|
+
if (mPropertyBag.reInitialize) {
|
|
452
|
+
await loadFlexData(mPropertyBag);
|
|
458
453
|
}
|
|
454
|
+
} else {
|
|
455
|
+
await loadFlexData(mPropertyBag);
|
|
456
|
+
}
|
|
459
457
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
458
|
+
initializeNewInstance(mPropertyBag);
|
|
459
|
+
oNewInitPromise.resolve();
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Waits until the FlexState is initialized
|
|
464
|
+
* This is only necessary if <code>FlexState.initialize</code> cannot be called directly
|
|
465
|
+
* due to missing information for the backend request (e.g. asyncHints)
|
|
466
|
+
*
|
|
467
|
+
* @param {string} sFlexReference - Flex reference of the app
|
|
468
|
+
* @returns {Promise<undefined>} Promise that resolves as soon as FlexState is initialized
|
|
469
|
+
*/
|
|
470
|
+
FlexState.waitForInitialization = function(sFlexReference) {
|
|
471
|
+
const oInitPromise = _mInitPromises[sFlexReference]?.promise;
|
|
472
|
+
if (!oInitPromise) {
|
|
473
|
+
Log.error("FlexState.waitForInitialization was called before FlexState.initialize");
|
|
474
|
+
return Promise.resolve();
|
|
475
|
+
}
|
|
476
|
+
return oInitPromise;
|
|
465
477
|
};
|
|
466
478
|
|
|
467
479
|
/**
|
|
@@ -507,7 +519,7 @@ sap.ui.define([
|
|
|
507
519
|
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be updated
|
|
508
520
|
* @returns {Promise<undefined>} Resolves when the data is loaded and the runtime persistence is updated
|
|
509
521
|
*/
|
|
510
|
-
FlexState.update = function(mPropertyBag) {
|
|
522
|
+
FlexState.update = async function(mPropertyBag) {
|
|
511
523
|
enhancePropertyBag(mPropertyBag);
|
|
512
524
|
var sReference = mPropertyBag.reference;
|
|
513
525
|
var oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
|
|
@@ -521,19 +533,21 @@ sap.ui.define([
|
|
|
521
533
|
_oChangePersistenceFactory._instanceCache[sReference].removeDirtyChanges();
|
|
522
534
|
}
|
|
523
535
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
536
|
+
const oOldInitPromise = _mInitPromises[sReference].promise;
|
|
537
|
+
const oNewInitPromise = new Deferred();
|
|
538
|
+
_mInitPromises[sReference] = oNewInitPromise;
|
|
539
|
+
await oOldInitPromise;
|
|
540
|
+
await loadFlexData(mPropertyBag);
|
|
541
|
+
oNewInitPromise.resolve();
|
|
542
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
543
|
+
var bUpdated = updateRuntimePersistence(
|
|
544
|
+
sReference,
|
|
545
|
+
_mInstances[sReference].storageResponse,
|
|
546
|
+
oCurrentRuntimePersistence
|
|
547
|
+
);
|
|
548
|
+
if (bUpdated) {
|
|
549
|
+
oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
|
|
550
|
+
}
|
|
537
551
|
};
|
|
538
552
|
|
|
539
553
|
function getChangeCategory(oChangeDefinition) {
|
|
@@ -826,7 +840,7 @@ sap.ui.define([
|
|
|
826
840
|
// TODO: also used by the CompVariantState to mutate the storage response, this has to be changed
|
|
827
841
|
FlexState.getStorageResponse = function(sReference) {
|
|
828
842
|
if (_mInitPromises[sReference]) {
|
|
829
|
-
return _mInitPromises[sReference].then(function() {
|
|
843
|
+
return _mInitPromises[sReference].promise.then(function() {
|
|
830
844
|
return _mInstances[sReference].unfilteredStorageResponse;
|
|
831
845
|
});
|
|
832
846
|
}
|
|
@@ -123,7 +123,7 @@ sap.ui.define([
|
|
|
123
123
|
*
|
|
124
124
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
125
125
|
* @since 1.86
|
|
126
|
-
* @version 1.121.
|
|
126
|
+
* @version 1.121.5
|
|
127
127
|
* @private
|
|
128
128
|
* @ui5-restricted sap.ui.fl
|
|
129
129
|
*/
|
|
@@ -208,7 +208,7 @@ sap.ui.define([
|
|
|
208
208
|
*
|
|
209
209
|
* @function
|
|
210
210
|
* @since 1.89
|
|
211
|
-
* @version 1.121.
|
|
211
|
+
* @version 1.121.5
|
|
212
212
|
* @private
|
|
213
213
|
* @ui5-restricted sap.ui.fl
|
|
214
214
|
*
|
|
@@ -22,7 +22,6 @@ sap.ui.define([
|
|
|
22
22
|
* @param {string} mPropertyBag.vmReference - Variant management ID
|
|
23
23
|
* @param {string} mPropertyBag.currentVReference - The ID of the currently used variant
|
|
24
24
|
* @param {string} mPropertyBag.newVReference - ID of the newly selected variant
|
|
25
|
-
* @param {object} mPropertyBag.changesMap - Changes inside the current changes map
|
|
26
25
|
*
|
|
27
26
|
* @typedef {object} sap.ui.fl.variants.SwitchChanges
|
|
28
27
|
* @property {array} changesToBeReverted - Array of changes to be reverted
|
|
@@ -32,7 +31,7 @@ sap.ui.define([
|
|
|
32
31
|
* @private
|
|
33
32
|
* @ui5-restricted
|
|
34
33
|
*/
|
|
35
|
-
function
|
|
34
|
+
function getControlChangesForVariantSwitch(mPropertyBag) {
|
|
36
35
|
var aCurrentVariantChanges = VariantManagementState.getControlChangesForVariant(
|
|
37
36
|
Object.assign(
|
|
38
37
|
_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
|
|
@@ -47,25 +46,11 @@ sap.ui.define([
|
|
|
47
46
|
}
|
|
48
47
|
)
|
|
49
48
|
);
|
|
50
|
-
var aMapChanges = Object.keys(mPropertyBag.changesMap).reduce(function(aControlChanges, sControlId) {
|
|
51
|
-
return aControlChanges.concat(mPropertyBag.changesMap[sControlId]);
|
|
52
|
-
}, []);
|
|
53
|
-
var aChangeKeysFromMap = aMapChanges.map(function(oCurrentVariantChange) {
|
|
54
|
-
return oCurrentVariantChange.getId();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
var aFilteredChangesFromMap = aCurrentVariantChanges.reduce(function(aFilteredChanges, oChange) {
|
|
58
|
-
var iMapIndex = aChangeKeysFromMap.indexOf(oChange.getId());
|
|
59
|
-
if (iMapIndex > -1) {
|
|
60
|
-
aFilteredChanges = aFilteredChanges.concat(aMapChanges[iMapIndex]);
|
|
61
|
-
}
|
|
62
|
-
return aFilteredChanges;
|
|
63
|
-
}, []);
|
|
64
49
|
|
|
65
50
|
var aRevertChanges = [];
|
|
66
51
|
if (aNewChanges.length > 0) {
|
|
67
|
-
aRevertChanges =
|
|
68
|
-
|
|
52
|
+
aRevertChanges = aCurrentVariantChanges.slice();
|
|
53
|
+
aCurrentVariantChanges.some(function(oChange) {
|
|
69
54
|
if (aNewChanges[0] && oChange.getId() === aNewChanges[0].getId()) {
|
|
70
55
|
aNewChanges.shift();
|
|
71
56
|
aRevertChanges.shift();
|
|
@@ -74,7 +59,7 @@ sap.ui.define([
|
|
|
74
59
|
}
|
|
75
60
|
});
|
|
76
61
|
} else {
|
|
77
|
-
aRevertChanges =
|
|
62
|
+
aRevertChanges = aCurrentVariantChanges;
|
|
78
63
|
}
|
|
79
64
|
|
|
80
65
|
var mSwitches = {
|
|
@@ -90,7 +75,7 @@ sap.ui.define([
|
|
|
90
75
|
*
|
|
91
76
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.Switcher
|
|
92
77
|
* @since 1.74
|
|
93
|
-
* @version 1.121.
|
|
78
|
+
* @version 1.121.5
|
|
94
79
|
* @private
|
|
95
80
|
* @ui5-restricted
|
|
96
81
|
*/
|
|
@@ -110,17 +95,13 @@ sap.ui.define([
|
|
|
110
95
|
* @private
|
|
111
96
|
* @ui5-restricted
|
|
112
97
|
*/
|
|
113
|
-
switchVariant(mPropertyBag) {
|
|
114
|
-
|
|
115
|
-
// TODO: should be a function in FlexState e.g. getUIChanges()
|
|
116
|
-
mPropertyBag.changesMap = mPropertyBag.flexController._oChangePersistence.getDependencyMapForComponent().mChanges;
|
|
117
|
-
var mChangesToBeSwitched = _getControlChangesForVariantSwitch(mPropertyBag);
|
|
98
|
+
async switchVariant(mPropertyBag) {
|
|
99
|
+
var mChangesToBeSwitched = getControlChangesForVariantSwitch(mPropertyBag);
|
|
118
100
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
});
|
|
101
|
+
await Reverter.revertMultipleChanges(mChangesToBeSwitched.changesToBeReverted, mPropertyBag);
|
|
102
|
+
// TODO: apply variantChanges() should be moved out of flex controller
|
|
103
|
+
await mPropertyBag.flexController.applyVariantChanges(mChangesToBeSwitched.changesToBeApplied, mPropertyBag.appComponent);
|
|
104
|
+
VariantManagementState.setCurrentVariant(mPropertyBag);
|
|
124
105
|
}
|
|
125
106
|
|
|
126
107
|
};
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
*
|
|
37
37
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
|
|
38
38
|
* @since 1.74
|
|
39
|
-
* @version 1.121.
|
|
39
|
+
* @version 1.121.5
|
|
40
40
|
* @private
|
|
41
41
|
* @ui5-restricted
|
|
42
42
|
*/
|
|
@@ -657,7 +657,11 @@ sap.ui.define([
|
|
|
657
657
|
return aCurrentControls;
|
|
658
658
|
}, []);
|
|
659
659
|
|
|
660
|
-
return aControls.length
|
|
660
|
+
return aControls.length
|
|
661
|
+
// When waiting for the initial changes, no variant switch could have happened yet
|
|
662
|
+
// that needs to be waited for, thus skip waiting for the variant switch promise
|
|
663
|
+
? mPropertyBag.flexController.waitForChangesToBeApplied(aControls, true)
|
|
664
|
+
: Promise.resolve();
|
|
661
665
|
};
|
|
662
666
|
|
|
663
667
|
return VariantManagementState;
|
|
@@ -14,7 +14,7 @@ sap.ui.define(["sap/ui/core/EventBus"], function(EventBus) {
|
|
|
14
14
|
* @alias sap.ui.fl.apply._internal.preprocessors.EventHistory
|
|
15
15
|
* @since 1.47.0
|
|
16
16
|
* @author SAP SE
|
|
17
|
-
* @version 1.121.
|
|
17
|
+
* @version 1.121.5
|
|
18
18
|
*
|
|
19
19
|
* @private
|
|
20
20
|
* @ui5-restricted sap.ui.fl.apply._internal.preprocessors.RegistrationDelegator
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* @namespace
|
|
20
20
|
* @name sap.ui.fl.descriptorRelated
|
|
21
21
|
* @author SAP SE
|
|
22
|
-
* @version 1.121.
|
|
22
|
+
* @version 1.121.5
|
|
23
23
|
* @private
|
|
24
24
|
* @ui5-restricted sap.ui.rta, smart business
|
|
25
25
|
*/
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
* @namespace
|
|
30
30
|
* @name sap.ui.fl.descriptorRelated.api
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.121.
|
|
32
|
+
* @version 1.121.5
|
|
33
33
|
* @private
|
|
34
34
|
* @ui5-restricted sap.ui.rta, smart business
|
|
35
35
|
*/
|
|
@@ -43,7 +43,7 @@ sap.ui.define([
|
|
|
43
43
|
* @constructor
|
|
44
44
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChange
|
|
45
45
|
* @author SAP SE
|
|
46
|
-
* @version 1.121.
|
|
46
|
+
* @version 1.121.5
|
|
47
47
|
* @private
|
|
48
48
|
* @ui5-restricted sap.ui.rta, smart business
|
|
49
49
|
*/
|
|
@@ -124,7 +124,7 @@ sap.ui.define([
|
|
|
124
124
|
* @constructor
|
|
125
125
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChangeFactory
|
|
126
126
|
* @author SAP SE
|
|
127
|
-
* @version 1.121.
|
|
127
|
+
* @version 1.121.5
|
|
128
128
|
* @private
|
|
129
129
|
* @ui5-restricted sap.ui.rta, smart business
|
|
130
130
|
*/
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @namespace
|
|
39
39
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorInlineChangeFactory
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.121.
|
|
41
|
+
* @version 1.121.5
|
|
42
42
|
* @private
|
|
43
43
|
* @deprecated Since version 1.76
|
|
44
44
|
* @ui5-restricted sap.ui.rta, smart business
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @namespace
|
|
17
17
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorVariantFactory
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.121.
|
|
19
|
+
* @version 1.121.5
|
|
20
20
|
* @private
|
|
21
21
|
* @deprecated Since version 1.73
|
|
22
22
|
* @ui5-restricted sap.ui.rta, smart business
|