From eec2b306662942c98d82078500873f68c4d75fb7 Mon Sep 17 00:00:00 2001 From: = Date: Mon, 20 Oct 2025 22:05:02 +0530 Subject: [PATCH] feat: greepy review --- .../db/migrations/20251018061215_sub-org.ts | 8 ++++- backend/src/db/seeds/5-machine-identity.ts | 3 +- backend/src/ee/routes/v1/sub-org-router.ts | 32 ++++++------------- .../ee/services/audit-log/audit-log-types.ts | 8 ++--- .../services/permission/permission-service.ts | 4 +-- backend/src/lib/api-docs/constants.ts | 8 ++--- .../server/plugins/auth/inject-identity.ts | 4 +-- .../identity-access-token-service.ts | 2 +- .../identity-alicloud-auth-service.ts | 2 +- .../identity-aws-auth-service.ts | 2 +- .../identity-azure-auth-service.ts | 2 +- .../identity-gcp-auth-service.ts | 2 +- .../identity-ua/identity-ua-service.ts | 6 +--- .../membership-identity-dal.ts | 4 +-- .../org/org-membership-identity-factory.ts | 6 ++-- .../membership-user/membership-user-dal.ts | 2 +- .../org/org-membership-user-factory.ts | 9 ++++-- .../api/orgIdentityMembership/mutation.tsx | 7 ++-- .../components/NavBar/Navbar.tsx | 4 +-- .../components/OrgNavBar/OrgNavBar.tsx | 2 +- .../IdentitySection/IdentitySection.tsx | 2 +- .../IdentitySection/IdentityTable.tsx | 2 +- .../AppConnectionsPage/route.tsx | 6 ++++ .../components/IdentityDetailsSection.tsx | 2 +- .../components/ShareSecretForm.tsx | 2 +- 25 files changed, 65 insertions(+), 66 deletions(-) diff --git a/backend/src/db/migrations/20251018061215_sub-org.ts b/backend/src/db/migrations/20251018061215_sub-org.ts index 94a220c5c..bd577fe75 100644 --- a/backend/src/db/migrations/20251018061215_sub-org.ts +++ b/backend/src/db/migrations/20251018061215_sub-org.ts @@ -14,8 +14,14 @@ export async function up(knex: Knex): Promise { t.foreign("rootOrgId").references("id").inTable(TableName.Organization).onDelete("CASCADE"); t.dropUnique(["slug"]); - t.unique(["rootOrgId", "parentOrgId", "slug"]); }); + + // had to switch to raw for null not distinct + await knex.raw(` +ALTER TABLE "organization" +ADD CONSTRAINT "organization_root_parent_slug_unique" +UNIQUE ("rootOrgId", "parentOrgId", "slug") NULLS NOT DISTINCT; +`); } const hasIdentityOrgCol = await knex.schema.hasColumn(TableName.Identity, "orgId"); diff --git a/backend/src/db/seeds/5-machine-identity.ts b/backend/src/db/seeds/5-machine-identity.ts index 333fc7e3a..85507c890 100644 --- a/backend/src/db/seeds/5-machine-identity.ts +++ b/backend/src/db/seeds/5-machine-identity.ts @@ -24,7 +24,8 @@ export async function seed(knex: Knex): Promise { // @ts-ignore id: seedData1.machineIdentity.id, name: seedData1.machineIdentity.name, - authMethod: IdentityAuthMethod.UNIVERSAL_AUTH + authMethod: IdentityAuthMethod.UNIVERSAL_AUTH, + orgId: seedData1.organization.id } ]); const identityUa = await knex(TableName.IdentityUniversalAuth) diff --git a/backend/src/ee/routes/v1/sub-org-router.ts b/backend/src/ee/routes/v1/sub-org-router.ts index 0a03c2ade..185425cea 100644 --- a/backend/src/ee/routes/v1/sub-org-router.ts +++ b/backend/src/ee/routes/v1/sub-org-router.ts @@ -4,11 +4,11 @@ import { OrganizationsSchema } from "@app/db/schemas"; import { EventType } from "@app/ee/services/audit-log/audit-log-types"; import { ApiDocsTags, SUB_ORGANIZATIONS } from "@app/lib/api-docs"; import { readLimit, writeLimit } from "@app/server/config/rateLimiter"; +import { GenericResourceNameSchema } from "@app/server/lib/schemas"; import { verifyAuth } from "@app/server/plugins/auth/verify-auth"; import { AuthMode } from "@app/services/auth/auth-type"; -import { GenericResourceNameSchema } from "@app/server/lib/schemas"; -const sanitiziedSubOrganizationSchema = OrganizationsSchema.pick({ +const sanitizedSubOrganizationSchema = OrganizationsSchema.pick({ id: true, name: true, slug: true, @@ -26,7 +26,7 @@ export const registerSubOrgRouter = async (server: FastifyZodProvider) => { schema: { hide: false, tags: [ApiDocsTags.SubOrganizations], - description: "Create a child organization", + description: "Create a sub organization", security: [ { bearerAuth: [] @@ -37,7 +37,7 @@ export const registerSubOrgRouter = async (server: FastifyZodProvider) => { }), response: { 200: z.object({ - organization: sanitiziedSubOrganizationSchema + organization: sanitizedSubOrganizationSchema }) } }, @@ -45,21 +45,14 @@ export const registerSubOrgRouter = async (server: FastifyZodProvider) => { handler: async (req) => { const { organization } = await server.services.subOrganization.createSubOrg({ name: req.body.name, - permissionActor: { - id: req.permission.id, - type: req.permission.type, - authMethod: req.permission.authMethod, - orgId: req.permission.orgId, - parentOrgId: req.permission.parentOrgId, - rootOrgId: req.permission.rootOrgId - } + permissionActor: req.permission }); await server.services.auditLog.createAuditLog({ ...req.auditLogInfo, orgId: req.permission.orgId, event: { - type: EventType.CREATE_CHILD_ORGANIZATION, + type: EventType.CREATE_SUB_ORGANIZATION, metadata: { name: req.body.name, organizationId: organization.id @@ -80,7 +73,7 @@ export const registerSubOrgRouter = async (server: FastifyZodProvider) => { schema: { hide: false, tags: [ApiDocsTags.SubOrganizations], - description: "List child organizations", + description: "List of sub organizations", security: [ { bearerAuth: [] @@ -97,21 +90,14 @@ export const registerSubOrgRouter = async (server: FastifyZodProvider) => { }), response: { 200: z.object({ - organizations: sanitiziedSubOrganizationSchema.array() + organizations: sanitizedSubOrganizationSchema.array() }) } }, onRequest: verifyAuth([AuthMode.JWT]), handler: async (req) => { const { organizations } = await server.services.subOrganization.listSubOrgs({ - permissionActor: { - id: req.permission.id, - type: req.permission.type, - authMethod: req.permission.authMethod, - orgId: req.permission.orgId, - parentOrgId: req.permission.orgId, - rootOrgId: req.permission.rootOrgId - }, + permissionActor: req.permission, data: { limit: req.query.limit, offset: req.query.offset, diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts index b5d49b7e4..a933485ae 100644 --- a/backend/src/ee/services/audit-log/audit-log-types.ts +++ b/backend/src/ee/services/audit-log/audit-log-types.ts @@ -173,7 +173,7 @@ export enum EventType { UPDATE_TOKEN_IDENTITY_TOKEN_AUTH = "update-token-identity-token-auth", GET_TOKENS_IDENTITY_TOKEN_AUTH = "get-tokens-identity-token-auth", - CREATE_CHILD_ORGANIZATION = "create-child-organization", + CREATE_SUB_ORGANIZATION = "create-child-organization", ADD_IDENTITY_TOKEN_AUTH = "add-identity-token-auth", UPDATE_IDENTITY_TOKEN_AUTH = "update-identity-token-auth", @@ -609,8 +609,8 @@ interface GetSecretsEvent { }; } -interface CreateChildOrganizationEvent { - type: EventType.CREATE_CHILD_ORGANIZATION; +interface CreateSubOrganizationEvent { + type: EventType.CREATE_SUB_ORGANIZATION; metadata: { name: string; organizationId: string; @@ -3873,7 +3873,7 @@ interface PamResourceDeleteEvent { } export type Event = - | CreateChildOrganizationEvent + | CreateSubOrganizationEvent | GetSecretsEvent | GetSecretEvent | CreateSecretEvent diff --git a/backend/src/ee/services/permission/permission-service.ts b/backend/src/ee/services/permission/permission-service.ts index ec2a21352..48b78d980 100644 --- a/backend/src/ee/services/permission/permission-service.ts +++ b/backend/src/ee/services/permission/permission-service.ts @@ -212,9 +212,9 @@ export const permissionServiceFactory = ({ const rootOrgId = permissionData?.[0]?.rootOrgId; const isChild = Boolean(rootOrgId); if (scope === OrganizationActionScope.ParentOrganization && isChild) { - throw new BadRequestError({ message: `Child organization cannot do this operation` }); + throw new ForbiddenRequestError({ message: `Child organization cannot do this operation` }); } else if (scope === OrganizationActionScope.ChildOrganization && !isChild) { - throw new BadRequestError({ message: `Parent organization cannot do this operation` }); + throw new ForbiddenRequestError({ message: `Parent organization cannot do this operation` }); } const permissionFromRoles = permissionData.flatMap((membership) => { diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts index 77ce47cd5..e42eb9eff 100644 --- a/backend/src/lib/api-docs/constants.ts +++ b/backend/src/lib/api-docs/constants.ts @@ -719,12 +719,12 @@ export const ORGANIZATIONS = { export const SUB_ORGANIZATIONS = { CREATE: { - name: "The name of the child organization to create." + name: "The name of the sub organization to create." }, LIST: { - limit: "The number of child organizations to return.", - offset: "The offset to start from. If you enter 10, it will start from the 10th child organization.", - isAccessible: "Filter to only return child organizations that the actor has access to." + limit: "The number of sub organizations to return.", + offset: "The offset to start from. If you enter 10, it will start from the 10th sub organization.", + isAccessible: "Filter to only return sub organizations that the actor has access to." } } as const; diff --git a/backend/src/server/plugins/auth/inject-identity.ts b/backend/src/server/plugins/auth/inject-identity.ts index 9a959c5bc..2339d78be 100644 --- a/backend/src/server/plugins/auth/inject-identity.ts +++ b/backend/src/server/plugins/auth/inject-identity.ts @@ -8,10 +8,10 @@ import { TScimTokenJwtPayload } from "@app/ee/services/scim/scim-types"; import { getConfig } from "@app/lib/config/env"; import { crypto } from "@app/lib/crypto"; import { BadRequestError } from "@app/lib/errors"; +import { GenericResourceNameSchema } from "@app/server/lib/schemas"; import { ActorType, AuthMethod, AuthMode, AuthModeJwtTokenPayload, AuthTokenType } from "@app/services/auth/auth-type"; import { TIdentityAccessTokenJwtPayload } from "@app/services/identity-access-token/identity-access-token-types"; import { getServerCfg } from "@app/services/super-admin/super-admin-service"; -import { GenericResourceNameSchema } from "@app/server/lib/schemas"; export type TAuthMode = | { @@ -243,7 +243,7 @@ export const injectIdentity = fp( requestContext.set("orgId", orgId); if (subOrganizationSelector) - throw new BadRequestError({ message: `Service token doesn't support sub organization selector` }); + throw new BadRequestError({ message: `SCIM token doesn't support sub organization selector` }); req.auth = { authMode: AuthMode.SCIM_TOKEN, diff --git a/backend/src/services/identity-access-token/identity-access-token-service.ts b/backend/src/services/identity-access-token/identity-access-token-service.ts index bbefe923c..02660a0ae 100644 --- a/backend/src/services/identity-access-token/identity-access-token-service.ts +++ b/backend/src/services/identity-access-token/identity-access-token-service.ts @@ -216,7 +216,7 @@ export const identityAccessTokenServiceFactory = ({ if (subOrganizationSelector) { const subOrganization = await orgDAL.findOne({ rootOrgId, slug: subOrganizationSelector }); - if (!subOrganizationSelector) + if (!subOrganization) throw new BadRequestError({ message: `Sub organization ${subOrganizationSelector} not found` }); const identityOrgMembership = await membershipIdentityDAL.findOne({ diff --git a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts index 646dc72fc..c6f6f1376 100644 --- a/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts +++ b/backend/src/services/identity-alicloud-auth/identity-alicloud-auth-service.ts @@ -24,9 +24,9 @@ import { extractIPDetails, isValidIpOrCidr } from "@app/lib/ip"; import { logger } from "@app/lib/logger"; import { ActorType, AuthTokenType } from "../auth/auth-type"; +import { TIdentityDALFactory } from "../identity/identity-dal"; import { TIdentityAccessTokenDALFactory } from "../identity-access-token/identity-access-token-dal"; import { TIdentityAccessTokenJwtPayload } from "../identity-access-token/identity-access-token-types"; -import { TIdentityDALFactory } from "../identity/identity-dal"; import { TMembershipIdentityDALFactory } from "../membership-identity/membership-identity-dal"; import { TOrgDALFactory } from "../org/org-dal"; import { validateIdentityUpdateForSuperAdminPrivileges } from "../super-admin/super-admin-fns"; diff --git a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts b/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts index d36ea64de..1814afb2e 100644 --- a/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts +++ b/backend/src/services/identity-aws-auth/identity-aws-auth-service.ts @@ -23,9 +23,9 @@ import { import { extractIPDetails, isValidIpOrCidr } from "@app/lib/ip"; import { ActorType, AuthTokenType } from "../auth/auth-type"; +import { TIdentityDALFactory } from "../identity/identity-dal"; import { TIdentityAccessTokenDALFactory } from "../identity-access-token/identity-access-token-dal"; import { TIdentityAccessTokenJwtPayload } from "../identity-access-token/identity-access-token-types"; -import { TIdentityDALFactory } from "../identity/identity-dal"; import { TMembershipIdentityDALFactory } from "../membership-identity/membership-identity-dal"; import { TOrgDALFactory } from "../org/org-dal"; import { validateIdentityUpdateForSuperAdminPrivileges } from "../super-admin/super-admin-fns"; diff --git a/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts b/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts index a9fb6e703..f75aeba4f 100644 --- a/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts +++ b/backend/src/services/identity-azure-auth/identity-azure-auth-service.ts @@ -20,9 +20,9 @@ import { import { extractIPDetails, isValidIpOrCidr } from "@app/lib/ip"; import { ActorType, AuthTokenType } from "../auth/auth-type"; +import { TIdentityDALFactory } from "../identity/identity-dal"; import { TIdentityAccessTokenDALFactory } from "../identity-access-token/identity-access-token-dal"; import { TIdentityAccessTokenJwtPayload } from "../identity-access-token/identity-access-token-types"; -import { TIdentityDALFactory } from "../identity/identity-dal"; import { TMembershipIdentityDALFactory } from "../membership-identity/membership-identity-dal"; import { TOrgDALFactory } from "../org/org-dal"; import { validateIdentityUpdateForSuperAdminPrivileges } from "../super-admin/super-admin-fns"; diff --git a/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts b/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts index 1865e0fb8..67adb6c1e 100644 --- a/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts +++ b/backend/src/services/identity-gcp-auth/identity-gcp-auth-service.ts @@ -20,9 +20,9 @@ import { import { extractIPDetails, isValidIpOrCidr } from "@app/lib/ip"; import { ActorType, AuthTokenType } from "../auth/auth-type"; +import { TIdentityDALFactory } from "../identity/identity-dal"; import { TIdentityAccessTokenDALFactory } from "../identity-access-token/identity-access-token-dal"; import { TIdentityAccessTokenJwtPayload } from "../identity-access-token/identity-access-token-types"; -import { TIdentityDALFactory } from "../identity/identity-dal"; import { TMembershipIdentityDALFactory } from "../membership-identity/membership-identity-dal"; import { TOrgDALFactory } from "../org/org-dal"; import { validateIdentityUpdateForSuperAdminPrivileges } from "../super-admin/super-admin-fns"; diff --git a/backend/src/services/identity-ua/identity-ua-service.ts b/backend/src/services/identity-ua/identity-ua-service.ts index dfd7787ea..00ab1610d 100644 --- a/backend/src/services/identity-ua/identity-ua-service.ts +++ b/backend/src/services/identity-ua/identity-ua-service.ts @@ -23,6 +23,7 @@ import { checkIPAgainstBlocklist, extractIPDetails, isValidIpOrCidr, TIp } from import { logger } from "@app/lib/logger"; import { ActorType, AuthTokenType } from "../auth/auth-type"; +import { TIdentityDALFactory } from "../identity/identity-dal"; import { TIdentityAccessTokenDALFactory } from "../identity-access-token/identity-access-token-dal"; import { TIdentityAccessTokenJwtPayload } from "../identity-access-token/identity-access-token-types"; import { TMembershipIdentityDALFactory } from "../membership-identity/membership-identity-dal"; @@ -41,7 +42,6 @@ import { TRevokeUaDTO, TUpdateUaDTO } from "./identity-ua-types"; -import { TIdentityDALFactory } from "../identity/identity-dal"; type TIdentityUaServiceFactoryDep = { identityDAL: Pick; @@ -314,10 +314,6 @@ export const identityUaServiceFactory = ({ throw new ForbiddenRequestError({ message: "Sub organization not authorized to access this identity" }); } - if (identityMembershipOrg.identity.identityOrgId !== actorOrgId) { - throw new ForbiddenRequestError({ message: "Sub organization not authorized to access this identity" }); - } - if (accessTokenMaxTTL > 0 && accessTokenTTL > accessTokenMaxTTL) { throw new BadRequestError({ message: "Access token TTL cannot be greater than max TTL" }); } diff --git a/backend/src/services/membership-identity/membership-identity-dal.ts b/backend/src/services/membership-identity/membership-identity-dal.ts index 78df6a757..682bfef3e 100644 --- a/backend/src/services/membership-identity/membership-identity-dal.ts +++ b/backend/src/services/membership-identity/membership-identity-dal.ts @@ -356,7 +356,7 @@ export const membershipIdentityDALFactory = (db: TDbClient) => { } }; - // this right nwo only support sub organization + // this right now only support sub organization const listAvailableIdentities = async (orgId: string, rootOrgId: string) => { try { const usersConnectedToOrg = db @@ -381,7 +381,7 @@ export const membershipIdentityDALFactory = (db: TDbClient) => { return docs; } catch (error) { - throw new DatabaseError({ error, name: "ListAvailableUsers" }); + throw new DatabaseError({ error, name: "ListAvailableIdentities" }); } }; diff --git a/backend/src/services/membership-identity/org/org-membership-identity-factory.ts b/backend/src/services/membership-identity/org/org-membership-identity-factory.ts index 1ad77dfbd..8b3bdf6d5 100644 --- a/backend/src/services/membership-identity/org/org-membership-identity-factory.ts +++ b/backend/src/services/membership-identity/org/org-membership-identity-factory.ts @@ -57,7 +57,7 @@ export const newOrgMembershipIdentityFactory = ({ const identityDetails = await identityDAL.findById(dto.data.identityId); if (identityDetails.orgId !== dto.permission.rootOrgId) { - throw new BadRequestError({ message: "Only identites from parent organization can be invited" }); + throw new BadRequestError({ message: "Only identities from parent organization can be invited" }); } const permissionRoles = await permissionService.getOrgPermissionByRoles( @@ -143,11 +143,11 @@ export const newOrgMembershipIdentityFactory = ({ scope: OrganizationActionScope.ChildOrganization }); - ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Create, OrgPermissionSubjects.Identity); + ForbiddenError.from(permission).throwUnlessCan(OrgPermissionIdentityActions.Delete, OrgPermissionSubjects.Identity); const identityDetails = await identityDAL.findById(dto.selector.identityId); if (identityDetails.orgId !== dto.permission.rootOrgId) { - throw new BadRequestError({ message: "Only identites from parent organization can do this operation" }); + throw new BadRequestError({ message: "Only identities from parent organization can do this operation" }); } if (identityDetails.orgId === dto.permission.orgId) { diff --git a/backend/src/services/membership-user/membership-user-dal.ts b/backend/src/services/membership-user/membership-user-dal.ts index 41fa09696..221228465 100644 --- a/backend/src/services/membership-user/membership-user-dal.ts +++ b/backend/src/services/membership-user/membership-user-dal.ts @@ -291,7 +291,7 @@ export const membershipUserDALFactory = (db: TDbClient) => { } }; - // this right nwo only support sub organization + // this right now only support sub organization const listAvailableUsers = async (orgId: string, rootOrgId: string) => { try { const usersConnectedToOrg = db diff --git a/backend/src/services/membership-user/org/org-membership-user-factory.ts b/backend/src/services/membership-user/org/org-membership-user-factory.ts index ca867286a..7aff05220 100644 --- a/backend/src/services/membership-user/org/org-membership-user-factory.ts +++ b/backend/src/services/membership-user/org/org-membership-user-factory.ts @@ -92,10 +92,15 @@ export const newOrgMembershipUserFactory = ({ }, scopeOrgId: org.rootOrgId }); - if (rootOrgMembership.length !== newMembers.length) + if (rootOrgMembership.length !== newMembers.length) { + const emails = newMembers + .filter((user) => !rootOrgMembership.find((i) => i.actorUserId === user.id)) + .map((el) => el.email) + .join(","); throw new BadRequestError({ - message: "User doesn't have membership in root organization" + message: `Users with email ${emails} doesn't have membership in root organization` }); + } } }; diff --git a/frontend/src/hooks/api/orgIdentityMembership/mutation.tsx b/frontend/src/hooks/api/orgIdentityMembership/mutation.tsx index cd5787842..3ba41905a 100644 --- a/frontend/src/hooks/api/orgIdentityMembership/mutation.tsx +++ b/frontend/src/hooks/api/orgIdentityMembership/mutation.tsx @@ -2,6 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { apiRequest } from "@app/config/request"; +import { identitiesKeys } from "../identities"; import { TCreateOrgIdentityMembershipDTO, TDeleteOrgIdentityMembershipDTO, @@ -19,8 +20,7 @@ export const useCreateOrgIdentityMembership = () => { return data.identityMembership; }, onSuccess: () => { - // Invalidate relevant queries if needed - queryClient.invalidateQueries({ queryKey: ["organization"] }); + queryClient.invalidateQueries({ queryKey: identitiesKeys.searchIdentities({ search: {} }) }); } }); }; @@ -35,8 +35,7 @@ export const useDeleteOrgIdentityMembership = () => { return data.identityMembership; }, onSuccess: () => { - // Invalidate relevant queries if needed - queryClient.invalidateQueries({ queryKey: ["organization"] }); + queryClient.invalidateQueries({ queryKey: identitiesKeys.searchIdentities({ search: {} }) }); } }); }; diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx index 19a255ee9..09bf59794 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx @@ -344,7 +344,7 @@ export const Navbar = () => { size="xs" className="flex w-full items-center justify-start p-0 font-normal" leftIcon={ - currentOrg?.id === org.id && ( + currentOrg?.parentOrgId === org.id && ( { subTitle="Define a new sub-organization under your current organization." >
- setShowSubOrgForm(true)} /> + setShowSubOrgForm(false)} />
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx index 57f8d99f4..4e72f9b06 100644 --- a/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/OrgNavBar/OrgNavBar.tsx @@ -3,8 +3,8 @@ import { motion } from "framer-motion"; import { CreateOrgModal } from "@app/components/organization/CreateOrgModal"; import { Tab, TabList, Tabs } from "@app/components/v2"; -import { usePopUp } from "@app/hooks"; import { useOrganization } from "@app/context"; +import { usePopUp } from "@app/hooks"; type Props = { isHidden?: boolean; diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx index 2f0551966..ceac67251 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx @@ -243,7 +243,7 @@ export const IdentitySection = withPermission( > handlePopUpClose("linkIdentity")} /> diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx index 2705593e5..c4c1561e7 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityTable.tsx @@ -370,7 +370,7 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {

- {currentOrg.id === orgId ? "Organization" : "Root Organization"} + {currentOrg.id === orgId ? "Sub Organization" : "Root Organization"}

)} diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/route.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/route.tsx index ea24aa679..86dfe4530 100644 --- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/route.tsx +++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/route.tsx @@ -1,4 +1,5 @@ import { createFileRoute } from "@tanstack/react-router"; +import { z } from "zod"; import { AppConnectionsPage } from "./AppConnectionsPage"; @@ -6,6 +7,11 @@ export const Route = createFileRoute( "/_authenticate/_inject-org-details/_org-layout/organization/app-connections/" )({ component: AppConnectionsPage, + validateSearch: z.object({ + error: z.string().optional(), + success: z.string().optional(), + connectionId: z.string().optional() + }), context: () => ({ breadcrumbs: [ { diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/IdentityDetailsSection.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/IdentityDetailsSection.tsx index a9a6bf2f9..30429d48d 100644 --- a/frontend/src/pages/organization/IdentityDetailsByIDPage/components/IdentityDetailsSection.tsx +++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/components/IdentityDetailsSection.tsx @@ -145,7 +145,7 @@ export const IdentityDetailsSection = ({ identityId, handlePopUpOpen, isOrgIdent {isSubOrganization && (
-

Manage By

+

Managed By

{isOrgIdentity ? "Organization" : "Root Organization"}

diff --git a/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx b/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx index 109c02fbc..a34c08f9d 100644 --- a/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx +++ b/frontend/src/pages/public/ShareSecretPage/components/ShareSecretForm.tsx @@ -3,6 +3,7 @@ import { Controller, useForm } from "react-hook-form"; import { faCheck, faCopy, faRedo } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { zodResolver } from "@hookform/resolvers/zod"; +import { useSearch } from "@tanstack/react-router"; import { z } from "zod"; import { createNotification } from "@app/components/notifications"; @@ -22,7 +23,6 @@ import { import { useTimedReset } from "@app/hooks"; import { useCreatePublicSharedSecret, useCreateSharedSecret } from "@app/hooks/api"; import { SecretSharingAccessType } from "@app/hooks/api/secretSharing"; -import { useSearch } from "@tanstack/react-router"; // values in ms const expiresInOptions = [