Skip to content

Commit

Permalink
Merge pull request wso2#4219 from wso2/add-branding-improvement
Browse files Browse the repository at this point in the history
Move `branding` to `features`
  • Loading branch information
brionmario authored Oct 15, 2023
2 parents 4551fe5 + ebb601a commit bcdd0a6
Show file tree
Hide file tree
Showing 59 changed files with 50 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import React, {
} from "react";
import { useSelector } from "react-redux";
import { AppState, store } from "../../../../features/core";
import { useBrandingPreference } from "../../branding/api";
import { BrandingPreferencesConstants } from "../../branding/constants";
import { BrandingPreferenceThemeInterface } from "../../branding/models";
import { BrandingPreferenceUtils } from "../../branding/utils";
import { useBrandingPreference } from "../../../../features/branding/api";
import { BrandingPreferencesConstants } from "../../../../features/branding/constants";
import { BrandingPreferenceThemeInterface } from "../../../../features/branding/models";
import { BrandingPreferenceUtils } from "../../../../features/branding/utils";
import { EmailTemplate } from "../models";
import { EmailCustomizationUtils } from "../utils";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
BrandingPreferenceThemeInterface,
PredefinedThemes,
ThemeConfigInterface
} from "../../branding/models";
import { BrandingPreferenceUtils } from "../../branding/utils";
} from "../../../../features/branding/models";
import { BrandingPreferenceUtils } from "../../../../features/branding/utils";

export class EmailCustomizationUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react";
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { HttpMethods } from "@wso2is/core/models";
import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios";
import { I18nConstants } from "../../../../features/core/constants";
import { I18nConstants } from "../../core/constants";
import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "../../../../features/core/hooks/use-request";
import { store } from "../../../../features/core/store";
} from "../../core/hooks/use-request";
import { store } from "../../core/store";
import { BrandingPreferencesConstants } from "../constants";
import {
BrandingPreferenceAPIResponseInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/

import { HttpMethods } from "@wso2is/core/models";
import { Config } from "../../../../features/core/configs";
import { AppConstants } from "../../../../features/core/constants";
import { Config } from "../../core/configs";
import { AppConstants } from "../../core/constants";
import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "../../../../features/core/hooks/use-request";
} from "../../core/hooks/use-request";
import { PredefinedLayouts } from "../meta";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import { HttpMethods } from "@wso2is/core/models";
import { useEffect, useState } from "react";
import { AppConstants } from "../../../../features/core/constants";
import { AppConstants } from "../../core/constants";
import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "../../../../features/core/hooks/use-request";
} from "../../core/hooks/use-request";
import { PreviewScreenType } from "../models/branding-preferences";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import React, { FunctionComponent, MutableRefObject, ReactElement, Ref, forwardR
import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";
import { Placeholder } from "semantic-ui-react";
import { AppState } from "../../../../../features/core";
import { AppState } from "../../../core";
import { BrandingPreferencesConstants } from "../../constants";
import { BrandingPreferenceInterface } from "../../models";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import {
} from "./general";
import { BrandingPreferencePreview } from "./preview";
import { StickyTabPaneActionPanel } from "./sticky-tab-pane-action-panel";
import { AppState } from "../../../../features/core/store";
import { commonConfig } from "../../../configs";
import { AppState } from "../../core/store";
import { commonConfig } from "../../../extensions/configs";
import { BrandingPreferencesConstants } from "../constants";
import { BrandingPreferenceMeta } from "../meta";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import { IllustrationsPreview } from "./illustrations-preview";
import * as LayoutDesignExtensions from "./layout-design-extensions";
import { LayoutSwatchAdapter } from "./layout-swatch";
import { ThemeSwatchAdapter, ThemeSwatchUIConfigsInterface } from "./theme-swatch";
import { AppConstants } from "../../../../../features/core/constants";
import { AppState } from "../../../../../features/core/store";
import { AppConstants } from "../../../core/constants";
import { AppState } from "../../../core/store";
import { useLayout } from "../../api";
import { BrandingPreferencesConstants } from "../../constants";
import { BrandingPreferenceMeta, PredefinedLayouts } from "../../meta";
Expand Down Expand Up @@ -2862,9 +2862,9 @@ export const DesignForm: FunctionComponent<DesignFormPropsInterface> = forwardRe
}
}
data-componentid={ `${componentId}-${layoutName}-layout-swatch` }
premium={
!commonConfig.enableDefaultBrandingPreviewSection
&& (layoutName === PredefinedLayouts.CUSTOM)
premium={
!commonConfig.enableDefaultBrandingPreviewSection
&& (layoutName === PredefinedLayouts.CUSTOM)
}
listen={ () => {
setLayout({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import React, { FunctionComponent, MutableRefObject, ReactElement, Ref, forwardR
import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";
import { Placeholder } from "semantic-ui-react";
import { AppState } from "../../../../../features/core/store";
import { AppState } from "../../../core/store";
import { BrandingPreferencesConstants } from "../../constants";
import { BrandingPreferenceInterface } from "../../models";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/

import { IdentifiableComponentInterface } from "@wso2is/core/models";
import {
ContentLoader,
DocumentationLink,
EmptyPlaceholder,
Iframe,
Link,
useDocumentation
import {
ContentLoader,
DocumentationLink,
EmptyPlaceholder,
Iframe,
Link,
useDocumentation
} from "@wso2is/react-components";
import { commonConfig } from "apps/console/src/extensions/configs";
import get from "lodash-es/get";
Expand All @@ -43,11 +43,11 @@ import { Placeholder } from "semantic-ui-react";
import { EmailTemplateScreenSkeleton } from "./email-template-screen-skeleton";
import { LoginScreenSkeleton } from "./login-screen-skeleton";
import { MyAccountScreenSkeleton } from "./my-account-screen-skeleton";
import { AppState } from "../../../../../features/core/store";
import { AppState } from "../../../core/store";
import { ReactComponent as CustomLayoutSuccessImg } from
"../../../../../themes/wso2is/assets/images/branding/custom-layout-success.svg";
"../../../../themes/wso2is/assets/images/branding/custom-layout-success.svg";
import { ReactComponent as CustomLayoutWarningImg } from
"../../../../../themes/wso2is/assets/images/branding/custom-layout-warning.svg";
"../../../../themes/wso2is/assets/images/branding/custom-layout-warning.svg";
import { useLayout, useLayoutStyle } from "../../api";
import { usePreviewContent, usePreviewStyle } from "../../api/preview-skeletons";
import { BrandingPreferenceMeta, LAYOUT_DATA, PredefinedLayouts } from "../../meta";
Expand Down Expand Up @@ -345,7 +345,7 @@ export const BrandingPreferencePreview: FunctionComponent<BrandingPreferencePrev
{
!isLoading && isIframeReady && !isLayoutResolving && !isPreviewScreenSkeletonContentLoading
? (
commonConfig.enableDefaultBrandingPreviewSection
commonConfig.enableDefaultBrandingPreviewSection
&& layoutContext[0] === PredefinedLayouts.CUSTOM ? (
<div className="branding-preference-preview-message" >
<EmptyPlaceholder
Expand Down Expand Up @@ -391,7 +391,7 @@ export const BrandingPreferencePreview: FunctionComponent<BrandingPreferencePrev
supportEmail
} }
>
Need a fully customized layout for your
Need a fully customized layout for your
organization? Reach us out at <Link
data-componentid=
{ "branding-preference-"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import parse from "html-react-parser";
import Mustache from "mustache";
import React, { FunctionComponent, ReactElement, useMemo } from "react";
import { useSelector } from "react-redux";
import { AppState } from "../../../../../features/core/store";
import { AppState } from "../../../core/store";
import { BrandingPreferenceMeta } from "../../meta/branding-preference-meta";
import { BrandingPreferenceInterface, PredefinedThemes } from "../../models";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import React, {
useEffect,
useState
} from "react";
import { AppConstants } from "../../../../../features/core/constants";
import { AppConstants } from "../../../core/constants";
import { BrandingPreferenceInterface } from "../../models";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import parse from "html-react-parser";
import Mustache from "mustache";
import React, { FunctionComponent, ReactElement, useMemo } from "react";
import { useSelector } from "react-redux";
import { AppState } from "../../../../../features/core/store";
import { AppState } from "../../../core/store";
import { BrandingPreferenceMeta } from "../../meta/branding-preference-meta";
import { BrandingPreferenceInterface } from "../../models";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React, {
ReactElement
} from "react";
import { useSelector } from "react-redux";
import { AppState } from "../../../../../features/core/store";
import { AppState } from "../../../core/store";
import { BrandingPreferencesConstants } from "../../constants";
import { BrandingPreferenceMeta } from "../../meta";
import { BrandingPreferenceInterface } from "../../models";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { StringUtils } from "@wso2is/core/utils";
import isEmpty from "lodash-es/isEmpty";
import { LAYOUTS } from "./layouts";
import { THEMES, THEME_SWATCH_UI_CONFIGS } from "./themes";
import { Config } from "../../../../features/core/configs";
import { Config } from "../../core/configs";
import { ThemeSwatchUIConfigsInterface } from "../components";
import { BrandingPreferencesConstants } from "../constants";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
* You may not alter or remove any copyright or other notice from copies of this content."
*/

import { Config } from "../../../../../features/core/configs";
import { Config } from "../../../core/configs";

/**
* Data set required to generate layout html code.
*/
export const addCommonDataForTheLayout = (
data: Record<string, string>,
data: Record<string, string>,
tenantDomain: string
): Record<string, string> => {
data["BASE_URL"] = Config.getDeploymentConfig().extensions?.layoutStoreURL
? (Config.getDeploymentConfig().extensions.layoutStoreURL as string)
.replace("${tenantDomain}", tenantDomain)
: "";

return data;
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import React, { FunctionComponent, ReactElement, useEffect, useMemo, useState }
import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import { Dispatch } from "redux";
import { EventPublisher } from "../../../../features/core";
import { AppState } from "../../../../features/core/store";
import { ExtendedFeatureConfigInterface } from "../../../configs/models";
import { EventPublisher } from "../../core";
import { AppState } from "../../core/store";
import { ExtendedFeatureConfigInterface } from "../../../extensions/configs/models";
import { deleteBrandingPreference, updateBrandingPreference, useBrandingPreference } from "../api";
import { BrandingPreferenceTabs } from "../components";
import { BrandingPreferencesConstants } from "../constants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class BrandingPreferenceUtils {
public static getPredefinedThemePreferences = (
appTheme: string): Promise<BrandingPreferenceThemeInterface> => {

return import(`../../../../themes/${ appTheme }/theme-variables.json`)
return import(`../../../themes/${ appTheme }/theme-variables.json`)
.then((response: Record<string, string>) => {
return Promise.resolve({
activeTheme: BrandingPreferencesConstants.DEFAULT_THEME,
Expand Down
6 changes: 3 additions & 3 deletions apps/console/src/features/core/configs/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter
showOnSidePanel: false
},
{
component: lazy(() =>
component: lazy(() =>
import("../../connections/pages/connection-edit")
),
exact: true,
Expand Down Expand Up @@ -387,7 +387,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter
},
{
category: "extensions:develop.sidePanel.categories.branding",
component: lazy(() => import("../../../extensions/components/branding/pages/branding")),
component: lazy(() => import("../../../features/branding/pages/branding")),
exact: true,
icon: {
icon: import("../../../extensions/assets/images/icons/paint-palette-and-brush-outline.svg")
Expand Down Expand Up @@ -1319,7 +1319,7 @@ export const getAppViewRoutes = (useExtendedRoutes: boolean = false): RouteInter
showOnSidePanel: true
}
);
}
}

routes.push({
component: null,
Expand Down

0 comments on commit bcdd0a6

Please sign in to comment.