This commit is contained in:
@@ -197,7 +197,9 @@ describe('SystemSettingsView', () => {
|
||||
expect(html).not.toContain(removed)
|
||||
// 需求(2026-10-14 收敛):数据源配置只剩两个入口 —— dws 导入(按当前钉钉账号发现)
|
||||
// 与 PP 导入;AList/静态钉钉知识库等来源类型不再出现在这里(也没有折叠开关兜着)。
|
||||
for (const hidden of ['公司级技术支持知识库', '专用浏览器扫码会话', '显示 AList/钉钉知识库来源'])
|
||||
expect(html).toContain('公司级技术支持知识库')
|
||||
expect(html).toContain('dws 共享授权')
|
||||
for (const hidden of ['专用浏览器扫码会话', '显示 AList/钉钉知识库来源'])
|
||||
expect(html).not.toContain(hidden)
|
||||
// 统一入口后不再按类型分标题:PP 与钉钉共用同一张清单与同一个添加向导。
|
||||
expect(html).not.toContain('PP 导入')
|
||||
@@ -289,11 +291,9 @@ describe('SystemSettingsView', () => {
|
||||
expect(servicesHtml).toContain('端点探测:暂无真实探测结果')
|
||||
// V1: left-nav section controls, per-source schedule editing, danger modal & history affordances.
|
||||
expect(html).toContain('settings-nav')
|
||||
// 非 PP 来源在这里根本不渲染卡片:连它们卡片上的调度、停用、修订入口一起消失。
|
||||
for (const gone of ['查看修订历史', '保存并启用调度', '停用来源', '下次自动刷新']) expect(html).not.toContain(gone)
|
||||
expect(html).toContain('本页只列 PP 来源')
|
||||
// 手工来源(本地手工验收)也不再列在这里,它的专属提示自然不出现。
|
||||
expect(html).not.toContain('本地手工导入来源不支持定时刷新')
|
||||
for (const kept of ['查看修订历史', '保存并启用调度', '停用来源', '下次自动刷新']) expect(html).toContain(kept)
|
||||
expect(html).not.toContain('本页只列 PP 来源')
|
||||
expect(html).toContain('本地手工导入来源不支持定时刷新')
|
||||
// dead buttons removed
|
||||
expect(html).not.toContain('添加内容源')
|
||||
expect(html).not.toContain('管理员编辑')
|
||||
@@ -551,13 +551,12 @@ describe('SystemSettingsView 数据源配置的默认清单', () => {
|
||||
/>
|
||||
</AuthContext.Provider>
|
||||
)
|
||||
it('只有两个入口:PP 来源列在 PP 导入下,AList/钉钉知识库/手工都不出现', () => {
|
||||
it('统一来源清单显示已接入的 PP 和钉钉来源,不依赖目录快照', () => {
|
||||
const html = view()
|
||||
expect(html).toContain('PP资料下载中心')
|
||||
expect(html).toContain('PP 资料下载中心')
|
||||
// 三个非 PP 来源一个都不该渲染,也没有任何折叠开关。
|
||||
for (const hidden of ['国内工业', 'ATOM知识库', '本地手工验收', '显示 AList', '折叠'])
|
||||
expect(html).not.toContain(hidden)
|
||||
for (const name of ['国内工业', 'ATOM知识库']) expect(html).toContain(name)
|
||||
expect(html).not.toContain('显示 AList')
|
||||
// 统一入口:一个「+ 添加数据源」向导,不再有按类型分家的 dws 导入面板标题。
|
||||
expect(html).toContain('+ 添加数据源')
|
||||
expect(html).not.toContain('PP 导入')
|
||||
|
||||
@@ -77,7 +77,7 @@ export const ppSourceConnections = (connections: SourceConnectionListItem[]) =>
|
||||
connections.filter((item) => item.source_type === 'pp')
|
||||
|
||||
const sourceAuthLabels: Record<string, string> = {
|
||||
dingtalk: '专用浏览器扫码会话',
|
||||
dingtalk: 'dws 共享授权',
|
||||
pp: '公开只读访问',
|
||||
alist: '直连 API Token',
|
||||
manual: '离线导入,无在线认证',
|
||||
@@ -358,8 +358,8 @@ export function SystemSettingsView({
|
||||
)
|
||||
const [dirty, setDirty] = useState(false)
|
||||
|
||||
// 本页只列 PP 来源;dws 导入由下面的发现面板负责(其余类型已归档下架,未删除)。
|
||||
const ppConnections = ppSourceConnections(connections)
|
||||
// 统一入口后,清单里列全部来源(钉钉知识库 / 钉盘 / PP),不再只显示 PP。
|
||||
const listedConnections = connections
|
||||
|
||||
useEffect(() => {
|
||||
if (!settings) return
|
||||
@@ -444,9 +444,9 @@ export function SystemSettingsView({
|
||||
/>
|
||||
) : null}
|
||||
<div className="settings-source-group" id="settings-sources-pp">
|
||||
{ppConnections.length ? (
|
||||
{listedConnections.length ? (
|
||||
<div className="settings-source-list">
|
||||
{ppConnections.map((connection) => (
|
||||
{listedConnections.map((connection) => (
|
||||
<SourceSettingsCard
|
||||
key={connection.id}
|
||||
connection={connection}
|
||||
@@ -458,7 +458,7 @@ export function SystemSettingsView({
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="empty-state">本页只列 PP 来源;现在还没有已接入的 PP 来源。</div>
|
||||
<div className="empty-state">还没有已接入的来源:用上面的「+ 添加数据源」加入。</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user