From 4db4e26a1e32786cd44c3f5d6290296603391c12 Mon Sep 17 00:00:00 2001 From: Kanika Sharma Date: Tue, 7 May 2024 12:09:03 +0530 Subject: [PATCH 1/3] incorporated review comments --- src/sap/fhir/model/r4/FHIRModel.js | 6 +++-- src/sap/fhir/model/r4/FHIRUtils.js | 24 +++++++++++-------- ...dleWithDeleteSuccessAndFailureEntries.json | 4 ++-- test/qunit/model/FHIRModel.integration.js | 8 +++---- test/qunit/model/FHIRModel.unit.js | 8 +++---- test/qunit/model/FHIRUtils.unit.js | 4 ++-- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/sap/fhir/model/r4/FHIRModel.js b/src/sap/fhir/model/r4/FHIRModel.js index 8311a6bd..ca716ead 100644 --- a/src/sap/fhir/model/r4/FHIRModel.js +++ b/src/sap/fhir/model/r4/FHIRModel.js @@ -650,7 +650,7 @@ sap.ui.define([ */ FHIRModel.prototype.submitChanges = function(sGroupId, fnSuccessCallback, fnErrorCallback) { - var removedResources = this.getRemovedResourcesObject(); + var removedResources = this._getRemovedResourcesObject(); if (typeof sGroupId === "function") { fnErrorCallback = fnSuccessCallback; fnSuccessCallback = FHIRUtils.deepClone(sGroupId); @@ -819,8 +819,10 @@ sap.ui.define([ * Iterates through the removed resources, * retrieves corresponding resources from the model, and returns them. * @returns {Array} An array containing the removed resources. + * @private + * @since 2.3.8 */ - FHIRModel.prototype.getRemovedResourcesObject = function () { + FHIRModel.prototype._getRemovedResourcesObject = function () { var resources = []; for (var type in this.mRemovedResources) { if (this.mRemovedResources.hasOwnProperty(type)) { diff --git a/src/sap/fhir/model/r4/FHIRUtils.js b/src/sap/fhir/model/r4/FHIRUtils.js index f8c8c58c..91876cc2 100644 --- a/src/sap/fhir/model/r4/FHIRUtils.js +++ b/src/sap/fhir/model/r4/FHIRUtils.js @@ -719,14 +719,16 @@ sap.ui.define([ /** * Extracts resource IDs from the error description in FHIR OperationOutcome. - * @param {Array} operationOutcomes - The array of FHIR OperationOutcome objects. + * @param {Array} aOperationOutcomes - The array of FHIR OperationOutcome objects. * @returns {Array} - An array containing the extracted resource IDs. + * @private + * @since 2.3.8 */ - FHIRUtils.getsIdFromOperationOutcome = function(operationOutcomes){ + FHIRUtils.getsIdFromOperationOutcome = function(aOperationOutcomes){ var sIds = []; - for (var key in operationOutcomes) { - if (operationOutcomes.hasOwnProperty(key)) { - var operationOutcome = operationOutcomes[key]; + for (var key in aOperationOutcomes) { + if (aOperationOutcomes.hasOwnProperty(key)) { + var operationOutcome = aOperationOutcomes[key]; var text = operationOutcome._aIssue[0].details.text; var sId = text.match(/[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}/); sIds.push(sId[0]); @@ -738,15 +740,17 @@ sap.ui.define([ /** * Filters an array of FHIR resources by their IDs, removing those that match the provided IDs. - * @param {Array} resources - The array of FHIR resources to filter. - * @param {Array} sIds - The array of resource IDs to exclude from the filtered result. + * @param {Array} aResources - The array of FHIR resources to filter. + * @param {Array} aSIds - The array of resource IDs to exclude from the filtered result. * @returns {Array} - The filtered array of FHIR resources. + * @private + * @since 2.3.8 */ - FHIRUtils.filterResourcesByIds = function(resources, sIds) { + FHIRUtils.filterResourcesByIds = function(aResources, aSIds) { function isIdNotIncluded(obj) { - return !sIds.includes(obj.id); + return !aSIds.includes(obj.id); } - return resources.filter(isIdNotIncluded); + return aResources.filter(isIdNotIncluded); }; return FHIRUtils; diff --git a/test/localService/BundleWithDeleteSuccessAndFailureEntries.json b/test/localService/BundleWithDeleteSuccessAndFailureEntries.json index c8f66559..b2247b3d 100644 --- a/test/localService/BundleWithDeleteSuccessAndFailureEntries.json +++ b/test/localService/BundleWithDeleteSuccessAndFailureEntries.json @@ -13,9 +13,9 @@ "severity": "error", "code": "conflict", "details": { - "text": "Referenced resource exist 'e1692049-4bdc-4e40-abb5-4eae27ce0b8b' for resource 'RolePermission}'" + "text": "Referenced resource exist 'e1692049-4bdc-4e40-abb5-4eae27ce0b8b' for resource 'Patient}'" }, - "diagnostics": "Referenced resource exist 'e1692049-4bdc-4e40-abb5-4eae27ce0b8b' for resource 'RolePermission}'" + "diagnostics": "Referenced resource exist 'e1692049-4bdc-4e40-abb5-4eae27ce0b8b' for resource 'Patient}'" } ], "resourceType": "OperationOutcome", diff --git a/test/qunit/model/FHIRModel.integration.js b/test/qunit/model/FHIRModel.integration.js index 9f82c3f8..1bd28049 100644 --- a/test/qunit/model/FHIRModel.integration.js +++ b/test/qunit/model/FHIRModel.integration.js @@ -923,13 +923,13 @@ sap.ui.define([ QUnit.test("Test delete containing successful entry and operation outcome", function (assert) { var oJSONData = TestUtils.loadJSONFile("BundleWithDeleteSuccessAndFailureEntries"); var done = assert.async(); - var sResId = this.oFhirModel.create("RolePermission", { - resourceType: "RolePermission", + var sResId = this.oFhirModel.create("Patient", { + resourceType: "Patient", version: "1.0.0", - name: "PersonaRead" + name: "Billy" }, "bundle"); this.oFhirModel.mChangedResources = {}; - this.oFhirModel.remove(["/RolePermission/" + sResId], undefined, "bundle"); + this.oFhirModel.remove(["/Patient/" + sResId], undefined, "bundle"); var fnErrorCallback = function (oMessage, aFHIRResource, aOperationOutcome) { assert.strictEqual(aOperationOutcome.length, 1, "Bundle error callback contains the opertion outcome of the failed entry "); done(); diff --git a/test/qunit/model/FHIRModel.unit.js b/test/qunit/model/FHIRModel.unit.js index 28b9b8e3..c2d1ce92 100644 --- a/test/qunit/model/FHIRModel.unit.js +++ b/test/qunit/model/FHIRModel.unit.js @@ -1504,10 +1504,10 @@ sap.ui.define([ }); QUnit.test("Test getRemovedResourcesObject returning the correct value", function (assert) { - this.oFhirModel1.mRemovedResources = { RolePermission: ["RolePermission/123"] }; - this.oFhirModel1.setProperty("/RolePermission/123", { id: 123, description: "this is a test object", resourceType: "RolePermission" }); - var resources = this.oFhirModel1.getRemovedResourcesObject(); - assert.deepEqual(resources, [{ id: 123, description: "this is a test object", resourceType: "RolePermission" }], "Correct resources returned"); + this.oFhirModel1.mRemovedResources = { Patient: ["Patient/123"] }; + this.oFhirModel1.setProperty("/Patient/123", { id: 123, description: "this is a test object", resourceType: "Patient" }); + var resources = this.oFhirModel1._getRemovedResourcesObject(); + assert.deepEqual(resources, [{ id: 123, description: "this is a test object", resourceType: "Patient" }], "Correct resources returned"); }); }); diff --git a/test/qunit/model/FHIRUtils.unit.js b/test/qunit/model/FHIRUtils.unit.js index 01056699..48e145c2 100644 --- a/test/qunit/model/FHIRUtils.unit.js +++ b/test/qunit/model/FHIRUtils.unit.js @@ -526,9 +526,9 @@ sap.ui.define(["../utils/TestUtils", "sap/fhir/model/r4/FHIRUtils"], function(Te "severity": "error", "code": "conflict", "details": { - "text": "Referenced resource exist '7b4abf15-8a93-4e11-8d85-96c945530d05' for resource 'RolePermission}'" + "text": "Referenced resource exist '7b4abf15-8a93-4e11-8d85-96c945530d05' for resource 'Patient}'" }, - "diagnostics": "Referenced resource exist '7b4abf15-8a93-4e11-8d85-96c945530d05' for resource 'RolePermission}'" + "diagnostics": "Referenced resource exist '7b4abf15-8a93-4e11-8d85-96c945530d05' for resource 'Patient}'" } ] } From 39c7e2891cbc29c3e23b10bb309fedddc3c8b7fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 12:56:05 +0530 Subject: [PATCH 2/3] chore(deps-dev): update @ui5/cli requirement from ^3.9.2 to ^3.10.0 (#444) Updates the requirements on [@ui5/cli](https://github.com/SAP/ui5-cli) to permit the latest version. - [Release notes](https://github.com/SAP/ui5-cli/releases) - [Changelog](https://github.com/SAP/ui5-cli/blob/v3.10.0/CHANGELOG.md) - [Commits](https://github.com/SAP/ui5-cli/compare/v3.9.2...v3.10.0) --- updated-dependencies: - dependency-name: "@ui5/cli" dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f6dad12..455223b8 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "karma-coverage": "^2.2.1", "karma-junit-reporter": "^2.0.1", "karma-ui5": "^3.0.4", - "@ui5/cli": "^3.9.2", + "@ui5/cli": "^3.10.0", "coveralls": "^3.1.1", "replace-in-file": "^7.1.0", "js-yaml": "^4.1.0", From 707b026a80a7234b34fd3d5075fa4d9058eb3d49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 13:24:29 +0530 Subject: [PATCH 3/3] chore(deps-dev): update jsdoc requirement from ^4.0.2 to ^4.0.3 (#446) Updates the requirements on [jsdoc](https://github.com/jsdoc/jsdoc) to permit the latest version. - [Release notes](https://github.com/jsdoc/jsdoc/releases) - [Changelog](https://github.com/jsdoc/jsdoc/blob/4.0.3/CHANGES.md) - [Commits](https://github.com/jsdoc/jsdoc/compare/4.0.2...4.0.3) --- updated-dependencies: - dependency-name: jsdoc dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 455223b8..dbf5ac8e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "eslint": "^8.57.0", "eslint-watch": "^8.0.0", "js-beautify": "^1.15.1", - "jsdoc": "^4.0.2", + "jsdoc": "^4.0.3", "@jsdoc/salty": "^0.2.8", "karma": "^6.4.3", "karma-chrome-launcher": "^3.2.0",