Skip to content

Commit

Permalink
Merge pull request #7613 from Shenali-SJ/custom-auth-refactor-termino…
Browse files Browse the repository at this point in the history
…logy
  • Loading branch information
pavinduLakshan authored Feb 15, 2025
2 parents 4b16760 + 9279555 commit ecae135
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-singers-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.connections.v1": patch
---

Refactor UX and Terminology of Custom Connector and Custom Authenticator
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ export const AuthenticatorCreateWizardFactory: FC<AuthenticatorCreateWizardFacto
<ExpertModeAuthenticationProviderCreateWizard
title={
selectedTemplateWithUniqueName?.name === "Expert Mode"
? "Custom Connector"
? t("authenticationProvider:overrides.authenticators.customAuthenticators." +
"pluginBased.name")
: selectedTemplateWithUniqueName?.name
}
subTitle={ selectedTemplateWithUniqueName?.description }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ export class CommonAuthenticatorConstants {
public static readonly IDENTIFIER_REGEX: RegExp = /^[a-zA-Z0-9_-]{3,}$/;
public static readonly DISPLAY_NAME_REGEX: RegExp = /^.{3,}$/;

public static readonly TEMPLATE_ID_FIELD: "templateId";
public static readonly TEMPLATE_ID_FIELD: string = "templateId";
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "custom-authenticator",
"docLink": "",
"image": "assets/images/logos/custom-authenticator.svg",
"name": "Custom Authenticator",
"name": "Custom Authenticator (Service-based)",
"services": [],
"disabled": false,
"type": "DEFAULT",
Expand Down
23 changes: 12 additions & 11 deletions features/admin.connections.v1/pages/connection-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,11 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =
if (error.response && error.response.data && error.response.data.description) {
dispatch(
addAlert({
description: t("authenticationProvider:" + "notifications.getIDP.error.description", {
description: t("authenticationProvider:notifications.getIDP.error.description", {
description: error.response.data.description
}),
level: AlertLevels.ERROR,
message: t("authenticationProvider:" + "notifications.getIDP.error.message")
message: t("authenticationProvider:notifications.getIDP.error.message")
})
);

Expand All @@ -399,9 +399,9 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =

dispatch(
addAlert({
description: t("authenticationProvider:" + "notifications.getIDP.genericError.description"),
description: t("authenticationProvider:notifications.getIDP.genericError.description"),
level: AlertLevels.ERROR,
message: t("authenticationProvider:" + "notifications.getIDP.genericError.message")
message: t("authenticationProvider:notifications.getIDP.genericError.message")
})
);
})
Expand Down Expand Up @@ -434,12 +434,12 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =
dispatch(
addAlert({
description: t(
"authenticationProvider:" + "notifications.getConnectionDetails.error.description",
"authenticationProvider:notifications.getConnectionDetails.error.description",
{ description: error.response.data.description }
),
level: AlertLevels.ERROR,
message: t(
"authenticationProvider:" + "notifications.getConnectionDetails.error.message"
"authenticationProvider:notifications.getConnectionDetails.error.message"
)
})
);
Expand All @@ -455,7 +455,7 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =
),
level: AlertLevels.ERROR,
message: t(
"authenticationProvider:" + "notifications.getConnectionDetails.genericError.message"
"authenticationProvider:notifications.getConnectionDetails.genericError.message"
)
})
);
Expand Down Expand Up @@ -538,15 +538,15 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =
return (
<LabelWithPopup
popupHeader={ t("authenticationProvider:popups.appStatus.enabled.header") }
popupSubHeader={ t("authenticationProvider:popups.appStatus." + "enabled.content") }
popupSubHeader={ t("authenticationProvider:popups.appStatus.enabled.content") }
labelColor="green"
/>
);
} else {
return (
<LabelWithPopup
popupHeader={ t("authenticationProvider:popups.appStatus." + "disabled.header") }
popupSubHeader={ t("authenticationProvider:popups.appStatus." + "disabled.content") }
popupHeader={ t("authenticationProvider:popups.appStatus.disabled.header") }
popupSubHeader={ t("authenticationProvider:popups.appStatus.disabled.content") }
labelColor="grey"
/>
);
Expand Down Expand Up @@ -650,7 +650,8 @@ const ConnectionEditPage: FunctionComponent<ConnectionEditPagePropsInterface> =
{ identityProviderTemplate?.name && (
<Label size="small">
{ identityProviderTemplate.name === "Expert Mode"
? "Custom Connector"
? t("authenticationProvider:overrides.authenticators.customAuthenticators." +
"pluginBased.name")
: identityProviderTemplate?.name }
</Label>
) }
Expand Down
2 changes: 1 addition & 1 deletion features/admin.connections.v1/utils/connection-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export const resolveConnectionName = (name: string): string => {
if (name === "Enterprise") {
return "Standard-Based IdP";
} else if (name === "Expert Mode") {
return "Custom Connector";
return I18n.instance.t("authenticationProvider:overrides.authenticators.customAuthenticators.pluginBased.name");
} else {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2052,4 +2052,13 @@ export interface AuthenticationProviderNS {
previous: string;
};
};
overrides: {
authenticators: {
customAuthenticators: {
pluginBased: {
name: string;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2133,5 +2133,14 @@ export const authenticationProvider:AuthenticationProviderNS = {
next: "Next",
previous: "Previous"
}
},
overrides: {
authenticators: {
customAuthenticators: {
pluginBased: {
name: "Custom Authenticator (Plugin-based)"
}
}
}
}
};

0 comments on commit ecae135

Please sign in to comment.