From 29eb3c8b625210b499f86160d4330e641ce5738a Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 26 Jun 2024 14:17:51 -0400 Subject: [PATCH] lint fix --- .../changeBoardModal/components/ChangeBoardModal.tsx | 2 +- .../features/gallery/components/Boards/BoardContextMenu.tsx | 6 ++++-- .../gallery/components/Boards/BoardsList/BoardsList.tsx | 3 +-- .../web/src/features/gallery/store/gallerySelectors.ts | 2 +- .../Invocation/fields/inputs/BoardFieldInputComponent.tsx | 2 +- .../frontend/web/src/services/api/hooks/useBoardName.ts | 4 ++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx b/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx index 132fc952ea..489085ebf5 100644 --- a/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx +++ b/invokeai/frontend/web/src/features/changeBoardModal/components/ChangeBoardModal.tsx @@ -7,11 +7,11 @@ import { isModalOpenChanged, selectChangeBoardModalSlice, } from 'features/changeBoardModal/store/slice'; +import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors'; import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; import { useAddImagesToBoardMutation, useRemoveImagesFromBoardMutation } from 'services/api/endpoints/images'; -import { selectListBoardsQueryArgs } from '../../gallery/store/gallerySelectors'; const selectImagesToChange = createMemoizedSelector( selectChangeBoardModalSlice, diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx index 032b9c3b01..d3c5121567 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx @@ -8,13 +8,12 @@ import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { PiArchiveBold, PiArchiveFill, PiDownloadBold, PiPlusBold } from 'react-icons/pi'; +import { useUpdateBoardMutation } from 'services/api/endpoints/boards'; import { useBulkDownloadImagesMutation } from 'services/api/endpoints/images'; import { useBoardName } from 'services/api/hooks/useBoardName'; import type { BoardDTO } from 'services/api/types'; import GalleryBoardContextMenuItems from './GalleryBoardContextMenuItems'; -import { useUpdateBoardMutation } from '../../../../services/api/endpoints/boards'; -import { MdArchive, MdUnarchive } from 'react-icons/md'; type Props = { board?: BoardDTO; @@ -109,6 +108,9 @@ const BoardContextMenu = ({ board, board_id, setBoardToDelete, children }: Props isSelectedForAutoAdd, setBoardToDelete, t, + handleArchive, + handleUnarchive, + isBoardArchived, ] ); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx index 8b74d83582..e47edd21fc 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx @@ -2,6 +2,7 @@ import { Collapse, Flex, Grid, GridItem } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import DeleteBoardModal from 'features/gallery/components/Boards/DeleteBoardModal'; +import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; import type { CSSProperties } from 'react'; import { memo, useState } from 'react'; @@ -12,7 +13,6 @@ import AddBoardButton from './AddBoardButton'; import BoardsSearch from './BoardsSearch'; import GalleryBoard from './GalleryBoard'; import NoBoardBoard from './NoBoardBoard'; -import { selectListBoardsQueryArgs } from '../../../store/gallerySelectors'; const overlayScrollbarsStyles: CSSProperties = { height: '100%', @@ -28,7 +28,6 @@ const BoardsList = (props: Props) => { const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId); const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText); const queryArgs = useAppSelector(selectListBoardsQueryArgs); - console.log({ queryArgs }); const { data: boards } = useListAllBoardsQuery(queryArgs); const filteredBoards = boardSearchText ? boards?.filter((board) => board.board_name.toLowerCase().includes(boardSearchText.toLowerCase())) diff --git a/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts b/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts index af66685200..fb49e9d5e8 100644 --- a/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts +++ b/invokeai/frontend/web/src/features/gallery/store/gallerySelectors.ts @@ -27,6 +27,6 @@ export const selectListImagesQueryArgs = createMemoizedSelector( export const selectListBoardsQueryArgs = createMemoizedSelector( selectGallerySlice, (gallery): ListBoardsArgs => ({ - archived: gallery.shouldShowArchivedBoards ? true : undefined + archived: gallery.shouldShowArchivedBoards ? true : undefined, }) ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BoardFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BoardFieldInputComponent.tsx index d4bb5559f0..aabcfa4b38 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BoardFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/BoardFieldInputComponent.tsx @@ -1,6 +1,7 @@ import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui-library'; import { Combobox, FormControl } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; +import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors'; import { fieldBoardValueChanged } from 'features/nodes/store/nodesSlice'; import type { BoardFieldInputInstance, BoardFieldInputTemplate } from 'features/nodes/types/field'; import { memo, useCallback, useMemo } from 'react'; @@ -8,7 +9,6 @@ import { useTranslation } from 'react-i18next'; import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; import type { FieldComponentProps } from './types'; -import { selectListBoardsQueryArgs } from '../../../../../../../gallery/store/gallerySelectors'; const BoardFieldInputComponent = (props: FieldComponentProps) => { const { nodeId, field } = props; diff --git a/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts b/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts index 8798673e0d..c2501d50e3 100644 --- a/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts +++ b/invokeai/frontend/web/src/services/api/hooks/useBoardName.ts @@ -1,8 +1,8 @@ +import { useAppSelector } from 'app/store/storeHooks'; +import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors'; import type { BoardId } from 'features/gallery/store/types'; import { t } from 'i18next'; import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; -import { selectListBoardsQueryArgs } from '../../../features/gallery/store/gallerySelectors'; -import { useAppSelector } from '../../../app/store/storeHooks'; export const useBoardName = (board_id: BoardId) => { const queryArgs = useAppSelector(selectListBoardsQueryArgs);