From 92267701ffa96a2ce9d4f35e3484cd159541ea87 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Mon, 5 Dec 2022 21:47:11 +0100 Subject: [PATCH] Rename tabs to Inbox, Contacts, Insights --- front/src/App.tsx | 12 ++++++------ front/src/layout/navbar/Navbar.tsx | 14 +++++++------- front/src/pages/{History.tsx => Contacts.tsx} | 4 ++-- front/src/pages/{Performances.tsx => Insights.tsx} | 4 ++-- .../src/pages/{tasks/Tasks.tsx => inbox/Inbox.tsx} | 4 ++-- front/src/pages/{tasks => inbox}/TaskList.tsx | 0 .../src/pages/{tasks => inbox}/TaskListHeader.tsx | 0 front/src/pages/{tasks => inbox}/TaskListItem.tsx | 0 front/src/stories/layout/navbar/Navbar.stories.tsx | 4 ++-- front/src/stories/pages/inbox/Inbox.stories.tsx | 13 +++++++++++++ .../pages/{tasks => inbox}/TaskList.stories.tsx | 4 ++-- .../{tasks => inbox}/TaskListHeader.stories.tsx | 4 ++-- .../{tasks => inbox}/TaskListItem.stories.tsx | 4 ++-- front/src/stories/pages/tasks/Tasks.stories.tsx | 13 ------------- front/src/tests/layout/navbar/Navbar.test.tsx | 8 ++++---- .../{tasks/Tasks.test.tsx => inbox/Inbox.test.tsx} | 6 +++--- .../tests/pages/{tasks => inbox}/TaskList.test.tsx | 4 ++-- .../pages/{tasks => inbox}/TaskListHeader.test.tsx | 2 +- .../pages/{tasks => inbox}/TaskListItem.test.tsx | 2 +- server/.gitignore | 2 +- 20 files changed, 52 insertions(+), 52 deletions(-) rename front/src/pages/{History.tsx => Contacts.tsx} (62%) rename front/src/pages/{Performances.tsx => Insights.tsx} (60%) rename front/src/pages/{tasks/Tasks.tsx => inbox/Inbox.tsx} (83%) rename front/src/pages/{tasks => inbox}/TaskList.tsx (100%) rename front/src/pages/{tasks => inbox}/TaskListHeader.tsx (100%) rename front/src/pages/{tasks => inbox}/TaskListItem.tsx (100%) create mode 100644 front/src/stories/pages/inbox/Inbox.stories.tsx rename front/src/stories/pages/{tasks => inbox}/TaskList.stories.tsx (57%) rename front/src/stories/pages/{tasks => inbox}/TaskListHeader.stories.tsx (66%) rename front/src/stories/pages/{tasks => inbox}/TaskListItem.stories.tsx (84%) delete mode 100644 front/src/stories/pages/tasks/Tasks.stories.tsx rename front/src/tests/pages/{tasks/Tasks.test.tsx => inbox/Inbox.test.tsx} (50%) rename front/src/tests/pages/{tasks => inbox}/TaskList.test.tsx (67%) rename front/src/tests/pages/{tasks => inbox}/TaskListHeader.test.tsx (72%) rename front/src/tests/pages/{tasks => inbox}/TaskListItem.test.tsx (72%) diff --git a/front/src/App.tsx b/front/src/App.tsx index 08bd528e9f..57fb0953c8 100644 --- a/front/src/App.tsx +++ b/front/src/App.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import Tasks from './pages/tasks/Tasks'; -import History from './pages/History'; -import Performances from './pages/Performances'; +import Inbox from './pages/inbox/Inbox'; +import Contacts from './pages/Contacts'; +import Insights from './pages/Insights'; import AppLayout from './layout/AppLayout'; import { Routes, Route } from 'react-router-dom'; @@ -9,9 +9,9 @@ function App() { return ( - } /> - } /> - } /> + } /> + } /> + } /> ); diff --git a/front/src/layout/navbar/Navbar.tsx b/front/src/layout/navbar/Navbar.tsx index 09433bcb24..8931e0b883 100644 --- a/front/src/layout/navbar/Navbar.tsx +++ b/front/src/layout/navbar/Navbar.tsx @@ -16,7 +16,7 @@ function Navbar() { <>

This is the history page

@@ -6,4 +6,4 @@ function History() { ); } -export default History; +export default Contacts; diff --git a/front/src/pages/Performances.tsx b/front/src/pages/Insights.tsx similarity index 60% rename from front/src/pages/Performances.tsx rename to front/src/pages/Insights.tsx index a9837b175d..295f39af0c 100644 --- a/front/src/pages/Performances.tsx +++ b/front/src/pages/Insights.tsx @@ -1,4 +1,4 @@ -function Performances() { +function Insights() { return (

This is the performances page

@@ -6,4 +6,4 @@ function Performances() { ); } -export default Performances; +export default Insights; diff --git a/front/src/pages/tasks/Tasks.tsx b/front/src/pages/inbox/Inbox.tsx similarity index 83% rename from front/src/pages/tasks/Tasks.tsx rename to front/src/pages/inbox/Inbox.tsx index 4c3822e187..4a0779ee3a 100644 --- a/front/src/pages/tasks/Tasks.tsx +++ b/front/src/pages/inbox/Inbox.tsx @@ -1,7 +1,7 @@ import FullWidthContainer from '../../layout/containers/FullWidthContainer'; import TaskList from './TaskList'; -function Tasks() { +function Inbox() { return ( @@ -9,4 +9,4 @@ function Tasks() { ); } -export default Tasks; +export default Inbox; diff --git a/front/src/pages/tasks/TaskList.tsx b/front/src/pages/inbox/TaskList.tsx similarity index 100% rename from front/src/pages/tasks/TaskList.tsx rename to front/src/pages/inbox/TaskList.tsx diff --git a/front/src/pages/tasks/TaskListHeader.tsx b/front/src/pages/inbox/TaskListHeader.tsx similarity index 100% rename from front/src/pages/tasks/TaskListHeader.tsx rename to front/src/pages/inbox/TaskListHeader.tsx diff --git a/front/src/pages/tasks/TaskListItem.tsx b/front/src/pages/inbox/TaskListItem.tsx similarity index 100% rename from front/src/pages/tasks/TaskListItem.tsx rename to front/src/pages/inbox/TaskListItem.tsx diff --git a/front/src/stories/layout/navbar/Navbar.stories.tsx b/front/src/stories/layout/navbar/Navbar.stories.tsx index 772c952e9c..841b4c6df7 100644 --- a/front/src/stories/layout/navbar/Navbar.stories.tsx +++ b/front/src/stories/layout/navbar/Navbar.stories.tsx @@ -7,8 +7,8 @@ export default { component: Navbar, }; -export const NavbarOnPerformance = () => ( - +export const NavbarOnInsights = () => ( + ); diff --git a/front/src/stories/pages/inbox/Inbox.stories.tsx b/front/src/stories/pages/inbox/Inbox.stories.tsx new file mode 100644 index 0000000000..97aa92fa97 --- /dev/null +++ b/front/src/stories/pages/inbox/Inbox.stories.tsx @@ -0,0 +1,13 @@ +import { MemoryRouter } from 'react-router-dom'; +import Inbox from '../../../pages/inbox/Inbox'; + +export default { + title: 'Inbox', + component: Inbox, +}; + +export const InboxDefault = () => ( + + + +); diff --git a/front/src/stories/pages/tasks/TaskList.stories.tsx b/front/src/stories/pages/inbox/TaskList.stories.tsx similarity index 57% rename from front/src/stories/pages/tasks/TaskList.stories.tsx rename to front/src/stories/pages/inbox/TaskList.stories.tsx index 0a98aea9d1..70eec25ec0 100644 --- a/front/src/stories/pages/tasks/TaskList.stories.tsx +++ b/front/src/stories/pages/inbox/TaskList.stories.tsx @@ -1,7 +1,7 @@ -import TaskList from '../../../pages/tasks/TaskList'; +import TaskList from '../../../pages/inbox/TaskList'; export default { - title: 'Tasks', + title: 'Inbox', component: TaskList, }; diff --git a/front/src/stories/pages/tasks/TaskListHeader.stories.tsx b/front/src/stories/pages/inbox/TaskListHeader.stories.tsx similarity index 66% rename from front/src/stories/pages/tasks/TaskListHeader.stories.tsx rename to front/src/stories/pages/inbox/TaskListHeader.stories.tsx index 888660da6e..58a5aa3b26 100644 --- a/front/src/stories/pages/tasks/TaskListHeader.stories.tsx +++ b/front/src/stories/pages/inbox/TaskListHeader.stories.tsx @@ -1,8 +1,8 @@ import { MemoryRouter } from 'react-router-dom'; -import TaskListHeader from '../../../pages/tasks/TaskListHeader'; +import TaskListHeader from '../../../pages/inbox/TaskListHeader'; export default { - title: 'Tasks', + title: 'Inbox', component: TaskListHeader, }; diff --git a/front/src/stories/pages/tasks/TaskListItem.stories.tsx b/front/src/stories/pages/inbox/TaskListItem.stories.tsx similarity index 84% rename from front/src/stories/pages/tasks/TaskListItem.stories.tsx rename to front/src/stories/pages/inbox/TaskListItem.stories.tsx index c611ad175a..143dce87a9 100644 --- a/front/src/stories/pages/tasks/TaskListItem.stories.tsx +++ b/front/src/stories/pages/inbox/TaskListItem.stories.tsx @@ -1,8 +1,8 @@ import { MemoryRouter } from 'react-router-dom'; -import TaskListItem from '../../../pages/tasks/TaskListItem'; +import TaskListItem from '../../../pages/inbox/TaskListItem'; export default { - title: 'Tasks', + title: 'Inbox', component: TaskListItem, }; diff --git a/front/src/stories/pages/tasks/Tasks.stories.tsx b/front/src/stories/pages/tasks/Tasks.stories.tsx deleted file mode 100644 index 1a3121735c..0000000000 --- a/front/src/stories/pages/tasks/Tasks.stories.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { MemoryRouter } from 'react-router-dom'; -import Tasks from '../../../pages/tasks/Tasks'; - -export default { - title: 'Tasks', - component: Tasks, -}; - -export const TasksDefault = () => ( - - - -); diff --git a/front/src/tests/layout/navbar/Navbar.test.tsx b/front/src/tests/layout/navbar/Navbar.test.tsx index 6f4298e1ed..0e813259e7 100644 --- a/front/src/tests/layout/navbar/Navbar.test.tsx +++ b/front/src/tests/layout/navbar/Navbar.test.tsx @@ -1,16 +1,16 @@ import { render } from '@testing-library/react'; -import { NavbarOnPerformance } from '../../../stories/layout/navbar/Navbar.stories'; +import { NavbarOnInsights } from '../../../stories/layout/navbar/Navbar.stories'; it('Checks the NavItem renders', () => { - const { getByRole } = render(); + const { getByRole } = render(); - expect(getByRole('button', { name: 'Performances' })).toHaveAttribute( + expect(getByRole('button', { name: 'Insights' })).toHaveAttribute( 'aria-selected', 'true', ); - expect(getByRole('button', { name: 'Tasks' })).toHaveAttribute( + expect(getByRole('button', { name: 'Inbox' })).toHaveAttribute( 'aria-selected', 'false', ); diff --git a/front/src/tests/pages/tasks/Tasks.test.tsx b/front/src/tests/pages/inbox/Inbox.test.tsx similarity index 50% rename from front/src/tests/pages/tasks/Tasks.test.tsx rename to front/src/tests/pages/inbox/Inbox.test.tsx index 24e70d89e9..6918edef73 100644 --- a/front/src/tests/pages/tasks/Tasks.test.tsx +++ b/front/src/tests/pages/inbox/Inbox.test.tsx @@ -1,9 +1,9 @@ import { render } from '@testing-library/react'; -import { TasksDefault } from '../../../stories/pages/tasks/Tasks.stories'; +import { InboxDefault } from '../../../stories/pages/inbox/Inbox.stories'; -it('Checks the Tasks page render', () => { - const { getAllByRole } = render(); +it('Checks the Inbox page render', () => { + const { getAllByRole } = render(); const button = getAllByRole('button'); expect(button[0]).toHaveTextContent('Sylvie Vartan'); diff --git a/front/src/tests/pages/tasks/TaskList.test.tsx b/front/src/tests/pages/inbox/TaskList.test.tsx similarity index 67% rename from front/src/tests/pages/tasks/TaskList.test.tsx rename to front/src/tests/pages/inbox/TaskList.test.tsx index 993aacd259..8ae9b42f54 100644 --- a/front/src/tests/pages/tasks/TaskList.test.tsx +++ b/front/src/tests/pages/inbox/TaskList.test.tsx @@ -1,8 +1,8 @@ import { render } from '@testing-library/react'; -import { TaskListDefault } from '../../../stories/pages/tasks/TaskList.stories'; +import { TaskListDefault } from '../../../stories/pages/inbox/TaskList.stories'; -it('Checks the Tasks page render', () => { +it('Checks the task list render', () => { const { getAllByRole } = render(); const button = getAllByRole('button'); diff --git a/front/src/tests/pages/tasks/TaskListHeader.test.tsx b/front/src/tests/pages/inbox/TaskListHeader.test.tsx similarity index 72% rename from front/src/tests/pages/tasks/TaskListHeader.test.tsx rename to front/src/tests/pages/inbox/TaskListHeader.test.tsx index b6d42fe91e..e5ce2625c9 100644 --- a/front/src/tests/pages/tasks/TaskListHeader.test.tsx +++ b/front/src/tests/pages/inbox/TaskListHeader.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import { TaskListHeaderDefault } from '../../../stories/pages/tasks/TaskListHeader.stories'; +import { TaskListHeaderDefault } from '../../../stories/pages/inbox/TaskListHeader.stories'; it('Checks the TaskListHeader render', () => { const { getAllByText } = render(); diff --git a/front/src/tests/pages/tasks/TaskListItem.test.tsx b/front/src/tests/pages/inbox/TaskListItem.test.tsx similarity index 72% rename from front/src/tests/pages/tasks/TaskListItem.test.tsx rename to front/src/tests/pages/inbox/TaskListItem.test.tsx index 27331e5fa3..a9d9bf64a5 100644 --- a/front/src/tests/pages/tasks/TaskListItem.test.tsx +++ b/front/src/tests/pages/inbox/TaskListItem.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import { TaskListItemDefault } from '../../../stories/pages/tasks/TaskListItem.stories'; +import { TaskListItemDefault } from '../../../stories/pages/inbox/TaskListItem.stories'; it('Checks the TaskListItem render', () => { const { getAllByText } = render(); diff --git a/server/.gitignore b/server/.gitignore index 22f55adc56..f505884128 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -30,6 +30,6 @@ lerna-debug.log* # IDE - VSCode .vscode/* !.vscode/settings.json -!.vscode/tasks.json +!.vscode/inbox.json !.vscode/launch.json !.vscode/extensions.json \ No newline at end of file