Files
plane/web/ee/constants/issues.ts

53 lines
1.6 KiB
TypeScript
Raw Permalink Normal View History

// types
import { TIssueActivityComment } from "@plane/types";
// ce constants
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
import {
TActivityFilters as TActivityFiltersCe,
EActivityFilterType,
ACTIVITY_FILTER_TYPE_OPTIONS as ACTIVITY_FILTER_TYPE_OPTIONS_CE,
} from "@/ce/constants/issues";
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
export enum EActivityFilterTypeEE {
WORKLOG = "WORKLOG",
ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY = "ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY",
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
}
export type TActivityFilters = TActivityFiltersCe | EActivityFilterTypeEE.WORKLOG;
export const ACTIVITY_FILTER_TYPE_OPTIONS: Record<TActivityFilters, { label: string }> = {
...ACTIVITY_FILTER_TYPE_OPTIONS_CE,
[EActivityFilterTypeEE.WORKLOG]: {
label: "Worklogs",
},
};
export const defaultActivityFilters: TActivityFilters[] = [
EActivityFilterType.ACTIVITY,
EActivityFilterType.COMMENT,
EActivityFilterTypeEE.WORKLOG,
];
export type TActivityFilterOption = {
key: TActivityFilters;
label: string;
isSelected: boolean;
onClick: () => void;
};
const shouldRenderActivity = (activity: TIssueActivityComment, filter: TActivityFilters): boolean =>
activity.activity_type === filter ||
(filter === EActivityFilterType.ACTIVITY &&
activity.activity_type === EActivityFilterTypeEE.ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY);
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
export const filterActivityOnSelectedFilters = (
activity: TIssueActivityComment[],
filters: TActivityFilters[]
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
): TIssueActivityComment[] =>
activity.filter((activity) => filters.some((filter) => shouldRenderActivity(activity, filter)));
[WEB-1846] feat: time tracking (#608) * chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2024-07-22 19:43:49 +05:30
export { EActivityFilterType };
2024-09-24 19:45:15 +05:30
2024-10-24 15:49:58 +05:30
export const ENABLE_LOCAL_DB_CACHE = true;
export const ENABLE_ISSUE_DEPENDENCIES = true;