OperationTypeの表示名をenumにDisplayAttributeで記載する#4162
Merged
KentaHizume merged 2 commits intomainfrom Dec 19, 2025
Hidden character warning
The head ref may contain hidden characters: "feature/OperationType\u306e\u8868\u793a\u540d\u3092enum\u306b\u8a18\u8f09\u3059\u308b"
Merged
Conversation
OperationTypeの各値に日本語の表示名をDisplay属性で付与しました。また、using宣言やnamespace宣言の位置・インデントも整理しました。
Announcement関連3ファイルのGetHistoryHeadingメソッドで、OperationTypeの表示名取得処理をswitch文からGetDisplayName()呼び出しに統一しました。これにより表示名管理の一元化とコードの簡素化を実現しています。
Test Result 📝Test was a success. Coverage 📐Summary
DresscaCMS.Announcement - 4.3%
DresscaCMS.Web - 3.5%
|
Contributor
There was a problem hiding this comment.
Pull request overview
このPRは、OperationType列挙型にDisplayAttributeを追加し、表示名の取得方法をMarisライブラリのGetDisplayName()メソッドを使用するように統一しています。これにより、3つのRazorファイルに散在していた重複したswitch式が削除され、コードの保守性が向上しています。
OperationType列挙型の各値にDisplay属性を追加(None, Create, Update, Delete)- 3つのRazorコンポーネントで重複していた
GetHistoryHeadingメソッドのswitch式をGetDisplayName()メソッドの呼び出しに簡素化 - コードの重複を削減し、表示名の一元管理を実現
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
samples/DresscaCMS/src/DresscaCMS.Announcement/ApplicationCore/OperationType.cs |
System.ComponentModel.DataAnnotationsをインポートし、各enum値に日本語の表示名を持つDisplay属性を追加 |
samples/DresscaCMS/src/DresscaCMS.Web/Components/Pages/AnnouncementEdit.razor |
GetHistoryHeadingメソッドをswitch式からGetDisplayName()呼び出しに簡素化し、変数初期化の空白も修正 |
samples/DresscaCMS/src/DresscaCMS.Web/Components/Pages/AnnouncementDeleteConfirm.razor |
GetHistoryHeadingメソッドをswitch式からGetDisplayName()呼び出しに簡素化 |
samples/DresscaCMS/src/DresscaCMS.Web/Components/Pages/AnnouncementDeleteComplete.razor |
GetHistoryHeadingメソッドをswitch式からGetDisplayName()呼び出しに簡素化 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
KentaHizume
approved these changes
Dec 19, 2025
Contributor
KentaHizume
left a comment
There was a problem hiding this comment.
Enumの数値にマッピングされた文字列が正しく画面に表示されることを確認いたしました。
未定義と削除については画面操作でうまく確認する方法が思いつかなかったため DB側をUPDATEして確認いたしました。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
この Pull request で実施したこと
OperationType列挙型にもMarisのライブラリを利用して表示名を取得するように修正しました。
この Pull request では実施していないこと
なし
Issues や Discussions 、関連する Web サイトなどへのリンク
なし