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

Add Custom Authentication Edit Page #7363

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Shenali-SJ
Copy link
Contributor

Purpose

This PR updates the edit page of the custom authentication feature. This also adds API integrations.

Note: This is needs to be updated once #7336 is merged this PR depends on the content of the above.

Related Issues

Related PRs (To be merged before)

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@Shenali-SJ Shenali-SJ changed the title Update Custom Authentication Edit Page Add Custom Authentication Edit Page Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.32%. Comparing base (be52c89) to head (4ae97b3).
Report is 75 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7363   +/-   ##
=======================================
  Coverage   36.32%   36.32%           
=======================================
  Files          42       42           
  Lines         903      903           
  Branches      205      205           
=======================================
  Hits          328      328           
  Misses        575      575           
Flag Coverage Δ
@wso2is/core 36.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@@ -106,6 +108,9 @@ export const AuthenticatorCreateWizardFactory: FC<AuthenticatorCreateWizardFacto
...rest
} = props;

const customAuthFeatureConfig: FeatureAccessConfigInterface = useSelector((state: AppState) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const customAuthFeatureConfig: FeatureAccessConfigInterface = useSelector((state: AppState) =>
const identityProviderFeatureConfig: FeatureAccessConfigInterface = useSelector((state: AppState) =>

@@ -330,6 +337,27 @@ export const AuthenticatorCreateWizardFactory: FC<AuthenticatorCreateWizardFacto
/>
);

case CommonAuthenticatorConstants.CONNECTION_TEMPLATE_IDS.CUSTOM_AUTHENTICATION:
if (isFeatureEnabled(customAuthFeatureConfig, "identityProviders.customAuthentication")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's define the identityProviders.customAuthentication as a feature identifier in /constants and refer it here.

This is done to organize the feature identifiers for each feature in a central location.

Eg:

Suggested change
if (isFeatureEnabled(customAuthFeatureConfig, "identityProviders.customAuthentication")) {
if (isFeatureEnabled(
customAuthFeatureConfig, ConnectionUIConstants.FEATURE_DICTIONARY.CUSTOM_AUTHENTICATION)) {

Ref. definition of feature dictionary object: https://github.com/wso2/identity-apps/blob/master/features/admin.groups.v1/constants/group-constants.ts#L40

);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

data-componentid={ `${ _componentId }-idp-image` }
maxLength={
ConnectionUIConstants
.GENERAL_FORM_CONSTRAINTS.IMAGE_URL_MAX_LENGTH as number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need casting here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have followed the same approach used in other components in the connections page.

It appears that the GENERAL_FORM_CONSTRAINTS record's value could be a union of string or number and here we are explicitly type casting it to string. But this seems like an additional overhead since we using typescript.

ConnectionUIConstants
.GENERAL_FORM_CONSTRAINTS.IMAGE_URL_MIN_LENGTH as number
}
hint="Logo to display in login pages."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use i18n for string literals

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

data-componentid={ `${ _componentId }-idp-description` }
maxLength={ ConnectionUIConstants.IDP_NAME_LENGTH.max }
minLength={ ConnectionUIConstants.IDP_NAME_LENGTH.min }
hint="A text description of the authenticator."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use i18n for string literals. Also let's get the UI text reviewed from doc team.

Suggested change
hint="A text description of the authenticator."
hint="A brief description of the authenticator."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

@wso2-jenkins-bot
Copy link
Contributor

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

@Shenali-SJ Shenali-SJ marked this pull request as draft January 24, 2025 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants