sap-ux-sap-systems-ext 0.3.4 → 0.3.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.
Files changed (2) hide show
  1. package/dist/extension.js +23 -10
  2. package/package.json +2 -2
package/dist/extension.js CHANGED
@@ -163775,7 +163775,7 @@ function shouldStoreSystemInfo(system) {
163775
163775
  var import_telemetry = __toESM(require_dist15());
163776
163776
 
163777
163777
  // package.json
163778
- var version = "0.3.4";
163778
+ var version = "0.3.5";
163779
163779
 
163780
163780
  // src/utils/telemetryHelper.ts
163781
163781
  var import_feature_toggle = __toESM(require_dist16());
@@ -164095,18 +164095,23 @@ function validateSystemInfo(input) {
164095
164095
  }
164096
164096
  return true;
164097
164097
  }
164098
- async function validateSystemName(newName, currentName) {
164098
+ async function validateSystemName(newName, currentName, panelViewType) {
164099
164099
  const systemService = await getBackendSystemService();
164100
164100
  const allSystems = await systemService.getAll({
164101
164101
  includeSensitiveData: false,
164102
164102
  backendSystemFilter: { connectionType: ["abap_catalog", "odata_service"] }
164103
164103
  });
164104
164104
  const newSystemName = newName.trim();
164105
- const nameExists = allSystems.some(
164106
- (sys) => sys.name.toLowerCase() === newSystemName.toLowerCase() && sys.name !== currentName
164107
- );
164105
+ const nameExists = allSystems.some((sys) => sys.name.toLowerCase() === newSystemName.toLowerCase());
164108
164106
  if (nameExists) {
164109
- throw t2("validation.connectionNameExists");
164107
+ if (panelViewType === 0 /* Create */ || panelViewType === 2 /* Import */) {
164108
+ throw t2("validation.connectionNameExists");
164109
+ } else if (panelViewType === 1 /* View */) {
164110
+ const currentSystemName = currentName?.trim().toLowerCase();
164111
+ if (currentSystemName !== newSystemName) {
164112
+ throw t2("validation.connectionNameExists");
164113
+ }
164114
+ }
164110
164115
  }
164111
164116
  return true;
164112
164117
  }
@@ -164391,7 +164396,7 @@ async function updateSystem(context4, action) {
164391
164396
  ...systemInfo && { systemInfo }
164392
164397
  };
164393
164398
  try {
164394
- await validateSystemName(backendSystem.name, context4.backendSystem?.name);
164399
+ await validateSystemName(backendSystem.name, context4.backendSystem?.name, context4.panelViewType);
164395
164400
  validateSystemUrl(backendSystem.url);
164396
164401
  const newPanelMsg = await updateHandler(context4, backendSystem, systemExistsInStore);
164397
164402
  await saveSystem(backendSystem, systemExistsInStore, context4.panelViewType);
@@ -164400,7 +164405,13 @@ async function updateSystem(context4, action) {
164400
164405
  }
164401
164406
  } catch (error) {
164402
164407
  const message = error instanceof Error ? error.message : String(error);
164403
- await postSavingError(message, context4.postMessage, systemExistsInStore, backendSystem.systemType);
164408
+ await postSavingError(
164409
+ message,
164410
+ context4.postMessage,
164411
+ systemExistsInStore,
164412
+ backendSystem.systemType,
164413
+ context4.panelViewType
164414
+ );
164404
164415
  }
164405
164416
  }
164406
164417
  async function fetchSystemInfo(context4, backendSystemPayload) {
@@ -164449,8 +164460,10 @@ async function updateHandler(context4, newSystem, systemExistsInStore) {
164449
164460
  }
164450
164461
  return newPanelMsg;
164451
164462
  }
164452
- async function postSavingError(errorMsg, postMessage, systemExistsInStore, systemType = "unknown") {
164453
- const message = t2(systemExistsInStore ? "error.updateFailure" : "error.creationFailure", { error: errorMsg });
164463
+ async function postSavingError(errorMsg, postMessage, systemExistsInStore, systemType = "unknown", panelViewType) {
164464
+ const message = t2(panelViewType === 1 /* View */ ? "error.updateFailure" : "error.creationFailure", {
164465
+ error: errorMsg
164466
+ });
164454
164467
  postMessage(
164455
164468
  updateSystemStatus({
164456
164469
  message,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sap-ux-sap-systems-ext",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "displayName": "Connection Manager for SAP Systems",
5
5
  "description": "Enables you to store connection information for remote SAP systems.",
6
6
  "main": "./dist/extension.js",
@@ -46,8 +46,8 @@
46
46
  "@vscode/vsce": "3.6.0",
47
47
  "@sap-ux/axios-extension": "1.25.15",
48
48
  "@sap-ux/guided-answers-helper": "0.4.2",
49
- "@sap-ux/feature-toggle": "0.3.7",
50
49
  "@sap-ux/ui-components": "1.27.6",
50
+ "@sap-ux/feature-toggle": "0.3.7",
51
51
  "@sap-ux/logger": "0.8.1",
52
52
  "@sap-ux/store": "1.5.7",
53
53
  "@sap-ux/sap-systems-ext-types": "0.0.4",