From 3bf89652097e96200d90640e4bf0f2b26024b0ed Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Wed, 14 Feb 2024 10:39:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A(app-desk)=20rename=20and=20group?= =?UTF-8?q?=20team=20Panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add folder Panel - rename PanelTeams to TeamList - rename PanelTeam to TeamItem --- .../teams/__tests__/PanelTeams.test.tsx | 12 +++++----- .../apps/desk/src/features/teams/api/index.ts | 1 + .../teams/components/{ => Panel}/Panel.tsx | 4 ++-- .../components/{ => Panel}/PanelActions.tsx | 9 ++++--- .../{PanelTeam.tsx => Panel/TeamItem.tsx} | 7 +++--- .../{PanelTeams.tsx => Panel/TeamList.tsx} | 24 ++++++------------- .../src/features/teams/components/index.ts | 2 +- 7 files changed, 24 insertions(+), 35 deletions(-) rename src/frontend/apps/desk/src/features/teams/components/{ => Panel}/Panel.tsx (93%) rename src/frontend/apps/desk/src/features/teams/components/{ => Panel}/PanelActions.tsx (88%) rename src/frontend/apps/desk/src/features/teams/components/{PanelTeam.tsx => Panel/TeamItem.tsx} (93%) rename src/frontend/apps/desk/src/features/teams/components/{PanelTeams.tsx => Panel/TeamList.tsx} (80%) diff --git a/src/frontend/apps/desk/src/features/teams/__tests__/PanelTeams.test.tsx b/src/frontend/apps/desk/src/features/teams/__tests__/PanelTeams.test.tsx index 23f528d..9294c73 100644 --- a/src/frontend/apps/desk/src/features/teams/__tests__/PanelTeams.test.tsx +++ b/src/frontend/apps/desk/src/features/teams/__tests__/PanelTeams.test.tsx @@ -4,7 +4,7 @@ import fetchMock from 'fetch-mock'; import { AppWrapper } from '@/tests/utils'; -import { PanelTeams } from '../components/PanelTeams'; +import { TeamList } from '../components/Panel/TeamList'; window.HTMLElement.prototype.scroll = function () {}; @@ -26,7 +26,7 @@ describe('PanelTeams', () => { results: [], }); - render(, { wrapper: AppWrapper }); + render(, { wrapper: AppWrapper }); expect(screen.getByRole('status')).toBeInTheDocument(); @@ -49,7 +49,7 @@ describe('PanelTeams', () => { ], }); - render(, { wrapper: AppWrapper }); + render(, { wrapper: AppWrapper }); expect(screen.getByRole('status')).toBeInTheDocument(); @@ -75,7 +75,7 @@ describe('PanelTeams', () => { ], }); - render(, { wrapper: AppWrapper }); + render(, { wrapper: AppWrapper }); expect(screen.getByRole('status')).toBeInTheDocument(); @@ -105,7 +105,7 @@ describe('PanelTeams', () => { ], }); - render(, { wrapper: AppWrapper }); + render(, { wrapper: AppWrapper }); expect(screen.getByRole('status')).toBeInTheDocument(); @@ -117,7 +117,7 @@ describe('PanelTeams', () => { status: 500, }); - render(, { wrapper: AppWrapper }); + render(, { wrapper: AppWrapper }); expect(screen.getByRole('status')).toBeInTheDocument(); diff --git a/src/frontend/apps/desk/src/features/teams/api/index.ts b/src/frontend/apps/desk/src/features/teams/api/index.ts index bc49929..7021b9c 100644 --- a/src/frontend/apps/desk/src/features/teams/api/index.ts +++ b/src/frontend/apps/desk/src/features/teams/api/index.ts @@ -1,2 +1,3 @@ export * from './useCreateTeam'; export * from './useTeam'; +export * from './useTeams'; diff --git a/src/frontend/apps/desk/src/features/teams/components/Panel.tsx b/src/frontend/apps/desk/src/features/teams/components/Panel/Panel.tsx similarity index 93% rename from src/frontend/apps/desk/src/features/teams/components/Panel.tsx rename to src/frontend/apps/desk/src/features/teams/components/Panel/Panel.tsx index 9066c84..99117a0 100644 --- a/src/frontend/apps/desk/src/features/teams/components/Panel.tsx +++ b/src/frontend/apps/desk/src/features/teams/components/Panel/Panel.tsx @@ -5,7 +5,7 @@ import { Box, Text } from '@/components'; import { useCunninghamTheme } from '@/cunningham'; import { PanelActions } from './PanelActions'; -import { PanelTeams } from './PanelTeams'; +import { TeamList } from './TeamList'; export const Panel = () => { const { t } = useTranslation(); @@ -36,7 +36,7 @@ export const Panel = () => { - + ); }; diff --git a/src/frontend/apps/desk/src/features/teams/components/PanelActions.tsx b/src/frontend/apps/desk/src/features/teams/components/Panel/PanelActions.tsx similarity index 88% rename from src/frontend/apps/desk/src/features/teams/components/PanelActions.tsx rename to src/frontend/apps/desk/src/features/teams/components/Panel/PanelActions.tsx index fe65ce4..ce46050 100644 --- a/src/frontend/apps/desk/src/features/teams/components/PanelActions.tsx +++ b/src/frontend/apps/desk/src/features/teams/components/Panel/PanelActions.tsx @@ -5,11 +5,10 @@ import styled from 'styled-components'; import { Box, StyledLink } from '@/components'; import { useCunninghamTheme } from '@/cunningham'; - -import { TeamsOrdering } from '../api/useTeams'; -import IconAdd from '../assets/icon-add.svg'; -import IconSort from '../assets/icon-sort.svg'; -import { useTeamStore } from '../store/useTeamsStore'; +import { TeamsOrdering } from '@/features/teams/api/'; +import IconAdd from '@/features/teams/assets/icon-add.svg'; +import IconSort from '@/features/teams/assets/icon-sort.svg'; +import { useTeamStore } from '@/features/teams/store/useTeamsStore'; const ButtonSort = styled(Button)<{ $background: CSSProperties['background']; diff --git a/src/frontend/apps/desk/src/features/teams/components/PanelTeam.tsx b/src/frontend/apps/desk/src/features/teams/components/Panel/TeamItem.tsx similarity index 93% rename from src/frontend/apps/desk/src/features/teams/components/PanelTeam.tsx rename to src/frontend/apps/desk/src/features/teams/components/Panel/TeamItem.tsx index da6d1c9..532a319 100644 --- a/src/frontend/apps/desk/src/features/teams/components/PanelTeam.tsx +++ b/src/frontend/apps/desk/src/features/teams/components/Panel/TeamItem.tsx @@ -5,15 +5,14 @@ import { useTranslation } from 'react-i18next'; import IconGroup from '@/assets/icons/icon-group.svg'; import { Box, StyledLink, Text } from '@/components'; import { useCunninghamTheme } from '@/cunningham'; - -import { Team } from '../api/types'; -import IconNone from '../assets/icon-none.svg'; +import { Team } from '@/features/teams/api/'; +import IconNone from '@/features/teams/assets/icon-none.svg'; interface TeamProps { team: Team; } -export const PanelTeam = ({ team }: TeamProps) => { +export const TeamItem = ({ team }: TeamProps) => { const { t } = useTranslation(); const { colorsTokens } = useCunninghamTheme(); const { diff --git a/src/frontend/apps/desk/src/features/teams/components/PanelTeams.tsx b/src/frontend/apps/desk/src/features/teams/components/Panel/TeamList.tsx similarity index 80% rename from src/frontend/apps/desk/src/features/teams/components/PanelTeams.tsx rename to src/frontend/apps/desk/src/features/teams/components/Panel/TeamList.tsx index cd48bf9..cc60ff9 100644 --- a/src/frontend/apps/desk/src/features/teams/components/PanelTeams.tsx +++ b/src/frontend/apps/desk/src/features/teams/components/Panel/TeamList.tsx @@ -4,12 +4,10 @@ import { useTranslation } from 'react-i18next'; import { Box, Text } from '@/components'; import { InfiniteScroll } from '@/components/InfiniteScroll'; +import { Team, useTeams } from '@/features/teams/api/'; +import { useTeamStore } from '@/features/teams/store/useTeamsStore'; -import { Team } from '../api/types'; -import { useTeams } from '../api/useTeams'; -import { useTeamStore } from '../store/useTeamsStore'; - -import { PanelTeam } from './PanelTeam'; +import { TeamItem } from './TeamItem'; interface PanelTeamsStateProps { isLoading: boolean; @@ -17,11 +15,7 @@ interface PanelTeamsStateProps { teams?: Team[]; } -const PanelTeamsState = ({ - isLoading, - isError, - teams, -}: PanelTeamsStateProps) => { +const TeamListState = ({ isLoading, isError, teams }: PanelTeamsStateProps) => { const { t } = useTranslation(); if (isError) { @@ -57,10 +51,10 @@ const PanelTeamsState = ({ ); } - return teams.map((team) => ); + return teams.map((team) => ); }; -export const PanelTeams = () => { +export const TeamList = () => { const ordering = useTeamStore((state) => state.ordering); const { data, @@ -92,11 +86,7 @@ export const PanelTeams = () => { className="p-0 mt-0" role="listbox" > - + ); diff --git a/src/frontend/apps/desk/src/features/teams/components/index.ts b/src/frontend/apps/desk/src/features/teams/components/index.ts index cb7aa82..38dec09 100644 --- a/src/frontend/apps/desk/src/features/teams/components/index.ts +++ b/src/frontend/apps/desk/src/features/teams/components/index.ts @@ -1,2 +1,2 @@ -export * from './Panel'; +export * from './Panel/Panel'; export * from './TeamInfo';