Skip to content

Commit

Permalink
fix: minor bugs in project/channel creation page (#83)
Browse files Browse the repository at this point in the history
* fix: minor bug

* feat: accordion button
  • Loading branch information
chiol authored Nov 21, 2023
1 parent 95c6a8e commit 68d4dc2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/etc/NoChannel/NoChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const NoChannel: React.FC<IProps> = ({ projectId }) => {
<div className="flex flex-1 flex-col items-center justify-center gap-8">
<div className="flex flex-col items-center gap-3">
<Icon name="NoChannelFill" size={56} className="text-tertiary" />
<p>{t('text.no-channel')}.</p>
<p>{t('text.no-channel')}</p>
</div>
<Tooltip open={step > 0} placement="bottom">
<TooltipTrigger asChild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ const CreateSectionTemplate: React.FC<IProps> = ({

return (
<div className="border-fill-tertiary overflow-hidden rounded-sm border">
<div className="bg-fill-quaternary flex items-center justify-between px-6 py-3">
<div
className="bg-fill-quaternary flex cursor-pointer items-center justify-between px-6 py-3"
onClick={() => setOpen((prev) => !prev)}
>
<p className="font-14-bold">{title}</p>
<button
className="icon-btn icon-btn-sm icon-btn-tertiary icon-btn-rounded"
onClick={() => setOpen((prev) => !prev)}
>
<button className="icon-btn icon-btn-sm icon-btn-tertiary icon-btn-rounded">
<Icon
name="ChevronDown"
className={[
Expand Down
9 changes: 5 additions & 4 deletions apps/web/src/containers/create-project/InputApiKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ const getColumns = (t: TFunction, onDelete: (index: number) => void) => [
</button>
</div>
),
size: 300,
}),
columnHelper.display({
header: 'Created',
cell: () => (
<p className="text-primary">{dayjs().format(DATE_TIME_FORMAT)}</p>
),
size: 100,
size: 150,
}),
columnHelper.display({
header: 'Status',
Expand All @@ -72,7 +73,7 @@ const getColumns = (t: TFunction, onDelete: (index: number) => void) => [
{t('main.setting.api-key-status.active')}
</Badge>
),
size: 50,
size: 150,
}),
columnHelper.display({
id: 'delete',
Expand All @@ -85,7 +86,7 @@ const getColumns = (t: TFunction, onDelete: (index: number) => void) => [
<Icon name="TrashFill" />
</button>
),
size: 50,
size: 100,
}),
];

Expand Down Expand Up @@ -123,7 +124,7 @@ const InputApiKey: React.FC = () => {
</button>
}
>
<table className="table">
<table className="table table-fixed">
<thead>
<tr>
{table.getFlatHeaders().map((header, i) => (
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/containers/create-project/InputIssueTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const InputIssueTracker: React.FC<IProps> = () => {
path: '/api/projects',
queryOptions: {
onError(error) {
console.log('error: ', error);
if (error.code === ErrorCode.Member.MemberInvalidUser)
setOpenMemberError(true);
else if (error.code === ErrorCode.Project.ProjectAlreadyExists)
Expand All @@ -86,12 +87,14 @@ const InputIssueTracker: React.FC<IProps> = () => {
projectInputScheme.parse(input);
} catch (error) {
if (error instanceof ZodError) {
console.log('error: ', error);
error.errors.forEach((err) => {
if (err.path[0] === 'members') setOpenMemberError(true);
else if (err.path[0] === 'projectInfo') setOpenProjectError(true);
else if (err.path[0] === 'roles') setOpenRoleError(true);
});
}
return;
}
mutate({
name: input.projectInfo.name,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/contexts/create-project.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export const projectInputScheme: Zod.ZodType<ProjectInputType> = z.object({
roleId: z.number(),
user: z.object({
id: z.number(),
name: z.string(),
email: z.string().email(),
department: z.string(),
name: z.string().nullable(),
department: z.string().nullable(),
}),
}),
),
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/types/user.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
export type UserType = {
id: number;
email: string;
name: string;
name: string | null;
department: string | null;
};

0 comments on commit 68d4dc2

Please sign in to comment.