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

Fixed Multi-selection functionality. #9345

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
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 Dec 10, 2024
5e98869
Merge branch 'develop' into multiselection
Jeffrin2005 Dec 10, 2024
e8499fd
updated , closes 9144
Jeffrin2005 Dec 10, 2024
db2fb4c
updated index.tsx
Jeffrin2005 Dec 11, 2024
2098454
updated index.tsx
Jeffrin2005 Dec 13, 2024
7d99ffe
Merge branch 'develop' into multiselection
Jeffrin2005 Dec 17, 2024
b9c2913
final Board.tsx
Jeffrin2005 Dec 18, 2024
e721590
Switch out all the ButtonV2s and used button
Jeffrin2005 Dec 19, 2024
c2fe3a9
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 Dec 19, 2024
7cd8d7f
button instead of buttonV2
Jeffrin2005 Dec 21, 2024
d869d1b
Merge branch 'develop' into multiselection
Jeffrin2005 Dec 21, 2024
aa51880
Final-updated shadcn button
Jeffrin2005 Dec 23, 2024
102bc74
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 Dec 23, 2024
9a73618
orginal-used shadcn button
Jeffrin2005 Dec 23, 2024
1f667e2
Final-Latest-used shadcn Button
Jeffrin2005 Dec 23, 2024
fc1ff52
used_variant=primary,secondary
Jeffrin2005 Dec 23, 2024
de35c4d
Merge branch 'develop' into multiselection
nihal467 Dec 24, 2024
1ad5032
Merge branch 'develop' into multiselection
nihal467 Dec 24, 2024
b900f6f
latest-investigation
Jeffrin2005 Dec 26, 2024
db0e22e
Merge branch 'develop' into multiselection
Jeffrin2005 Dec 28, 2024
bad7863
Correct Failing Test Case
Jeffrin2005 Dec 28, 2024
0faeb64
Merge branch 'multiselection' of https://github.com/Jeffrin2005/care_…
Jeffrin2005 Dec 28, 2024
f52117b
Correct Failing Test case
Jeffrin2005 Dec 28, 2024
564a461
changed patientInvestigation.ts
Jeffrin2005 Dec 28, 2024
18fcf32
final test fail
Jeffrin2005 Dec 28, 2024
ce00cdf
latest check
Jeffrin2005 Dec 28, 2024
a2d1d38
final
Jeffrin2005 Dec 28, 2024
e6702d0
latest-final
Jeffrin2005 Dec 28, 2024
6c91c63
final1
Jeffrin2005 Dec 28, 2024
0c9da17
cypress test fail
Jeffrin2005 Dec 28, 2024
623dfa0
cypress3 test
Jeffrin2005 Dec 28, 2024
762c1ea
final2
Jeffrin2005 Dec 28, 2024
6a67690
orginal
Jeffrin2005 Dec 28, 2024
34d40da
latest1
Jeffrin2005 Dec 28, 2024
e9129e5
finall
Jeffrin2005 Dec 28, 2024
ec73916
rever
Jeffrin2005 Dec 28, 2024
33653fb
orginal
Jeffrin2005 Dec 28, 2024
a971c59
test final
Jeffrin2005 Dec 28, 2024
21601fe
temp1
Jeffrin2005 Dec 28, 2024
6d63a69
Test final
Jeffrin2005 Dec 28, 2024
a920771
Final commit of tests
Jeffrin2005 Dec 28, 2024
d6fe9b4
test1
Jeffrin2005 Dec 28, 2024
197c9a9
UP1
Jeffrin2005 Dec 28, 2024
4c56047
FINAL_COMMIT
Jeffrin2005 Dec 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"@pnotify/mobile": "^5.2.0",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-icons": "^1.3.2",
Copy link
Contributor

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.

"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.4",
Expand Down
58 changes: 33 additions & 25 deletions src/components/Facility/Investigations/Reports/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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: (
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 && (
Expand Down
Loading