diff --git a/packages/canyon-backend/package.json b/packages/canyon-backend/package.json index 36a61fe0..156ddc3e 100755 --- a/packages/canyon-backend/package.json +++ b/packages/canyon-backend/package.json @@ -7,17 +7,8 @@ "license": "UNLICENSED", "scripts": { "build": "nest build", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", - "start:dev": "nest start --watch", - "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", - "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "test": "jest", - "test:watch": "jest --watch", - "test:cov": "jest --coverage", - "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json", + "dev-backend": "nest start --watch", "preinstall": "prisma generate && nest build", "migrate": "prisma migrate dev" }, diff --git a/packages/canyon-platform/package.json b/packages/canyon-platform/package.json index 9ad61fdd..58c75dbb 100644 --- a/packages/canyon-platform/package.json +++ b/packages/canyon-platform/package.json @@ -33,6 +33,7 @@ "i18next": "^23.8.2", "i18next-browser-languagedetector": "^7.2.0", "monaco-editor": "^0.46.0", + "monaco-themes": "^0.4.4", "query-string": "^9.0.0", "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", diff --git a/packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx b/packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx index e5a4f4c4..0fe692b2 100644 --- a/packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx +++ b/packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx @@ -92,7 +92,7 @@ const CanyonReportCoverageDetail = ({ data, theme }) => { })} /> { - const [value, setValue] = useState<{ text: string; color: string }[]>([]); - return ( -
- - i.text).join(',')} - onChange={(val) => { - setValue( - val.target.value.split(',').map((item) => { - return { text: item, color: value.find((i) => i.text === item)?.color || '#000000' }; - }), - ); - }} - /> - {value.map((item, index) => { - return ( -
- {item.text} - {color.toHexString()}} - onChange={(color) => { - setValue((prev) => { - prev[index].color = color.toHexString(); - return [...prev]; - }); - }} - /> -
- ); - })} -
- ); -}; - -export default TagSelect; diff --git a/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/ConfigRule.tsx b/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/ConfigRule.tsx deleted file mode 100644 index 4522cff1..00000000 --- a/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/ConfigRule.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { ExperimentOutlined, FileAddFilled, PlusOutlined } from '@ant-design/icons'; -import { useMutation } from '@apollo/client'; -import { Editor } from '@monaco-editor/react'; -import { Button, ConfigProvider, Space } from 'antd'; -import { useParams } from 'react-router-dom'; - -import { UpdateProjectDocument } from '../../../../../../helpers/backend/gen/graphql.ts'; -const gridStyle: any = { - width: '100%', -}; - -const ConfigRule = ({ rules }) => { - const [activedName, setActivedName] = useState(''); - const [dataSource, setDataSource] = useState(JSON.parse(JSON.stringify(rules || []))); - - const columns = [ - { - title: '名称', - dataIndex: 'name', - key: 'name', - }, - { - title: '更新时间', - dataIndex: 'updatedAt', - key: 'updatedAt', - }, - { - title: '编辑', - dataIndex: 'address', - key: 'address', - render(text, record) { - return ( - { - setActivedName(record.name); - }} - > - 编辑 - - ); - }, - }, - ]; - - return ( -
- - - 规则 -
- } - > - - - record.name} - pagination={false} - // size={'small'} - bordered={true} - columns={columns} - dataSource={dataSource} - expandable={{ - expandedRowKeys: [activedName], - onExpand: (expanded, record) => { - if (expanded === false) { - setActivedName(''); - } else { - setActivedName(record.name); - } - }, - expandedRowRender: (record) => ( - { - // se - const d = JSON.parse(JSON.stringify(dataSource)); - d.find((i) => i.name === activedName).config = val || ''; - setDataSource(d); - }} - /> - ), - rowExpandable: (record) => record.name !== 'Not Expandable', - }} - /> - -
- - - - - - - - ); -}; - -export default ConfigRule; diff --git a/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx b/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx index 4fcda5d1..6fdb41d1 100644 --- a/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx +++ b/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx @@ -111,7 +111,7 @@ const ProjectConfigure = () => { theme={ { light: 'light', - dark: 'vs-dark', + dark: 'nightowl', }[localStorage.getItem('theme') || 'light'] } defaultValue={GetProjectByIdDocumentData?.getProjectByID.coverage} diff --git a/packages/canyon-platform/src/useWorker.ts b/packages/canyon-platform/src/useWorker.ts index 2a0079a5..bdeb4f70 100644 --- a/packages/canyon-platform/src/useWorker.ts +++ b/packages/canyon-platform/src/useWorker.ts @@ -25,6 +25,9 @@ self.MonacoEnvironment = { }, }; -loader.config({ monaco }); - -loader.init().then(/* ... */); +import('monaco-themes/themes/Night Owl.json').then((data) => { + // @ts-ignore + monaco.editor.defineTheme('nightowl', data); + loader.config({ monaco }); + loader.init() +});