-
Notifications
You must be signed in to change notification settings - Fork 516
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
Fixed Multi-selection functionality. #9345
Closed
Closed
Changes from 4 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
72c25c7
Fix multi-selection, closes #9144
Jeffrin2005 5e98869
Merge branch 'develop' into multiselection
Jeffrin2005 e8499fd
updated , closes 9144
Jeffrin2005 db2fb4c
updated index.tsx
Jeffrin2005 2098454
updated index.tsx
Jeffrin2005 7d99ffe
Merge branch 'develop' into multiselection
Jeffrin2005 b9c2913
final Board.tsx
Jeffrin2005 e721590
Switch out all the ButtonV2s and used button
Jeffrin2005 c2fe3a9
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 7cd8d7f
button instead of buttonV2
Jeffrin2005 d869d1b
Merge branch 'develop' into multiselection
Jeffrin2005 aa51880
Final-updated shadcn button
Jeffrin2005 102bc74
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 9a73618
orginal-used shadcn button
Jeffrin2005 1f667e2
Final-Latest-used shadcn Button
Jeffrin2005 fc1ff52
used_variant=primary,secondary
Jeffrin2005 de35c4d
Merge branch 'develop' into multiselection
nihal467 1ad5032
Merge branch 'develop' into multiselection
nihal467 b900f6f
latest-investigation
Jeffrin2005 db0e22e
Merge branch 'develop' into multiselection
Jeffrin2005 bad7863
Correct Failing Test Case
Jeffrin2005 0faeb64
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 f52117b
Correct Failing Test case
Jeffrin2005 564a461
changed patientInvestigation.ts
Jeffrin2005 18fcf32
final test fail
Jeffrin2005 ce00cdf
latest check
Jeffrin2005 a2d1d38
final
Jeffrin2005 e6702d0
latest-final
Jeffrin2005 6c91c63
final1
Jeffrin2005 0c9da17
cypress test fail
Jeffrin2005 623dfa0
cypress3 test
Jeffrin2005 762c1ea
final2
Jeffrin2005 6a67690
orginal
Jeffrin2005 34d40da
latest1
Jeffrin2005 e9129e5
finall
Jeffrin2005 ec73916
rever
Jeffrin2005 33653fb
orginal
Jeffrin2005 a971c59
test final
Jeffrin2005 21601fe
temp1
Jeffrin2005 6d63a69
Test final
Jeffrin2005 a920771
Final commit of tests
Jeffrin2005 d6fe9b4
test1
Jeffrin2005 197c9a9
UP1
Jeffrin2005 4c56047
FINAL_COMMIT
Jeffrin2005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,42 +53,36 @@ const initialState: InitialState = { | |
|
||
const investigationReportsReducer = (state = initialState, action: any) => { | ||
switch (action.type) { | ||
case "set_investigation_groups": { | ||
case "set_investigation_groups": | ||
return { | ||
...state, | ||
investigationGroups: action.payload, | ||
}; | ||
} | ||
case "set_selected_group": { | ||
case "set_selected_group": | ||
return { | ||
...state, | ||
selectedGroup: action.payload, | ||
}; | ||
} | ||
case "set_investigations": { | ||
case "set_investigations": | ||
return { | ||
...state, | ||
investigations: action.payload, | ||
}; | ||
} | ||
case "set_selected_investigations": { | ||
case "set_selected_investigations": | ||
return { | ||
...state, | ||
selectedInvestigations: action.payload, | ||
}; | ||
} | ||
case "set_investigation_table_data": { | ||
case "set_investigation_table_data": | ||
return { | ||
...state, | ||
investigationTableData: action.payload, | ||
}; | ||
} | ||
case "set_loading": { | ||
case "set_loading": | ||
return { | ||
...state, | ||
isLoading: action.payload, | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
|
@@ -113,6 +107,10 @@ const InvestigationReports = ({ id }: any) => { | |
selectedInvestigations, | ||
} = state as InitialState; | ||
|
||
const clearSelectedInvestigations = () => { | ||
dispatch({ type: "set_selected_investigations", payload: [] }); | ||
}; | ||
|
||
const fetchInvestigationsData = useCallback( | ||
async ( | ||
onSuccess: ( | ||
|
@@ -344,23 +342,33 @@ const InvestigationReports = ({ id }: any) => { | |
}) | ||
} | ||
optionLabel={(option) => option.name} | ||
optionValue={(option) => option} | ||
optionValue={(option) => option.external_id} | ||
isLoading={isLoading.investigationLoading} | ||
placeholder={t("select_investigations")} | ||
selectAll={true} | ||
/> | ||
</div> | ||
|
||
<ButtonV2 | ||
onClick={() => { | ||
setSessionPage(1); | ||
handleGenerateReports(1); | ||
}} | ||
disabled={generateReportDisabled} | ||
variant="primary" | ||
className="my-2.5" | ||
> | ||
{t("generate_report")} | ||
</ButtonV2> | ||
<div className="flex space-x-2"> | ||
<ButtonV2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switch these out for Shadcn's Button component under ui/ (Switch out all the ButtonV2s in this file while you are at it) |
||
onClick={() => { | ||
setSessionPage(1); | ||
handleGenerateReports(1); | ||
}} | ||
disabled={generateReportDisabled} | ||
variant="primary" | ||
className="my-2.5" | ||
> | ||
{t("generate_report")} | ||
</ButtonV2> | ||
<ButtonV2 | ||
onClick={clearSelectedInvestigations} | ||
disabled={!selectedInvestigations.length} | ||
variant="secondary" | ||
className="my-2.5" | ||
> | ||
{t("clear")} | ||
</ButtonV2> | ||
</div> | ||
</> | ||
)} | ||
{isLoading.tableData && ( | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Leave package.json out of the commit.