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

Fix: Clear button functionality and center-align dropdown arrow (#8815) #8817

Conversation

NitinPSingh
Copy link
Contributor

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

17.10.2024_16.19.02_REC.online-video-cutter.com.mp4

@NitinPSingh NitinPSingh requested a review from a team as a code owner October 17, 2024 11:03
Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit ce4831f
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6718d1a347271f00080d29fb
😎 Deploy Preview https://deploy-preview-8817--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@NitinPSingh
Copy link
Contributor Author

@rithviknishad @nihal467 the cross button is implemented such that it opens the dropdown on click , do you want to remove this?

current:

17.10.2024_16.19.02_REC.online-video-cutter.com.mp4

i have implemented the changes which will not open the dropdown on click of cross button, should i push?

17.10.2024_17.49.55_REC.mp4

@nihal467
Copy link
Member

@NitinPSingh the cross button is implemented such that it opens the dropdown on click , keep this behavior itself

@NitinPSingh
Copy link
Contributor Author

@nihal467 ok , i havent push that part yet , so the current code will clear the selected and also open the drop-down

@nihal467
Copy link
Member

@NitinPSingh
Copy link
Contributor Author

all green now

@nihal467
Copy link
Member

LGTM

@bodhish
Copy link
Member

bodhish commented Oct 21, 2024

@NitinPSingh Please do add a human firendly title for the PR

@NitinPSingh NitinPSingh changed the title Fix#8815/fix clear button aligned arrow Fix: Clear button functionality and center-align dropdown arrow (#8815) Oct 21, 2024
@@ -99,7 +100,7 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) {
showNOptions={8}
selected={selectedFacility}
setSelected={(v) =>
v && !Array.isArray(v) && setSelectedFacility(v)
(v === null || (!Array.isArray(v) && v)) && setSelectedFacility(v)
Copy link
Contributor

@Jacobjeevan Jacobjeevan Oct 21, 2024

Choose a reason for hiding this comment

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

This isn't a big deal, but since you are specifying the type for state object to be FacilityModel or null, probably don't need the (&& v) check anymore.

Copy link
Member

Choose a reason for hiding this comment

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

@NitinPSingh Like @Jacobjeevan mentioned, the logic wouldnt be effected but its hard to read, please simplify it to something like

Suggested change
(v === null || (!Array.isArray(v) && v)) && setSelectedFacility(v)
(v === null || !Array.isArray(v)) && setSelectedFacility(v)

Copy link
Contributor

@Jacobjeevan Jacobjeevan left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -99,7 +100,7 @@ export default function SpokeFacilityEditor(props: SpokeFacilityEditorProps) {
showNOptions={8}
selected={selectedFacility}
setSelected={(v) =>
v && !Array.isArray(v) && setSelectedFacility(v)
(v === null || (!Array.isArray(v) && v)) && setSelectedFacility(v)
Copy link
Member

Choose a reason for hiding this comment

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

@NitinPSingh Like @Jacobjeevan mentioned, the logic wouldnt be effected but its hard to read, please simplify it to something like

Suggested change
(v === null || (!Array.isArray(v) && v)) && setSelectedFacility(v)
(v === null || !Array.isArray(v)) && setSelectedFacility(v)

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Oct 23, 2024
Copy link

👋 Hi, @NitinPSingh,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

<>
<div className="flex flex-1 items-center justify-center rounded-lg">
<img
src={preview || imageUrl}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
@rithviknishad rithviknishad added invalid This doesn't seem right and removed tested merge conflict pull requests with merge conflict labels Oct 23, 2024
@rithviknishad
Copy link
Member

this wasn't intended right?

image

@NitinPSingh
Copy link
Contributor Author

something went wrong here i guess let me fix , i create new pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clear Button of Spoke Facility Dropdown in facility details update page is not working