diff --git a/android/app/build.gradle b/android/app/build.gradle index 1b115941..4855aa72 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -134,8 +134,8 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } -def VERSION_CODE = 148 -def VERSION_NAME = "2.9.7" +def VERSION_CODE = 147 +def VERSION_NAME = "2.9.6" android { ndkVersion rootProject.ext.ndkVersion diff --git a/package.json b/package.json index f0a051e5..4c73d9fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "AV_APP", - "version": "2.9.7", - "buildNumber": "148", + "version": "2.9.6", + "buildNumber": "147", "private": true, "scripts": { "android:dev": "yarn move:dev && react-native run-android", diff --git a/src/common/Constants.ts b/src/common/Constants.ts index abe53f7c..d21cc569 100644 --- a/src/common/Constants.ts +++ b/src/common/Constants.ts @@ -25,11 +25,6 @@ export const RANGE_FILTER_SEPARATOR = '-'; export interface Option { label: string; value: any; - meta?: Record; -} - -export interface SubLabelOption extends Option { - subLabel?: string; } export enum FirestoreUpdateTypes { diff --git a/src/components/screens/allCases/allCasesFilters/FilterOptions.tsx b/src/components/screens/allCases/allCasesFilters/FilterOptions.tsx index 3799daac..a3115509 100644 --- a/src/components/screens/allCases/allCasesFilters/FilterOptions.tsx +++ b/src/components/screens/allCases/allCasesFilters/FilterOptions.tsx @@ -9,7 +9,6 @@ import { IFilterOptionsProps } from './Interface'; import { useSelector } from 'react-redux'; import { RootState } from '../../../../store/store'; import styles from './styles'; -import {getKeys, getOptions} from "@components/screens/allCases/allCasesFilters/FilterUtils"; const FilterOptions: React.FC = ({ selectedFilterKey, @@ -20,21 +19,19 @@ const FilterOptions: React.FC = ({ const { filters } = useSelector((state: RootState) => ({ filters: state.filters.filters, })); - if (Object.keys(filters).length === 0) { - return null; + return <>; } if (selectedFilterKey) { const options = filterSearchString.length > 0 ? Search( filterSearchString, - getOptions(filters[selectedFilterKey.filterGroup].filters[selectedFilterKey.filterKey].options, selectedFilterKey.filterKey) || + filters[selectedFilterKey.filterGroup].filters[selectedFilterKey.filterKey].options || [], - { keys: getKeys(selectedFilterKey.filterKey) } + { keys: ['label'] } ).map((option) => option.obj) - : getOptions(filters[selectedFilterKey.filterGroup].filters[selectedFilterKey.filterKey].options, selectedFilterKey.filterKey); - + : filters[selectedFilterKey.filterGroup].filters[selectedFilterKey.filterKey].options; switch ( filters[selectedFilterKey.filterGroup].filters[selectedFilterKey.filterKey].selectionType ) { diff --git a/src/components/screens/allCases/allCasesFilters/FilterUtils.ts b/src/components/screens/allCases/allCasesFilters/FilterUtils.ts index 40cc38c0..a1333e6a 100644 --- a/src/components/screens/allCases/allCasesFilters/FilterUtils.ts +++ b/src/components/screens/allCases/allCasesFilters/FilterUtils.ts @@ -7,14 +7,12 @@ import { } from '../../../../screens/allCases/interface'; import { CONDITIONAL_OPERATORS, - FILTER_TYPES, Option, + FILTER_TYPES, RANGE_FILTER_SEPARATOR, - SELECTION_TYPES, SubLabelOption, + SELECTION_TYPES, } from '../../../../common/Constants'; import { getObjectValueFromKeys } from '../../../utlis/parsers'; import { _map } from '../../../../../RN-UI-LIB/src/utlis/common'; -import { pluralise } from "@utils/commonFunctions"; -import { FilterKeys, OptionTypes } from "@components/screens/allCases/allCasesFilters/types"; export const evaluateFilterForCases = ( caseRecord: CaseDetail, @@ -171,40 +169,3 @@ export function filterTransformer(filterResponseList: FilterResponse[]) { }); return { filterGroupMap, quickFilters }; } - -const populateSubLabelsAndSort = (options: Option[], subLabelKey: string) => options.map(option => { - const subLabelList = option?.meta? option.meta[subLabelKey]: [""]; - const subLabel = subLabelList?.length > 0 ? subLabelList[0] : ""; - return { - ...option, - subLabel - }; -}).sort((firstOption, secondOption) => { - if (firstOption.subLabel && secondOption.subLabel && firstOption.subLabel.localeCompare(secondOption.subLabel) === 0) { - return firstOption.label.localeCompare(secondOption.label); - } else if (firstOption.subLabel && secondOption.subLabel) { - return firstOption.subLabel.localeCompare(secondOption.subLabel); - } else if (firstOption?.subLabel) { - return -1; - } else if (secondOption?.subLabel) { - return 1; - } else { - return firstOption.label.localeCompare(secondOption.label); - } -}); - -export const getOptions = (options: Option[], filterKey: string) => { - if (filterKey === FilterKeys.PIN_CODE) { - return populateSubLabelsAndSort(options, OptionTypes.LOCALITY); - } - - return options; -} - -export const getKeys = (filterKey: string) => { - if (filterKey === FilterKeys.PIN_CODE) { - return ["label", "subLabel"]; - } - - return ["label"]; -} diff --git a/src/components/screens/allCases/allCasesFilters/types.ts b/src/components/screens/allCases/allCasesFilters/types.ts deleted file mode 100644 index 31bda42d..00000000 --- a/src/components/screens/allCases/allCasesFilters/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum OptionTypes { - COLLECTION_CASE = 'COLLECTION_CASE', - LOCALITY = 'LOCALITY' -} - -export enum FilterKeys { - PIN_CODE = 'PINCODE' -} diff --git a/src/components/utlis/commonFunctions.ts b/src/components/utlis/commonFunctions.ts index c179e191..3af01df2 100644 --- a/src/components/utlis/commonFunctions.ts +++ b/src/components/utlis/commonFunctions.ts @@ -520,8 +520,4 @@ export const sendDeviceDetailsToClickstream = async () => { }); }; -export const pluralise = (count: number, singularWord: string, pluralWord: string) => { - return count === 1 ? singularWord : pluralWord; -} - export const isFunction = (fn: unknown): fn is (...args: any[]) => void => typeof fn === 'function';