From aeb65bdae5ba7caeda3a4878587a60cd24fc54f4 Mon Sep 17 00:00:00 2001 From: zant Date: Tue, 27 Aug 2024 19:31:47 +0200 Subject: [PATCH 1/3] feat: complete register flow --- .env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 8ee8ab0..a64b46c 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_VERSION="1.0.0" -VITE_API_URL="https://apisandbox.denguechatplus.org" +VITE_API_URL="http://localhost:3000" VITE_HOST="develop.denguechatplus.org" VITE_DEFAULT_LANG="es" VITE_LOCALE="es-ES" From cd0fd11dd533ab5f68ceb5db0f50752f39fe8aad Mon Sep 17 00:00:00 2001 From: zant Date: Mon, 9 Sep 2024 16:38:23 +0200 Subject: [PATCH 2/3] fix: add missing columns --- .env.development | 2 +- src/components/dialog/AssignMembersDialog.tsx | 10 +++++----- src/components/list/TeamsList.tsx | 17 +++++++++++------ src/i18n/locales/en/translation.json | 3 ++- src/i18n/locales/es/translation.json | 3 ++- src/i18n/locales/pt/translation.json | 3 ++- src/schemas/entities.ts | 1 + 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.env.development b/.env.development index a64b46c..8ee8ab0 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_VERSION="1.0.0" -VITE_API_URL="http://localhost:3000" +VITE_API_URL="https://apisandbox.denguechatplus.org" VITE_HOST="develop.denguechatplus.org" VITE_DEFAULT_LANG="es" VITE_LOCALE="es-ES" diff --git a/src/components/dialog/AssignMembersDialog.tsx b/src/components/dialog/AssignMembersDialog.tsx index 4a73764..eb27451 100644 --- a/src/components/dialog/AssignMembersDialog.tsx +++ b/src/components/dialog/AssignMembersDialog.tsx @@ -5,17 +5,17 @@ import { useTranslation } from 'react-i18next'; import { useSnackbar } from 'notistack'; +import { zodResolver } from '@hookform/resolvers/zod'; +import useAxios from 'axios-hooks'; +import { deserialize, ExistingDocumentObject } from 'jsonapi-fractal'; +import { useEffect, useState } from 'react'; +import { ErrorResponse } from 'react-router-dom'; import { TEAM_MEMBER_ROLE } from '@/constants'; import useUpdateMutation from '@/hooks/useUpdateMutation'; import { FormSelectOption, Member } from '@/schemas'; import { Team } from '@/schemas/entities'; import { UpdateTeam, UpdateTeamInputType, updateTeamSchema } from '@/schemas/update'; import FormMultipleSelect from '@/themed/form-multiple-select/FormMultipleSelect'; -import { zodResolver } from '@hookform/resolvers/zod'; -import useAxios from 'axios-hooks'; -import { deserialize, ExistingDocumentObject } from 'jsonapi-fractal'; -import { useEffect, useState } from 'react'; -import { ErrorResponse } from 'react-router-dom'; import { IUser } from '../../schemas/auth'; import { Button } from '../../themed/button/Button'; import { FormInput } from '../../themed/form-input/FormInput'; diff --git a/src/components/list/TeamsList.tsx b/src/components/list/TeamsList.tsx index 86a5b3f..6733123 100644 --- a/src/components/list/TeamsList.tsx +++ b/src/components/list/TeamsList.tsx @@ -1,10 +1,10 @@ +import { Dialog } from '@mui/material'; +import { useState } from 'react'; +import { useTranslation } from 'react-i18next'; import useStateContext from '@/hooks/useStateContext'; import { Member } from '@/schemas'; import { Team } from '@/schemas/entities'; import Button from '@/themed/button/Button'; -import { Dialog } from '@mui/material'; -import { useState } from 'react'; -import { useTranslation } from 'react-i18next'; import { HeadCell } from '../../themed/table/DataTable'; import { AssignMembersDialog } from '../dialog/AssignMembersDialog'; import FilteredDataTable from './FilteredDataTable'; @@ -22,6 +22,12 @@ function headCells(isAdmin: boolean): HeadCell[] { sortable: true, filterable: true, }, + { + id: 'city', + label: 'city', + filterable: true, + sortable: true, + }, { id: 'sector', label: 'sector', @@ -35,10 +41,9 @@ function headCells(isAdmin: boolean): HeadCell[] { sortable: true, }, { - id: 'members', - label: 'members', + id: 'memberCount', + label: 'memberCount', filterable: false, - render: (row) => {row.members.map((m: Member) => `${m.fullName}`).join(', ')}, sortKey: 'members', }, { diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index ec01317..1d82928 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -77,7 +77,8 @@ "wedge": "Wedge", "members": "Members", "leader": "Leader", - "memberCount": "Number of members" + "memberCount": "Number of members", + "city": "City" }, "options": { "notDefined": "Not Defined", diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index bab8581..557f4a2 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -76,7 +76,8 @@ "wedge": "Cuña", "members": "Miembros", "leader": "Líder", - "memberCount": "Número de miembros" + "memberCount": "Número de miembros", + "city": "Ciudad" }, "options": { "notDefined": "No definido", diff --git a/src/i18n/locales/pt/translation.json b/src/i18n/locales/pt/translation.json index 2137ff2..fa5773f 100644 --- a/src/i18n/locales/pt/translation.json +++ b/src/i18n/locales/pt/translation.json @@ -76,7 +76,8 @@ "wedge": "Subsetor", "members": "Membros", "leader": "Líder", - "memberCount": "Número de membros" + "memberCount": "Número de membros", + "city": "Cidade" }, "options": { "notDefined": "Não definido", diff --git a/src/schemas/entities.ts b/src/schemas/entities.ts index 02e9955..26ab584 100644 --- a/src/schemas/entities.ts +++ b/src/schemas/entities.ts @@ -35,6 +35,7 @@ export interface Role extends BaseEntity { export interface Team extends BaseEntity { organization: Organization; sector: string; + city: string; wedge: string; leader: string; members: Member[]; From 9ec65d0db5fca93140092ffc3b21f1e572fa907c Mon Sep 17 00:00:00 2001 From: zant Date: Mon, 9 Sep 2024 16:40:44 +0200 Subject: [PATCH 3/3] fix: import order --- src/components/list/TeamsList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/list/TeamsList.tsx b/src/components/list/TeamsList.tsx index 6733123..496268e 100644 --- a/src/components/list/TeamsList.tsx +++ b/src/components/list/TeamsList.tsx @@ -2,7 +2,6 @@ import { Dialog } from '@mui/material'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import useStateContext from '@/hooks/useStateContext'; -import { Member } from '@/schemas'; import { Team } from '@/schemas/entities'; import Button from '@/themed/button/Button'; import { HeadCell } from '../../themed/table/DataTable';