Skip to content

Commit

Permalink
fix(portal-web): 修复文件编辑器配置加载路径缺少斜杠的问题 (#991)
Browse files Browse the repository at this point in the history
1. 文件编辑器加载配置文件时未考虑路径问题,导致缺少斜杠

![image](https://github.com/PKUHPC/SCOW/assets/140392039/76f0a998-d7ee-4ef1-9692-e94429a568e6)
2. portal-web 新增开发依赖 fs-extra
  • Loading branch information
Miracle575 authored Nov 21, 2023
1 parent 1c10da5 commit 04e5d68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-shoes-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/portal-web": patch
---

修复文件编辑器配置加载路径缺少斜杠的问题
1 change: 1 addition & 0 deletions apps/portal-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@types/styled-components": "5.1.30",
"@types/url-join": "4.0.3",
"@types/ws": "8.5.9",
"fs-extra": "^11.1.1",
"jest-environment-jsdom": "29.7.0",
"node-mocks-http": "1.13.0",
"postcss": "8.4.31",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { CloseOutlined, FullscreenExitOutlined, FullscreenOutlined } from "@ant-design/icons";
import Editor, { loader } from "@monaco-editor/react";
import { App, Badge, Button, Modal, Space, Spin, Tabs, Tooltip } from "antd";
import { join } from "path";
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { api } from "src/apis";
import { prefix, useI18nTranslateToString } from "src/i18n";
Expand Down Expand Up @@ -95,7 +96,7 @@ const p = prefix("pageComp.fileManagerComp.fileEditModal.");

loader.config({
paths: {
vs: publicConfig.BASE_PATH + "monaco-assets/vs",
vs: join(publicConfig.BASE_PATH ?? "", "/monaco-assets/vs"),
},
});

Expand Down Expand Up @@ -158,7 +159,6 @@ export const FileEditModal: React.FC<Props> = ({ previewFile, setPreviewFile })
const [exitType, setExitType] = useState<ExitType>(ExitType.CLOSE);
const [isFullScreen, setIsFullScreen] = useState(false);


const [options, setOptions] = useState({
readOnly: true,
lineNumbersMinChars: 7,
Expand Down
4 changes: 3 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 04e5d68

Please sign in to comment.