Skip to content

Commit

Permalink
Merge pull request #7043 from DonOmalVindula/master
Browse files Browse the repository at this point in the history
Remove revert branding option when branding is not configured
  • Loading branch information
DonOmalVindula authored Oct 25, 2024
2 parents 60bc510 + 9ab3d23 commit c756b12
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 38 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-donkeys-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.branding.v1": patch
---

Remove revert branding option when branding is not configured
81 changes: 43 additions & 38 deletions features/admin.branding.v1/components/branding-core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -791,44 +791,49 @@ const BrandingCore: FunctionComponent<BrandingCoreInterface> = (
<Show
when={ featureConfig?.branding?.scopes?.delete }
>
<DangerZoneGroup sectionHeader={ t("extensions:develop.branding.dangerZoneGroup.header") }>
{ brandingPreference.configs?.isBrandingEnabled && (
<DangerZone
actionTitle={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.actionTitle")
}
header={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.header")
}
subheader={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.subheader",
{ productName: productName })
}
onActionClick={ (): void => handleBrandingUnpublish() }
data-componentid={ `${ componentId }-danger-zone-unpublish` }
isButtonDisabled={ brandingMode === BrandingModes.APPLICATION && !selectedApplication }
buttonDisableHint={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.disableHint") }
/>
) }
<DangerZone
actionTitle={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.actionTitle")
}
header={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.header")
}
subheader={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.subheader",
{ productName: productName })
}
onActionClick={ (): void => setShowRevertConfirmationModal(true) }
data-componentid={ `${ componentId }-danger-zone` }
isButtonDisabled={ brandingMode === BrandingModes.APPLICATION && !selectedApplication }
buttonDisableHint={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.disableHint") }
/>
</DangerZoneGroup>
{
isBrandingConfigured && (
<DangerZoneGroup sectionHeader={ t("extensions:develop.branding.dangerZoneGroup.header") }>
{ brandingPreference.configs?.isBrandingEnabled && (
<DangerZone
actionTitle={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.actionTitle")
}
header={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.header")
}
subheader={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.subheader",
{ productName: productName })
}
onActionClick={ (): void => handleBrandingUnpublish() }
data-componentid={ `${ componentId }-danger-zone-unpublish` }
isButtonDisabled={
brandingMode === BrandingModes.APPLICATION && !selectedApplication }
buttonDisableHint={
t("extensions:develop.branding.dangerZoneGroup.unpublishBranding.disableHint") }
/>
) }
<DangerZone
actionTitle={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.actionTitle")
}
header={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.header")
}
subheader={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.subheader",
{ productName: productName })
}
onActionClick={ (): void => setShowRevertConfirmationModal(true) }
data-componentid={ `${ componentId }-danger-zone` }
isButtonDisabled={ brandingMode === BrandingModes.APPLICATION && !selectedApplication }
buttonDisableHint={
t("extensions:develop.branding.dangerZoneGroup.revertBranding.disableHint") }
/>
</DangerZoneGroup>
)
}
</Show>
<ConfirmationModal
onClose={ (): void => setShowRevertConfirmationModal(false) }
Expand Down

0 comments on commit c756b12

Please sign in to comment.