Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/elements/common/types/SidebarNavigation.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export const ViewType = Object.freeze({
METADATA_REDESIGN: 'metadata_redesign',
SKILLS: 'skills',
ACTIVITY: 'activity',
VERSIONS: 'versions',
DOCGEN: 'docgen',
});

export const FeedEntryType = Object.freeze({
ANNOTATIONS: 'annotations',
COMMENTS: 'comments',
TASKS: 'tasks',
VERSIONS: 'versions',
});

export type ViewTypeValues = $Values<typeof ViewType>;
Expand All @@ -27,13 +27,14 @@ export type SidebarNavigation = {
activeFeedEntryType?: FeedEntryTypeValues,
activeFeedEntryId?: string,
fileVersionId?: string,
filteredTemplateIds?: string,
sidebar: ViewTypeValues,
filteredTemplateIds?: string[],
sidebar?: ViewTypeValues,
versionId?: string,
};

export type InternalSidebarNavigation = SidebarNavigation & {
open?: boolean,
silent?: boolean,
};

export type SidebarNavigationHandler = (sidebar: SidebarNavigation, replace?: boolean) => void;
Expand Down
10 changes: 6 additions & 4 deletions src/elements/common/types/SidebarNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ export enum ViewType {
METADATA_REDESIGN = 'metadata_redesign',
BOXAI = 'boxai',
ACTIVITY = 'activity',
VERSIONS = 'versions',
DOCGEN = 'docgen',
}

export enum FeedEntryType {
ANNOTATIONS = 'annotations',
COMMENTS = 'comments',
TASKS = 'tasks',
VERSIONS = 'versions',
}

type VersionSidebarView = {
sidebar: ViewType.ACTIVITY | ViewType.DETAILS;
versionId: string;
activeFeedEntryType: FeedEntryType.VERSIONS;
versionId?: string;
};

export type MetadataSidebarView = {
sidebar: ViewType.METADATA | ViewType.METADATA_REDESIGN;
filteredTemplateIds?: string;
filteredTemplateIds: string[];
};

export type ActivityAnnotationsSidebarView = {
Expand All @@ -39,7 +40,7 @@ type ActivityCommentsSidebarView = {

export type SidebarNavigation =
| {
sidebar: ViewType;
sidebar?: ViewType;
}
| VersionSidebarView
| MetadataSidebarView
Expand All @@ -48,6 +49,7 @@ export type SidebarNavigation =

export type InternalSidebarNavigation = SidebarNavigation & {
open?: boolean;
silent?: boolean;
};

export type SidebarNavigationHandler = (sidebar: SidebarNavigation, replace?: boolean) => void;
Expand Down
Loading