Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
tea-artist committed May 28, 2024
1 parent 08d5062 commit 9b2947e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { FieldType } from '@teable/core';

export const UNCATEGORIZED_STACK_ID = 't_kanban_uncategorized';
export const UNCATEGORIZED_STACK_NAME = 'Uncategorized';
export const UNCATEGORIZED_STACK_EMAIL = 'unknown@teable.io';

export const KANBAN_STACK_FIELD_TYPES = new Set([FieldType.SingleSelect, FieldType.User]);
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { useContext, useMemo, useState } from 'react';
import { ShareViewPageContext } from '../../../share/view/ShareViewPageContext';
import {
KANBAN_STACK_FIELD_TYPES,
UNCATEGORIZED_STACK_EMAIL,
UNCATEGORIZED_STACK_ID,
UNCATEGORIZED_STACK_NAME,
} from '../constant';
Expand Down Expand Up @@ -131,13 +132,14 @@ export const KanbanProvider = ({ children }: { children: ReactNode }) => {
const users = userList?.data;
if (!users?.length) return;

const stacks = users.map(({ userId, userName, avatar }) => {
const stacks = users.map(({ userId, userName, avatar, email }) => {
const data = groupPointMap[userId];
return {
id: userId,
data: {
id: userId,
title: userName,
email,
avatarUrl: avatar,
},
count: data?.count ?? 0,
Expand All @@ -149,6 +151,7 @@ export const KanbanProvider = ({ children }: { children: ReactNode }) => {
data: {
id: UNCATEGORIZED_STACK_ID,
title: UNCATEGORIZED_STACK_NAME,
email: UNCATEGORIZED_STACK_EMAIL,
avatarUrl: null,
},
count: groupPointMap[UNCATEGORIZED_STACK_ID]?.count ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/components/editor/user/EditorBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const UserEditorBaseRef: ForwardRefRenderFunction<IUserEditorRef, IUserEditorBas
<CommandItem
key={userId}
value={userName}
onSelect={() => onSelect({ id: userId, title: userName, avatarUrl: avatar })}
onSelect={() => onSelect({ id: userId, title: userName, avatarUrl: avatar, email })}
className="flex justify-between"
>
<UserOption name={userName} email={email} avatar={avatar} />
Expand Down

0 comments on commit 9b2947e

Please sign in to comment.