bbf7ac29bf
The "All" scope of the knowledge-base list renders every card with `:key="kb.id"`. The same knowledge base can appear more than once in the source data — owned *and* shared back to the caller, or shared into their view through two different organizations (distinct share_id, identical knowledge_base.id). Duplicate `v-for` keys corrupt Vue's virtual-DOM patch and the list renders empty/partial. A single KB never collides, so the page works with one KB and blanks once there are two or more — the exact behavior reported in #795. Extract the merge into a pure, unit-tested helper (mergeAllScopeKnowledgeBases) that de-duplicates by knowledge-base id — owned rows win over shared duplicates, and repeated shares of one KB keep the most-privileged permission — while preserving the existing pinned → mine → teammate → shared(editable-first) ordering. Tests use the repo's existing node:test convention; a `test` script is added so `npm test` discovers them (it also wires up the two previously orphaned *.test.ts files). Fixes #795 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68 lines
1.8 KiB
JSON
68 lines
1.8 KiB
JSON
{
|
|
"name": "knowledage-base",
|
|
"version": "0.6.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"build-with-types": "run-p type-check \"build-only {@}\" --",
|
|
"preview": "vite preview",
|
|
"build-only": "vite build",
|
|
"type-check": "vue-tsc --build",
|
|
"test": "node --test"
|
|
},
|
|
"dependencies": {
|
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
"@types/dompurify": "^3.2.0",
|
|
"@types/papaparse": "^5.5.2",
|
|
"@vue-office/pptx": "^1.0.1",
|
|
"axios": "^1.16.0",
|
|
"docx-preview": "^0.3.7",
|
|
"dompurify": "^3.4.2",
|
|
"highlight.js": "^11.11.1",
|
|
"katex": "^0.16.45",
|
|
"marked": "^17.0.5",
|
|
"marked-katex-extension": "^5.1.8",
|
|
"mermaid": "^11.15.0",
|
|
"pagefind": "^1.5.2",
|
|
"papaparse": "^5.5.3",
|
|
"pinia": "^3.0.4",
|
|
"swiper": "^12.1.4",
|
|
"tdesign-icons-vue-next": "0.4.4",
|
|
"tdesign-vue-next": "^1.19.2",
|
|
"vue": "^3.5.34",
|
|
"vue-demi": "^0.14.10",
|
|
"vue-i18n": "^11.4.2",
|
|
"vue-router": "^4.5.0",
|
|
"vue-virtual-scroller": "^2.0.0-beta.8",
|
|
"webpack": "^5.106.2",
|
|
"xlsx": "file:./packages/xlsx-0.20.2.tgz"
|
|
},
|
|
"devDependencies": {
|
|
"@tsconfig/node22": "^22.0.5",
|
|
"@types/node": "^22.14.0",
|
|
"@vitejs/plugin-vue": "6.0.6",
|
|
"@vitejs/plugin-vue-jsx": "5.1.5",
|
|
"@vue/tsconfig": "^0.9.1",
|
|
"less": "^4.6.4",
|
|
"less-loader": "^12.3.2",
|
|
"npm-run-all2": "^8.0.4",
|
|
"typescript": "~6.0.3",
|
|
"vite": "^7.2.2",
|
|
"vue-tsc": "^3.2.8"
|
|
},
|
|
"overrides": {
|
|
"lightningcss": "none",
|
|
"esbuild": "^0.25.0",
|
|
"serialize-javascript": "^7.0.3",
|
|
"tdesign-icons-vue-next": "0.4.4"
|
|
},
|
|
"resolutions": {
|
|
"lightningcss": "none",
|
|
"esbuild": "^0.25.0",
|
|
"serialize-javascript": "^7.0.3",
|
|
"tdesign-icons-vue-next": "0.4.4"
|
|
}
|
|
}
|