refactor: plugin manager keywords (#3490)

This commit is contained in:
katherinehhh 2024-02-05 14:37:07 +08:00 committed by GitHub
parent ed35a35837
commit a059b27d13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 72 additions and 86 deletions

View File

@ -844,10 +844,11 @@
"Permission denied": "没有权限", "Permission denied": "没有权限",
"Allow add new": "允许新增", "Allow add new": "允许新增",
"Allow selection of existing records": "允许选择已有数据", "Allow selection of existing records": "允许选择已有数据",
"Data model": "数据模型", "Data Model": "数据模型",
"Security": "认证与安全", "Blocks":"区块",
"Action": "操作", "Users & permissions": "用户和权限",
"System": "系统管理", "System management": "系统管理",
"Other": "其他", "System & security":"系统和安全",
"Workflow":"工作流" "Workflow":"工作流",
"Third party services":"第三方服务"
} }

View File

@ -74,24 +74,22 @@ const LocalPlugins = () => {
const [keyword, setKeyword] = useState(null); const [keyword, setKeyword] = useState(null);
const debouncedSearchValue = useDebounce(searchValue, { wait: 100 }); const debouncedSearchValue = useDebounce(searchValue, { wait: 100 });
const keywordList = useMemo(() => { const keyWordlists = [
let keyWordlists = []; 'Data Model',
data?.data.forEach((v) => { 'Fields',
if (v.keywords) { 'Blocks',
keyWordlists = keyWordlists.concat(v.keywords); 'Actions',
} 'Users & permissions',
}); 'Workflow',
keyWordlists.sort((a, b) => { 'System management',
if (a === 'data model') return -1; 'System & security',
if (b === 'data model') return 1; 'Third party services',
return 0; 'Others',
}); ];
return _.uniq(keyWordlists).concat('other');
}, [data?.data]);
const keyWordsfilterList = useMemo(() => { const keyWordsfilterList = useMemo(() => {
const list = keywordList.map((i) => { const list = keyWordlists.map((i) => {
if (i === 'other') { if (i === 'Others') {
const result = data?.data.filter((v) => !v.keywords); const result = data?.data.filter((v) => !v.keywords);
return { return {
key: i, key: i,
@ -105,7 +103,7 @@ const LocalPlugins = () => {
}; };
}); });
return list; return list;
}, [keywordList]); }, [keyWordlists]);
const pluginList = useMemo(() => { const pluginList = useMemo(() => {
let list = filterList[filterIndex]?.list || []; let list = filterList[filterIndex]?.list || [];
@ -198,9 +196,7 @@ const LocalPlugins = () => {
style={{ padding: '3px 0' }} style={{ padding: '3px 0' }}
onClick={() => (item.key !== keyword ? setKeyword(item.key) : setKeyword(null))} onClick={() => (item.key !== keyword ? setKeyword(item.key) : setKeyword(null))}
> >
<a style={{ fontWeight: keyword === item.key ? 'bold' : 'normal' }}> <a style={{ fontWeight: keyword === item.key ? 'bold' : 'normal' }}>{t(item.key)}</a>
{t(item.key?.charAt?.(0).toUpperCase() + item.key?.slice?.(1))}
</a>
</List.Item> </List.Item>
); );
}} }}

View File

@ -9,7 +9,7 @@
"main": "./dist/server/index.js", "main": "./dist/server/index.js",
"homepage": "https://docs.nocobase.com/plugins/acl", "homepage": "https://docs.nocobase.com/plugins/acl",
"homepage.zh-CN": "https://docs-cn.nocobase.com/plugins/acl", "homepage.zh-CN": "https://docs-cn.nocobase.com/plugins/acl",
"keywords":["security","users"], "keywords":["Users & permissions"],
"devDependencies": { "devDependencies": {
"@types/jsonwebtoken": "^8.5.8", "@types/jsonwebtoken": "^8.5.8",
"async-mutex": "^0.3.2", "async-mutex": "^0.3.2",

View File

@ -15,5 +15,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -15,5 +15,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -15,5 +15,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -16,6 +16,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"action" "actions"
] ]
} }

View File

@ -24,5 +24,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["system"] "keywords":["System & security"]
} }

View File

@ -27,5 +27,5 @@
"description": "Basic authentication and authenticator management", "description": "Basic authentication and authenticator management",
"description.zh-CN": "提供基础认证功能和扩展认证器管理功能", "description.zh-CN": "提供基础认证功能和扩展认证器管理功能",
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["security","users"] "keywords":["Users & permissions"]
} }

View File

@ -38,5 +38,5 @@
"@nocobase/test": "0.x", "@nocobase/test": "0.x",
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"keywords":["system"] "keywords":["System management"]
} }

View File

@ -38,6 +38,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"block" "Blocks"
] ]
} }

View File

@ -24,5 +24,5 @@
"react-router-dom": "6.x" "react-router-dom": "6.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["security","users"] "keywords":["Users & permissions"]
} }

View File

@ -23,5 +23,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["field"] "keywords":["Fields"]
} }

View File

@ -23,5 +23,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["data model"] "keywords":["Data Model"]
} }

View File

@ -23,5 +23,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -34,5 +34,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["block"] "keywords":["Blocks"]
} }

View File

@ -8,5 +8,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["pm"] "keywords":["system"]
} }

View File

@ -17,5 +17,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["field"] "keywords":["Fields"]
} }

View File

@ -28,5 +28,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -26,5 +26,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["field"] "keywords":["Fields"]
} }

View File

@ -18,5 +18,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["block"] "keywords":["Blocks"]
} }

View File

@ -36,5 +36,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["data model"] "keywords":["Data Model"]
} }

View File

@ -26,5 +26,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["block"] "keywords":["Blocks"]
} }

View File

@ -35,5 +35,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["action"] "keywords":["Actions"]
} }

View File

@ -15,5 +15,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["block"] "keywords":["Blocks"]
} }

View File

@ -21,6 +21,5 @@
"displayName.zh-CN": "多语言管理", "displayName.zh-CN": "多语言管理",
"description": "Allows to manage localization resources of the application.", "description": "Allows to manage localization resources of the application.",
"description.zh-CN": "支持管理应用程序的多语言资源。", "description.zh-CN": "支持管理应用程序的多语言资源。",
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde"
"keywords":["system"]
} }

View File

@ -20,5 +20,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["system"] "keywords":["System & security"]
} }

View File

@ -37,5 +37,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["block"] "keywords":["Blocks"]
} }

View File

@ -20,5 +20,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["field"] "keywords":["Fields"]
} }

View File

@ -24,5 +24,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["system"] "keywords":["System management"]
} }

View File

@ -16,6 +16,5 @@
"@nocobase/test": "0.x", "@nocobase/test": "0.x",
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde"
"keywords":["system"]
} }

View File

@ -30,5 +30,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["security","users"] "keywords":["Users & permissions"]
} }

View File

@ -28,5 +28,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords":["security","users"] "keywords":["Users & permissions"]
} }

View File

@ -31,6 +31,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"field" "Fields"
] ]
} }

View File

@ -26,8 +26,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords":["Users & permissions"]
"security",
"users"
]
} }

View File

@ -28,6 +28,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"field" "Fields"
] ]
} }

View File

@ -16,7 +16,5 @@
"@nocobase/test": "0.x" "@nocobase/test": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords":["System management"]
"system"
]
} }

View File

@ -33,7 +33,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords":["System management"]
"system"
]
} }

View File

@ -19,6 +19,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"system" "System & security"
] ]
} }

View File

@ -26,6 +26,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"system" "System & security"
] ]
} }

View File

@ -25,7 +25,5 @@
"@nocobase/utils": "0.x" "@nocobase/utils": "0.x"
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords":["Users & permissions"]
"users"
]
} }

View File

@ -33,6 +33,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"system" "Third party services"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -32,6 +32,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -32,6 +32,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -24,6 +24,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }

View File

@ -23,6 +23,6 @@
}, },
"gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde", "gitHead": "979a9c59a98c61a2287dd847580746a9b597cbde",
"keywords": [ "keywords": [
"workflow" "Workflow"
] ]
} }