-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat]: Add Timelog FilterOptions (#3333)
* feat: add useTimelogFilterOptions hook for managing time log filter states * fix:coderabbitai * fix:build * feat:save multi select filter in localstorage clear on cancel * fix:coderabbitai
- Loading branch information
1 parent
257cb9e
commit 9a94213
Showing
12 changed files
with
128 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { timesheetFilterEmployeeState, timesheetFilterProjectState, timesheetFilterStatusState, timesheetFilterTaskState } from '@/app/stores'; | ||
import { useAtom } from 'jotai'; | ||
|
||
export function useTimelogFilterOptions() { | ||
const [employeeState, setEmployeeState] = useAtom(timesheetFilterEmployeeState); | ||
const [projectState, setProjectState] = useAtom(timesheetFilterProjectState); | ||
const [statusState, setStatusState] = useAtom(timesheetFilterStatusState); | ||
const [taskState, setTaskState] = useAtom(timesheetFilterTaskState); | ||
|
||
const employee = employeeState; | ||
const project = projectState; | ||
const task = taskState | ||
|
||
|
||
return { | ||
statusState, | ||
employee, | ||
project, | ||
task, | ||
setEmployeeState, | ||
setProjectState, | ||
setTaskState, | ||
setStatusState | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import { ITimerLogsDailyReport } from '@app/interfaces/timer/ITimerLogs'; | ||
import { atom } from 'jotai'; | ||
import { ITimeSheet } from '../interfaces'; | ||
import { IProject, ITeamTask, ITimeSheet, OT_Member } from '../interfaces'; | ||
|
||
interface IFilterOption { | ||
value: string; | ||
label: string; | ||
} | ||
|
||
export const timerLogsDailyReportState = atom<ITimerLogsDailyReport[]>([]); | ||
|
||
export const timesheetRapportState = atom<ITimeSheet[]>([]) | ||
|
||
export const timesheetFilterEmployeeState = atom<OT_Member[]>([]); | ||
export const timesheetFilterProjectState = atom<IProject[]>([]); | ||
export const timesheetFilterTaskState = atom<ITeamTask[]>([]); | ||
|
||
export const timesheetFilterStatusState = atom<IFilterOption | IFilterOption[] | null>([]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.