Skip to content

Commit

Permalink
Asset CSV export (ohcnetwork#6262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Sep 12, 2023
1 parent d0ffbd5 commit 8c242d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ export const XLSXAssetImportSchema = {
return ip;
},
},
"Config: Camera Access Key": {
"Config - Camera Access Key": {
prop: "camera_access_key",
type: String,
},
Expand Down
20 changes: 18 additions & 2 deletions src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const AssetsList = () => {
},
},
{
label: "Export Assets",
label: "Export Assets (JSON)",
action: () =>
authorizedForImportExport &&
listAssets({
Expand All @@ -333,7 +333,23 @@ const AssetsList = () => {
limit: totalCount,
}),
type: "json",
filePrefix: `assets_${facility?.name}`,
filePrefix: `assets_${facility?.name ?? "all"}`,
options: {
icon: <CareIcon className="care-l-export" />,
disabled: totalCount === 0 || !authorizedForImportExport,
},
},
{
label: "Export Assets (CSV)",
action: () =>
authorizedForImportExport &&
listAssets({
...qParams,
csv: true,
limit: totalCount,
}),
type: "csv",
filePrefix: `assets_${facility?.name ?? "all"}`,
options: {
icon: <CareIcon className="care-l-export" />,
disabled: totalCount === 0 || !authorizedForImportExport,
Expand Down

0 comments on commit 8c242d6

Please sign in to comment.