feat(web): restore legacy channel editor
This commit is contained in:
@@ -136,8 +136,12 @@ for (const required of ['status-online-dot', 'status-upgrade', 'status-system',
|
||||
if (!statusbarSource.includes(required)) failures.push(`project statusbar must restore ${required}`)
|
||||
}
|
||||
|
||||
const newChannelSource = readFileSync('src/pages/projects/project-new-channel.tsx', 'utf8')
|
||||
for (const required of ['保存频道', '频道名称', '频道类型', '链接地址', '创建后可接入的内容']) {
|
||||
if (!newChannelSource.includes(required)) failures.push(`new channel page must restore ${required}`)
|
||||
}
|
||||
|
||||
const unsupportedControls = [
|
||||
{ file: 'src/pages/projects/project-new-channel.tsx', required: '暂未开放', forbidden: ['保存频道', '<Input', '<Select', '<TextArea'] },
|
||||
{ file: 'src/pages/projects/project-topbar.tsx', forbidden: ['停靠左边', '停靠右边', 'DockIcon', 'isDesktopRuntime'] },
|
||||
]
|
||||
for (const check of unsupportedControls) {
|
||||
|
||||
@@ -229,6 +229,8 @@ for (const channel of [
|
||||
foundPage: Boolean(pageNode),
|
||||
heading,
|
||||
activeChannel,
|
||||
inputCount: pageNode?.querySelectorAll('input, textarea').length ?? 0,
|
||||
hasSaveChannel: [...(pageNode?.querySelectorAll('button') ?? [])].some((button) => button.textContent?.includes('保存频道')),
|
||||
}
|
||||
}, channel))
|
||||
}
|
||||
@@ -403,6 +405,9 @@ for (const check of channelPageChecks) {
|
||||
if (!check.activeChannel.includes(check.label)) {
|
||||
failures.push(`expected ${check.label} sidebar button to stay active, got ${JSON.stringify(check.activeChannel)}`)
|
||||
}
|
||||
if (check.label === '新建频道' && (check.inputCount < 4 || !check.hasSaveChannel)) {
|
||||
failures.push(`expected legacy new channel editor, got inputs=${check.inputCount}, save=${check.hasSaveChannel}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (failures.length) {
|
||||
|
||||
Reference in New Issue
Block a user