-
Notifications
You must be signed in to change notification settings - Fork 525
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
Changes from 1 commit
72c25c7
5e98869
e8499fd
db2fb4c
2098454
7d99ffe
b9c2913
e721590
c2fe3a9
7cd8d7f
d869d1b
aa51880
102bc74
9a73618
1f667e2
fc1ff52
de35c4d
1ad5032
b900f6f
db0e22e
bad7863
0faeb64
f52117b
564a461
18fcf32
ce00cdf
a2d1d38
e6702d0
6c91c63
0c9da17
623dfa0
762c1ea
6a67690
34d40da
e9129e5
ec73916
33653fb
a971c59
21601fe
6d63a69
a920771
d6fe9b4
197c9a9
4c56047
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
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. revert unrelated changes 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. @rithviknishad I added " * text=auto " to the .gitattributes file. Should I remove it? do I need to update any packages in the package-lock.json file? |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -54,42 +54,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; | ||||||||||
} | ||||||||||
|
@@ -114,6 +108,10 @@ const InvestigationReports = ({ id }: any) => { | |||||||||
selectedInvestigations, | ||||||||||
} = state as InitialState; | ||||||||||
|
||||||||||
const clearSelectedInvestigations = () => { | ||||||||||
dispatch({ type: "set_selected_investigations", payload: [] }); | ||||||||||
}; | ||||||||||
|
||||||||||
const fetchInvestigationsData = useCallback( | ||||||||||
async ( | ||||||||||
onSuccess: ( | ||||||||||
|
@@ -185,7 +183,7 @@ const InvestigationReports = ({ id }: any) => { | |||||||||
.flatten() | ||||||||||
.map((i) => ({ | ||||||||||
...i, | ||||||||||
name: `${i.name} ${i.groups[0].name && " | " + i.groups[0].name} `, | ||||||||||
name: `${i.name} ${i.groups[0].name && " | " + i.groups[0].name}`, | ||||||||||
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. Fix investigation name formatting logic. The current implementation has a logical error in the string concatenation that could lead to incorrect formatting. - name: `${i.name} ${i.groups[0].name && " | " + i.groups[0].name}`,
+ name: `${i.name}${i.groups[0]?.name ? ` | ${i.groups[0].name}` : ''}`, 📝 Committable suggestion
Suggested change
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. Fix investigation name formatting logic The current implementation has potential issues with empty groups and unnecessary separators. - name: `${i.name} ${i.groups[0].name && " | " + i.groups[0].name}`,
+ name: `${i.name}${i.groups?.[0]?.name ? ` | ${i.groups[0].name}` : ''}`, 📝 Committable suggestion
Suggested change
|
||||||||||
})) | ||||||||||
.unionBy("external_id") | ||||||||||
.value(); | ||||||||||
|
@@ -345,23 +343,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 && ( | ||||||||||
|
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.
revert unrelated changes