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

Improve email domain discovery page to incorporate new configuration for enabling email domain discovery for self-registration #7084

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Yasasr1
Copy link
Contributor

@Yasasr1 Yasasr1 commented Nov 5, 2024

Purpose

Following improvements will be made to the existing email domain discovery page

  • Generalize the page name to "Organization Discovery"
  • Move down the assign email domain button from top right corner to separate email domain discovery related configs from email domain mappings for organizations
  • Improve the info message at the top to mention the flows that restricts email domains when email domain discovery is enabled
  • Add a checkbox to incorporate the new config: email domain based organization discovery for self-registration
Screenshot 2024-11-05 at 10 50 23 AM

Related issue

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.02%. Comparing base (ef0a800) to head (ba5ced4).
Report is 641 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7084      +/-   ##
==========================================
+ Coverage   31.79%   32.02%   +0.22%     
==========================================
  Files          41       41              
  Lines         890      893       +3     
  Branches      220      215       -5     
==========================================
+ Hits          283      286       +3     
  Misses        557      557              
  Partials       50       50              
Flag Coverage Δ
@wso2is/core 32.02% <ø> (+0.22%) ⬆️

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

see 1 file with indirect coverage changes

@@ -36,7 +36,8 @@ import {
* @returns SWR response object containing the data, error, isValidating, mutate.
*/
const useGetOrganizationDiscoveryConfig = <
Data = OrganizationDiscoveryConfigInterface & { isOrganizationDiscoveryEnabled: boolean },
Data = OrganizationDiscoveryConfigInterface & { isOrganizationDiscoveryEnabled: boolean,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add these to the OrganizationDiscoveryConfigInterface


if ((data as OrganizationDiscoveryConfigInterface)?.properties) {
(data as OrganizationDiscoveryConfigInterface).properties?.forEach(
(property: OrganizationDiscoveryConfigPropertyInterface) => {
if (property.key === "emailDomain.enable") {
if (property.key === "emailDomain.enable" && property.value === "true") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add as constants

@@ -0,0 +1,15 @@
.discoverable-organizations-list-layout {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add license header

align-items: center;
gap: 10px;

>.ui.grid {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

recheck usage of >

onListItemLimitChange: (limit: number) => void;
onListOffsetChange: (offset: number) => void;
onSearchQueryChange: (query: string) => void;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove line

* Default props for the component.
*/
DiscoverableOrganizationsListLayout.defaultProps = {
"data-componentid": "discoverable-organizations-list-layout"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactor

[ featureConfig, allowedScopes ]
);
const isEmailDomainDiscoveryForSelfRegFeatureEnabled: boolean = !featureConfig?.organizationDiscovery?.
disabledFeatures?.includes("organizationDiscovery.emailDomainDiscoveryForSelfReg");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use FEATURE_DICTIONARY constant

onListItemLimitChange: (limit: number) => void;
onListOffsetChange: (offset: number) => void;
onSearchQueryChange: (query: string) => void;

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

),
[ featureConfig, allowedScopes ]
);
const isEmailDomainDiscoveryForSelfRegFeatureEnabled: boolean = !featureConfig?.organizationDiscovery?.
Copy link
Contributor

Choose a reason for hiding this comment

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

use isFeatureEnabled from core module

* Fetch the self-registration configuration.
*/
useEffect(() => {
getConnectorDetails(ServerConfigurationsConstants.USER_ONBOARDING_CONNECTOR_ID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use a swr hook to fetch the properties


updateData.properties.push({
key: "emailDomain.enable",
value: isOrganizationDiscoveryEnabled ? "true" : "false"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

convert to string. check other places

@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.

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.

3 participants