From 0b0d73e6204dd370fa4900342f163e87100c663e Mon Sep 17 00:00:00 2001 From: shuhaib-aot Date: Fri, 2 Aug 2024 13:57:34 +0530 Subject: [PATCH 1/8] FWF 3540 [ bugfix] fixed groups showing in multi tenant and label changed --- .../src/components/dashboard/dashboard.tsx | 12 ++++++++---- forms-flow-admin/src/utils/utils.js | 13 +++++++++++++ .../src/resourceBundles/bg/resourceBundles.ts | 3 ++- .../src/resourceBundles/de/resourceBundles.ts | 3 ++- .../src/resourceBundles/en/resourceBundles.ts | 3 ++- .../src/resourceBundles/es/resourceBundles.ts | 3 ++- .../src/resourceBundles/fr/resourceBundles.ts | 3 ++- .../src/resourceBundles/pt/resourceBundles.ts | 3 ++- .../src/resourceBundles/zh/resourceBundles.ts | 3 ++- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/forms-flow-admin/src/components/dashboard/dashboard.tsx b/forms-flow-admin/src/components/dashboard/dashboard.tsx index 25d2225f9..be224ed25 100644 --- a/forms-flow-admin/src/components/dashboard/dashboard.tsx +++ b/forms-flow-admin/src/components/dashboard/dashboard.tsx @@ -9,6 +9,10 @@ import "react-bootstrap-table2-paginator/dist/react-bootstrap-table2-paginator.m import paginationFactory from "react-bootstrap-table2-paginator"; import { toast } from "react-toastify"; import Loading from "../loading"; +import { useParams } from "react-router-dom"; +import {removeTenantKey} from "../../utils/utils.js"; +import { MULTITENANCY_ENABLED } from "../../constants"; + import { updateAuthorization, fetchAuthorizations, @@ -44,7 +48,7 @@ export const InsightDashboard = React.memo((props: any) => { const [isAuthUpdated, setIsAuthUpdated] = React.useState(false); const { t } = useTranslation(); - + const { tenantId } = useParams(); const [remainingGroups, setRemainingGroups] = React.useState([]); const [activeRow, setActiveRow] = React.useState(null); @@ -181,7 +185,7 @@ export const InsightDashboard = React.memo((props: any) => { }, { dataField: "roles", - text: {(t) => t("Access Groups")}, + text: {(t) => t("Access Roles")}, formatter: (cell, rowData) => { return (
@@ -190,7 +194,7 @@ export const InsightDashboard = React.memo((props: any) => { style={{ background: "#EAEFFF" }} data-testid={`dashboard-access-group-${i}`}> - {label} + {MULTITENANCY_ENABLED ? removeTenantKey(label,tenantId) : label} removeDashboardAuth(rowData, label)} @@ -227,7 +231,7 @@ export const InsightDashboard = React.memo((props: any) => { onClick={() => addDashboardAuth(item)} data-testid={`dashboard-remaining-group-${key}`} > - {item.path} + {MULTITENANCY_ENABLED ? removeTenantKey(item.path, tenantId) : item.path}
)) ) : ( diff --git a/forms-flow-admin/src/utils/utils.js b/forms-flow-admin/src/utils/utils.js index e2c333095..8e69a4425 100644 --- a/forms-flow-admin/src/utils/utils.js +++ b/forms-flow-admin/src/utils/utils.js @@ -22,3 +22,16 @@ export const removingTenantId = (roles=[], tenantId, tenantIdInPath = false) => } return roles; }; + + +export const removeTenantKey = (value, tenantkey) => { + const tenantKeyCheck = value.match(`${tenantkey}-`); + if ( + tenantKeyCheck && + tenantKeyCheck[0].toLowerCase() === `${tenantkey.toLowerCase()}-` + ) { + return value.replace(`${tenantkey.toLowerCase()}-`, ""); + } else { + return false; + } +}; \ No newline at end of file diff --git a/forms-flow-service/src/resourceBundles/bg/resourceBundles.ts b/forms-flow-service/src/resourceBundles/bg/resourceBundles.ts index 7b8d07fd7..c9d8b9916 100644 --- a/forms-flow-service/src/resourceBundles/bg/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/bg/resourceBundles.ts @@ -1200,5 +1200,6 @@ export const RESOURCE_BUNDLES_BG = { "Proceed to Sign In": "Продължете към Вход", "Contact formsflow.ai support": "Свържете се с поддръжката на formsflow.ai", "Please provide your tenant name to sign in": "Моля, предоставете името на вашата аренда, за да влезете", - "Tenant not found":"Наемателят не е намерен" + "Tenant not found":"Наемателят не е намерен", + "Access Roles": "Роли за достъп", } diff --git a/forms-flow-service/src/resourceBundles/de/resourceBundles.ts b/forms-flow-service/src/resourceBundles/de/resourceBundles.ts index f124fbaa6..652206b05 100644 --- a/forms-flow-service/src/resourceBundles/de/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/de/resourceBundles.ts @@ -1205,6 +1205,7 @@ export const RESOURCE_BUNDLES_DE = { "Proceed to Sign In": "Weiter zur Anmeldung", "Contact formsflow.ai support": "Kontaktieren Sie den Support von formsflow.ai", "Please provide your tenant name to sign in": "Bitte geben Sie Ihren Mandantenname zum Anmelden ein", - "Tenant not found":"Mandant nicht gefunden" + "Tenant not found":"Mandant nicht gefunden", + "Access Roles": "Zugriffsrollen", } diff --git a/forms-flow-service/src/resourceBundles/en/resourceBundles.ts b/forms-flow-service/src/resourceBundles/en/resourceBundles.ts index d5d95b888..331308099 100644 --- a/forms-flow-service/src/resourceBundles/en/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/en/resourceBundles.ts @@ -708,5 +708,6 @@ export const RESOURCE_BUNDLES_EN ={ "Proceed to Sign In": "Proceed to Sign In", "Contact formsflow.ai support": "Contact formsflow.ai support", "Please provide your tenant name to sign in": "Please provide your tenant name to sign in", - "Tenant not found":"Tenant not found" + "Tenant not found":"Tenant not found", + "Access Roles" :"Access Roles", } diff --git a/forms-flow-service/src/resourceBundles/es/resourceBundles.ts b/forms-flow-service/src/resourceBundles/es/resourceBundles.ts index ba8370ede..daf8b4ddb 100644 --- a/forms-flow-service/src/resourceBundles/es/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/es/resourceBundles.ts @@ -689,5 +689,6 @@ export const RESOURCE_BUNDLES_ES = { "Proceed to Sign In": "Continuar para iniciar sesión", "Contact formsflow.ai support": "Contactar con el soporte de formsflow.ai", "Please provide your tenant name to sign in": "Por favor, proporcione el nombre de su inquilino para iniciar sesión", - "Tenant not found":"Inquilino no encontrado" + "Tenant not found":"Inquilino no encontrado", + "Access Roles": "Roles de acceso", } diff --git a/forms-flow-service/src/resourceBundles/fr/resourceBundles.ts b/forms-flow-service/src/resourceBundles/fr/resourceBundles.ts index 1e347083f..d60b1bff3 100644 --- a/forms-flow-service/src/resourceBundles/fr/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/fr/resourceBundles.ts @@ -1203,7 +1203,8 @@ export const RESOURCE_BUNDLES_FR ={ "Proceed to Sign In": "Procéder à la connexion", "Contact formsflow.ai support": "Contacter le support de formsflow.ai", "Please provide your tenant name to sign in": "Veuillez fournir le nom de votre locataire pour vous connecter", - "Tenant not found":"Locataire non trouvé" + "Tenant not found":"Locataire non trouvé", + "Access Roles": "Rôles d'accès", } diff --git a/forms-flow-service/src/resourceBundles/pt/resourceBundles.ts b/forms-flow-service/src/resourceBundles/pt/resourceBundles.ts index 0971ee4ca..64f125f26 100644 --- a/forms-flow-service/src/resourceBundles/pt/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/pt/resourceBundles.ts @@ -1202,5 +1202,6 @@ export const RESOURCE_BUNDLES_PT ={ "Proceed to Sign In": "Prosseguir para Entrar", "Contact formsflow.ai support": "Contactar suporte formsflow.ai", "Please provide your tenant name to sign in": "Por favor, forneça o nome do seu inquilino para entrar", - "Tenant not found":"Inquilino não encontrado" + "Tenant not found":"Inquilino não encontrado", + "Access Roles": "Funções de Acesso", }; diff --git a/forms-flow-service/src/resourceBundles/zh/resourceBundles.ts b/forms-flow-service/src/resourceBundles/zh/resourceBundles.ts index 3e3c9d170..e68ce3eb5 100644 --- a/forms-flow-service/src/resourceBundles/zh/resourceBundles.ts +++ b/forms-flow-service/src/resourceBundles/zh/resourceBundles.ts @@ -1189,5 +1189,6 @@ export const RESOURCE_BUNDLES_ZH = { "Proceed to Sign In": "继续登录", "Contact formsflow.ai support": "联系 formsflow.ai 支持", "Please provide your tenant name to sign in": "请提供您的租户名称以登录", - "Tenant not found":"未找到租户" + "Tenant not found":"未找到租户", + "Access Roles": "访问角色", } From b24cf32c1e4aad855bd26d297f3211e187a64c2c Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Thu, 8 Aug 2024 01:29:29 -0700 Subject: [PATCH 2/8] FWF:3560[Bugfix] Fixed Admin Login showing Forms page --- forms-flow-admin/src/index.tsx | 19 ++++++++++++++++++- forms-flow-nav/src/Navbar.jsx | 11 ++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/forms-flow-admin/src/index.tsx b/forms-flow-admin/src/index.tsx index 4bfdef3b6..27658a44d 100644 --- a/forms-flow-admin/src/index.tsx +++ b/forms-flow-admin/src/index.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Route, Switch,useHistory, useParams,useLocation } from "react-router-dom"; +import { Route, Switch,useHistory, useParams,useLocation,Redirect } from "react-router-dom"; import { ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import { KeycloakService, StorageService } from "@formsflow/service"; @@ -146,6 +146,23 @@ const Admin = React.memo(({ props }: any) => { /> )} />)} + + { + userRoles.length && ( + + ) + } + ):
diff --git a/forms-flow-nav/src/Navbar.jsx b/forms-flow-nav/src/Navbar.jsx index 751b2aa17..e3c7be252 100644 --- a/forms-flow-nav/src/Navbar.jsx +++ b/forms-flow-nav/src/Navbar.jsx @@ -117,13 +117,7 @@ const isViewDashboard=userRoles?.includes("view_dashboards") const isDashboardManager = userRoles?.includes("manage_dashboard_authorizations"); const isRoleManager = userRoles?.includes("manage_roles"); const isUserManager = userRoles?.includes("manage_users"); - const ADMIN_BASE_ROUTE = isDashboardManager - ? `${baseUrl}admin/dashboard` - : isRoleManager - ? `${baseUrl}admin/roles` - : isUserManager - ? `${baseUrl}admin/users` - : null; + const onResize = React.useCallback(() => { if (navbarRef?.current) { @@ -337,7 +331,7 @@ const isUserManager = userRoles?.includes("manage_users"); )} - {userRoles?.includes("manage_integrations") ? (integrationEnabled || ENABLE_INTEGRATION_PREMIUM) && ( Date: Thu, 8 Aug 2024 03:37:53 -0700 Subject: [PATCH 3/8] updated --- forms-flow-admin/src/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/forms-flow-admin/src/index.tsx b/forms-flow-admin/src/index.tsx index 27658a44d..b96adac4e 100644 --- a/forms-flow-admin/src/index.tsx +++ b/forms-flow-admin/src/index.tsx @@ -97,9 +97,11 @@ const Admin = React.memo(({ props }: any) => { const restricted = (location === '/admin/dashboard' && !isDashboardManager) || (location === '/admin/roles' && !isRoleManager) || - (location === '/admin/users' && !isUserManager); + (location === '/admin/users' && !isUserManager) || + (!(isDashboardManager ||isRoleManager ||isUserManager)); setIsAccessRestricted(restricted); },[location,userRoles]); + console.log(isAccessRestricted,"hi"); return ( <> {userRoles.includes("admin") ? ( @@ -156,10 +158,9 @@ const Admin = React.memo(({ props }: any) => { to ={ isDashboardManager ? `${BASE_ROUTE}admin/dashboard` :isRoleManager ? `${BASE_ROUTE}admin/roles` - :isUserManager ? `${BASE_ROUTE}admin/users` - : '/404' + : `${BASE_ROUTE}admin/users` } - /> + /> ) } From f8f1670f0dba518c95a856f03c981b827e478506 Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Thu, 8 Aug 2024 03:39:52 -0700 Subject: [PATCH 4/8] console removed --- forms-flow-admin/src/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/forms-flow-admin/src/index.tsx b/forms-flow-admin/src/index.tsx index b96adac4e..ed3afe15c 100644 --- a/forms-flow-admin/src/index.tsx +++ b/forms-flow-admin/src/index.tsx @@ -101,7 +101,6 @@ const Admin = React.memo(({ props }: any) => { (!(isDashboardManager ||isRoleManager ||isUserManager)); setIsAccessRestricted(restricted); },[location,userRoles]); - console.log(isAccessRestricted,"hi"); return ( <> {userRoles.includes("admin") ? ( From 4a836a7a537278f47ac3d203f326ba94274fdd83 Mon Sep 17 00:00:00 2001 From: abilpraju-aot Date: Mon, 12 Aug 2024 00:07:49 -0700 Subject: [PATCH 5/8] updated version --- forms-flow-service/package-lock.json | 93 ++++++++++++++++------------ forms-flow-service/package.json | 2 +- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/forms-flow-service/package-lock.json b/forms-flow-service/package-lock.json index cdfe4644d..30f78267c 100644 --- a/forms-flow-service/package-lock.json +++ b/forms-flow-service/package-lock.json @@ -11,7 +11,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^20.0.3", + "keycloak-js": "^25.0.2", "moment": "^2.29.4", "single-spa": "^5.9.3" }, @@ -551,6 +551,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", @@ -569,6 +570,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.", "dev": true, "dependencies": { "@babel/helper-create-class-features-plugin": "^7.18.6", @@ -585,6 +587,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz", "integrity": "sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-static-block instead.", "dev": true, "dependencies": { "@babel/helper-create-class-features-plugin": "^7.20.7", @@ -602,6 +605,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -618,6 +622,7 @@ "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.9", @@ -634,6 +639,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -650,6 +656,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", @@ -666,6 +673,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -682,6 +690,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -698,6 +707,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.", "dev": true, "dependencies": { "@babel/compat-data": "^7.20.5", @@ -717,6 +727,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -733,6 +744,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz", "integrity": "sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", @@ -750,6 +762,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.", "dev": true, "dependencies": { "@babel/helper-create-class-features-plugin": "^7.18.6", @@ -766,6 +779,7 @@ "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", @@ -784,6 +798,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.", "dev": true, "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.18.6", @@ -1819,6 +1834,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", @@ -1833,6 +1849,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "deprecated": "Use @eslint/object-schema instead", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -3074,6 +3091,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", "dev": true }, "node_modules/accepts": { @@ -3606,25 +3624,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -4653,6 +4652,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "deprecated": "Use your platform's native DOMException instead", "dev": true, "dependencies": { "webidl-conversions": "^5.0.0" @@ -5976,6 +5976,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -6458,6 +6459,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { "once": "^1.3.0", @@ -8440,9 +8442,9 @@ } }, "node_modules/js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.11.0.tgz", + "integrity": "sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==" }, "node_modules/js-tokens": { "version": "4.0.0", @@ -8584,13 +8586,21 @@ "node": ">= 10.0.0" } }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "engines": { + "node": ">=18" + } + }, "node_modules/keycloak-js": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-20.0.3.tgz", - "integrity": "sha512-XOOPip8M8K8BsHvk9hnyHuHQ49u9cDu42UXY187G6fM9wsFSvM2apYK3WQ0EUg90nlWt1oMykrWsCWJY10Ihkw==", + "version": "25.0.2", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.2.tgz", + "integrity": "sha512-ACLf5O5PqzfDJwGqvLpqM0kflYWmyl3+T7M2C23gztJYccDxdfNP54+B9OkXz2GnDpLUId0ceoA+lbHw9t4Wng==", "dependencies": { - "base64-js": "^1.5.1", - "js-sha256": "^0.9.0" + "js-sha256": "^0.11.0", + "jwt-decode": "^4.0.0" } }, "node_modules/kind-of": { @@ -10043,6 +10053,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "dependencies": { "glob": "^7.1.3" @@ -14732,11 +14743,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -18337,9 +18343,9 @@ } }, "js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.11.0.tgz", + "integrity": "sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==" }, "js-tokens": { "version": "4.0.0", @@ -18448,13 +18454,18 @@ } } }, + "jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==" + }, "keycloak-js": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-20.0.3.tgz", - "integrity": "sha512-XOOPip8M8K8BsHvk9hnyHuHQ49u9cDu42UXY187G6fM9wsFSvM2apYK3WQ0EUg90nlWt1oMykrWsCWJY10Ihkw==", + "version": "25.0.2", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.2.tgz", + "integrity": "sha512-ACLf5O5PqzfDJwGqvLpqM0kflYWmyl3+T7M2C23gztJYccDxdfNP54+B9OkXz2GnDpLUId0ceoA+lbHw9t4Wng==", "requires": { - "base64-js": "^1.5.1", - "js-sha256": "^0.9.0" + "js-sha256": "^0.11.0", + "jwt-decode": "^4.0.0" } }, "kind-of": { diff --git a/forms-flow-service/package.json b/forms-flow-service/package.json index fcc2b563e..6fce031a3 100644 --- a/forms-flow-service/package.json +++ b/forms-flow-service/package.json @@ -47,7 +47,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^20.0.3", + "keycloak-js": "^25.0.2", "moment": "^2.29.4", "single-spa": "^5.9.3" }, From e7e4f8332773a5bc6675dd4513980f8cd76ec7b1 Mon Sep 17 00:00:00 2001 From: abilpraju-aot Date: Wed, 14 Aug 2024 11:37:43 +0530 Subject: [PATCH 6/8] added new roles for integretion --- forms-flow-integration/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms-flow-integration/src/index.tsx b/forms-flow-integration/src/index.tsx index 99e1abd12..1de475262 100644 --- a/forms-flow-integration/src/index.tsx +++ b/forms-flow-integration/src/index.tsx @@ -9,7 +9,7 @@ import { KEYCLOAK_CLIENT, } from "./endpoints/config"; import Footer from "./components/Footer"; -import { BASE_ROUTE, DESIGNER_ROLE, MULTITENANCY_ENABLED, ENABLE_INTEGRATION_PREMIUM } from "./constants"; +import { BASE_ROUTE, MULTITENANCY_ENABLED, ENABLE_INTEGRATION_PREMIUM } from "./constants"; import Recipes from "./components/Recipes"; import ConnectedApps from "./components/ConnectedApps"; import PremiumSubscription from "./components/PremiumSubscription"; @@ -65,7 +65,7 @@ const Integration = React.memo(({ props }: any) => { React.useEffect(() => { if (!isAuth) return const roles = JSON.parse(StorageService.get(StorageService.User.USER_ROLE)); - if (roles.includes(DESIGNER_ROLE)) { + if (roles.includes('view_designs')) { setIsDesigner(true); } const locale = localStorage.getItem("i18nextLng") From ca75140f35ddde3dac0871dcbe3131482a1a1bdc Mon Sep 17 00:00:00 2001 From: abilpraju-aot Date: Fri, 16 Aug 2024 09:52:35 +0530 Subject: [PATCH 7/8] updated keycloak version --- forms-flow-service/package-lock.json | 14 +++++++------- forms-flow-service/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/forms-flow-service/package-lock.json b/forms-flow-service/package-lock.json index 30f78267c..45a5c8337 100644 --- a/forms-flow-service/package-lock.json +++ b/forms-flow-service/package-lock.json @@ -11,7 +11,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^25.0.2", + "keycloak-js": "^24.0.5", "moment": "^2.29.4", "single-spa": "^5.9.3" }, @@ -8595,9 +8595,9 @@ } }, "node_modules/keycloak-js": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.2.tgz", - "integrity": "sha512-ACLf5O5PqzfDJwGqvLpqM0kflYWmyl3+T7M2C23gztJYccDxdfNP54+B9OkXz2GnDpLUId0ceoA+lbHw9t4Wng==", + "version": "24.0.5", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-24.0.5.tgz", + "integrity": "sha512-VQOSn3j13DPB6OuavKAq+sRjDERhIKrXgBzekoHRstifPuyULILguugX6yxRUYFSpn3OMYUXmSX++tkdCupOjA==", "dependencies": { "js-sha256": "^0.11.0", "jwt-decode": "^4.0.0" @@ -18460,9 +18460,9 @@ "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==" }, "keycloak-js": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.2.tgz", - "integrity": "sha512-ACLf5O5PqzfDJwGqvLpqM0kflYWmyl3+T7M2C23gztJYccDxdfNP54+B9OkXz2GnDpLUId0ceoA+lbHw9t4Wng==", + "version": "24.0.5", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-24.0.5.tgz", + "integrity": "sha512-VQOSn3j13DPB6OuavKAq+sRjDERhIKrXgBzekoHRstifPuyULILguugX6yxRUYFSpn3OMYUXmSX++tkdCupOjA==", "requires": { "js-sha256": "^0.11.0", "jwt-decode": "^4.0.0" diff --git a/forms-flow-service/package.json b/forms-flow-service/package.json index 6fce031a3..7d8d01123 100644 --- a/forms-flow-service/package.json +++ b/forms-flow-service/package.json @@ -47,7 +47,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^25.0.2", + "keycloak-js": "^24.0.5", "moment": "^2.29.4", "single-spa": "^5.9.3" }, From 5552cfe5f5928f29f528936ac36f4d55c4cbba28 Mon Sep 17 00:00:00 2001 From: abilpraju-aot Date: Thu, 22 Aug 2024 11:29:23 +0530 Subject: [PATCH 8/8] updated keycloak to latest version --- forms-flow-service/package-lock.json | 14 +++++++------- forms-flow-service/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/forms-flow-service/package-lock.json b/forms-flow-service/package-lock.json index 45a5c8337..072197ed1 100644 --- a/forms-flow-service/package-lock.json +++ b/forms-flow-service/package-lock.json @@ -11,7 +11,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^24.0.5", + "keycloak-js": "^25.0.4", "moment": "^2.29.4", "single-spa": "^5.9.3" }, @@ -8595,9 +8595,9 @@ } }, "node_modules/keycloak-js": { - "version": "24.0.5", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-24.0.5.tgz", - "integrity": "sha512-VQOSn3j13DPB6OuavKAq+sRjDERhIKrXgBzekoHRstifPuyULILguugX6yxRUYFSpn3OMYUXmSX++tkdCupOjA==", + "version": "25.0.4", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.4.tgz", + "integrity": "sha512-LW7dVgqcBxMnnJTdmh7Zgd0NpStJnX2sCMrJGqcGtm4zmk4Rwlqk2o2uOvY7PaRHHYePXfbIwrqVhlN3GAnRCg==", "dependencies": { "js-sha256": "^0.11.0", "jwt-decode": "^4.0.0" @@ -18460,9 +18460,9 @@ "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==" }, "keycloak-js": { - "version": "24.0.5", - "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-24.0.5.tgz", - "integrity": "sha512-VQOSn3j13DPB6OuavKAq+sRjDERhIKrXgBzekoHRstifPuyULILguugX6yxRUYFSpn3OMYUXmSX++tkdCupOjA==", + "version": "25.0.4", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.4.tgz", + "integrity": "sha512-LW7dVgqcBxMnnJTdmh7Zgd0NpStJnX2sCMrJGqcGtm4zmk4Rwlqk2o2uOvY7PaRHHYePXfbIwrqVhlN3GAnRCg==", "requires": { "js-sha256": "^0.11.0", "jwt-decode": "^4.0.0" diff --git a/forms-flow-service/package.json b/forms-flow-service/package.json index 7d8d01123..e8f092720 100644 --- a/forms-flow-service/package.json +++ b/forms-flow-service/package.json @@ -47,7 +47,7 @@ "@types/webpack-env": "^1.16.2", "axios": "^1.3.0", "i18next": "^23.2.11", - "keycloak-js": "^24.0.5", + "keycloak-js": "^25.0.4", "moment": "^2.29.4", "single-spa": "^5.9.3" },