Fix cannot delete working saml config
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -78,11 +78,11 @@ export function SAMLConfigurationList(props: {
|
|||||||
{
|
{
|
||||||
successMessage: "SAML configuration deleted successfully.",
|
successMessage: "SAML configuration deleted successfully.",
|
||||||
errorMessage: "Failed to delete SAML configuration. Please try again.",
|
errorMessage: "Failed to delete SAML configuration. Please try again.",
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleDelete = (
|
const handleDelete = (
|
||||||
config: NodeOf<SAMLConfigurationListFragment$data["samlConfigurations"]>,
|
config: NodeOf<SAMLConfigurationListFragment$data["samlConfigurations"]>
|
||||||
) => {
|
) => {
|
||||||
confirm(
|
confirm(
|
||||||
async () => {
|
async () => {
|
||||||
@@ -100,11 +100,11 @@ export function SAMLConfigurationList(props: {
|
|||||||
message: __(
|
message: __(
|
||||||
"Are you sure you want to delete the SAML configuration for " +
|
"Are you sure you want to delete the SAML configuration for " +
|
||||||
config.emailDomain +
|
config.emailDomain +
|
||||||
"? This action cannot be undone.",
|
"? This action cannot be undone."
|
||||||
),
|
),
|
||||||
label: __("Delete"),
|
label: __("Delete"),
|
||||||
variant: "danger",
|
variant: "danger",
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ export function SAMLConfigurationList(props: {
|
|||||||
</h3>
|
</h3>
|
||||||
<p className="text-gray-600 mb-6">
|
<p className="text-gray-600 mb-6">
|
||||||
{__(
|
{__(
|
||||||
"Set up SAML 2.0 single sign-on for your organization by adding a configuration for each email domain.",
|
"Set up SAML 2.0 single sign-on for your organization by adding a configuration for each email domain."
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
{isAuthorized("Organization", "createSAMLConfiguration") && (
|
{isAuthorized("Organization", "createSAMLConfiguration") && (
|
||||||
@@ -198,7 +198,7 @@ export function SAMLConfigurationList(props: {
|
|||||||
<>
|
<>
|
||||||
{isAuthorized(
|
{isAuthorized(
|
||||||
"SAMLConfiguration",
|
"SAMLConfiguration",
|
||||||
"updateSAMLConfiguration",
|
"updateSAMLConfiguration"
|
||||||
) && (
|
) && (
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
@@ -207,6 +207,14 @@ export function SAMLConfigurationList(props: {
|
|||||||
{__("Edit")}
|
{__("Edit")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
{isAuthorized("Organization", "deleteOrganization") && (
|
||||||
|
<Button
|
||||||
|
variant="danger"
|
||||||
|
onClick={() => handleDelete(config)}
|
||||||
|
>
|
||||||
|
{__("Delete")}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user