From 2cea440ae9d67d70b52a639aaf7cfc504c63f0be Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Mon, 11 Sep 2023 10:51:02 +0100 Subject: [PATCH] chore: remove logic that would not stay deleted (#17364) --- .../notebookCommentButtonLogic.ts | 84 ------------------- 1 file changed, 84 deletions(-) delete mode 100644 frontend/src/scenes/notebooks/NotebookCommentButton/notebookCommentButtonLogic.ts diff --git a/frontend/src/scenes/notebooks/NotebookCommentButton/notebookCommentButtonLogic.ts b/frontend/src/scenes/notebooks/NotebookCommentButton/notebookCommentButtonLogic.ts deleted file mode 100644 index 519f41368af29..0000000000000 --- a/frontend/src/scenes/notebooks/NotebookCommentButton/notebookCommentButtonLogic.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { actions, events, kea, key, listeners, path, props, reducers, selectors } from 'kea' -import { loaders } from 'kea-loaders' -import { NotebookListItemType, NotebookNodeType } from '~/types' - -import api from 'lib/api' - -import type { notebookCommentButtonLogicType } from './notebookCommentButtonLogicType' - -export interface NotebookCommentButtonProps { - sessionRecordingId: string - startVisible: boolean -} - -export const notebookCommentButtonLogic = kea([ - path((key) => ['scenes', 'session-recordings', 'NotebookCommentButton', 'multiNotebookCommentButtonLogic', key]), - props({} as NotebookCommentButtonProps), - key((props) => props.sessionRecordingId || 'no recording id yet'), - actions({ - setShowPopover: (visible: boolean) => ({ visible }), - setSearchQuery: (query: string) => ({ query }), - loadContainingNotebooks: true, - loadAllNotebooks: true, - }), - reducers(({ props }) => ({ - searchQuery: [ - '', - { - setSearchQuery: (_, { query }) => query, - }, - ], - showPopover: [ - props.startVisible, - { - setShowPopover: (_, { visible }) => visible, - }, - ], - })), - listeners(({ actions }) => ({ - setSearchQuery: () => { - actions.loadAllNotebooks() - actions.loadContainingNotebooks() - }, - })), - loaders(({ props, values }) => ({ - allNotebooks: [ - [] as NotebookListItemType[], - { - loadAllNotebooks: async (_, breakpoint) => { - breakpoint(100) - const response = await api.notebooks.list(undefined, undefined, values.searchQuery ?? undefined) - // TODO for simplicity we'll assume the results will fit into one page - return response.results - }, - }, - ], - containingNotebooks: [ - [] as NotebookListItemType[], - { - loadContainingNotebooks: async (_, breakpoint) => { - breakpoint(100) - const response = await api.notebooks.list( - [{ type: NotebookNodeType.Recording, attrs: { id: props.sessionRecordingId } }], - undefined, - values.searchQuery ?? undefined - ) - // TODO for simplicity we'll assume the results will fit into one page - return response.results - }, - }, - ], - })), - events(({ actions }) => ({ - afterMount: () => { - actions.loadAllNotebooks() - actions.loadContainingNotebooks() - }, - })), - selectors(() => ({ - notebooksLoading: [ - (s) => [s.allNotebooksLoading, s.containingNotebooksLoading], - (allNotebooksLoading, containingNotebooksLoading) => allNotebooksLoading || containingNotebooksLoading, - ], - })), -])