fix: inquiry edit form - make customer fields read-only
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m18s
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m18s
P1-04: Inquiry 수정 계약 확정 - 화면과 저장 필드 불일치 제거 Problem: InquiryEdit showed editable fields for Name/Phone/Email/Message, but UpdateInquiryDto only saved Status/AdminMemo. Users could edit fields that had no effect on save - the 'false affordance' anti-pattern. Solution: - Add IsEditMode parameter to InquiryForm - When IsEditMode=true: bind Name/Phone/Email/Message as ReadOnly (disabled input) - Update InquiryEdit to pass IsEditMode="true" - InquiryCreate passes default false, keeping all fields editable Result: Edit mode now clearly shows which fields are modifiable (Status, AdminMemo) vs. informational (customer contact details, message text). UI matches API contract. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,20 +5,20 @@
|
||||
<MudForm @ref="form">
|
||||
<AdminFormSection Title="연락처" Description="고객 식별과 기본 회신 정보입니다." CssClass="mb-4">
|
||||
<MudTextField @bind-Value="model.Name" Label="이름"
|
||||
Variant="Variant.Outlined" Class="mb-4" Required="true" />
|
||||
Variant="Variant.Outlined" Class="mb-4" Required="true" ReadOnly="@IsEditMode" />
|
||||
|
||||
<MudTextField @bind-Value="model.Phone" Label="전화번호 (예: 010-1234-5678)"
|
||||
Variant="Variant.Outlined" Class="mb-4" Required="true" />
|
||||
Variant="Variant.Outlined" Class="mb-4" Required="true" ReadOnly="@IsEditMode" />
|
||||
|
||||
<MudTextField @bind-Value="model.Email" Label="이메일"
|
||||
Variant="Variant.Outlined" Class="mb-4" InputType="InputType.Email" />
|
||||
Variant="Variant.Outlined" Class="mb-4" InputType="InputType.Email" ReadOnly="@IsEditMode" />
|
||||
</AdminFormSection>
|
||||
|
||||
<AdminFormSection Title="문의 내용" Description="운영 분류와 처리 메모를 함께 관리합니다." CssClass="mb-4">
|
||||
<CommonCodeSelect @bind-Value="model.ServiceType" Group="INQUIRY_SERVICE_TYPE" Label="문의 유형" Class="mb-4" />
|
||||
<AdminFormSection Title="문의 내용" Description="@(IsEditMode ? "상태와 메모만 변경 가능합니다." : "운영 분류와 처리 메모를 함께 관리합니다.")" CssClass="mb-4">
|
||||
<CommonCodeSelect @bind-Value="model.ServiceType" Group="INQUIRY_SERVICE_TYPE" Label="문의 유형" Class="mb-4" Disabled="@IsEditMode" />
|
||||
|
||||
<MudTextField @bind-Value="model.Message" Label="문의 내용"
|
||||
Variant="Variant.Outlined" Lines="5" Class="mb-4" Required="true" />
|
||||
Variant="Variant.Outlined" Lines="5" Class="mb-4" Required="true" ReadOnly="@IsEditMode" />
|
||||
|
||||
<CommonCodeSelect @bind-Value="model.Status" Group="INQUIRY_STATUS" Label="상태" Class="mb-4" />
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
[Parameter]
|
||||
public InquiryFormModel? InitialData { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool IsEditMode { get; set; } = false;
|
||||
|
||||
private MudForm? form;
|
||||
private InquiryFormModel model = new();
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
else
|
||||
{
|
||||
<MudPaper Class="pa-4 mt-4" Elevation="1">
|
||||
<InquiryForm ButtonText="수정" InitialData="formModel" OnSubmit="HandleUpdate" OnCancel="GoBack" />
|
||||
<InquiryForm ButtonText="수정" InitialData="formModel" OnSubmit="HandleUpdate" OnCancel="GoBack" IsEditMode="true" />
|
||||
|
||||
<MudDivider Class="my-4" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user