@sap-ux/preview-middleware 0.21.1 → 0.21.3

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.
@@ -48,9 +48,9 @@ sap.ui.define([
48
48
  this.model.setProperty('/selectedNavigation/key', selectedKey);
49
49
  },
50
50
  onCreateBtnPress: async function _onCreateBtnPress(event) {
51
- await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
52
51
  const source = event.getSource();
53
52
  source.setEnabled(false);
53
+ await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
54
54
  const flexSettings = this.rta.getFlexSettings();
55
55
  const navProperty = this.model.getProperty('/selectedNavigation/key');
56
56
  const navigation = this.model.getProperty('/navigationData').find(item => item.navProperty = navProperty);
@@ -119,9 +119,10 @@ export default class AddSubpage extends BaseDialog<AddSubpageModel> {
119
119
  * @param event Event
120
120
  */
121
121
  async onCreateBtnPress(event: Event) {
122
- await super.onCreateBtnPressHandler();
123
122
  const source = event.getSource<Button>();
124
123
  source.setEnabled(false);
124
+ await super.onCreateBtnPressHandler();
125
+
125
126
 
126
127
  const flexSettings = this.rta.getFlexSettings();
127
128
  const navProperty = this.model.getProperty('/selectedNavigation/key');
@@ -53,9 +53,9 @@ sap.ui.define([
53
53
  this.dialog.open();
54
54
  },
55
55
  onCreateBtnPress: async function _onCreateBtnPress(event) {
56
- await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
57
56
  const source = event.getSource();
58
57
  source.setEnabled(false);
58
+ await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
59
59
  const columnFragmentName = this.model.getProperty('/newColumnFragmentName');
60
60
  const cellFragmentName = this.model.getProperty('/newCellFragmentName');
61
61
  const index = this.model.getProperty('/selectedIndex');
@@ -103,9 +103,9 @@ export default class AddTableColumnFragments extends BaseDialog<AddTableColumnsF
103
103
  * @param event Event
104
104
  */
105
105
  async onCreateBtnPress(event: Event) {
106
- await super.onCreateBtnPressHandler();
107
106
  const source = event.getSource<Button>();
108
107
  source.setEnabled(false);
108
+ await super.onCreateBtnPressHandler();
109
109
 
110
110
  const columnFragmentName = this.model.getProperty('/newColumnFragmentName');
111
111
  const cellFragmentName = this.model.getProperty('/newCellFragmentName');
@@ -41,13 +41,13 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/version", "../../uti
41
41
  async initialize() {
42
42
  const version = await getUi5Version();
43
43
  const isReuseComponent = await getReuseComponentChecker(version);
44
- for (const control of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
44
+ const control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
45
+ if (control) {
45
46
  const controlInfo = getControllerInfoForControl(control);
46
47
  const data = await getExistingController(controlInfo.controllerName);
47
48
  this.controllerExists = data?.controllerExists;
48
49
  const isActiveAction = isControllerExtensionEnabledForControl(control, isReuseComponent, this.context.flexSettings.isCloud);
49
50
  this.control = isActiveAction ? control : undefined;
50
- break;
51
51
  }
52
52
  }
53
53
  get textKey() {
@@ -53,11 +53,12 @@ export class AddControllerToPageQuickAction
53
53
  const version = await getUi5Version();
54
54
  const isReuseComponent = await getReuseComponentChecker(version);
55
55
 
56
- for (const control of getRelevantControlFromActivePage(
56
+ const control = getRelevantControlFromActivePage(
57
57
  this.context.controlIndex,
58
58
  this.context.view,
59
59
  CONTROL_TYPES
60
- )) {
60
+ )[0];
61
+ if (control) {
61
62
  const controlInfo = getControllerInfoForControl(control);
62
63
  const data = await getExistingController(controlInfo.controllerName);
63
64
  this.controllerExists = data?.controllerExists;
@@ -67,7 +68,6 @@ export class AddControllerToPageQuickAction
67
68
  this.context.flexSettings.isCloud
68
69
  );
69
70
  this.control = isActiveAction ? control : undefined;
70
- break;
71
71
  }
72
72
  }
73
73
 
@@ -22,10 +22,7 @@ sap.ui.define([
22
22
  this.enablementValidators = enablementValidators;
23
23
  }
24
24
  initialize() {
25
- for (const control of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
26
- this.control = control;
27
- break;
28
- }
25
+ this.control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)[0];
29
26
  return Promise.resolve();
30
27
  }
31
28
  getActionObject() {
@@ -30,14 +30,11 @@ export abstract class SimpleQuickActionDefinitionBase<
30
30
  }
31
31
 
32
32
  initialize(): Promise<void> {
33
- for (const control of getRelevantControlFromActivePage<T>(
33
+ this.control = getRelevantControlFromActivePage<T>(
34
34
  this.context.controlIndex,
35
35
  this.context.view,
36
36
  this.controlTypes
37
- )) {
38
- this.control = control;
39
- break;
40
- }
37
+ )[0];
41
38
  return Promise.resolve();
42
39
  }
43
40
 
@@ -16,11 +16,14 @@ sap.ui.define(["../cpe/additional-change-info/add-xml-additional-info"], functio
16
16
  return;
17
17
  }
18
18
  let additionalChangeInfo;
19
+ const key = change.getDefinition().fileName;
19
20
  if (change?.getChangeType?.() === 'addXML') {
20
21
  additionalChangeInfo = getAddXMLAdditionalInfo(change);
21
22
  }
22
- if (additionalChangeInfo) {
23
- additionalChangeInfoMap.set(change.getDefinition().fileName, additionalChangeInfo);
23
+ if (additionalChangeInfo && !additionalChangeInfoMap.get(key)) {
24
+ // in certain scenarios we explicitly set additional info e.g template when creating the change
25
+ // and that value should not be overwritten
26
+ additionalChangeInfoMap.set(key, additionalChangeInfo);
24
27
  }
25
28
  }
26
29
  function setAdditionalChangeInfoForChangeFile(fileName, additionalChangeInfo) {
@@ -21,12 +21,15 @@ export function setAdditionalChangeInfo(change: FlexChange<AddXMLChangeContent>
21
21
  }
22
22
 
23
23
  let additionalChangeInfo;
24
+ const key = change.getDefinition().fileName;
24
25
  if (change?.getChangeType?.() === 'addXML') {
25
26
  additionalChangeInfo = getAddXMLAdditionalInfo(change);
26
27
  }
27
28
 
28
- if (additionalChangeInfo) {
29
- additionalChangeInfoMap.set(change.getDefinition().fileName, additionalChangeInfo);
29
+ if (additionalChangeInfo && !additionalChangeInfoMap.get(key)) {
30
+ // in certain scenarios we explicitly set additional info e.g template when creating the change
31
+ // and that value should not be overwritten
32
+ additionalChangeInfoMap.set(key, additionalChangeInfo);
30
33
  }
31
34
  }
32
35
 
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.21.1",
12
+ "version": "0.21.3",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
- "@sap-ux/adp-tooling": "0.15.13",
28
+ "@sap-ux/adp-tooling": "0.15.14",
29
29
  "@sap-ux/btp-utils": "1.1.0",
30
30
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.0",
31
31
  "@sap-ux/feature-toggle": "0.3.0",
@@ -50,7 +50,7 @@
50
50
  "nock": "13.4.0",
51
51
  "npm-run-all2": "6.2.0",
52
52
  "supertest": "7.1.4",
53
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.15.1",
53
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.15.3",
54
54
  "@sap-ux/axios-extension": "1.22.5",
55
55
  "@sap-ux/store": "1.1.2",
56
56
  "@sap-ux/ui5-info": "0.12.1"