Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the revert Branding confirmation and default app-wise branding messages #6976

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lovely-weeks-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.branding.v1": patch
"@wso2is/console": patch
---

Improve the revert Branding confirmation and default app-wise branding messages.
1 change: 1 addition & 0 deletions apps/console/src/extensions/i18n/models/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@ export interface Extensions {
applicationBrandingtitle: string;
applicationBrandingDescription: string;
applicationListWarning: string;
defaultBrandingAppliedMessage: string;
backButtonText: string;
description: string;
organization: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1353,9 +1353,7 @@ export const extensions: Extensions = {
assertionHint: "Please confirm your action.",
content: "This action is irreversible and will permanently revert your branding preferences.",
header: "Are you sure?",
message:
"If you revert the branding preferences, your users will start to see " +
"{{ productName }} branding on the login flows. Please proceed with caution."
message: "Reverting your branding preferences will apply the default branding from the next available level (such as your organization or parent organization)."
},
unpublishBranding: {
assertionHint: "Please confirm your action.",
Expand Down Expand Up @@ -1985,7 +1983,8 @@ export const extensions: Extensions = {
application: "Application",
applicationBrandingtitle: "Application Branding",
applicationBrandingDescription: "Customize consumer-facing user interfaces of applications.",
applicationListWarning: "Please select an application from the list above to customize the branding preferences.",
applicationListWarning: "Select an application from the list above to customize the branding preferences.",
defaultBrandingAppliedMessage: "Organization branding has been applied to this application because no app-specific branding is set.",
backButtonText: "Go back to Application Settings",
description: "Customize consumer-facing user interfaces of applications in your organization.",
organization: "Organization",
Expand Down
18 changes: 18 additions & 0 deletions features/admin.branding.v1/components/branding-page-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import useAIBrandingPreference from "@wso2is/admin.branding.ai.v1/hooks/use-ai-b
import { AppConstants, AppState, history } from "@wso2is/admin.core.v1";
import { FeatureStatusLabel } from "@wso2is/admin.feature-gate.v1/models/feature-status";
import { useGetCurrentOrganizationType } from "@wso2is/admin.organizations.v1/hooks/use-get-organization-type";
import useGetBrandingPreferenceResolve from "@wso2is/common.branding.v1/api/use-get-branding-preference-resolve";
import { BrandingPreferenceTypes } from "@wso2is/common.branding.v1/models";
import { AlertLevels, IdentifiableComponentInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { DocumentationLink, PageLayout, useDocumentation } from "@wso2is/react-components";
Expand Down Expand Up @@ -77,6 +79,10 @@ const BrandingPageLayout: FunctionComponent<BrandingPageLayoutInterface> = (
updateActiveTab
} = useBrandingPreference();

const {
data: brandingData
} = useGetBrandingPreferenceResolve(selectedApplication, BrandingPreferenceTypes.APP);

const {
data: applicationList,
isLoading: isApplicationListFetchRequestLoading,
Expand Down Expand Up @@ -418,6 +424,18 @@ const BrandingPageLayout: FunctionComponent<BrandingPageLayoutInterface> = (
</Alert>
)
}
{
brandingMode === BrandingModes.APPLICATION &&
selectedApplication &&
brandingData?.type === BrandingPreferenceTypes.ORG && (
<Alert
severity="info"
sx={ { marginBottom: 2 } }
>
{ t("extensions:develop.branding.pageHeader.defaultBrandingAppliedMessage") }
</Alert>
)
}
</motion.div>
{
!brandingDisabledFeatures?.includes(AI_BRANDING_FEATURE_ID) &&
Expand Down
Loading