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 {
|
||||
searchedBranch: string;
|
||||
status: StatusOptions;
|
||||
status: StatusOptions | string;
|
||||
updateAtRange?: Value;
|
||||
}
|
||||
|
||||
@ -64,13 +64,11 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => {
|
||||
}
|
||||
};
|
||||
|
||||
const statusOptions = Object.values(StatusOptions)
|
||||
.map((status) => ({
|
||||
label: status,
|
||||
value: status,
|
||||
leftIcon: getOptionIcon(status),
|
||||
}))
|
||||
.filter((status) => status.value !== StatusOptions.ALL_STATUS);
|
||||
const statusOptions = Object.values(StatusOptions).map((status) => ({
|
||||
label: status,
|
||||
value: status,
|
||||
leftIcon: getOptionIcon(status),
|
||||
}));
|
||||
|
||||
const handleReset = () => {
|
||||
setSearchedBranch('');
|
||||
@ -104,11 +102,15 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => {
|
||||
options={statusOptions}
|
||||
clearable
|
||||
placeholder="All status"
|
||||
value={{ label: selectedStatus, value: selectedStatus }}
|
||||
value={
|
||||
selectedStatus
|
||||
? { label: selectedStatus, value: selectedStatus }
|
||||
: undefined
|
||||
}
|
||||
onChange={(item) =>
|
||||
setSelectedStatus((item as SelectOption).value as StatusOptions)
|
||||
}
|
||||
onClear={() => setSelectedStatus(StatusOptions.ALL_STATUS)}
|
||||
onClear={() => setSelectedStatus('')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@ import { RefreshIcon } from 'components/shared/CustomIcon';
|
||||
|
||||
const DEFAULT_FILTER_VALUE: FilterValue = {
|
||||
searchedBranch: '',
|
||||
status: StatusOptions.ALL_STATUS,
|
||||
status: '',
|
||||
};
|
||||
const FETCH_DEPLOYMENTS_INTERVAL = 5000;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user