From a4b8fb3b3cfcb68a0072f1b928e5cf48b8fed820 Mon Sep 17 00:00:00 2001 From: pnzrr Date: Sat, 5 Aug 2023 16:44:15 -0600 Subject: [PATCH] fix imports --- js/apps/admin-ui/src/phaseII/README.md | 1 + js/apps/admin-ui/src/phaseII/custom-styles/StylesSection.tsx | 2 +- .../src/phaseII/custom-styles/email/email-template.tsx | 2 +- .../src/phaseII/custom-styles/general/general-styles.tsx | 2 +- .../admin-ui/src/phaseII/custom-styles/login/login-styles.tsx | 2 +- .../src/phaseII/custom-styles/portal/portal-styles.tsx | 2 +- js/apps/admin-ui/src/phaseII/orgs/OrgIdentityProviders.tsx | 3 --- .../phaseII/orgs/components/KeycloakDataTableCustomized.tsx | 2 +- .../orgs/components/key-value-form-custom/AttributeForm.tsx | 2 +- .../orgs/components/key-value-form-custom/KeyValueInput.tsx | 2 +- .../src/phaseII/orgs/components/portal-link/PortalLink.tsx | 4 ++-- js/apps/admin-ui/src/routes.tsx | 4 ++++ 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/js/apps/admin-ui/src/phaseII/README.md b/js/apps/admin-ui/src/phaseII/README.md index f4d5684c7171..d57c22396e4c 100644 --- a/js/apps/admin-ui/src/phaseII/README.md +++ b/js/apps/admin-ui/src/phaseII/README.md @@ -5,6 +5,7 @@ P// has added a lot of additional functionality to the Admin UI. Those are cordo - `PageNav.tsx` - Extensions nav group imported from the `phaseII/navigation` folder - Export Left Nav for use in the `extensions` file. +- Include the routes for the Phase II orgs and styles in `admin-ui/src/routes` - Translations - Files have to live in the `/js/apps/admin-ui/public/locales/en` folder - `orgs.json` diff --git a/js/apps/admin-ui/src/phaseII/custom-styles/StylesSection.tsx b/js/apps/admin-ui/src/phaseII/custom-styles/StylesSection.tsx index 720dab46a2a4..2a46021d27ba 100644 --- a/js/apps/admin-ui/src/phaseII/custom-styles/StylesSection.tsx +++ b/js/apps/admin-ui/src/phaseII/custom-styles/StylesSection.tsx @@ -13,7 +13,7 @@ import { EmailTemplate } from "./email/email-template"; import { PortalStyles } from "./portal/portal-styles"; import { KeycloakSpinner } from "../../components/keycloak-spinner/KeycloakSpinner"; -import { useFetch } from "apps/admin-ui/src/utils/useFetch"; +import { useFetch } from "../../utils/useFetch"; import { useState } from "react"; import { useRealm } from "../../context/realm-context/RealmContext"; import RealmRepresentation from "libs/keycloak-admin-client/lib/defs/realmRepresentation"; diff --git a/js/apps/admin-ui/src/phaseII/custom-styles/email/email-template.tsx b/js/apps/admin-ui/src/phaseII/custom-styles/email/email-template.tsx index e1c1db77f2d9..88e28c88042c 100644 --- a/js/apps/admin-ui/src/phaseII/custom-styles/email/email-template.tsx +++ b/js/apps/admin-ui/src/phaseII/custom-styles/email/email-template.tsx @@ -20,7 +20,7 @@ import { KeycloakTextArea } from "../../../components/keycloak-text-area/Keycloa import { useRealm } from "../../../context/realm-context/RealmContext"; import { SaveReset } from "../components/SaveReset"; import useStylesFetcher from "../useStylesFetcher"; -import { adminClient } from "apps/admin-ui/src/admin-client"; +import { adminClient } from "../../../admin-client"; type EmailTemplateTabProps = { realm: RealmRepresentation; diff --git a/js/apps/admin-ui/src/phaseII/custom-styles/general/general-styles.tsx b/js/apps/admin-ui/src/phaseII/custom-styles/general/general-styles.tsx index eec458b7b281..208ab0fd1e42 100644 --- a/js/apps/admin-ui/src/phaseII/custom-styles/general/general-styles.tsx +++ b/js/apps/admin-ui/src/phaseII/custom-styles/general/general-styles.tsx @@ -20,7 +20,7 @@ import { useRealm } from "../../../context/realm-context/RealmContext"; import RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; import { get, isEqual } from "lodash-es"; import { useAlerts } from "../../../components/alert/Alerts"; -import { adminClient } from "apps/admin-ui/src/admin-client"; +import { adminClient } from "../../../admin-client"; type GeneralStylesType = { logoUrl: string; diff --git a/js/apps/admin-ui/src/phaseII/custom-styles/login/login-styles.tsx b/js/apps/admin-ui/src/phaseII/custom-styles/login/login-styles.tsx index a2d3fdc7cef8..6d4391a464b9 100644 --- a/js/apps/admin-ui/src/phaseII/custom-styles/login/login-styles.tsx +++ b/js/apps/admin-ui/src/phaseII/custom-styles/login/login-styles.tsx @@ -19,7 +19,7 @@ import { get } from "lodash-es"; import { useAlerts } from "../../../components/alert/Alerts"; import { ColorPicker } from "../components/ColorPicker"; import { KeycloakTextArea } from "../../../components/keycloak-text-area/KeycloakTextArea"; -import { adminClient } from "apps/admin-ui/src/admin-client"; +import { adminClient } from "../../../admin-client"; type LoginStylesType = { primaryColor: string; diff --git a/js/apps/admin-ui/src/phaseII/custom-styles/portal/portal-styles.tsx b/js/apps/admin-ui/src/phaseII/custom-styles/portal/portal-styles.tsx index 65ba9a8bfbc4..5c4f9f692ac6 100644 --- a/js/apps/admin-ui/src/phaseII/custom-styles/portal/portal-styles.tsx +++ b/js/apps/admin-ui/src/phaseII/custom-styles/portal/portal-styles.tsx @@ -20,7 +20,7 @@ import { get, mapKeys, pick } from "lodash-es"; import { useAlerts } from "../../../components/alert/Alerts"; import { ColorPicker } from "../components/ColorPicker"; import { KeycloakTextArea } from "../../../components/keycloak-text-area/KeycloakTextArea"; -import { adminClient } from "apps/admin-ui/src/admin-client"; +import { adminClient } from "../../../admin-client"; type PortalStylesType = { primaryColor: string; diff --git a/js/apps/admin-ui/src/phaseII/orgs/OrgIdentityProviders.tsx b/js/apps/admin-ui/src/phaseII/orgs/OrgIdentityProviders.tsx index ba47195a55fe..202345156ae9 100644 --- a/js/apps/admin-ui/src/phaseII/orgs/OrgIdentityProviders.tsx +++ b/js/apps/admin-ui/src/phaseII/orgs/OrgIdentityProviders.tsx @@ -42,8 +42,6 @@ interface IdentityProviderRepresentationP2 export default function OrgIdentityProviders({ org, }: OrgIdentityProvidersProps) { - console.log("[OrgIdentityProviders org]", org); - const { realm } = useRealm(); // eslint-disable-next-line @typescript-eslint/no-unused-vars const { updateIdentityProvider } = useOrgFetcher(realm); @@ -63,7 +61,6 @@ export default function OrgIdentityProviders({ const identityProviders = (await adminClient.identityProviders.find({ realm, })) as IdentityProviderRepresentationP2[]; - console.log("[identityProviders]", identityProviders); setIdps(identityProviders); // at least one IdP? diff --git a/js/apps/admin-ui/src/phaseII/orgs/components/KeycloakDataTableCustomized.tsx b/js/apps/admin-ui/src/phaseII/orgs/components/KeycloakDataTableCustomized.tsx index 9b018e451d7e..47e50c4af39d 100644 --- a/js/apps/admin-ui/src/phaseII/orgs/components/KeycloakDataTableCustomized.tsx +++ b/js/apps/admin-ui/src/phaseII/orgs/components/KeycloakDataTableCustomized.tsx @@ -13,7 +13,7 @@ import { import { get, cloneDeep, differenceBy, omit, uniqBy } from "lodash-es"; import { ListEmptyState } from "../../../components/list-empty-state/ListEmptyState"; import { KeycloakSpinner } from "../../../components/keycloak-spinner/KeycloakSpinner"; -import { useFetch } from "apps/admin-ui/src/utils/useFetch"; +import { useFetch } from "../../../../src/utils/useFetch"; import { ButtonVariant } from "@patternfly/react-core"; import type { Action, diff --git a/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/AttributeForm.tsx b/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/AttributeForm.tsx index 48c72a5d580e..00c841008216 100644 --- a/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/AttributeForm.tsx +++ b/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/AttributeForm.tsx @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import type { KeyValueType } from "./key-value-convert"; import { KeyValueInput } from "./KeyValueInput"; -import { FormAccess } from "apps/admin-ui/src/components/form/FormAccess"; +import { FormAccess } from "../../../../../src/components/form/FormAccess"; export type AttributeForm = Omit & { attributes?: KeyValueType[]; diff --git a/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/KeyValueInput.tsx b/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/KeyValueInput.tsx index e3f5bfcf2469..0f53af0e70e5 100644 --- a/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/KeyValueInput.tsx +++ b/js/apps/admin-ui/src/phaseII/orgs/components/key-value-form-custom/KeyValueInput.tsx @@ -11,7 +11,7 @@ import { useFieldArray, useFormContext, useWatch } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { KeyValueType } from "./key-value-convert"; -import { KeycloakTextInput } from "apps/admin-ui/src/components/keycloak-text-input/KeycloakTextInput"; +import { KeycloakTextInput } from "../../../../../src/components/keycloak-text-input/KeycloakTextInput"; type KeyValueInputProps = { name: string; diff --git a/js/apps/admin-ui/src/phaseII/orgs/components/portal-link/PortalLink.tsx b/js/apps/admin-ui/src/phaseII/orgs/components/portal-link/PortalLink.tsx index 86298db5f6d7..bc175cc2ced4 100644 --- a/js/apps/admin-ui/src/phaseII/orgs/components/portal-link/PortalLink.tsx +++ b/js/apps/admin-ui/src/phaseII/orgs/components/portal-link/PortalLink.tsx @@ -11,10 +11,10 @@ import { import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; -import { useRealm } from "apps/admin-ui/src/context/realm-context/RealmContext"; +import { useRealm } from "../../../../../src/context/realm-context/RealmContext"; import { OrgParams } from "../../routes/Org"; import useOrgFetcher from "../../useOrgFetcher"; -import { ConfirmDialogModal } from "apps/admin-ui/src/components/confirm-dialog/ConfirmDialog"; +import { ConfirmDialogModal } from "../../../../../src/components/confirm-dialog/ConfirmDialog"; type PortalLinkProps = { id: string; diff --git a/js/apps/admin-ui/src/routes.tsx b/js/apps/admin-ui/src/routes.tsx index 2a76ca999dac..d80932cf3012 100644 --- a/js/apps/admin-ui/src/routes.tsx +++ b/js/apps/admin-ui/src/routes.tsx @@ -18,6 +18,8 @@ import realmRoutes from "./realm/routes"; import sessionRoutes from "./sessions/routes"; import userFederationRoutes from "./user-federation/routes"; import userRoutes from "./user/routes"; +import orgRoutes from "./phaseII/orgs/routes"; +import stylesRoutes from "./phaseII/custom-styles/routes"; export type AppRouteObjectHandle = { access: AccessType | AccessType[]; @@ -52,6 +54,8 @@ export const routes: AppRouteObject[] = [ ...groupsRoutes, ...dashboardRoutes, NotFoundRoute, + ...orgRoutes, + ...stylesRoutes, ]; export const RootRoute: RouteObject = {