🚚(app-desk) create addMembers feature

All the code related to adding members has been moved
to the addMembers feature.
This commit is contained in:
Anthony LC
2024-03-25 17:49:11 +01:00
committed by Anthony LC
parent 832dae789e
commit 25af872a2a
13 changed files with 16 additions and 17 deletions

View File

@@ -0,0 +1,3 @@
export * from './useCreateInvitation';
export * from './useCreateTeamAccess';
export * from './useUsers';

View File

@@ -2,10 +2,10 @@ import { useMutation } from '@tanstack/react-query';
import { APIError, errorCauses, fetchAPI } from '@/api';
import { User } from '@/features/auth';
import { Invitation, Role } from '@/features/members';
import { Team } from '@/features/teams';
import { Invitation, Role } from '../types';
import { OptionType } from '../typesSearchMembers';
import { OptionType } from '../types';
interface CreateInvitationParams {
email: User['email'];

View File

@@ -2,12 +2,10 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import { APIError, errorCauses, fetchAPI } from '@/api';
import { User } from '@/features/auth';
import { Access, KEY_LIST_TEAM_ACCESSES, Role } from '@/features/members';
import { KEY_LIST_TEAM, KEY_TEAM, Team } from '@/features/teams';
import { Access, Role } from '../types';
import { OptionType } from '../typesSearchMembers';
import { KEY_LIST_TEAM_ACCESSES } from '.';
import { OptionType } from '../types';
interface CreateTeamAccessParams {
name: User['name'];

View File

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 925 B

View File

@@ -12,20 +12,19 @@ import { createGlobalStyle } from 'styled-components';
import { APIError } from '@/api';
import { Box, Text } from '@/components';
import { useCunninghamTheme } from '@/cunningham';
import { ChooseRole, Role } from '@/features/members';
import { Team } from '@/features/teams';
import { useCreateInvitation, useCreateTeamAccess } from '../api';
import IconAddMember from '../assets/add-member.svg';
import { Role } from '../types';
import {
OptionInvitation,
OptionNewMember,
OptionSelect,
OptionType,
isOptionNewMember,
} from '../typesSearchMembers';
} from '../types';
import { ChooseRole } from './ChooseRole';
import { OptionsSelect, SearchMembers } from './SearchMembers';
const GlobalStyle = createGlobalStyle`

View File

@@ -7,7 +7,7 @@ import { Team } from '@/features/teams';
import { isValidEmail } from '@/utils';
import { KEY_LIST_USER, useUsers } from '../api/useUsers';
import { OptionSelect, OptionType } from '../typesSearchMembers';
import { OptionSelect, OptionType } from '../types';
export type OptionsSelect = Options<OptionSelect>;

View File

@@ -0,0 +1 @@
export * from './components/ModalAddMembers';

View File

@@ -1,5 +1,2 @@
export * from './useCreateInvitation';
export * from './useCreateTeamAccess';
export * from './useTeamsAccesses';
export * from './useUpdateTeamAccess';
export * from './useUsers';

View File

@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import IconUser from '@/assets/icons/icon-user.svg';
import { Box, Card, TextErrors } from '@/components';
import { useCunninghamTheme } from '@/cunningham';
import { ModalAddMembers } from '@/features/addMembers';
import { Team } from '@/features/teams';
import { useTeamAccesses } from '../api/';
@@ -12,7 +13,6 @@ import { PAGE_SIZE } from '../conf';
import { Role } from '../types';
import { MemberAction } from './MemberAction';
import { ModalAddMembers } from './ModalAddMembers';
interface MemberGridProps {
team: Team;

View File

@@ -1,3 +1,4 @@
export * from './types';
export * from './api/useTeamsAccesses';
export * from './components/ChooseRole';
export * from './components/MemberGrid';
export * from './components/ModalAddMembers';
export * from './types';

View File

@@ -16,7 +16,7 @@ test.describe('Members Create', () => {
await page.getByLabel('Add members to the team').click();
await expect(page.getByText('Add members to the team')).toBeVisible();
await expect(page.getByText('Add a member')).toBeVisible();
await expect(
page.getByLabel(/Find a member to add to the team/),
).toBeVisible();