From 66bedca98b5e484f7413174727b7bc89094a40d0 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Mon, 30 May 2022 03:36:51 +0000 Subject: [PATCH] fix: util code editor --- ux/.eslintrc.js | 2 +- ux/package.json | 14 +- ux/src/components/UserEditOverlay.vue | 12 +- ux/src/components/UtilCodeEditor.vue | 180 ++++++++++++++------------ ux/yarn.lock | 148 +++++++++++---------- 5 files changed, 186 insertions(+), 170 deletions(-) diff --git a/ux/.eslintrc.js b/ux/.eslintrc.js index dff451c7..037260f2 100644 --- a/ux/.eslintrc.js +++ b/ux/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { // Uncomment any of the lines below to choose desired strictness, // but leave only one uncommented! // See https://eslint.vuejs.org/rules/#available-rules - 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) + // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) diff --git a/ux/package.json b/ux/package.json index ab219231..22dc0752 100644 --- a/ux/package.json +++ b/ux/package.json @@ -11,8 +11,8 @@ "lint": "eslint --ext .js,.vue ./" }, "dependencies": { - "@apollo/client": "3.6.4", - "@codemirror/autocomplete": "0.20.1", + "@apollo/client": "3.6.5", + "@codemirror/autocomplete": "0.20.2", "@codemirror/basic-setup": "0.20.0", "@codemirror/closebrackets": "0.19.2", "@codemirror/commands": "0.20.0", @@ -61,7 +61,7 @@ "apollo-upload-client": "17.0.0", "browser-fs-access": "0.29.5", "clipboard": "2.0.11", - "filesize": "8.0.7", + "filesize": "9.0.0", "filesize-parser": "1.5.0", "graphql": "16.5.0", "graphql-tag": "2.12.6", @@ -71,10 +71,10 @@ "luxon": "2.4.0", "pinia": "2.0.14", "pug": "3.0.2", - "quasar": "2.7.0", + "quasar": "2.7.1", "tippy.js": "6.3.7", "uuid": "8.3.2", - "v-network-graph": "0.5.16", + "v-network-graph": "0.5.17", "vue": "3.2.31", "vue-codemirror": "5.0.1", "vue-i18n": "9.1.10", @@ -84,7 +84,7 @@ }, "devDependencies": { "@intlify/vite-plugin-vue-i18n": "3.4.0", - "@quasar/app-vite": "1.0.0", + "@quasar/app-vite": "1.0.1", "@types/lodash": "4.14.182", "autoprefixer": "10.4.7", "eslint": "8.16.0", @@ -92,7 +92,7 @@ "eslint-plugin-import": "2.26.0", "eslint-plugin-n": "15.2.0", "eslint-plugin-promise": "6.0.0", - "eslint-plugin-vue": "8.7.1" + "eslint-plugin-vue": "9.0.1" }, "engines": { "node": "^18 || ^16", diff --git a/ux/src/components/UserEditOverlay.vue b/ux/src/components/UserEditOverlay.vue index 9791f576..07ea135d 100644 --- a/ux/src/components/UserEditOverlay.vue +++ b/ux/src/components/UserEditOverlay.vue @@ -414,9 +414,10 @@ q-layout(view='hHh lpR fFf', container) q-item q-item-section q-no-ssr(:placeholder='t(`common.loading`)') - codemirror.metadata-codemirror( + util-code-editor.admin-theme-cm( v-model='metadata' - :extensions='[json()]' + language='json' + :min-height='500' ) q-page(v-else-if='route.params.section === `operations`') @@ -504,9 +505,7 @@ import { useAdminStore } from 'src/stores/admin' import { useDataStore } from 'src/stores/data' import UserChangePwdDialog from './UserChangePwdDialog.vue' -import { Codemirror } from 'vue-codemirror' -import { json } from '@codemirror/lang-json' -// import { oneDark } from '@codemirror/theme-one-dark' +import UtilCodeEditor from './UtilCodeEditor.vue' // QUASAR @@ -822,8 +821,7 @@ onMounted(() => {