forked from cerc-io/snowballtools-base
⚡️ feat: make the default status to undefined
This commit is contained in:
parent
18dde52c9a
commit
80097a32ac
@ -22,7 +22,7 @@ export enum StatusOptions {
|
|||||||
|
|
||||||
export interface FilterValue {
|
export interface FilterValue {
|
||||||
searchedBranch: string;
|
searchedBranch: string;
|
||||||
status: StatusOptions;
|
status: StatusOptions | string;
|
||||||
updateAtRange?: Value;
|
updateAtRange?: Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,13 +64,11 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusOptions = Object.values(StatusOptions)
|
const statusOptions = Object.values(StatusOptions).map((status) => ({
|
||||||
.map((status) => ({
|
label: status,
|
||||||
label: status,
|
value: status,
|
||||||
value: status,
|
leftIcon: getOptionIcon(status),
|
||||||
leftIcon: getOptionIcon(status),
|
}));
|
||||||
}))
|
|
||||||
.filter((status) => status.value !== StatusOptions.ALL_STATUS);
|
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setSearchedBranch('');
|
setSearchedBranch('');
|
||||||
@ -104,11 +102,15 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => {
|
|||||||
options={statusOptions}
|
options={statusOptions}
|
||||||
clearable
|
clearable
|
||||||
placeholder="All status"
|
placeholder="All status"
|
||||||
value={{ label: selectedStatus, value: selectedStatus }}
|
value={
|
||||||
|
selectedStatus
|
||||||
|
? { label: selectedStatus, value: selectedStatus }
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
onChange={(item) =>
|
onChange={(item) =>
|
||||||
setSelectedStatus((item as SelectOption).value as StatusOptions)
|
setSelectedStatus((item as SelectOption).value as StatusOptions)
|
||||||
}
|
}
|
||||||
onClear={() => setSelectedStatus(StatusOptions.ALL_STATUS)}
|
onClear={() => setSelectedStatus('')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,7 +14,7 @@ import { RefreshIcon } from 'components/shared/CustomIcon';
|
|||||||
|
|
||||||
const DEFAULT_FILTER_VALUE: FilterValue = {
|
const DEFAULT_FILTER_VALUE: FilterValue = {
|
||||||
searchedBranch: '',
|
searchedBranch: '',
|
||||||
status: StatusOptions.ALL_STATUS,
|
status: '',
|
||||||
};
|
};
|
||||||
const FETCH_DEPLOYMENTS_INTERVAL = 5000;
|
const FETCH_DEPLOYMENTS_INTERVAL = 5000;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user