-
Notifications
You must be signed in to change notification settings - Fork 476
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
Adds support for searching user type in user creation form #7332
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/Components/Users/UserAdd.tsx
Outdated
onResponse: (result) => { | ||
if (!result || !result.res || !result.data) return; | ||
if (userIndex <= USER_TYPES.indexOf("StateAdmin")) { | ||
setStates([authUser.state_object!]); | ||
} else { | ||
setStates(result.data.results); | ||
} | ||
}, |
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.
onResponse: (result) => { | |
if (!result || !result.res || !result.data) return; | |
if (userIndex <= USER_TYPES.indexOf("StateAdmin")) { | |
setStates([authUser.state_object!]); | |
} else { | |
setStates(result.data.results); | |
} | |
}, | |
onResponse: ({ data }) => { | |
if (!data) { | |
return; | |
} | |
if (userIndex <= USER_TYPES.indexOf("StateAdmin")) { | |
setStates([authUser.state_object!]); | |
} else { | |
setStates(data.results); | |
} | |
}, |
return ( | ||
<Page | ||
title={headerText} | ||
options={ | ||
<Link | ||
href="https://school.coronasafe.network/targets/12953" | ||
href="https://school.coronasafe.network/targets/12953 " |
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.
Why was this changed?
href="https://school.coronasafe.network/targets/12953 " | |
href="https://school.coronasafe.network/targets/12953" |
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.
While saving the file extra space removed.
Is this making any conflict?
className="inline-block rounded border border-gray-600 bg-gray-50 px-4 py-2 text-gray-600 transition hover:bg-gray-100" | ||
target="_blank" | ||
target="_blank " |
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.
Why was this changed?
target="_blank " | |
target="_blank" |
src/Components/Users/UserAdd.tsx
Outdated
@@ -631,15 +632,26 @@ export const UserAdd = (props: UserProps) => { | |||
showAll={false} | |||
/> | |||
</div> | |||
<SelectFormField | |||
|
|||
{/* <SelectFormField |
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.
You can remove this instead of commenting it
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.
I was checking the everything was working properly I will remove and make new commit.
src/Components/Users/UserAdd.tsx
Outdated
{...field("user_type")} | ||
label="User Type" | ||
placeholder="Search for a user type..." | ||
// value={userTypes} |
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.
// value={userTypes} |
src/Components/Users/UserAdd.tsx
Outdated
@@ -326,7 +327,7 @@ export const UserAdd = (props: UserProps) => { | |||
|
|||
const setFacility = (selected: FacilityModel | FacilityModel[] | null) => { | |||
setSelectedFacility(selected as FacilityModel[]); | |||
const form = { ...state.form }; | |||
const form: any = { ...state.form }; |
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.
Casting to any
not allowed.
const form: any = { ...state.form }; | |
const form = { ...state.form }; |
Also, it'd be great if you could give a meaningful title for the PR. It could convey what this PR has done. For example: "Adds support for searching user type in user creation form" |
Also, ensure cypress tests are passing |
@rithviknishad I fix the previous mentioned changes. |
Are you sure the cypress tests are passing? |
No, 3 out of 7 cypress test failed and rest is passed. |
@rithviknishad Is there something I have to do here? |
Hey, you can connect your FE to your local backend and run the cypress tests by following the documentation here... https://github.com/coronasafe/care_fe?tab=readme-ov-file#-run-cypress-tests Once you've identified which tests are failing, you can update the corresponding cypress tests. The test code would be present in the same file name as the cypress test spec name. |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, This pr has been automatically closed because it has not had any recent activity. Thank you for your contributions. Feel free to repopen the pr. |
Proposed Changes
There was difficulty in finding the suitable user type from the options provided because there was large number of options were available.
So, added a search tab in User Type to find out the best desired type easily from the detailed list.
Fixed some type error and UI flaws.
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist