Skip to content

Commit

Permalink
Merge pull request #6917 from asha15/myaccount
Browse files Browse the repository at this point in the history
Hide application enable/disable element for sub-org Myaccount
  • Loading branch information
asha15 committed Sep 24, 2024
2 parents e3bf639 + 31189bd commit 56cd027
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-cheetahs-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.applications.v1": patch
---

Hide application enable/disable element for sub-org Myaccount
46 changes: 24 additions & 22 deletions features/admin.applications.v1/components/edit-application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,29 +438,31 @@ export const EditApplication: FunctionComponent<EditApplicationPropsInterface> =
<MyAccountOverview/>
</ResourceTab.Pane>
<Divider hidden />
<Show
when={ applicationsUpdateScopes }
>
<DangerZoneGroup
sectionHeader={ t("applications:dangerZoneGroup.header") }
{ !isSubOrganization() && (
<Show
when={ applicationsUpdateScopes }
>
<DangerZone
actionTitle={ t("applications:dangerZoneGroup.disableApplication.actionTitle",
{ state: application.applicationEnabled ? t("common:disable") : t("common:enable") }) }
header={ t("applications:dangerZoneGroup.disableApplication.header",
{ state: application.applicationEnabled ? t("common:disable") : t("common:enable") } ) }
subheader={ application.applicationEnabled
? t("applications:dangerZoneGroup.disableApplication.subheader")
: t("applications:dangerZoneGroup.disableApplication.subheader2") }
onActionClick={ undefined }
toggle={ {
checked: application.applicationEnabled,
onChange: handleAppEnableDisableToggleChange
} }
data-testid={ `${ componentId }-danger-zone-disable` }
/>
</DangerZoneGroup>
</Show>
<DangerZoneGroup
sectionHeader={ t("applications:dangerZoneGroup.header") }
>
<DangerZone
actionTitle={ t("applications:dangerZoneGroup.disableApplication.actionTitle",
{ state: application.applicationEnabled ? t("common:disable") : t("common:enable") }) }
header={ t("applications:dangerZoneGroup.disableApplication.header",
{ state: application.applicationEnabled ? t("common:disable") : t("common:enable") } ) }
subheader={ application.applicationEnabled
? t("applications:dangerZoneGroup.disableApplication.subheader")
: t("applications:dangerZoneGroup.disableApplication.subheader2") }
onActionClick={ undefined }
toggle={ {
checked: application.applicationEnabled,
onChange: handleAppEnableDisableToggleChange
} }
data-testid={ `${ componentId }-danger-zone-disable` }
/>
</DangerZoneGroup>
</Show>
) }
<ConfirmationModal
onClose={ (): void => setShowDisableConfirmationModal(false) }
type="warning"
Expand Down

0 comments on commit 56cd027

Please sign in to comment.