fix(陶泥儿发布): 灰度未命中占位改成「暂未开放」而非「尚未接入」
- EmptyTab 默认文案「尚未接入」适合真的没实现的目标,灰度未命中却会误导成功能不存在 - EmptyTab 增加可选 message 覆盖文案;陶泥儿命中灰度把关时传「正在灰度中,暂未对你开放」 - 同步 exportGamePublishAvailability 断言并移除不再使用的 Target/TARGET_META 导入
This commit is contained in:
+12
-2
@@ -5,14 +5,24 @@ import { type Target, TARGET_META } from '../model';
|
||||
*
|
||||
* TapTap 目标当前没有内容;陶泥儿发布灰度未命中(读取中 / 读取失败按未命中)时也退化成这里。
|
||||
* 两种情况都仍是正式 tab(可选中、可来回切),不是「点了没反应」。
|
||||
*
|
||||
* 默认文案是「尚未接入」,只适合真的还没实现的目标;已接入但当前账号灰度未命中的目标用
|
||||
* `message` 覆盖成「暂未开放」,避免让用户以为功能不存在。
|
||||
*/
|
||||
export function EmptyTab({ target }: { target: Target }) {
|
||||
export function EmptyTab({
|
||||
target,
|
||||
message,
|
||||
}: {
|
||||
target: Target;
|
||||
/** 覆盖默认「尚未接入」文案;传了就用它当占位文字。 */
|
||||
message?: string;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className="grid h-full min-h-0 place-items-center p-6 text-sm text-(--platform-text-soft)"
|
||||
aria-label={`${TARGET_META[target].label}导出页`}
|
||||
>
|
||||
{`${TARGET_META[target].label}导出页尚未接入`}
|
||||
{message ?? `${TARGET_META[target].label}导出页尚未接入`}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+6
-1
@@ -16,7 +16,12 @@ import { ChatPane } from './chat/Pane';
|
||||
*/
|
||||
export function TaonierPage({ tab }: { tab: TaonierTabState }) {
|
||||
if (!tab.gamePublishEnabled) {
|
||||
return <EmptyTab target={Target.Taonier} />;
|
||||
return (
|
||||
<EmptyTab
|
||||
target={Target.Taonier}
|
||||
message="陶泥儿发布正在灰度中,暂未对你开放"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="grid h-full min-h-0 min-w-0 grid-cols-1 overflow-hidden md:grid-cols-2">
|
||||
|
||||
@@ -12,10 +12,6 @@ import {
|
||||
} from '@testing-library/react';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import {
|
||||
Target,
|
||||
TARGET_META,
|
||||
} from '../src/view/project-development/export/model';
|
||||
import type { TaonierTabState } from '../src/view/project-development/export/state/useTaonierTab';
|
||||
import { TaonierPage } from '../src/view/project-development/export/tabs/taonier/Page';
|
||||
|
||||
@@ -62,7 +58,8 @@ describe('陶泥儿发布灰度开关', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
screen.getByText(`${TARGET_META[Target.Taonier].label}导出页尚未接入`);
|
||||
screen.getByText('陶泥儿发布正在灰度中,暂未对你开放');
|
||||
expect(screen.queryByText(/尚未接入/)).toBeNull();
|
||||
expect(screen.queryByRole('button', { name: '打包并发布' })).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user