Skip to content

release: v0.1.1 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
typescript:
- changed-files:
- '**/*.ts'
- '**/*.tsx'
- any-glob-to-any-file:
- '**/*.ts'
- '**/*.tsx'

'Type: Testing':
- changed-files:
- '**/*.spec.ts'
- '**/*.e2e-spec.ts'
- any-glob-to-any-file:
- '**/*.spec.ts'
- '**/*.e2e-spec.ts'

'Type: Documentation':
- changed-files:
- '**/*.md'
- any-glob-to-any-file:
- '**/*.md'

'Type: CI/CD':
- changed-files:
- '.github/workflows/*.yml'
- any-glob-to-any-file:
- '.github/workflows/*.yml'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
- [ページネーション](#%E3%83%9A%E3%83%BC%E3%82%B8%E3%83%8D%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3)
- [アーキテクチャ](#%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3)
- [始め方](#%E5%A7%8B%E3%82%81%E6%96%B9)
- [Auth0の設定](#auth0%E3%81%AE%E8%A8%AD%E5%AE%9A)
- [環境変数の設定](#%E7%92%B0%E5%A2%83%E5%A4%89%E6%95%B0%E3%81%AE%E8%A8%AD%E5%AE%9A)
- [開発サーバーの実行](#%E9%96%8B%E7%99%BA%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%81%AE%E5%AE%9F%E8%A1%8C)
- [デフォルトアカウント](#%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%82%A2%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88)
- [一般ユーザー](#%E4%B8%80%E8%88%AC%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC)
- [管理者](#%E7%AE%A1%E7%90%86%E8%80%85)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bun-nextjs-graphql",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/CreateTaskForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import type { CreateTaskInput } from '@/_hooks/types';
import type { CreateTaskInput } from '$/types';
import { useCreateTask } from '@/_hooks/useTasks';
import { useState } from 'react';

Expand Down Expand Up @@ -54,7 +54,7 @@ export function CreateTaskForm({ userId, onCreated }: CreateTaskFormProps) {

// Add expiredAt if provided
if (expiredAt) {
input.expiredAt = new Date(expiredAt).toISOString();
input.expiredAt = new Date(expiredAt);
}

try {
Expand Down
10 changes: 6 additions & 4 deletions src/app/_components/TaskDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import type { UpdateTaskInput } from '@/_hooks/types';
import type { UpdateTaskInput } from '$/types';
import {
useCompleteTask,
useDeleteTask,
Expand All @@ -21,7 +21,7 @@ export function TaskDetail({ taskId, onClose, onDeleted }: TaskDetailProps) {
const [isEditing, setIsEditing] = useState(false);
const [title, setTitle] = useState('');
const [description, setDescription] = useState('');
const [expiredAt, setExpiredAt] = useState<string | null | undefined>(
const [expiredAt, setExpiredAt] = useState<Date | null | undefined>(
undefined,
);

Expand Down Expand Up @@ -68,7 +68,7 @@ export function TaskDetail({ taskId, onClose, onDeleted }: TaskDetailProps) {
// Check if expiredAt has changed
const currentExpiredAt = data?.task.expiredAt ?? null;
if (expiredAt !== currentExpiredAt) {
input.expiredAt = expiredAt ? new Date(expiredAt).toISOString() : null;
input.expiredAt = expiredAt ? new Date(expiredAt) : null;
}

if (Object.keys(input).length === 0) {
Expand Down Expand Up @@ -247,7 +247,9 @@ export function TaskDetail({ taskId, onClose, onDeleted }: TaskDetailProps) {
value={
expiredAt ? dayjs(expiredAt).format('YYYY-MM-DDTHH:mm') : ''
}
onChange={(e) => setExpiredAt(e.target.value || null)}
onChange={(e) =>
setExpiredAt(e.target.value ? new Date(e.target.value) : null)
}
className="w-full p-2 border rounded bg-input-background border-input-border text-foreground"
/>
) : (
Expand Down
38 changes: 19 additions & 19 deletions src/app/_components/TaskList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { SortOrder, TaskSortKey, TaskStatus } from '@/_hooks/types';
import { SortOrder, type TaskEdge, TaskSortKey, TaskStatus } from '$/types';
import { useGetTasks } from '@/_hooks/useTasks';
import { useState } from 'react';

Expand All @@ -12,14 +12,14 @@ interface TaskListProps {
export function TaskList({ onTaskSelect, refreshTrigger = 0 }: TaskListProps) {
const [page, setPage] = useState(1);
const [perPage, setPerPage] = useState(10);
const [sortKey, setSortKey] = useState<TaskSortKey>(TaskSortKey.ID);
const [sortOrder, setSortOrder] = useState<SortOrder>(SortOrder.ASC);
const [sortKey, setSortKey] = useState<TaskSortKey>(TaskSortKey.Id);
const [sortOrder, setSortOrder] = useState<SortOrder>(SortOrder.Asc);
const [searchQuery, setSearchQuery] = useState('');
const [activeSearchQuery, setActiveSearchQuery] = useState('');
const [selectedStatuses, setSelectedStatuses] = useState<TaskStatus[]>([
TaskStatus.PLANNED,
TaskStatus.IN_PROGRESS,
TaskStatus.EXPIRED,
TaskStatus.Planned,
TaskStatus.InProgress,
TaskStatus.Expired,
]);

const { loading, error, data } = useGetTasks(
Expand Down Expand Up @@ -62,7 +62,7 @@ export function TaskList({ onTaskSelect, refreshTrigger = 0 }: TaskListProps) {
};

const handleOrderChange = () => {
setSortOrder(sortOrder === SortOrder.ASC ? SortOrder.DESC : SortOrder.ASC);
setSortOrder(sortOrder === SortOrder.Asc ? SortOrder.Desc : SortOrder.Asc);
};

const handleSearch = (event: React.FormEvent<HTMLFormElement>) => {
Expand Down Expand Up @@ -93,7 +93,7 @@ export function TaskList({ onTaskSelect, refreshTrigger = 0 }: TaskListProps) {
</div>
);

const tasks = data?.tasks.edges || [];
const tasks: TaskEdge[] = data?.tasks.edges || [];

return (
<div className="w-full">
Expand Down Expand Up @@ -124,16 +124,16 @@ export function TaskList({ onTaskSelect, refreshTrigger = 0 }: TaskListProps) {
onChange={handleSortChange}
className="p-2 border rounded bg-input-background border-input-border text-foreground"
>
<option value={TaskSortKey.ID}>ID</option>
<option value={TaskSortKey.TITLE}>Title</option>
<option value={TaskSortKey.Id}>ID</option>
<option value={TaskSortKey.Title}>Title</option>
</select>
</div>
<button
type="button"
onClick={handleOrderChange}
className="px-3 py-1 border rounded flex items-center gap-1 bg-button-secondary text-button-secondary-text border-input-border"
>
{sortOrder === SortOrder.ASC ? '↑ Ascending' : '↓ Descending'}
{sortOrder === SortOrder.Asc ? '↑ Ascending' : '↓ Descending'}
</button>
</div>

Expand All @@ -143,35 +143,35 @@ export function TaskList({ onTaskSelect, refreshTrigger = 0 }: TaskListProps) {
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
checked={selectedStatuses.includes(TaskStatus.PLANNED)}
onChange={() => handleStatusToggle(TaskStatus.PLANNED)}
checked={selectedStatuses.includes(TaskStatus.Planned)}
onChange={() => handleStatusToggle(TaskStatus.Planned)}
className="rounded text-primary-600 focus:ring-primary-500"
/>
<span>Planned</span>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
checked={selectedStatuses.includes(TaskStatus.IN_PROGRESS)}
onChange={() => handleStatusToggle(TaskStatus.IN_PROGRESS)}
checked={selectedStatuses.includes(TaskStatus.InProgress)}
onChange={() => handleStatusToggle(TaskStatus.InProgress)}
className="rounded text-primary-600 focus:ring-primary-500"
/>
<span>In Progress</span>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
checked={selectedStatuses.includes(TaskStatus.COMPLETED)}
onChange={() => handleStatusToggle(TaskStatus.COMPLETED)}
checked={selectedStatuses.includes(TaskStatus.Completed)}
onChange={() => handleStatusToggle(TaskStatus.Completed)}
className="rounded text-primary-600 focus:ring-primary-500"
/>
<span>Completed</span>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
checked={selectedStatuses.includes(TaskStatus.EXPIRED)}
onChange={() => handleStatusToggle(TaskStatus.EXPIRED)}
checked={selectedStatuses.includes(TaskStatus.Expired)}
onChange={() => handleStatusToggle(TaskStatus.Expired)}
className="rounded text-primary-600 focus:ring-primary-500"
/>
<span>Expired</span>
Expand Down
60 changes: 0 additions & 60 deletions src/app/_hooks/types.ts

This file was deleted.

Loading