From 9f01a48998997c855c2b2a7f3e10a240a0e4b786 Mon Sep 17 00:00:00 2001 From: Matthias Eichner Date: Tue, 20 Feb 2024 16:05:09 +0100 Subject: [PATCH] MCR-3043 request changes * add TODO for allow header * rm npm-run-all2 as yarn dep * better documentation * use nextTick instead of setTimeout --- .../src/main/vue/texteditor/README.md | 2 +- .../src/main/vue/texteditor/package.json | 1 - .../texteditor/src/apis/BaseContentHandler.ts | 2 +- .../src/apis/ClassificationsContentHandler.ts | 4 + .../texteditor/src/views/TextEditorView.vue | 28 +++--- .../src/main/vue/texteditor/yarn.lock | 91 +------------------ 6 files changed, 20 insertions(+), 108 deletions(-) diff --git a/mycore-webtools/src/main/vue/texteditor/README.md b/mycore-webtools/src/main/vue/texteditor/README.md index 8991f2c87e..a4748af169 100644 --- a/mycore-webtools/src/main/vue/texteditor/README.md +++ b/mycore-webtools/src/main/vue/texteditor/README.md @@ -9,5 +9,5 @@ yarn ### Compile and Hot-Reload for Development ```sh -npm dev +yarn dev ``` diff --git a/mycore-webtools/src/main/vue/texteditor/package.json b/mycore-webtools/src/main/vue/texteditor/package.json index ab52ebb2ad..45f0cb0562 100644 --- a/mycore-webtools/src/main/vue/texteditor/package.json +++ b/mycore-webtools/src/main/vue/texteditor/package.json @@ -22,7 +22,6 @@ "@types/node": "^20.11.10", "@vitejs/plugin-vue": "^5.0.3", "@vue/tsconfig": "^0.5.1", - "npm-run-all2": "^6.1.1", "typescript": "~5.3.0", "vite": "^5.0.11", "vue-tsc": "^1.8.27" diff --git a/mycore-webtools/src/main/vue/texteditor/src/apis/BaseContentHandler.ts b/mycore-webtools/src/main/vue/texteditor/src/apis/BaseContentHandler.ts index f5465a9c74..a39bb7c9b0 100644 --- a/mycore-webtools/src/main/vue/texteditor/src/apis/BaseContentHandler.ts +++ b/mycore-webtools/src/main/vue/texteditor/src/apis/BaseContentHandler.ts @@ -33,7 +33,7 @@ export abstract class BaseContentHandler implements ContentHandler { if (!response.ok) { throw this.buildError(`Unable get OPTIONS of ${id}.`, response); } - //let allow = response.headers.get("Allow"); + //TODO const allow = response.headers.get("Allow"); const allow = "HEAD,DELETE,GET,OPTIONS,PUT"; if (!allow) { throw new Error(`Unable get OPTIONS of ${id}. Request failed because 'Allow' header is empty.`); diff --git a/mycore-webtools/src/main/vue/texteditor/src/apis/ClassificationsContentHandler.ts b/mycore-webtools/src/main/vue/texteditor/src/apis/ClassificationsContentHandler.ts index ae9f8c3978..4dd02edf18 100644 --- a/mycore-webtools/src/main/vue/texteditor/src/apis/ClassificationsContentHandler.ts +++ b/mycore-webtools/src/main/vue/texteditor/src/apis/ClassificationsContentHandler.ts @@ -42,6 +42,10 @@ export class ClassificationsContentHandler extends BaseContentHandler { } /** + * Prettifies classification xml. This is a workaround as long as the server does not returns a prettified xml by + * itself. + * TODO: remove if not necessary anymore + * * https://stackoverflow.com/questions/376373/pretty-printing-xml-with-javascript * * @param xml xml to prettify diff --git a/mycore-webtools/src/main/vue/texteditor/src/views/TextEditorView.vue b/mycore-webtools/src/main/vue/texteditor/src/views/TextEditorView.vue index aa2e36623b..84638db097 100644 --- a/mycore-webtools/src/main/vue/texteditor/src/views/TextEditorView.vue +++ b/mycore-webtools/src/main/vue/texteditor/src/views/TextEditorView.vue @@ -1,5 +1,5 @@