From 8d6d97c55591df11ac9dc93bbacf8f764bcf13ff Mon Sep 17 00:00:00 2001 From: Wojciech Mizia Date: Wed, 22 Jan 2025 14:58:46 +0100 Subject: [PATCH 1/6] only single file on xalan frontend --- .../xml/XmlOutputFieldComponent.vue | 22 ++++++++++++++----- .../xml/XmlTabbedInputComponent.vue | 12 ++++++---- Frontend/src/style.css | 4 ++++ Frontend/src/views/XSLTView.vue | 6 +++-- Frontend/tsconfig.json | 3 ++- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/Frontend/src/components/xml/XmlOutputFieldComponent.vue b/Frontend/src/components/xml/XmlOutputFieldComponent.vue index 2e0adc8..5804712 100644 --- a/Frontend/src/components/xml/XmlOutputFieldComponent.vue +++ b/Frontend/src/components/xml/XmlOutputFieldComponent.vue @@ -7,11 +7,12 @@ const props = defineProps( { tool: {type: String, required: true}, xml: {type: [String, Array], required: true}, - query: {type: String, required: true} + query: {type: String, required: true}, + activeTabId: {type: Number, required: false} } ) -const emit = defineEmits(["update"]); +const emit = defineEmits(["update", "update:engine"]); const result = ref(''); @@ -111,14 +112,16 @@ function prepareURL(): string { const engineEndpoint = engine.value == "libxml" ? "libxml" : "java"; let tool = props.tool; - if (Array.isArray(props.xml) && props.xml.length > 1) + if (Array.isArray(props.xml) && props.xml.length > 1 && engine.value !== "xalan") tool = "multiple/xslt"; return document.location.protocol + "//" + document.location.hostname + "/" + engineEndpoint + "/" + tool; } function selectRequestBodyType() : string { - if (Array.isArray(props.xml) && props.xml.length > 1) + if (Array.isArray(props.xml) && engine.value == "xalan") + return prepareRequestBodySingleXml(props.xml.at(props.activeTabId!)!.data) + else if (Array.isArray(props.xml) && props.xml.length > 1) return prepareRequestBodyMultiXml(); else if (Array.isArray(props.xml)) return prepareRequestBodySingleXml(props.xml.at(0)!.data); @@ -188,6 +191,10 @@ function emitVersionChange() { emit("update", version.value); } +function emitEngineChange() { + emit("update:engine", engine.value); +} + function isVersionSelectionAvailable() { return !(versionsForCurrentEngine.value.length == 1 && versionsForCurrentEngine.value.at(0) == "N/A"); } @@ -202,6 +209,11 @@ function highlightField() { return ""; } +function handleChange() { + changeAvailableVersions(); + emitEngineChange(); +} +