Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add homeTable skeleton #106

Merged
merged 11 commits into from
May 21, 2024
Merged

add homeTable skeleton #106

merged 11 commits into from
May 21, 2024

Conversation

RenauxLeaInsee
Copy link
Contributor

No description provided.

@RenauxLeaInsee RenauxLeaInsee self-assigned this Apr 16, 2024
@RenauxLeaInsee RenauxLeaInsee force-pushed the feature/addHomeTable branch 2 times, most recently from ea89fe9 to 59c3f51 Compare April 17, 2024 09:07
@RenauxLeaInsee RenauxLeaInsee marked this pull request as ready for review April 23, 2024 08:26
src/i18n-en.js Outdated
readQuestionnaire: 'Read questionnaire',
close: 'Close',
comment: 'Comment',
surveyUnitNumber: 'SU n°',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe Su n.

src/i18n-fr.js Outdated
subSample: 'Sous-éch.',
interviewer: 'Enquêteur',
state: 'Etat',
closingCause: 'Bilan agrégé',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motif de clôture

src/i18n-en.js Outdated
@@ -7,7 +7,7 @@ export const messagesEn = {
goToReassignment: 'Reassignment',
goToHelp: 'HELP',
logout: 'Logout',
selectFavoriteSurveys: 'Select my favorite surveys',
selectFavoriteSurveys: 'MY FAVORITE SURVEYS',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could keep standard case in i18n and convert it to uppercase in component

src/i18n-fr.js Outdated
@@ -7,7 +7,7 @@ export const messagesFr = {
goToReassignment: 'Réaffectation',
goToHelp: 'AIDE',
logout: 'Se déconnecter',
selectFavoriteSurveys: 'Sélectionner mes enquêtes favorites',
selectFavoriteSurveys: 'MES ENQUÊTES FAVORITES',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same case here 🤭

src/routes.tsx Outdated
@@ -26,6 +27,7 @@ export const routes: RouteObject[] = [
{ path: "notify", element: <NotifyPage /> },
{ path: "collectOrganization", element: <CollectOrganizationPage /> },
{ path: "reassignment", element: <ReassignmentPage /> },
{ path: "surveyUnits/:id", element: <SurveyUnitPage /> },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the path be /survey-unit/{id}
url should be case insensitive => kebab case rulz ✊

};

const handleDelete = () => {
// TODO call api to delete comment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking :
create an api interface layer and call its methods in components
could mock api interface for tests and remove // TODOs in component 😁

InputProps={{
startAdornment: <InputAdornment position="start" />,
}}
autoFocus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessibility is not fond of autofocus
to check with a11y referent

<TableCell sx={{ typography: "itemSmall" }}>{surveyUnit.ssech ?? "-"}</TableCell>
<TableCell sx={{ typography: "itemSmall" }}>{surveyUnit.interviewer ?? "-"}</TableCell>
<TableCell sx={{ typography: "itemSmall" }}>
<StateChip value={surveyUnit.states} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX really want to show StateEnum entry value VIC, AOC, WFT, CLO, [...] ?
=> probably need a translation like what is done with surveyUnit.closingCause NPX, NPA, [...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translation is done by StateChip component ;)


describe("TableHeadCell component", () => {
it("should render label, sort icon and call sort function ", () => {
const onRequestSortMock = vi.fn();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if onRequestSort is always mocked, it could be define once for all it blocks

Comment on lines 25 to 28
if (!onRequestSort) {
return;
}
onRequestSort(event, property);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!onRequestSort) {
return;
}
onRequestSort(event, property);
onRequestSort?.(event, property);

optional chaining to ensure that the function is not null or undefined

Copy link

sonarqubecloud bot commented May 7, 2024

@SimonDmz SimonDmz merged commit c9866d7 into sonorV2 May 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants