-
Notifications
You must be signed in to change notification settings - Fork 259
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. |
4fad846
to
9d66740
Compare
@@ -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, |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
), | ||
[ featureConfig, allowedScopes ] | ||
); | ||
const isEmailDomainDiscoveryForSelfRegFeatureEnabled: boolean = !featureConfig?.organizationDiscovery?. |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
adcb98a
to
859fbcd
Compare
859fbcd
to
ba5ced4
Compare
🦋 Changeset detectedThe changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. |
Purpose
Following improvements will be made to the existing email domain discovery page
Related issue