🚚(app-desk) create addMembers feature
All the code related to adding members has been moved to the addMembers feature.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export * from './useCreateInvitation';
|
||||
export * from './useCreateTeamAccess';
|
||||
export * from './useUsers';
|
||||
@@ -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'];
|
||||
@@ -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'];
|
||||
|
Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 925 B |
@@ -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`
|
||||
@@ -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>;
|
||||
|
||||
1
src/frontend/apps/desk/src/features/addMembers/index.ts
Normal file
1
src/frontend/apps/desk/src/features/addMembers/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './components/ModalAddMembers';
|
||||
@@ -1,5 +1,2 @@
|
||||
export * from './useCreateInvitation';
|
||||
export * from './useCreateTeamAccess';
|
||||
export * from './useTeamsAccesses';
|
||||
export * from './useUpdateTeamAccess';
|
||||
export * from './useUsers';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user