@sap-ux/preview-middleware 0.23.77 → 0.23.79

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.
@@ -92,7 +92,7 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor
92
92
  createAppDescriptorChangeForV4: async function _createAppDescriptorChangeForV(templatePath) {
93
93
  const fragmentName = this.model.getProperty('/newFragmentName');
94
94
  const template = `${this.options.appDescriptor?.projectId}.changes.${templatePath}`;
95
- let sectionId = this.options.appDescriptor?.anchor;
95
+ const sectionId = this.options.appDescriptor?.anchor;
96
96
  const flexSettings = this.rta.getFlexSettings();
97
97
  const modifiedValue = {
98
98
  reference: this.options.appDescriptor?.projectId,
@@ -128,7 +128,7 @@ export default class AddCustomFragment extends BaseDialog<AddFragmentModel> {
128
128
  private async createAppDescriptorChangeForV4(templatePath: string) {
129
129
  const fragmentName = this.model.getProperty('/newFragmentName');
130
130
  const template = `${this.options.appDescriptor?.projectId}.changes.${templatePath}`;
131
- let sectionId = this.options.appDescriptor?.anchor;
131
+ const sectionId = this.options.appDescriptor?.anchor;
132
132
  const flexSettings = this.rta.getFlexSettings();
133
133
  const modifiedValue = {
134
134
  reference: this.options.appDescriptor?.projectId,
@@ -24,7 +24,7 @@ type FileExistModel = JSONModel & {
24
24
  * @namespace open.ux.preview.client.adp.controllers
25
25
  */
26
26
  export default class FileExistsDialog extends BaseDialog<FileExistModel> {
27
- private options: FileExistsDialogOptions;
27
+ private readonly options: FileExistsDialogOptions;
28
28
  public model: JSONModel;
29
29
  constructor(name: string, options: FileExistsDialogOptions) {
30
30
  super(name);
@@ -90,7 +90,7 @@ sap.ui.define(["../../../utils/fe-v4", "../add-new-subpage-quick-action-base", "
90
90
  throw new Error('Unexpected type of page owner component');
91
91
  }
92
92
  let entitySet = component.getEntitySet();
93
- let contextPath = component.getContextPath();
93
+ const contextPath = component.getContextPath();
94
94
  if (contextPath) {
95
95
  entitySet = await this.resolveContextPathTargetName(contextPath, metaModel);
96
96
  }
@@ -128,7 +128,7 @@ export class AddNewSubpage extends AddNewSubpageBase<ODataMetaModelV4> {
128
128
  throw new Error('Unexpected type of page owner component');
129
129
  }
130
130
  let entitySet: string | undefined = component.getEntitySet();
131
- let contextPath = component.getContextPath();
131
+ const contextPath = component.getContextPath();
132
132
  if (contextPath) {
133
133
  entitySet = await this.resolveContextPathTargetName(contextPath, metaModel);
134
134
  }
@@ -101,7 +101,7 @@ sap.ui.define(["../../utils/version", "sap/ui/core/util/reflection/JsControlTree
101
101
  return;
102
102
  }
103
103
  try {
104
- let control = JsControlTreeModifier.bySelector(selector, appComponent);
104
+ const control = JsControlTreeModifier.bySelector(selector, appComponent);
105
105
  if (!control) {
106
106
  return selector.id;
107
107
  }
@@ -187,7 +187,7 @@ sap.ui.define(["../../utils/version", "sap/ui/core/util/reflection/JsControlTree
187
187
  }
188
188
  const configMapKey = getConfigMapControlIdMap(change.content.page, propertyPathSegments);
189
189
  const controlIds = configPropertyControlIdMap?.get(configMapKey) || [];
190
- let value = change.content.entityPropertyChange.propertyValue;
190
+ const value = change.content.entityPropertyChange.propertyValue;
191
191
  const properties = typeof value === 'object' ? [{
192
192
  label: propertyName,
193
193
  displayValueWithIcon: true
@@ -205,7 +205,7 @@ export async function getControlIdByChange(
205
205
  }
206
206
 
207
207
  try {
208
- let control = JsControlTreeModifier.bySelector(selector, appComponent);
208
+ const control = JsControlTreeModifier.bySelector(selector, appComponent);
209
209
  if (!control) {
210
210
  return selector.id;
211
211
  }
@@ -329,7 +329,7 @@ function getV4ConfigurationChange(
329
329
  }
330
330
  const configMapKey = getConfigMapControlIdMap(change.content.page, propertyPathSegments);
331
331
  const controlIds = configPropertyControlIdMap?.get(configMapKey) || [];
332
- let value = change.content.entityPropertyChange.propertyValue;
332
+ const value = change.content.entityPropertyChange.propertyValue;
333
333
  const properties =
334
334
  typeof value === 'object'
335
335
  ? [
@@ -171,7 +171,7 @@ sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-proper
171
171
  };
172
172
  }
173
173
  throw new Error('Unknown change type');
174
- } catch (error) {
174
+ } catch {
175
175
  // Gracefully handle change files with invalid content
176
176
  const flexObject = await getFlexObject(change);
177
177
  const selectorId = await getControlIdByChange(flexObject, this.options.rta.getRootControlInstance());
@@ -210,7 +210,7 @@ export class ChangeService extends EventTarget {
210
210
  };
211
211
  }
212
212
  throw new Error('Unknown change type');
213
- } catch (error) {
213
+ } catch {
214
214
  // Gracefully handle change files with invalid content
215
215
  const flexObject = await getFlexObject(change);
216
216
  const selectorId = await getControlIdByChange(
@@ -12,7 +12,7 @@ export class CommunicationService {
12
12
  * Sends an action to the CPE.
13
13
  */
14
14
  static sendAction: (action: ExternalAction) => void;
15
- private static actionHandlers: ActionHandler[] = [];
15
+ private static readonly actionHandlers: ActionHandler[] = [];
16
16
 
17
17
  static {
18
18
  const { sendAction } = startPostMessageCommunication<ExternalAction>(
@@ -47,7 +47,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
47
47
  this.texts = await getTextBundle();
48
48
  subscribe(async action => {
49
49
  if (executeQuickAction.match(action)) {
50
- const actionInstance = this.actions.filter(quickActionDefinition => quickActionDefinition.id === action.payload.id).pop();
50
+ const actionInstance = this.actions.findLast(quickActionDefinition => quickActionDefinition.id === action.payload.id);
51
51
  if (!actionInstance) {
52
52
  return;
53
53
  }
@@ -38,7 +38,7 @@ import { getUi5Version } from '../../utils/version';
38
38
  */
39
39
  export class QuickActionService implements Service {
40
40
  private sendAction: ActionSenderFunction = () => {};
41
- private actions: QuickActionDefinition[] = [];
41
+ private readonly actions: QuickActionDefinition[] = [];
42
42
  private controlTreeIndex: ControlTreeIndex;
43
43
 
44
44
  private actionService: ActionService;
@@ -73,8 +73,7 @@ export class QuickActionService implements Service {
73
73
  subscribe(async (action: ExternalAction): Promise<void> => {
74
74
  if (executeQuickAction.match(action)) {
75
75
  const actionInstance = this.actions
76
- .filter((quickActionDefinition) => quickActionDefinition.id === action.payload.id)
77
- .pop();
76
+ .findLast((quickActionDefinition) => quickActionDefinition.id === action.payload.id);
78
77
  if (!actionInstance) {
79
78
  return;
80
79
  }
@@ -91,8 +91,8 @@ async function addDocumentationForProperties(control: ManagedObject, controlData
91
91
  *
92
92
  */
93
93
  export class SelectionService implements Service {
94
- private appliedChangeCache = new Map<string, number>();
95
- private activeChangeHandlers = new Set<() => void>();
94
+ private readonly appliedChangeCache = new Map<string, number>();
95
+ private readonly activeChangeHandlers = new Set<() => void>();
96
96
  private currentSelection: ManagedObject;
97
97
  /**
98
98
  *
@@ -23,7 +23,7 @@ sap.ui.define(["sap/base/util/merge", "sap/ui/fl/write/api/connectors/ObjectStor
23
23
  if (typeof this.fileChangeRequestNotifier === 'function' && change.fileName) {
24
24
  try {
25
25
  this.fileChangeRequestNotifier(change.fileName, 'create', change, additionalChangeInfo);
26
- } catch (e) {
26
+ } catch {
27
27
  // exceptions in the listener call are ignored
28
28
  }
29
29
  }
@@ -23,7 +23,7 @@ const connector = merge({}, ObjectStorageConnector, {
23
23
  if (typeof this.fileChangeRequestNotifier === 'function' && change.fileName) {
24
24
  try {
25
25
  this.fileChangeRequestNotifier(change.fileName, 'create', change, additionalChangeInfo);
26
- } catch (e) {
26
+ } catch {
27
27
  // exceptions in the listener call are ignored
28
28
  }
29
29
  }
@@ -24,7 +24,7 @@ sap.ui.define(["sap/ui/fl/LrepConnector", "sap/ui/fl/FakeLrepConnector", "../uti
24
24
  if (typeof FakeLrepConnector.fileChangeRequestNotifier === 'function' && change.fileName) {
25
25
  try {
26
26
  FakeLrepConnector.fileChangeRequestNotifier(change.fileName, 'create', change, additionalChangeInfo);
27
- } catch (e) {
27
+ } catch {
28
28
  // exceptions in the listener call are ignored
29
29
  }
30
30
  }
@@ -44,7 +44,7 @@ export async function create(changes: FlexChange | FlexChange[]): Promise<void>
44
44
  if (typeof FakeLrepConnector.fileChangeRequestNotifier === 'function' && change.fileName) {
45
45
  try {
46
46
  FakeLrepConnector.fileChangeRequestNotifier(change.fileName, 'create', change, additionalChangeInfo);
47
- } catch (e) {
47
+ } catch {
48
48
  // exceptions in the listener call are ignored
49
49
  }
50
50
  }
@@ -36,7 +36,7 @@ export async function getResourceModel(key = 'open.ux.preview.client'): Promise<
36
36
  }
37
37
 
38
38
  export class TextBundle {
39
- constructor(private bundle: ResourceBundle) {}
39
+ constructor(private readonly bundle: ResourceBundle) {}
40
40
 
41
41
  getText(key: string, args?: string[]): string {
42
42
  return this.bundle.getText(key, args) ?? key;
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.23.77",
12
+ "version": "0.23.79",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,17 +27,17 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "qrcode": "1.5.4",
29
29
  "@sap/bas-sdk": "3.12.0",
30
- "@sap-ux/adp-tooling": "0.18.25",
30
+ "@sap-ux/adp-tooling": "0.18.27",
31
31
  "@sap-ux/btp-utils": "1.1.6",
32
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.5",
32
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.6",
33
33
  "@sap-ux/feature-toggle": "0.3.5",
34
- "@sap-ux/logger": "0.7.2",
35
- "@sap-ux/project-access": "1.32.16",
36
- "@sap-ux/system-access": "0.6.34",
37
- "@sap-ux/i18n": "0.3.6"
34
+ "@sap-ux/logger": "0.8.0",
35
+ "@sap-ux/project-access": "1.33.0",
36
+ "@sap-ux/system-access": "0.6.36",
37
+ "@sap-ux/i18n": "0.3.7"
38
38
  },
39
39
  "devDependencies": {
40
- "@sap-ux-private/playwright": "0.2.3",
40
+ "@sap-ux-private/playwright": "0.2.5",
41
41
  "@types/connect": "^3.4.38",
42
42
  "@types/qrcode": "1.5.5",
43
43
  "@types/ejs": "3.1.2",
@@ -53,10 +53,10 @@
53
53
  "nock": "13.4.0",
54
54
  "npm-run-all2": "6.2.0",
55
55
  "supertest": "7.1.4",
56
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.6",
57
- "@sap-ux/axios-extension": "1.25.0",
58
- "@sap-ux/store": "1.4.0",
59
- "@sap-ux/ui5-info": "0.13.4"
56
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.7",
57
+ "@sap-ux/axios-extension": "1.25.2",
58
+ "@sap-ux/store": "1.4.2",
59
+ "@sap-ux/ui5-info": "0.13.6"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "express": "4"