Skip to content

Commit

Permalink
fix: rename assignee search component
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Jul 24, 2024
1 parent daf404d commit 7183cda
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions webapp/src/component/task/TaskDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Validation } from 'tg.constants/GlobalValidationSchema';
import { components } from 'tg.service/apiSchema.generated';

import { TaskDatePicker } from './TaskDatePicker';
import { UserSearchSelect } from './assigneeSelect/UserSearchSelect';
import { AssigneeSearchSelect } from './assigneeSelect/AssigneeSearchSelect';
import { TaskLabel } from './TaskLabel';
import { messageService } from 'tg.service/MessageService';
import { TaskInfoItem } from './TaskInfoItem';
Expand Down Expand Up @@ -127,7 +127,7 @@ export const TaskDetail = ({ task, onClose, project }: Props) => {
label={t('task_detail_field_name')}
fullWidth
/>
<UserSearchSelect
<AssigneeSearchSelect
label={t('task_detail_field_assignees')}
value={values.assignees}
onChange={(value) => setFieldValue('assignees', value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ArrowDropDown, Clear } from '@mui/icons-material';
import { stopAndPrevent } from 'tg.fixtures/eventHandler';
import { components } from 'tg.service/apiSchema.generated';
import { TextField } from 'tg.component/common/TextField';
import { UserSearchSelectPopover } from './UserSearchSelectPopover';
import { AssigneeSearchSelectPopover } from './AssigneeSearchSelectPopover';
import { User } from './types';

type SimpleProjectModel = components['schemas']['SimpleProjectModel'];
Expand Down Expand Up @@ -54,7 +54,7 @@ type Props = {
project: SimpleProjectModel;
};

export const UserSearchSelect: React.FC<Props> = ({
export const AssigneeSearchSelect: React.FC<Props> = ({
value,
onChange,
label,
Expand Down Expand Up @@ -125,7 +125,7 @@ export const UserSearchSelect: React.FC<Props> = ({
}}
/>

<UserSearchSelectPopover
<AssigneeSearchSelectPopover
open={isOpen}
onClose={handleClose}
selected={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ type Props = {
size?: number;
};

export const UserSearchSelectItem: React.FC<Props> = ({ data, size = 24 }) => {
export const AssigneeSearchSelectItem: React.FC<Props> = ({
data,
size = 24,
}) => {
return (
<StyledOrgItem>
<Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useDebounce } from 'use-debounce';
import { components } from 'tg.service/apiSchema.generated';
import { useApiInfiniteQuery } from 'tg.service/http/useQueryApi';
import { SpinnerProgress } from 'tg.component/SpinnerProgress';
import { UserSearchSelectItem } from './UserSearchSelectItem';
import { AssigneeSearchSelectItem } from './AssigneeSearchSelectItem';
import { User } from './types';

type SimpleProjectModel = components['schemas']['SimpleProjectModel'];
Expand Down Expand Up @@ -65,7 +65,7 @@ type Props = {
project: SimpleProjectModel;
};

export const UserSearchSelectPopover: React.FC<Props> = ({
export const AssigneeSearchSelectPopover: React.FC<Props> = ({
open,
onClose,
onSelect,
Expand Down Expand Up @@ -180,7 +180,7 @@ export const UserSearchSelectPopover: React.FC<Props> = ({
selected={Boolean(selection.find((u) => u.id === option.id))}
data-cy="user-switch-item"
>
<UserSearchSelectItem data={option} />
<AssigneeSearchSelectItem data={option} />
</MenuItem>
{usersLoadable.hasNextPage &&
option.id === items![items!.length - 1].id && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FlagImage } from 'tg.component/languages/FlagImage';
import { useTranslate } from '@tolgee/react';
import { useNumberFormatter } from 'tg.hooks/useLocale';
import { Warning } from '@mui/icons-material';
import { UserSearchSelect } from 'tg.component/task/assigneeSelect/UserSearchSelect';
import { AssigneeSearchSelect } from 'tg.component/task/assigneeSelect/UserSearchSelect';
import { User } from 'tg.component/task/assigneeSelect/types';

type TaskType = components['schemas']['TaskModel']['type'];
Expand Down Expand Up @@ -107,7 +107,7 @@ export const TaskPreview = ({
</StyledMetric>
</Box>
</Box>
<UserSearchSelect
<AssigneeSearchSelect
value={assigness}
project={project}
onChange={onUpdateAssignees}
Expand Down

0 comments on commit 7183cda

Please sign in to comment.