@openui5/sap.ui.fl 1.101.0 → 1.102.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/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +6 -3
- 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 +4 -6
- package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Scenario.js +27 -0
- package/src/sap/ui/fl/Utils.js +8 -6
- package/src/sap/ui/fl/Variant.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/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/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/controlVariants/Utils.js +9 -5
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.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/flexState/FlexState.js +1 -1
- 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/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -1
- 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 +4 -2
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +6 -4
- package/src/sap/ui/fl/changeHandler/HideControl.js +4 -2
- package/src/sap/ui/fl/changeHandler/MoveControls.js +4 -2
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +6 -4
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +4 -2
- package/src/sap/ui/fl/changeHandler/StashControl.js +17 -4
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +6 -4
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +7 -3
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/condenser/Classification.js +43 -0
- package/src/sap/ui/fl/codeExt/CodeExtManager.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/Storage.js +8 -6
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +7 -2
- 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 +18 -62
- package/src/sap/ui/fl/library.support.js +1 -1
- package/src/sap/ui/fl/support/Flexibility.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/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/themes/base/VariantManagement.less +23 -20
- 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/VariantManagement.js +2 -1
- package/src/sap/ui/fl/variants/VariantModel.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +7 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +85 -36
- 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 +13 -11
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +5 -3
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +78 -12
- 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/extensionPoint/Registry.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 +27 -6
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +98 -41
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +13 -2
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +7 -4
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -2
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +18 -11
- package/src/sap/ui/fl/write/api/TranslationAPI.js +54 -17
- package/src/sap/ui/fl/write/api/Version.js +22 -0
- package/src/sap/ui/fl/write/api/VersionsAPI.js +90 -74
|
@@ -8,15 +8,17 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/fl/registry/Settings",
|
|
9
9
|
"sap/ui/fl/ChangePersistenceFactory",
|
|
10
10
|
"sap/ui/fl/write/_internal/Storage",
|
|
11
|
-
"sap/ui/model/json/JSONModel",
|
|
12
11
|
"sap/ui/fl/Utils",
|
|
12
|
+
"sap/ui/fl/write/api/Version",
|
|
13
|
+
"sap/ui/model/json/JSONModel",
|
|
13
14
|
"sap/ui/model/BindingMode"
|
|
14
15
|
], function(
|
|
15
16
|
Settings,
|
|
16
17
|
ChangePersistenceFactory,
|
|
17
18
|
Storage,
|
|
18
|
-
JSONModel,
|
|
19
19
|
Utils,
|
|
20
|
+
Version,
|
|
21
|
+
JSONModel,
|
|
20
22
|
BindingMode
|
|
21
23
|
) {
|
|
22
24
|
"use strict";
|
|
@@ -27,37 +29,50 @@ sap.ui.define([
|
|
|
27
29
|
// ensure sufficient data is present even if a draft was returned and later discarded
|
|
28
30
|
var BACKEND_REQUEST_LIMIT = MODEL_SIZE_LIMIT + 1;
|
|
29
31
|
|
|
30
|
-
function createModel(
|
|
32
|
+
function createModel(bVersioningEnabled, aVersions) {
|
|
31
33
|
var bBackendDraft = _doesDraftExistInVersions(aVersions);
|
|
34
|
+
var aDraftFilenames = [];
|
|
32
35
|
|
|
33
|
-
var sActiveVersion =
|
|
34
|
-
|
|
35
|
-
if (oVersion.version === sap.ui.fl.Versions.Draft) {
|
|
36
|
-
oVersion.type = "draft";
|
|
37
|
-
} else if (sActiveVersion === sap.ui.fl.Versions.Original) {
|
|
38
|
-
// no active version found yet; the first non-draft version is always the active version
|
|
39
|
-
oVersion.type = "active";
|
|
40
|
-
sActiveVersion = oVersion.version;
|
|
41
|
-
} else {
|
|
42
|
-
oVersion.type = "inactive";
|
|
43
|
-
}
|
|
44
|
-
});
|
|
36
|
+
var sActiveVersion = Version.Number.Original;
|
|
37
|
+
var bPublishVersionEnabled = false;
|
|
45
38
|
|
|
46
39
|
return Utils.getUShellService("URLParsing")
|
|
47
40
|
.then(function (oURLParsingService) {
|
|
48
41
|
var sPersistedBasisForDisplayedVersion = Utils.getParameter(
|
|
49
|
-
|
|
42
|
+
Version.UrlParameter,
|
|
50
43
|
oURLParsingService
|
|
51
44
|
);
|
|
52
45
|
if (!sPersistedBasisForDisplayedVersion) {
|
|
53
46
|
if (aVersions.length > 0) {
|
|
54
47
|
sPersistedBasisForDisplayedVersion = aVersions[0].version;
|
|
55
48
|
} else {
|
|
56
|
-
sPersistedBasisForDisplayedVersion =
|
|
49
|
+
sPersistedBasisForDisplayedVersion = Version.Number.Original;
|
|
57
50
|
}
|
|
58
51
|
}
|
|
59
52
|
|
|
53
|
+
aVersions.forEach(function (oVersion) {
|
|
54
|
+
if (oVersion.version === Version.Number.Draft) {
|
|
55
|
+
oVersion.type = "draft";
|
|
56
|
+
oVersion.isPublished = false;
|
|
57
|
+
aDraftFilenames = oVersion.filenames;
|
|
58
|
+
} else {
|
|
59
|
+
if (sActiveVersion === Version.Number.Original) {
|
|
60
|
+
// no active version found yet; the first non-draft version is always the active version
|
|
61
|
+
oVersion.type = "active";
|
|
62
|
+
sActiveVersion = oVersion.version;
|
|
63
|
+
} else {
|
|
64
|
+
oVersion.type = "inactive";
|
|
65
|
+
}
|
|
66
|
+
//If the current selected version is not yet published, enable the publish button
|
|
67
|
+
//Original versions are not part of back end response, so publish button is not enabled by default value
|
|
68
|
+
if ((oVersion.version === sPersistedBasisForDisplayedVersion) && (oVersion.isPublished === false)) {
|
|
69
|
+
bPublishVersionEnabled = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
60
74
|
var oModel = new JSONModel({
|
|
75
|
+
publishVersionEnabled: bPublishVersionEnabled,
|
|
61
76
|
versioningEnabled: bVersioningEnabled,
|
|
62
77
|
versions: aVersions,
|
|
63
78
|
activeVersion: sActiveVersion,
|
|
@@ -66,7 +81,8 @@ sap.ui.define([
|
|
|
66
81
|
draftAvailable: bBackendDraft,
|
|
67
82
|
activateEnabled: bBackendDraft,
|
|
68
83
|
persistedVersion: sPersistedBasisForDisplayedVersion,
|
|
69
|
-
displayedVersion: sPersistedBasisForDisplayedVersion
|
|
84
|
+
displayedVersion: sPersistedBasisForDisplayedVersion,
|
|
85
|
+
draftFilenames: aDraftFilenames
|
|
70
86
|
});
|
|
71
87
|
|
|
72
88
|
oModel.setDefaultBindingMode(BindingMode.OneWay);
|
|
@@ -87,12 +103,13 @@ sap.ui.define([
|
|
|
87
103
|
var bDraftAvailable = bVersioningEnabled && (bDirtyChanges || bBackendDraft);
|
|
88
104
|
oModel.setProperty("/draftAvailable", bDraftAvailable);
|
|
89
105
|
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
if (bDirtyChanges) {
|
|
107
|
+
oModel.setProperty("/displayedVersion", Version.Number.Draft);
|
|
108
|
+
}
|
|
92
109
|
|
|
93
110
|
// add draft
|
|
94
111
|
if (!_doesDraftExistInVersions(aVersions) && bDraftAvailable) {
|
|
95
|
-
aVersions.splice(0, 0, {version:
|
|
112
|
+
aVersions.splice(0, 0, {version: Version.Number.Draft, type: "draft", filenames: [], isPublished: false});
|
|
96
113
|
}
|
|
97
114
|
|
|
98
115
|
// remove draft
|
|
@@ -148,7 +165,7 @@ sap.ui.define([
|
|
|
148
165
|
|
|
149
166
|
function _doesDraftExistInVersions(aVersions) {
|
|
150
167
|
return aVersions.some(function(oVersion) {
|
|
151
|
-
return oVersion.version ===
|
|
168
|
+
return oVersion.version === Version.Number.Draft;
|
|
152
169
|
});
|
|
153
170
|
}
|
|
154
171
|
|
|
@@ -157,7 +174,7 @@ sap.ui.define([
|
|
|
157
174
|
*
|
|
158
175
|
* @namespace sap.ui.fl.write._internal.Versions
|
|
159
176
|
* @since 1.74
|
|
160
|
-
* @version 1.
|
|
177
|
+
* @version 1.102.0
|
|
161
178
|
* @private
|
|
162
179
|
* @ui5-restricted sap.ui.fl
|
|
163
180
|
*/
|
|
@@ -182,7 +199,7 @@ sap.ui.define([
|
|
|
182
199
|
var aVersionsPromise = bVersionsEnabled ? Storage.versions.load(mPropertyBag) : Promise.resolve([]);
|
|
183
200
|
return aVersionsPromise
|
|
184
201
|
.then(function (aVersions) {
|
|
185
|
-
return createModel(
|
|
202
|
+
return createModel(bVersionsEnabled, aVersions);
|
|
186
203
|
})
|
|
187
204
|
.then(function (oModel) {
|
|
188
205
|
_mInstances[sReference] = _mInstances[sReference] || {};
|
|
@@ -248,7 +265,7 @@ sap.ui.define([
|
|
|
248
265
|
* @param {string} mPropertyBag.appComponent - Application Component
|
|
249
266
|
* @returns {Promise<sap.ui.fl.Version>} Promise resolving with the updated list of versions for the application
|
|
250
267
|
* when the version was activated;
|
|
251
|
-
* rejects if an error occurs, the layer does not support draft handling, there is no draft to activate or
|
|
268
|
+
* rejects if an error occurs, the layer does not support draft handling, there is unsaved content, there is no draft to activate or
|
|
252
269
|
* when the displayed version is already active
|
|
253
270
|
*/
|
|
254
271
|
Versions.activate = function(mPropertyBag) {
|
|
@@ -257,35 +274,37 @@ sap.ui.define([
|
|
|
257
274
|
var bDraftExists = _doesDraftExistInVersions(aVersions);
|
|
258
275
|
var sDisplayedVersion = oModel.getProperty("/displayedVersion");
|
|
259
276
|
var sActiveVersion = oModel.getProperty("/activeVersion");
|
|
260
|
-
var sParentVersion = oModel.getProperty("/persistedVersion");
|
|
261
277
|
if (sDisplayedVersion === sActiveVersion) {
|
|
262
278
|
return Promise.reject("Version is already active");
|
|
263
279
|
}
|
|
264
280
|
mPropertyBag.version = sDisplayedVersion;
|
|
265
281
|
|
|
266
|
-
var
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
282
|
+
var oDirtyChangeInfo = _getDirtyChangesInfo(mPropertyBag);
|
|
283
|
+
var aChangePersistences = oDirtyChangeInfo.changePersistences;
|
|
284
|
+
var bDirtyChangesExists = aChangePersistences.some(function (oChangePersistence) {
|
|
285
|
+
return oChangePersistence.getDirtyChanges().length > 0;
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
if (bDirtyChangesExists) {
|
|
289
|
+
return Promise.reject("unsaved changes exists");
|
|
274
290
|
}
|
|
275
|
-
|
|
276
|
-
|
|
291
|
+
|
|
292
|
+
return Storage.versions.activate(mPropertyBag)
|
|
277
293
|
.then(function (oVersion) {
|
|
278
294
|
aVersions.forEach(function (oVersionEntry) {
|
|
279
295
|
oVersionEntry.type = "inactive";
|
|
280
296
|
});
|
|
281
297
|
oVersion.type = "active";
|
|
298
|
+
oVersion.isPublished = false;
|
|
282
299
|
if (bDraftExists) {
|
|
283
300
|
aVersions.shift();
|
|
284
301
|
}
|
|
285
302
|
aVersions.splice(0, 0, oVersion);
|
|
303
|
+
oModel.setProperty("/publishVersionEnabled", true);
|
|
286
304
|
oModel.setProperty("/backendDraft", false);
|
|
287
305
|
oModel.setProperty("/dirtyChanges", false);
|
|
288
306
|
oModel.setProperty("/draftAvailable", false);
|
|
307
|
+
oModel.setProperty("/publishVersionEnabled", true);
|
|
289
308
|
oModel.setProperty("/activateEnabled", false);
|
|
290
309
|
oModel.setProperty("/activeVersion", oVersion.version);
|
|
291
310
|
oModel.setProperty("/displayedVersion", oVersion.version);
|
|
@@ -329,5 +348,35 @@ sap.ui.define([
|
|
|
329
348
|
});
|
|
330
349
|
};
|
|
331
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Publishes a version.
|
|
353
|
+
*
|
|
354
|
+
* @param {object} mPropertyBag - Property Bag
|
|
355
|
+
* @param {string} mPropertyBag.reference - ID of the application for which the versions are requested (this reference must not contain the ".Component" suffix)
|
|
356
|
+
* @param {string} mPropertyBag.layer - Layer for which the versions should be retrieved
|
|
357
|
+
* @param {string} mPropertyBag.version - The number of the version to be published
|
|
358
|
+
* @returns {Promise<sap.ui.fl.Version>} Promise resolving when the version was published;
|
|
359
|
+
* rejects if an error occurs, the layer does not support draft handling, there is no version to publish or
|
|
360
|
+
* when the displayed version is already published
|
|
361
|
+
*/
|
|
362
|
+
Versions.publish = function(mPropertyBag) {
|
|
363
|
+
var oModel = Versions.getVersionsModel({
|
|
364
|
+
reference: Utils.normalizeReference(mPropertyBag.reference),
|
|
365
|
+
layer: mPropertyBag.layer
|
|
366
|
+
});
|
|
367
|
+
return Storage.versions.publish(mPropertyBag)
|
|
368
|
+
.then(function (sMessage) {
|
|
369
|
+
//If transport version success, disable publish version button
|
|
370
|
+
if (sMessage !== "Error" && sMessage !== "Cancel") {
|
|
371
|
+
oModel.setProperty("/publishVersionEnabled", false);
|
|
372
|
+
var aVersions = oModel.getProperty("/versions");
|
|
373
|
+
aVersions.find(function (oVersion) {
|
|
374
|
+
return oVersion.version === mPropertyBag.version;
|
|
375
|
+
}).isPublished = true;
|
|
376
|
+
}
|
|
377
|
+
return sMessage;
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
|
|
332
381
|
return Versions;
|
|
333
382
|
});
|
|
@@ -10,6 +10,7 @@ sap.ui.define([
|
|
|
10
10
|
"sap/base/Log",
|
|
11
11
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
12
12
|
"sap/ui/core/Core",
|
|
13
|
+
"sap/ui/fl/changeHandler/condenser/Classification",
|
|
13
14
|
"sap/ui/fl/apply/_internal/changes/Utils",
|
|
14
15
|
"sap/ui/fl/write/_internal/condenser/classifications/LastOneWins",
|
|
15
16
|
"sap/ui/fl/write/_internal/condenser/classifications/Reverse",
|
|
@@ -24,6 +25,7 @@ sap.ui.define([
|
|
|
24
25
|
Log,
|
|
25
26
|
JsControlTreeModifier,
|
|
26
27
|
Core,
|
|
28
|
+
CondenserClassification,
|
|
27
29
|
ChangesUtils,
|
|
28
30
|
LastOneWins,
|
|
29
31
|
Reverse,
|
|
@@ -41,7 +43,7 @@ sap.ui.define([
|
|
|
41
43
|
* @namespace
|
|
42
44
|
* @alias sap.ui.fl.write._internal.condenser.Condenser
|
|
43
45
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
46
|
+
* @version 1.102.0
|
|
45
47
|
*/
|
|
46
48
|
var Condenser = {};
|
|
47
49
|
|
|
@@ -67,8 +69,8 @@ sap.ui.define([
|
|
|
67
69
|
* @returns {boolean} <code>true</code> if the 'move' subtype has been added to the data structure before 'create' subtype
|
|
68
70
|
*/
|
|
69
71
|
function isCreateAfterMoveSubtype(mSubtypes, oCondenserInfo) {
|
|
70
|
-
var aMoveSubType = mSubtypes[
|
|
71
|
-
return oCondenserInfo.classification ===
|
|
72
|
+
var aMoveSubType = mSubtypes[CondenserClassification.Move];
|
|
73
|
+
return oCondenserInfo.classification === CondenserClassification.Create
|
|
72
74
|
&& aMoveSubType
|
|
73
75
|
&& aMoveSubType[aMoveSubType.length - 1].targetContainer === oCondenserInfo.targetContainer;
|
|
74
76
|
}
|
|
@@ -81,7 +83,7 @@ sap.ui.define([
|
|
|
81
83
|
* @returns {boolean} <code>true</code> if the 'destroy' subtype has been added to the data structure before 'move' subtype
|
|
82
84
|
*/
|
|
83
85
|
function isMoveAfterDestroySubtype(mSubtypes, oCondenserInfo) {
|
|
84
|
-
return oCondenserInfo.classification ===
|
|
86
|
+
return oCondenserInfo.classification === CondenserClassification.Move && mSubtypes[CondenserClassification.Destroy];
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|
|
@@ -92,7 +94,7 @@ sap.ui.define([
|
|
|
92
94
|
* @returns {boolean} <code>true</code> if the 'move' subtype has been added to the data structure before 'create' subtype
|
|
93
95
|
*/
|
|
94
96
|
function isCreateAfterDestroySubtype(mClassifications, oCondenserInfo) {
|
|
95
|
-
return oCondenserInfo.classification ===
|
|
97
|
+
return oCondenserInfo.classification === CondenserClassification.Create && mClassifications[CondenserClassification.Destroy];
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
/**
|
|
@@ -124,17 +126,17 @@ sap.ui.define([
|
|
|
124
126
|
isCreateAfterMoveSubtype(mClassifications, oCondenserInfo)
|
|
125
127
|
|| isCreateAfterDestroySubtype(mClassifications, oCondenserInfo)
|
|
126
128
|
) {
|
|
127
|
-
if (mClassifications[
|
|
128
|
-
mClassifications[
|
|
129
|
+
if (mClassifications[CondenserClassification.Move]) {
|
|
130
|
+
mClassifications[CondenserClassification.Move].forEach(function(oCondenserInfo) {
|
|
129
131
|
oCondenserInfo.change.condenserState = "delete";
|
|
130
132
|
});
|
|
131
|
-
delete mClassifications[
|
|
133
|
+
delete mClassifications[CondenserClassification.Move];
|
|
132
134
|
}
|
|
133
|
-
if (mClassifications[
|
|
134
|
-
mClassifications[
|
|
135
|
+
if (mClassifications[CondenserClassification.Destroy]) {
|
|
136
|
+
mClassifications[CondenserClassification.Destroy].forEach(function(oCondenserInfo) {
|
|
135
137
|
oCondenserInfo.change.condenserState = "delete";
|
|
136
138
|
});
|
|
137
|
-
delete mClassifications[
|
|
139
|
+
delete mClassifications[CondenserClassification.Destroy];
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
return UIReconstruction.addChange(mUIReconstructions, oCondenserInfo);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/restricted/_isEqual",
|
|
9
9
|
"sap/base/util/each",
|
|
10
|
+
"sap/ui/fl/changeHandler/condenser/Classification",
|
|
10
11
|
"sap/ui/fl/write/_internal/condenser/classifications/Create",
|
|
11
12
|
"sap/ui/fl/write/_internal/condenser/classifications/Destroy",
|
|
12
13
|
"sap/ui/fl/write/_internal/condenser/classifications/Move",
|
|
@@ -14,6 +15,7 @@ sap.ui.define([
|
|
|
14
15
|
], function(
|
|
15
16
|
_isEqual,
|
|
16
17
|
each,
|
|
18
|
+
CondenserClassification,
|
|
17
19
|
Create,
|
|
18
20
|
Destroy,
|
|
19
21
|
Move,
|
|
@@ -27,7 +29,7 @@ sap.ui.define([
|
|
|
27
29
|
* @namespace
|
|
28
30
|
* @alias sap.ui.fl.write._internal.condenser.UIReconstruction
|
|
29
31
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
32
|
+
* @version 1.102.0
|
|
31
33
|
*/
|
|
32
34
|
var UIReconstruction = {};
|
|
33
35
|
|
|
@@ -95,7 +97,7 @@ sap.ui.define([
|
|
|
95
97
|
*/
|
|
96
98
|
function containsOnlyCreateChanges(aCondenserInfos) {
|
|
97
99
|
return !aCondenserInfos.some(function(vElement) {
|
|
98
|
-
return vElement.classification !==
|
|
100
|
+
return vElement.classification !== CondenserClassification.Create;
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
|
|
@@ -217,7 +219,7 @@ sap.ui.define([
|
|
|
217
219
|
var mTypes = mReducedChanges[sTargetElementId];
|
|
218
220
|
var mSubtypes = mTypes[Utils.INDEX_RELEVANT];
|
|
219
221
|
each(mSubtypes, function(sSubtypeKey, aCondenserChanges) {
|
|
220
|
-
if (sSubtypeKey !==
|
|
222
|
+
if (sSubtypeKey !== CondenserClassification.Destroy) {
|
|
221
223
|
aCondenserChanges.forEach(function(oCondenserChange) {
|
|
222
224
|
oCondenserChange.setTargetIndex(oCondenserChange.change, iIndex);
|
|
223
225
|
oCondenserChange.change.condenserState = "select";
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
*
|
|
30
30
|
* @namespace sap.ui.fl.write._internal.connectors.KeyUserConnector
|
|
31
31
|
* @since 1.70
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.102.0
|
|
33
33
|
* @private
|
|
34
34
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
35
35
|
*/
|
|
@@ -148,7 +148,7 @@ sap.ui.define([
|
|
|
148
148
|
var mParameters = {};
|
|
149
149
|
var sTranslationUrl = InitialUtils.getUrl(KeyUserConnector.ROUTES.TRANSLATION.GET_SOURCELANGUAGE, mPropertyBag, mParameters);
|
|
150
150
|
return InitialUtils.sendRequest(sTranslationUrl, "GET", mPropertyBag).then(function(oResult) {
|
|
151
|
-
return oResult.response;
|
|
151
|
+
return oResult && oResult.response && oResult.response.sourceLanguages ? oResult.response.sourceLanguages : [];
|
|
152
152
|
});
|
|
153
153
|
},
|
|
154
154
|
|
|
@@ -56,7 +56,8 @@ sap.ui.define([
|
|
|
56
56
|
VERSIONS: {
|
|
57
57
|
GET: "/flex/versions/",
|
|
58
58
|
ACTIVATE: "/flex/versions/activate/",
|
|
59
|
-
DISCARD: "/flex/versions/draft/"
|
|
59
|
+
DISCARD: "/flex/versions/draft/",
|
|
60
|
+
PUBLISH: "/flex/versions/publish/"
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -162,7 +163,7 @@ sap.ui.define([
|
|
|
162
163
|
*
|
|
163
164
|
* @namespace sap.ui.fl.write._internal.connectors.LrepConnector
|
|
164
165
|
* @since 1.67
|
|
165
|
-
* @version 1.
|
|
166
|
+
* @version 1.102.0
|
|
166
167
|
* @private
|
|
167
168
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
168
169
|
*/
|
|
@@ -192,9 +193,9 @@ sap.ui.define([
|
|
|
192
193
|
aChanges = mPropertyBag.changes;
|
|
193
194
|
oTransportSelectionPromise = Settings.getInstance().then(function (oSettings) {
|
|
194
195
|
if (!oSettings.isProductiveSystem()) {
|
|
195
|
-
return new TransportSelection().setTransports(aChanges, Component.get(mPropertyBag.reference)).then(function() {
|
|
196
|
+
return new TransportSelection().setTransports(aChanges, Component.get(mPropertyBag.reference)).then(function () {
|
|
196
197
|
//Make sure we include one request in case of mixed changes (local and transported)
|
|
197
|
-
aChanges.some(function(oChange) {
|
|
198
|
+
aChanges.some(function (oChange) {
|
|
198
199
|
if (oChange.getRequest()) {
|
|
199
200
|
mPropertyBag.changelist = oChange.getRequest();
|
|
200
201
|
return true;
|
|
@@ -206,7 +207,7 @@ sap.ui.define([
|
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
return oTransportSelectionPromise.then(function() {
|
|
210
|
+
return oTransportSelectionPromise.then(function () {
|
|
210
211
|
BusyIndicator.show(0); //Re-display the busy indicator in case it was hide by transport selection
|
|
211
212
|
var aParameters = ["reference", "layer", "changelist", "generator"];
|
|
212
213
|
var mParameters = _pick(mPropertyBag, aParameters);
|
|
@@ -229,14 +230,14 @@ sap.ui.define([
|
|
|
229
230
|
);
|
|
230
231
|
return WriteUtils.sendRequest(sResetUrl, "DELETE", oRequestOption).then(function (oResponse) {
|
|
231
232
|
if (oResponse && oResponse.response) {
|
|
232
|
-
oResponse.response.forEach(function(oContentId) {
|
|
233
|
+
oResponse.response.forEach(function (oContentId) {
|
|
233
234
|
oContentId.fileName = oContentId.name;
|
|
234
235
|
delete oContentId.name;
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
BusyIndicator.hide();
|
|
238
239
|
return oResponse;
|
|
239
|
-
}).catch(function(oError) {
|
|
240
|
+
}).catch(function (oError) {
|
|
240
241
|
BusyIndicator.hide();
|
|
241
242
|
return Promise.reject(oError);
|
|
242
243
|
});
|
|
@@ -279,7 +280,7 @@ sap.ui.define([
|
|
|
279
280
|
|
|
280
281
|
var oTransportSelection = new TransportSelection();
|
|
281
282
|
return oTransportSelection.openTransportSelection(null, mPropertyBag.transportDialogSettings.rootControl, mPropertyBag.transportDialogSettings.styleClass)
|
|
282
|
-
.then(function(oTransportInfo) {
|
|
283
|
+
.then(function (oTransportInfo) {
|
|
283
284
|
if (oTransportSelection.checkTransportInfo(oTransportInfo)) {
|
|
284
285
|
BusyIndicator.show(0);
|
|
285
286
|
var oContentParameters = {
|
|
@@ -291,7 +292,7 @@ sap.ui.define([
|
|
|
291
292
|
mPropertyBag.localChanges,
|
|
292
293
|
mPropertyBag.appVariantDescriptors,
|
|
293
294
|
oContentParameters
|
|
294
|
-
).then(function() {
|
|
295
|
+
).then(function () {
|
|
295
296
|
BusyIndicator.hide();
|
|
296
297
|
if (oTransportInfo.transport === "ATO_NOTIFICATION") {
|
|
297
298
|
return oResourceBundle.getText("MSG_ATO_NOTIFICATION");
|
|
@@ -449,6 +450,7 @@ sap.ui.define([
|
|
|
449
450
|
* @param {object} mPropertyBag Property bag
|
|
450
451
|
* @param {object} mPropertyBag.flexObject Flex Object to be deleted
|
|
451
452
|
* @param {string} [mPropertyBag.transport] The transport ID
|
|
453
|
+
* @param {string} [mPropertyBag.parentVersion] Indicates if changes should be written as a draft and on which version the changes should be based on
|
|
452
454
|
* @param {string} [mPropertyBag.url] Configured url for the connector
|
|
453
455
|
* @returns {Promise} Resolves as soon as the deletion is completed without data
|
|
454
456
|
*/
|
|
@@ -460,6 +462,9 @@ sap.ui.define([
|
|
|
460
462
|
if (mPropertyBag.transport) {
|
|
461
463
|
mParameters.changelist = mPropertyBag.transport;
|
|
462
464
|
}
|
|
465
|
+
if (mPropertyBag.parentVersion) {
|
|
466
|
+
mParameters.parentVersion = mPropertyBag.parentVersion;
|
|
467
|
+
}
|
|
463
468
|
InitialConnector._addClientInfo(mParameters);
|
|
464
469
|
mPropertyBag.fileName = mPropertyBag.flexObject.fileName;
|
|
465
470
|
var sRoute = mPropertyBag.flexObject.fileType === "variant" ? ROUTES.VARIANTS : ROUTES.CHANGES;
|
|
@@ -619,7 +624,7 @@ sap.ui.define([
|
|
|
619
624
|
load: function (mPropertyBag) {
|
|
620
625
|
var oRequestOption = WriteUtils.getRequestOptions(
|
|
621
626
|
InitialConnector,
|
|
622
|
-
ROUTES.TOKEN
|
|
627
|
+
InitialUtils.getUrl(ROUTES.TOKEN, mPropertyBag)
|
|
623
628
|
);
|
|
624
629
|
var mParameters = {};
|
|
625
630
|
InitialUtils.addLanguageInfo(mParameters);
|
|
@@ -634,7 +639,7 @@ sap.ui.define([
|
|
|
634
639
|
activate: function (mPropertyBag) {
|
|
635
640
|
var oRequestOption = WriteUtils.getRequestOptions(
|
|
636
641
|
InitialConnector,
|
|
637
|
-
ROUTES.TOKEN,
|
|
642
|
+
InitialUtils.getUrl(ROUTES.TOKEN, mPropertyBag),
|
|
638
643
|
{title: mPropertyBag.title},
|
|
639
644
|
"application/json; charset=utf-8",
|
|
640
645
|
"json"
|
|
@@ -650,10 +655,71 @@ sap.ui.define([
|
|
|
650
655
|
discardDraft: function (mPropertyBag) {
|
|
651
656
|
var oRequestOption = WriteUtils.getRequestOptions(
|
|
652
657
|
InitialConnector,
|
|
653
|
-
ROUTES.TOKEN
|
|
658
|
+
InitialUtils.getUrl(ROUTES.TOKEN, mPropertyBag)
|
|
654
659
|
);
|
|
655
660
|
var sVersionsUrl = InitialUtils.getUrl(ROUTES.VERSIONS.DISCARD, mPropertyBag);
|
|
656
661
|
return WriteUtils.sendRequest(sVersionsUrl, "DELETE", oRequestOption);
|
|
662
|
+
},
|
|
663
|
+
publish: function (mPropertyBag) {
|
|
664
|
+
var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.fl");
|
|
665
|
+
|
|
666
|
+
var fnHandleAllErrors = function (oError) {
|
|
667
|
+
BusyIndicator.hide();
|
|
668
|
+
var sMessage = oResourceBundle.getText("MSG_TRANSPORT_ERROR", oError ? [oError.message || oError] : undefined);
|
|
669
|
+
var sTitle = oResourceBundle.getText("HEADER_TRANSPORT_ERROR");
|
|
670
|
+
Log.error("transport error" + oError);
|
|
671
|
+
MessageBox.show(sMessage, {
|
|
672
|
+
icon: MessageBox.Icon.ERROR,
|
|
673
|
+
title: sTitle,
|
|
674
|
+
styleClass: mPropertyBag.styleClass
|
|
675
|
+
});
|
|
676
|
+
return "Error";
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
var oTransportSelection = new TransportSelection();
|
|
680
|
+
return oTransportSelection.openTransportSelection(null, mPropertyBag.rootControl, mPropertyBag.styleClass, false)
|
|
681
|
+
.then(function (oTransportInfo) {
|
|
682
|
+
if (oTransportSelection.checkTransportInfo(oTransportInfo)) {
|
|
683
|
+
BusyIndicator.show(0);
|
|
684
|
+
|
|
685
|
+
if (!oTransportInfo.transport) {
|
|
686
|
+
return Promise.reject(new Error("no transport provided as attribute of mParameters"));
|
|
687
|
+
}
|
|
688
|
+
if (!mPropertyBag.reference) {
|
|
689
|
+
return Promise.reject(new Error("no reference provided as attribute of mParameters"));
|
|
690
|
+
}
|
|
691
|
+
if (!mPropertyBag.version) {
|
|
692
|
+
return Promise.reject(new Error("no version provided as attribute of mParameters"));
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
var mParameters = {
|
|
696
|
+
transport: oTransportInfo.transport,
|
|
697
|
+
version: mPropertyBag.version
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
var sUrl = InitialUtils.getUrl(ROUTES.VERSIONS.PUBLISH, {
|
|
701
|
+
url: Utils.getLrepUrl(),
|
|
702
|
+
reference: mPropertyBag.reference
|
|
703
|
+
}, mParameters);
|
|
704
|
+
var sTokenUrl = InitialUtils.getUrl(ROUTES.TOKEN, {url: Utils.getLrepUrl()});
|
|
705
|
+
|
|
706
|
+
var oRequestOption = WriteUtils.getRequestOptions(
|
|
707
|
+
InitialConnector,
|
|
708
|
+
sTokenUrl,
|
|
709
|
+
undefined,
|
|
710
|
+
"application/json; charset=utf-8", "json"
|
|
711
|
+
);
|
|
712
|
+
return WriteUtils.sendRequest(sUrl, "POST", oRequestOption)
|
|
713
|
+
.then(function () {
|
|
714
|
+
BusyIndicator.hide();
|
|
715
|
+
if (oTransportInfo.transport === "ATO_NOTIFICATION") {
|
|
716
|
+
return oResourceBundle.getText("MSG_ATO_NOTIFICATION");
|
|
717
|
+
}
|
|
718
|
+
return oResourceBundle.getText("MSG_TRANSPORT_SUCCESS");
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
return "Cancel";
|
|
722
|
+
})['catch'](fnHandleAllErrors);
|
|
657
723
|
}
|
|
658
724
|
}
|
|
659
725
|
});
|