diff --git a/backend/startup.sh b/backend/startup.sh index bce161f3..a8f5c27c 100755 --- a/backend/startup.sh +++ b/backend/startup.sh @@ -66,4 +66,9 @@ if [ -f "/certs/zscaler-ca.crt" ]; then keytool -import -trustcacerts -file /certs/zscaler-ca.crt -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt fi -mvn -ntp spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5006" \ No newline at end of file +# Import certificates - Needed by CGI laptops for development +if [ -f "zscaler-cgi.crt" ]; then + keytool -import -trustcacerts -file zscaler-cgi.crt -keystore /opt/java/openjdk/lib/security/cacerts -storepass changeit -noprompt +fi + +mvn -ntp spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5006" -Dspring-boot.run.profiles="dev-local" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d85fd7a3..41ac1eea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,13 +48,14 @@ services: entrypoint: sh -c './startup.sh' #image: maven:3.9.6-amazoncorretto-21 image: maven:3.9.9-eclipse-temurin-17 - network_mode: host + # network_mode: host + ports: [8080:8080] volumes: - ./backend:/app - $HOME/zscaler-certs:/certs working_dir: /app environment: - DATABASE_HOST: nrcdb03.bcgov + DATABASE_HOST: ${DATABASE_HOST} #nrcdb03.bcgov DATABASE_PORT: "1543" DATABASE_USER: ${DATABASE_USER} DATABASE_PASSWORD: ${DATABASE_PASSWORD} @@ -62,7 +63,7 @@ services: ORACLEDB_KEYSTORE: /app/jssecacerts ORACLEDB_SECRET: changeit AWS_COGNITO_ISSUER_URI: https://cognito-idp.ca-central-1.amazonaws.com/ca-central-1_t2HSZBHur - POSTGRES_HOST: localhost + POSTGRES_HOST: database DASHBOARD_JOB_IDIR_USERS: ${DASHBOARD_JOB_IDIR_USERS} <<: *db-vars <<: *backend @@ -74,7 +75,7 @@ services: volumes: ["/pgdata"] ports: ["5432:5432"] healthcheck: - test: pg_isready -U postgres + test: pg_isready -U nr-silva interval: 5s timeout: 5s retries: 5 @@ -90,7 +91,7 @@ services: wiremock: image: "wiremock/wiremock:latest" container_name: forest-client-api-stub - ports: ["9000:9000","9001:9001"] + ports: ["9002:9000","9001:9001"] volumes: - ./stub/:/home/wiremock/ entrypoint: ["/docker-entrypoint.sh", "--enable-stub-cors","--global-response-templating","--port","9000","--https-port","9001","--verbose"] \ No newline at end of file diff --git a/frontend/src/components/AutocompleteClientLocation/index.tsx b/frontend/src/components/AutocompleteClientLocation/index.tsx index 4c4f1a7f..4fab8b4c 100644 --- a/frontend/src/components/AutocompleteClientLocation/index.tsx +++ b/frontend/src/components/AutocompleteClientLocation/index.tsx @@ -1,11 +1,11 @@ import React, { useEffect, useState, useImperativeHandle, forwardRef } from "react"; -import { ComboBox } from "@carbon/react"; +import { ComboBox, FlexGrid, Row, Column } from "@carbon/react"; import { useAutocomplete } from "../../contexts/AutocompleteProvider"; -import { +import { fetchClientsByNameAcronymNumber, fetchClientLocations, ForestClientAutocomplete, - ForestClientLocation + ForestClientLocation } from "../../services/OpeningClientLocationService"; interface AutocompleteProps { @@ -13,7 +13,7 @@ interface AutocompleteProps { label: string, } -interface AutocompleteComboboxProps{ +interface AutocompleteComboboxProps { selectedItem: AutocompleteProps } @@ -41,17 +41,17 @@ export const skipConditions = { export const fetchValues = async (query: string, key: string) => { // If there is no query, return an empty array - if(!key || !query) return []; - + if (!key || !query) return []; + // For clients, it will do the autocomplete search based on the name, acronym, or number if (key === "clients") { const response = await fetchClientsByNameAcronymNumber(query); const apiresponse = response; return apiresponse.map((item: ForestClientAutocomplete) => ({ id: item.id, - label: `${item.name}, ${item.id}, ${item.acronym? item.acronym : ''}` + label: `${item.name}, ${item.id}, ${item.acronym ? item.acronym : ''}` })); - } + } // For locations, it will just load the value based on the selected client id if (key === "locations") { @@ -67,6 +67,7 @@ export const fetchValues = async (query: string, key: string) => { }; const AutocompleteClientLocation: React.ForwardRefExoticComponent> = forwardRef( + ({ setValue }, ref) => { const { options, fetchOptions, updateOptions } = useAutocomplete(); diff --git a/frontend/src/components/OpeningsSearchTable/index.tsx b/frontend/src/components/OpeningsSearchTable/index.tsx index e066896c..fc3616ff 100644 --- a/frontend/src/components/OpeningsSearchTable/index.tsx +++ b/frontend/src/components/OpeningsSearchTable/index.tsx @@ -62,7 +62,7 @@ const OpeningsSearchTable: React.FC = ({ }; const clickViewAction = useCallback((id: string) => { - console.log(`Clicked view on id ${id}`); + //console.log(`Clicked view on id ${id}`); }, []); const selectRowEvent = useCallback((openingId: string, selected: boolean) => { @@ -72,7 +72,7 @@ const OpeningsSearchTable: React.FC = ({ }, []); const batchActionClick = (selectedRows: any[]) => () => { - console.log('Batch action clicked with selected rows:', selectedRows); + //console.log('Batch action clicked with selected rows:', selectedRows); // Add your logic to handle batch actions here }; @@ -96,7 +96,7 @@ const OpeningsSearchTable: React.FC = ({ selectedRows, getTableProps, getTableContainerProps, - selectRow, + selectRow }:{ rows: any[], headers: any[], diff --git a/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/AdvancedSearchDropdown.scss b/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/AdvancedSearchDropdown.scss index 15e8ef86..52466269 100644 --- a/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/AdvancedSearchDropdown.scss +++ b/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/AdvancedSearchDropdown.scss @@ -3,97 +3,152 @@ @use '@carbon/type'; .advanced-search-dropdown { - background-color: var(--#{vars.$bcgov-prefix}-layer-02); - position: absolute; - z-index: 2; - width: 65.66%; - //these are for the nested elements - .advanced-search-container{ - box-shadow: 0px 2px 6px 0px #0000004D; - } - input{ - background-color: var(--bx-field-01); - border-bottom: 1px solid var(--bx-border-strong-01); - } - .multi-select .bx--list-box__field--wrapper{ - background-color: var(--bx-field-01); - border-bottom: 1px solid var(--bx-border-strong-01); - } + background-color: var(--#{vars.$bcgov-prefix}-layer-02); + padding-top: 20px; + padding-bottom: 20px; + padding-right: 20px; + position: absolute; + z-index: 2; + box-shadow: 0px 2px 6px 0px #0000004D; -} + .autoClientLocation { + padding-left: 10px; + padding-right: 0px; + } -.horizontal-checkbox-group { - display: flex; - flex-wrap: wrap; - max-width: 462px; - - .#{vars.$bcgov-prefix}--checkbox-label-text{ - font-size: 14px; - line-height: 18px; - letter-spacing:0.16px; - margin-right: 16px; - color: var(--bx-text-primary); - } -} + legend { + font-size: 12px; + line-height: 16px; + letter-spacing: 0.16px; + color: var(--bx-text-primary); + white-space: nowrap; + } -.date-type-col{ - padding: 0px; - padding-left: 16px; -} -.date-selectors-col{ - padding-left: 0px; -} + label { + font-size: 12px; + line-height: 16px; + letter-spacing: 0.16px; + white-space: nowrap; + color: var(--#{vars.$bcgov-prefix}-text-primary); + } + + .bx--label--disabled { + color: var(--#{vars.$bcgov-prefix}-text-secondary); + } + + .bx--text-input { + color: var(--#{vars.$bcgov-prefix}-text-secondary); + } + + .bx--row { + padding: 10px; + } + + .bx--col-md-3 { + padding-right: 10px; + } + + .orgUnitCol { + padding-right: 2rem; + } + + .locationCodeCombo { + width: 96% + } + + .timeberMarkCol { + padding-right: 2rem; + } + + .cutBlock { + padding-top: 12px; + } + + .cuttingPermit { + padding-top: 12px; + } + + .clientLocationCol { + padding-right: 2rem; + } + + input { + background-color: var(--bx-field-01); + border-bottom: 1px solid var(--bx-border-strong-01); + } + + input::placeholder { + color: var(--#{vars.$bcgov-prefix}-text-secondary); + } + + input:disabled::placeholder { + color: var(--#{vars.$bcgov-prefix}-text-secondary); + } + + .multi-select .bx--list-box__field--wrapper { + background-color: var(--bx-field-01); + border-bottom: 1px solid var(--bx-border-strong-01); + } -@media only screen and (min-width: 320px) { - .advanced-search-dropdown { - width: 93.5%; - } - .date-type-col{ - padding: 0px; - padding-left: 16px; - padding-right: 16px; - } - .date-selectors-col{ - padding-left: 16px; - padding-top:8px; - } - .flex-status-list{ - flex-direction: column; - } - } - /* Medium - Up to 672px */ - @media only screen and (min-width: 672px) { - .advanced-search-dropdown { - width: 96.6%; - } - .flex-status-list{ - flex-direction: column; - } - - } - /* Large - Up to 1056px */ - @media only screen and (min-width: 1056px) { - .advanced-search-dropdown { - width: 56.3%; - } - .flex-status-list{ - flex-direction: row; - } - } - - /* Max - Up to 1584px */ - @media only screen and (min-width: 1584px) { - .advanced-search-dropdown { - width: 60.66%; - } - .date-selectors-col{ - padding: 0px; - } - } - /* Extra Max - Up to 1784px */ - @media only screen and (min-width: 1784px) { - .advanced-search-dropdown { - width: 70.66%; - } + .bx--date-picker--range .bx--date-picker-container, + .bx--date-picker--range .bx--date-picker__input { + width: 95% } + .bx--date-picker__input[readonly] { + width: 95%; + } +} + +// @media only screen and (min-width: 320px) { +// .advanced-search-dropdown { +// width: 93.5%; +// } +// .date-type-col{ +// padding: 0px; +// padding-left: 16px; +// padding-right: 16px; +// } +// .date-selectors-col{ +// padding-left: 16px; +// padding-top:8px; +// } +// .flex-status-list{ +// flex-direction: column; +// } +// } +// /* Medium - Up to 672px */ +// @media only screen and (min-width: 672px) { +// .advanced-search-dropdown { +// width: 96.6%; +// } +// .flex-status-list{ +// flex-direction: column; +// } + +// } +// /* Large - Up to 1056px */ +// @media only screen and (min-width: 1056px) { +// .advanced-search-dropdown { +// width: 56.3%; +// } +// .flex-status-list{ +// flex-direction: row; +// } +// } + +// /* Max - Up to 1584px */ +// @media only screen and (min-width: 1584px) { +// .advanced-search-dropdown { +// width: 80%; +// } +// .date-selectors-col{ +// padding: 0px; +// } +// } +// /* Extra Max - Up to 1784px */ +// @media only screen and (min-width: 1784px) { +// .advanced-search-dropdown { +// width: 70.66%; +// } +// } \ No newline at end of file diff --git a/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/index.tsx b/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/index.tsx index d37921de..b1b08dd4 100644 --- a/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/index.tsx +++ b/frontend/src/components/SilvicultureSearch/Openings/AdvancedSearchDropdown/index.tsx @@ -1,16 +1,16 @@ -import React, { useState, useEffect, useRef } from "react"; +import React, { useEffect, useState, useRef } from "react"; import { Checkbox, CheckboxGroup, - Dropdown, TextInput, DatePicker, DatePickerInput, Loading, FlexGrid, + FilterableMultiSelect, Row, Column, - FilterableMultiSelect + ComboBox } from "@carbon/react"; import "./AdvancedSearchDropdown.scss"; import { useOpeningFiltersQuery } from "../../../../services/queries/search/openingQueries"; @@ -18,27 +18,54 @@ import { useOpeningsSearch } from "../../../../contexts/search/OpeningsSearch"; import { TextValueData, sortItems } from "../../../../utils/multiSelectSortUtils"; import { formatDateForDatePicker } from "../../../../utils/DateUtils"; import { AutocompleteProvider } from "../../../../contexts/AutocompleteProvider"; -import AutocompleteClientLocation, { skipConditions, fetchValues, AutocompleteComponentRefProps} from "../../../AutocompleteClientLocation"; +import AutocompleteClientLocation, { skipConditions, fetchValues, AutocompleteComponentRefProps } from "../../../AutocompleteClientLocation"; +import { setDate } from "date-fns"; interface AdvancedSearchDropdownProps { toggleShowFilters: () => void; // Function to be passed as a prop } -const AdvancedSearchDropdown: React.FC = () => { +interface TextValueProps { + text: string; + value: string; +} + +const AdvancedSearchDropdown: React.FC = () => { const { filters, setFilters, setIndividualClearFieldFunctions } = useOpeningsSearch(); const { data, isLoading, isError } = useOpeningFiltersQuery(); // Initialize selected items for OrgUnit MultiSelect based on existing filters const [selectedOrgUnits, setSelectedOrgUnits] = useState([]); const [selectedCategories, setSelectedCategories] = useState([]); + const [dateTypeValue, setDateTypeValue] = useState(null); + const [dateTypeItem, setDateTypeItem] = useState(null); const autoCompleteRef = useRef(null); + const categoryItems = + data?.categories?.map((item: any) => ({ + text: item.description, + value: item.code + })) || []; + + const orgUnitItems = + data?.orgUnits?.map((item: any) => ({ + text: item.orgUnitName, + value: item.orgUnitCode + })) || []; + + const dateTypeItems = + data?.dateTypes?.map((item: any) => ({ + text: item.label, + value: item.value + })) || []; + useEffect(() => { + //console.log("Use Effect in child is being called.", filters); // Split filters.orgUnit into array and format as needed for selectedItems if (filters.orgUnit) { const orgUnitsArray = filters.orgUnit.map((orgUnit: string) => ({ text: data?.orgUnits?.find((item: any) => item.orgUnitCode === orgUnit)?.orgUnitName || orgUnit, - value: orgUnit, + value: orgUnit })); setSelectedOrgUnits(orgUnitsArray); } else { @@ -46,27 +73,54 @@ const AdvancedSearchDropdown: React.FC = () => { } // Split filters.category into array and format as needed for selectedItems if (filters.category) { - const categoriesArray = filters.category.map((category: string) => ({ - text: data?.categories?.find((item: any) => item.code === category)?.description || category, - value: category, - })); - setSelectedCategories(categoriesArray); - } else{ - setSelectedCategories([]); - } + const categoriesArray = filters.category.map((category: string) => ({ + text: data?.categories?.find((item: any) => item.code === category)?.description || category, + value: category + })); + setSelectedCategories(categoriesArray); + } else { + setSelectedCategories([]); + } }, [filters.orgUnit, filters.category]); + const clearDates = () => { + handleFilterChange({ + startDate: null, + endDate: null, + dateType: "" + }); + setDateTypeValue(null); + setDateTypeItem(null); + setFilters({ ...filters, startDate: null, endDate: null, dateType: "" }); + }; + useEffect(() => { + // In here, we're defining the function that will be called when the user clicks on the "Clear" button + // The idea is to keep the autocomplete component clear of any ties to the opening search context + setIndividualClearFieldFunctions((previousIndividualFilters) => ({ + ...previousIndividualFilters, + clientLocationCode: () => autoCompleteRef.current?.reset(), + startDate: clearDates + })); + }, []); + + useEffect(() => { + // We use the useEffect to do a lookup on the clients options + // It will fill with the autocomplete triggering the fetchOptions + const selectedItem = dateTypeItems?.find((item: any) => item.text === dateTypeValue) || null; - // In here, we're defining the function that will be called when the user clicks on the "Clear" button - // The idea is to keep the autocomplete component clear of any ties to the opening search context - setIndividualClearFieldFunctions((previousIndividualFilters) => ({ - ...previousIndividualFilters, - clientLocationCode: () => autoCompleteRef.current?.reset() - })); - },[]); + if (selectedItem) { + setDateTypeItem(selectedItem); + handleFilterChange({ dateType: selectedItem.value }); + } + + }, [dateTypeValue]); const handleFilterChange = (updatedFilters: Partial) => { + if (updatedFilters.dateType === "") { + updatedFilters.startDate = null as Date | null; + updatedFilters.endDate = null as Date | null; + } setFilters({ ...filters, ...updatedFilters }); }; @@ -88,7 +142,7 @@ const AdvancedSearchDropdown: React.FC = () => { handleFilterChange({ [group]: updatedGroup }); }; - + if (isLoading) { return ; } @@ -101,305 +155,230 @@ const AdvancedSearchDropdown: React.FC = () => { ); } - const categoryItems = - data.categories?.map((item: any) => ({ - text: item.description, - value: item.code, - })) || []; - - const orgUnitItems = - data.orgUnits?.map((item: any) => ({ - text: item.orgUnitName, - value: item.orgUnitCode, - })) || []; - - const dateTypeItems = - data.dateTypes?.map((item: any) => ({ - text: item.label, - value: item.value, - })) || []; return ( -
- - - - - - handleCheckboxChange( - "Openings created by me", - "openingFilters" - ) - } - /> - - handleCheckboxChange( - "FRPA section 108", - "openingFilters" - ) - } - /> - - - - - - - (item ? `${item.value} - ${item.text}` : "")} - selectionFeedback="top-after-reopen" - onChange={(e: any) => handleMultiSelectChange("orgUnit", e.selectedItems)} - selectedItems={selectedOrgUnits} - sortItems={sortItems} + + + + + + handleCheckboxChange( + "Openings created by me", + "openingFilters" + ) + } /> - - - (item ? `${item.value} - ${item.text}` : "")} - selectionFeedback="top-after-reopen" - onChange={(e: any) => handleMultiSelectChange("category",e.selectedItems)} - selectedItems={selectedCategories} - sortItems={sortItems} + + handleCheckboxChange( + "FRPA section 108", + "openingFilters" + ) + } /> - - - - - - - handleFilterChange({ clientLocationCode: value })} - ref={autoCompleteRef} - /> - - - -
- - handleFilterChange({ cutBlock: e.target.value }) - } - /> - - handleFilterChange({ cuttingPermit: e.target.value }) - } - /> -
-
-
+ +
+
+ + + (item ? `${item.value} - ${item.text}` : "")} + selectionFeedback="top-after-reopen" + onChange={(e: any) => handleMultiSelectChange("orgUnit", e.selectedItems)} + selectedItems={selectedOrgUnits} + sortItems={sortItems} + /> + + + (item ? `${item.value} - ${item.text}` : "")} + selectionFeedback="top-after-reopen" + onChange={(e: any) => handleMultiSelectChange("category", e.selectedItems)} + selectedItems={selectedCategories} + sortItems={sortItems} + /> + + + + + + handleFilterChange({ clientLocationCode: value })} + ref={autoCompleteRef} + /> + + + + + handleFilterChange({ cutBlock: e.target.value }) + } + /> + + + + handleFilterChange({ cuttingPermit: e.target.value }) + } + /> + + - - - - handleFilterChange({ timberMark: e.target.value }) + + + + handleFilterChange({ timberMark: e.target.value }) + } + /> + + + (item ? item.text : "")} + onInputChange={setDateTypeValue} + selectedItem={dateTypeItem} + onChange={(e: any) => + handleFilterChange({ dateType: e.selectedItem === null ? "" : e.selectedItem.value }) + } + label="Date type" + /> + + + { + if (dates.length > 0) { + handleFilterChange({ + startDate: dates[0].toISOString().slice(0, 10), + endDate: dates[1] ? dates[1].toISOString().slice(0, 10) : null + }); } + }} + onClose={(dates: [Date, Date]) => { + if (dates.length > 0) { + handleFilterChange({ + startDate: dates[0].toISOString().slice(0, 10), + endDate: dates[1] ? dates[1].toISOString().slice(0, 10) : null + }); + } + }} + disabled={!filters.dateType} + > + - - - - - - (item ? item.text : "")} - onChange={(e: any) => - handleFilterChange({ dateType: e.selectedItem.value }) - } - selectedItem={ - filters.dateType - ? dateTypeItems.find( - (item: any) => item.value === filters.dateType - ) - : "" - } - label="Date type" - /> - - -
- { - if (dates.length > 0) { - handleFilterChange({ - startDate: dates[0].toISOString().slice(0, 10), - }); - } - }} - onClose={(dates: [Date]) => { - if (dates.length > 0) { - handleFilterChange({ - startDate: dates[0].toISOString().slice(0, 10), - }); - } - }} - readOnly={!filters.dateType} - > - - - - { - if (dates.length > 0) { - handleFilterChange({ - endDate: dates[0].toISOString().slice(0, 10), - }); - } - }} - onClose={(dates: [Date]) => { - if (dates.length > 0) { - handleFilterChange({ - endDate: dates[0].toISOString().slice(0, 10), - }); - } - }} - readOnly={!filters.dateType} - > - - -
-
-
-
-
-
+ + +
+
+ + + + handleCheckboxChange("AMG", "status")} + /> + handleCheckboxChange("AMD", "status")} + /> + handleCheckboxChange("APP", "status")} + /> + handleCheckboxChange("DFT", "status")} + /> + handleCheckboxChange("FG", "status")} + /> + handleCheckboxChange("RMD", "status")} + /> + handleCheckboxChange("RET", "status")} + /> + handleCheckboxChange("SUB", "status")} + /> + + + - - - -
- handleCheckboxChange("AMG", "status")} - /> - handleCheckboxChange("AMD", "status")} - /> - handleCheckboxChange("APP", "status")} - /> - handleCheckboxChange("DFT", "status")} - /> - handleCheckboxChange("FG", "status")} - /> - handleCheckboxChange("RMD", "status")} - /> - handleCheckboxChange("RET", "status")} - /> - handleCheckboxChange("SUB", "status")} - /> -
-
-
-
-
-
+ ); }; -export default AdvancedSearchDropdown; +export default AdvancedSearchDropdown; \ No newline at end of file diff --git a/frontend/src/components/SilvicultureSearch/Openings/SearchFilterBar/index.tsx b/frontend/src/components/SilvicultureSearch/Openings/SearchFilterBar/index.tsx index 04038539..ae260974 100644 --- a/frontend/src/components/SilvicultureSearch/Openings/SearchFilterBar/index.tsx +++ b/frontend/src/components/SilvicultureSearch/Openings/SearchFilterBar/index.tsx @@ -9,7 +9,7 @@ interface SearchFilterBarProps { const SearchFilterBar: React.FC = ({}) => { const [activeFilters, setActiveFilters] = useState([]); - const { filters, clearFilters, clearIndividualField } = useOpeningsSearch(); + const { filters, clearFilters, clearIndividualField} = useOpeningsSearch(); useEffect(() => { setActiveFilters(getActiveFilters(filters)); diff --git a/frontend/src/contexts/search/OpeningsSearch.tsx b/frontend/src/contexts/search/OpeningsSearch.tsx index b58f03c9..63b0e30e 100644 --- a/frontend/src/contexts/search/OpeningsSearch.tsx +++ b/frontend/src/contexts/search/OpeningsSearch.tsx @@ -30,7 +30,7 @@ export const OpeningsSearchProvider: React.FC<{ children: ReactNode }> = ({ chil timberMark: "", dateType: null as string | null, openingFilters: [] as string[], - blockStatuses: [] as string[], + blockStatuses: [] as string[] }; const [filters, setFilters] = useState(defaultFilters); @@ -47,11 +47,11 @@ export const OpeningsSearchProvider: React.FC<{ children: ReactNode }> = ({ chil }; const clearFilters = () => { - setFilters(defaultFilters); - Object.keys(defaultFilters).forEach((key) => { individualClearFieldFunctions[key] && individualClearFieldFunctions[key](); }); + + setFilters(defaultFilters); }; @@ -69,4 +69,4 @@ export const useOpeningsSearch = (): OpeningsSearchContextProps => { throw new Error('useOpeningsSearch must be used within an OpeningsSearchProvider'); } return context; -}; +}; \ No newline at end of file diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index ee654df5..875984a9 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -53,7 +53,7 @@ if (container) { - +