收口反馈页输入字段
将反馈页问题描述迁移到 PlatformTextField 将反馈页联系电话迁移到 PlatformTextField 将反馈页字段标题迁移到 PlatformFieldLabel 补充反馈页公共输入字段断言 更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
@@ -25,11 +25,25 @@ test('PlatformFeedbackView renders reference feedback fields', () => {
|
||||
|
||||
expect(screen.getByText('帮助与反馈')).toBeTruthy();
|
||||
expect(screen.getByText('反馈问题')).toBeTruthy();
|
||||
expect(screen.getByLabelText('问题描述')).toBeTruthy();
|
||||
const descriptionField = screen.getByLabelText('问题描述');
|
||||
expect(descriptionField).toBeTruthy();
|
||||
expect(descriptionField.tagName).toBe('TEXTAREA');
|
||||
expect(descriptionField.className).toContain('platform-text-field');
|
||||
expect(descriptionField.className).toContain('!bg-transparent');
|
||||
expect(screen.getByText('问题描述').className).toContain(
|
||||
'text-[var(--platform-text-strong)]',
|
||||
);
|
||||
expect(screen.getByText('0/200')).toBeTruthy();
|
||||
expect(screen.getByText('上传凭证(提供问题截图)')).toBeTruthy();
|
||||
expect(screen.getByText('上传凭证')).toBeTruthy();
|
||||
expect(screen.getByLabelText('联系电话')).toBeTruthy();
|
||||
const contactPhoneField = screen.getByLabelText('联系电话');
|
||||
expect(contactPhoneField).toBeTruthy();
|
||||
expect(contactPhoneField.tagName).toBe('INPUT');
|
||||
expect(contactPhoneField.className).toContain('platform-text-field');
|
||||
expect(contactPhoneField.className).toContain('!bg-transparent');
|
||||
expect(screen.getByText('联系电话').className).toContain(
|
||||
'text-[var(--platform-text-strong)]',
|
||||
);
|
||||
expect(screen.getByRole('button', { name: '提交' })).toBeTruthy();
|
||||
const feedbackHistoryButton = screen.getByRole('button', {
|
||||
name: '查看反馈与投诉记录',
|
||||
|
||||
@@ -3,8 +3,10 @@ import { useRef, useState } from 'react';
|
||||
|
||||
import type { ProfileFeedbackEvidenceItemInput } from '../../../packages/shared/src/contracts/runtime';
|
||||
import { PlatformActionButton } from '../common/PlatformActionButton';
|
||||
import { PlatformFieldLabel } from '../common/PlatformFieldLabel';
|
||||
import { PlatformStatusMessage } from '../common/PlatformStatusMessage';
|
||||
import { PlatformSubpanel } from '../common/PlatformSubpanel';
|
||||
import { PlatformTextField } from '../common/PlatformTextField';
|
||||
import { PlatformUploadPreviewCard } from '../common/PlatformUploadPreviewCard';
|
||||
import { PlatformUploadTile } from '../common/PlatformUploadTile';
|
||||
|
||||
@@ -243,17 +245,25 @@ export function PlatformFeedbackView({
|
||||
<PlatformSubpanel radius="md">
|
||||
<label
|
||||
htmlFor="profile-feedback-description"
|
||||
className="block text-base font-semibold text-[var(--platform-text-strong)]"
|
||||
className="block"
|
||||
>
|
||||
问题描述
|
||||
<PlatformFieldLabel
|
||||
variant="form"
|
||||
className="mb-0 text-base font-semibold"
|
||||
>
|
||||
问题描述
|
||||
</PlatformFieldLabel>
|
||||
</label>
|
||||
<textarea
|
||||
<PlatformTextField
|
||||
variant="textarea"
|
||||
id="profile-feedback-description"
|
||||
value={description}
|
||||
maxLength={MAX_FEEDBACK_DESCRIPTION_LENGTH}
|
||||
onChange={(event) => updateDescription(event.target.value)}
|
||||
placeholder="请填写10个字以上的问题描述以便我们提供更好的帮助,温馨提醒您请勿填写身份证号等个人隐私信息。"
|
||||
className="mt-3 min-h-[10.5rem] w-full resize-none border-0 bg-transparent text-sm leading-6 text-[var(--platform-text-strong)] outline-none placeholder:text-[var(--platform-text-soft)]"
|
||||
density="roomy"
|
||||
size="md"
|
||||
className="mt-3 min-h-[10.5rem] !rounded-none !border-0 !bg-transparent !px-0 !py-0 text-[var(--platform-text-strong)] placeholder:text-[var(--platform-text-soft)] focus:!bg-transparent focus:!ring-0"
|
||||
/>
|
||||
<div className="text-right text-xs text-[var(--platform-text-soft)]">
|
||||
{descriptionLength}/{MAX_FEEDBACK_DESCRIPTION_LENGTH}
|
||||
@@ -295,18 +305,25 @@ export function PlatformFeedbackView({
|
||||
<PlatformSubpanel radius="md">
|
||||
<label
|
||||
htmlFor="profile-feedback-phone"
|
||||
className="block text-base font-semibold text-[var(--platform-text-strong)]"
|
||||
className="block"
|
||||
>
|
||||
联系电话
|
||||
<PlatformFieldLabel
|
||||
variant="form"
|
||||
className="mb-0 text-base font-semibold"
|
||||
>
|
||||
联系电话
|
||||
</PlatformFieldLabel>
|
||||
</label>
|
||||
<input
|
||||
<PlatformTextField
|
||||
id="profile-feedback-phone"
|
||||
type="tel"
|
||||
value={contactPhone}
|
||||
maxLength={MAX_CONTACT_PHONE_LENGTH}
|
||||
onChange={(event) => updateContactPhone(event.target.value)}
|
||||
placeholder="选填,如您填写则将会同步开发者与您联系"
|
||||
className="mt-3 w-full border-0 bg-transparent text-sm leading-6 text-[var(--platform-text-strong)] outline-none placeholder:text-[var(--platform-text-soft)]"
|
||||
size="md"
|
||||
density="compact"
|
||||
className="mt-3 !rounded-none !border-0 !bg-transparent !px-0 !py-0 text-[var(--platform-text-strong)] placeholder:text-[var(--platform-text-soft)] focus:!bg-transparent focus:!ring-0"
|
||||
/>
|
||||
</PlatformSubpanel>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user