From 6158d682f9ec4da8a88432527c7507507baccb2d Mon Sep 17 00:00:00 2001 From: tumms2021389 <97188066+tumms2021389@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:21:28 +0530 Subject: [PATCH] refactor: changing displayMode value to DISPLAY_ONLY (#222) --- package-lock.json | 18 ++++++++++-------- package.json | 7 +++---- src/bridge/BridgeBase/index.ts | 15 ++------------- src/components/DeferLoad/index.ts | 2 +- src/components/ModalViewContainer/index.ts | 6 ++---- src/components/NavBar/navbar-styles.ts | 5 ----- src/components/fields/SemanticLink/index.ts | 2 +- .../templates/AppShell/appshell-styles.ts | 4 ---- .../templates/DataReference/index.ts | 2 +- .../templates/FieldGroupTemplate/index.ts | 2 +- .../templates/details/Details/index.ts | 2 +- src/helpers/field-group-utils.ts | 4 ++-- 12 files changed, 24 insertions(+), 45 deletions(-) diff --git a/package-lock.json b/package-lock.json index f52ecb5..f0bd1eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,21 @@ { "name": "web-components-sdk", - "version": "0.1.0", + "version": "24.2.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "web-components-sdk", - "version": "0.1.0", + "version": "24.2.10", "dependencies": { "@lion/ui": "^0.7.6", - "@pega/auth": "^0.2.4", + "@pega/auth": "^0.2.15", "@vaadin/grid": "^24.4.6", "@vaadin/notification": "^24.4.6", "@vaadin/router": "^2.0.0", "@vaadin/text-field": "^24.4.6", "dayjs": "^1.11.13", - "downloadjs": "^1.4.7", - "fast-deep-equal": "^3.1.3" + "downloadjs": "^1.4.7" }, "devDependencies": { "@custom-elements-manifest/analyzer": "^0.6.3", @@ -1559,8 +1558,9 @@ } }, "node_modules/@pega/auth": { - "version": "0.2.14", - "license": "Apache-2.0", + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/@pega/auth/-/auth-0.2.15.tgz", + "integrity": "sha512-l8Vy8ZasPUM3KTmM2PmR+/k67CiHTsDPZlXreni0C2iPLUlETOFvi2vjR6MHpmalRIKZLnisRLMVE1PhVgkQig==", "dependencies": { "node-fetch": "^3.2.10", "open": "^8.4.2" @@ -6049,6 +6049,7 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", + "dev": true, "license": "MIT" }, "node_modules/fast-equals": { @@ -10518,8 +10519,9 @@ }, "node_modules/shx": { "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.3", "shelljs": "^0.8.5" diff --git a/package.json b/package.json index 07e4f1c..aeb7ca9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-components-sdk", - "version": "0.1.0", + "version": "24.2.10", "private": true, "scripts": { "analyze": "cem analyze --litelement --globs \"src/**/*.ts\"", @@ -32,14 +32,13 @@ }, "dependencies": { "@lion/ui": "^0.7.6", - "@pega/auth": "^0.2.4", + "@pega/auth": "^0.2.15", "@vaadin/grid": "^24.4.6", "@vaadin/notification": "^24.4.6", "@vaadin/router": "^2.0.0", "@vaadin/text-field": "^24.4.6", "dayjs": "^1.11.13", - "downloadjs": "^1.4.7", - "fast-deep-equal": "^3.1.3" + "downloadjs": "^1.4.7" }, "devDependencies": { "@custom-elements-manifest/analyzer": "^0.6.3", diff --git a/src/bridge/BridgeBase/index.ts b/src/bridge/BridgeBase/index.ts index 7a64f41..24e2aeb 100644 --- a/src/bridge/BridgeBase/index.ts +++ b/src/bridge/BridgeBase/index.ts @@ -3,7 +3,6 @@ // best practice to ensure compatible versions is to import LitElement from lit import { LitElement, html, nothing } from 'lit'; import { property } from 'lit/decorators.js'; -import * as isEqual from 'fast-deep-equal'; import Utils from '../../helpers/utils'; import { bootstrapStyles } from './bootstrap-styles'; @@ -72,15 +71,6 @@ export class BridgeBase extends LitElement { this.theStore = PCore.getStore(); this.theComponentProps = {}; this.renderTemplates = []; - - // Always best to use deep object compare when it's available - if (isEqual !== undefined) { - if (this.bLogging) { - console.log(`${this.theComponentName}: [${this.theComponentId}] using deep object compare`); - } - } else if (this.bLogging) { - console.log(`${this.theComponentName}: [${this.theComponentId}] using JSON.stringify compare`); - } } /** @@ -326,9 +316,8 @@ export class BridgeBase extends LitElement { const currentProps: any = currentComponentProps; // compare to current to prior props. If different, update stored props and return true - // fast-deep-equal version - if (isEqual !== undefined) { - bRet = !isEqual(priorProps, currentProps); + if (PCore.isDeepEqual !== undefined) { + bRet = !PCore.isDeepEqual(priorProps, currentProps); } else { // stringify compare version const priorPropsAsStr: string = JSON.stringify(priorProps); diff --git a/src/components/DeferLoad/index.ts b/src/components/DeferLoad/index.ts index acf5706..08ec34b 100644 --- a/src/components/DeferLoad/index.ts +++ b/src/components/DeferLoad/index.ts @@ -163,7 +163,7 @@ class DeferLoad extends BridgeBase { } }; const configObject = PCore.createPConnect(config); - configObject.getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT'); + configObject.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY'); this.loadedPConn = configObject.getPConnect(); this.componentName = this.loadedPConn.getComponentName(); // ${BridgeBase.getComponentFromConfigObj(config)} diff --git a/src/components/ModalViewContainer/index.ts b/src/components/ModalViewContainer/index.ts index b77a7c2..6e9c503 100644 --- a/src/components/ModalViewContainer/index.ts +++ b/src/components/ModalViewContainer/index.ts @@ -5,7 +5,6 @@ import { BridgeBase } from '../../bridge/BridgeBase'; // import the component's styles as HTML with