Skip to content

Conversation

@Kubosaka
Copy link
Collaborator

@Kubosaka Kubosaka commented Aug 28, 2025

対応Issue

新機能実装のためissueなし

概要

ユーザーが複数の部門に所属できる機能を実装しました。部門管理ページの新規作成とユーザー管理機能の拡張を行いました。

主な実装内容

1. 部門管理ページの新規作成

  • /pages/divisions/index.tsx - 部門一覧ページ
  • 部門の追加、編集、削除機能
  • 管理者権限チェック
  • モックAPIによる動作確認

2. ユーザー管理の複数部門対応

  • ユーザー一覧で複数部門をタグ形式で表示
  • ユーザー編集モーダルで部門の追加/削除が可能
  • 直感的なUI/UXで部門を管理

3. ナビゲーション改善

  • サイドバーに「管理」セクションを追加
  • 部門管理とユーザー管理へのリンクを配置

技術的詳細

  • 既存のコードパターンに従った実装
  • TypeScriptの型安全性を保持
  • レスポンシブデザイン対応
  • モックデータで動作確認済み

画面スクリーンショット等

部門管理ページ

  • 部門の一覧表示
  • 追加、編集、削除のモーダル操作

ユーザー管理ページ

  • 複数部門のタグ表示
  • 部門管理セクション付きの編集モーダル

テスト項目

  • 部門管理ページへのアクセス(管理者権限)
  • 部門の追加、編集、削除操作
  • ユーザー一覧での複数部門表示
  • ユーザー編集での部門追加/削除操作
  • 権限チェック(一般ユーザーのアクセス制限)
  • レスポンシブデザインの確認

備考

  • 現在はモックAPIで実装
  • 実際のAPI実装時は適切なエンドポイントに変更が必要
  • 既存のユーザー管理機能との互換性を保持

🤖 Generated with Claude Code

image image

Co-Authored-By: Claude noreply@anthropic.com

- 部門管理ページの新規作成
  - 部門の一覧、追加、編集、削除機能
  - 管理者権限チェック
  - モックAPIで動作確認

- ユーザー管理の複数部門対応
  - ユーザー一覧で複数部門をタグ表示
  - ユーザー編集モーダルで部門の追加/削除が可能
  - 直感的なUI/UXで部門管理

- ナビゲーション改善
  - 管理セクションをサイドバーに追加
  - 部門管理とユーザー管理へのアクセス

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Kubosaka Kubosaka changed the title feat: ユーザー複数部門管理機能を実装 feat: ユーザー複数部門管理機能を実装(1/2) Aug 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

複数部門に所属できるユーザー管理機能を実装するPRです。部門管理ページの新規作成と既存ユーザー管理機能の拡張を行いました。

  • 新しい部門管理ページの実装(CRUD操作対応)
  • ユーザー管理での複数部門所属機能の追加
  • ナビゲーションに管理セクションを追加

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pages/users/index.tsx ユーザー一覧で複数部門をタグ表示、モックデータへの変更
pages/divisions/index.tsx 部門管理ページの新規作成(一覧・CRUD機能)
constants/linkItem.tsx ナビゲーションに管理セクション追加
components/users/OpenEditModalButton.tsx 部門情報をpropsに追加
components/users/EditModal.tsx ユーザー編集で複数部門管理機能を実装
components/divisions/OpenEditModalButton.tsx 部門編集モーダルボタンコンポーネント
components/divisions/OpenDeleteModalButton.tsx 部門削除モーダルボタンコンポーネント
components/divisions/OpenAddModalButton.tsx 部門追加モーダルボタンコンポーネント
components/divisions/EditModal.tsx 部門編集モーダルコンポーネント
components/divisions/DeleteModal.tsx 部門削除モーダルコンポーネント
components/divisions/AddModal.tsx 部門追加モーダルコンポーネント
components/common/SideNav.tsx サイドナビゲーションに管理セクション追加

Comment on lines +15 to +23
interface Division {
id: number;
name: string;
}

interface UserWithDivisions extends Omit<User, 'bureauID'> {
bureauID?: number;
divisions?: Division[];
}
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

めちゃ同じDivisionインターフェース定義してるじゃん!!😱 複数ファイルで重複してるのやばたにえんよ〜💦 共通の型定義ファイルに移動してリスペクトしかない!✨

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +75 to +84
console.log('Updating user with divisions:', {
id,
name: data.name,
bureauID: data.bureauID,
roleID: data.roleID,
divisions: data.divisions
});

// 成功時の処理
alert('ユーザーの部門を更新しました');
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.logとalertがあるのは開発中だからわかるけど、プロダクションコードには適切なエラーハンドリングとトースト通知を実装した方がいいぞい〜🚀 ユーザー体験がしぬほど良くなるよ!💕

Copilot uses AI. Check for mistakes.
@Kubosaka Kubosaka closed this Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants