From f1e96cfc2bfd2dcfc52d70669ec494c5bb96fd45 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 26 Sep 2024 19:14:47 +0530 Subject: [PATCH 1/2] Plausible: Track applied filters (#8640) --- src/Common/hooks/useFilters.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Common/hooks/useFilters.tsx b/src/Common/hooks/useFilters.tsx index 188dec2229d..a6974a5a43b 100644 --- a/src/Common/hooks/useFilters.tsx +++ b/src/Common/hooks/useFilters.tsx @@ -6,6 +6,7 @@ import PaginationComponent from "../../Components/Common/Pagination"; import { classNames, humanizeStrings } from "../../Utils/utils"; import FiltersCache from "../../Utils/FiltersCache"; import careConfig from "@careConfig"; +import { triggerGoal } from "../../Integrations/Plausible"; export type FilterState = Record; @@ -42,6 +43,17 @@ export default function useFilters({ ) => { query = FiltersCache.utils.clean(query); _setQueryParams(query, options); + + // For each of the newly applied filters (additional filters compared to + // previously applied ones), trigger a plausible goal "Advanced filter + // applied" with the applied filter's query key and current location as tags. + Object.keys(query).forEach((filter) => + triggerGoal("Advanced filter applied", { + filter, + location: location.pathname, + }), + ); + updateCache(query); }; From 53c5a7aeb9f8eee7408ff644024668f65b868ceb Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Fri, 27 Sep 2024 12:49:46 +0530 Subject: [PATCH 2/2] Fixed fileupload name bug (#8638) --- src/Components/Files/FileUpload.tsx | 11 ++++--- .../Patient/PatientConsentRecords.tsx | 7 ++-- src/Locale/en/FileUpload.json | 1 + src/Utils/useFileUpload.tsx | 33 +++++++++++++++---- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/Components/Files/FileUpload.tsx b/src/Components/Files/FileUpload.tsx index 85d991d7c3b..1701a632472 100644 --- a/src/Components/Files/FileUpload.tsx +++ b/src/Components/Files/FileUpload.tsx @@ -195,6 +195,7 @@ export const FileUpload = (props: FileUploadProps) => { "ods", "pdf", ], + allowNameFallback: false, onUpload: refetchAll, }); @@ -259,7 +260,7 @@ export const FileUpload = (props: FileUploadProps) => {