From 3ed9669de2c5e379278f52a919be5435125fb297 Mon Sep 17 00:00:00 2001 From: Ege Korkan Date: Mon, 9 Oct 2023 11:20:58 +0200 Subject: [PATCH] remove yaml --- packages/web-new/src/scripts/aas.js | 20 +++----------------- packages/web-new/src/scripts/console.js | 10 +--------- packages/web-new/src/template.html | 1 - 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/packages/web-new/src/scripts/aas.js b/packages/web-new/src/scripts/aas.js index b101e8325..7184761f9 100644 --- a/packages/web-new/src/scripts/aas.js +++ b/packages/web-new/src/scripts/aas.js @@ -15,7 +15,7 @@ /** * @file The `aas.js` takes care of the main functionality for the - * AAS/AID feature within the console. This include initializing the editor, + * AAS AID feature within the console. This include initializing the editor, * connecting it to the local storage, as well as the main buttons within the AAS * feature such as json, yaml conversion and the download option. */ @@ -26,13 +26,12 @@ import { generateTD, offerFileDownload } from './util' import { getEditorData } from './editor' /******************************************************************/ -/* ASS functionality */ +/* AAS functionality */ /******************************************************************/ //AAS Elements export const AASTab = document.querySelector(".aas-tab-btn") export const AASJsonBtn = document.querySelector("#aas-json") -export const AASYamlBtn = document.querySelector("#aas-yaml") export const AASView = document.querySelector("#aas-view") const AASDownload = document.querySelector("#aas-download") @@ -63,25 +62,12 @@ async function initAASEditor() { initAASEditor() -//Json conversion btn -AASJsonBtn.addEventListener("click", () => { - generateTD("json", window.AASEditor) - AASJsonBtn.disabled = true - AASYamlBtn.disabled = false -}) - -//Yaml conversion btn -AASYamlBtn.addEventListener("click", () => { - generateTD("yaml", window.AASEditor) - AASJsonBtn.disabled = false - AASYamlBtn.disabled = true -}) //Donwload btn AASDownload.addEventListener("click", () => { const editorData = getEditorData(window.AASEditor) const contentType = `application/${editorData[0]};charset=utf-8;` - const visualizationName = editorData[2]["submodels"][0]["submodelElements"][0]["value"][0]["value"] + const visualizationName = editorData[2]["submodelElements"][0]["value"][0]["value"] offerFileDownload( `${visualizationName}-AAS.${editorData[0]}`, diff --git a/packages/web-new/src/scripts/console.js b/packages/web-new/src/scripts/console.js index be143006b..55857730f 100644 --- a/packages/web-new/src/scripts/console.js +++ b/packages/web-new/src/scripts/console.js @@ -21,7 +21,7 @@ import { openApiTab, openApiJsonBtn, openApiYamlBtn, openApiView } from './open-api' import { asyncApiTab, asyncApiJsonBtn, asyncApiYamlBtn, asyncApiView } from './async-api' -import { AASJsonBtn, AASYamlBtn, AASView } from './aas' +import { AASJsonBtn, AASView } from './aas' import { defaultsView, defaultsJsonBtn, defaultsYamlBtn, defaultsAddBtn } from './defaults' import { visualize } from './visualize' import { validationView } from './validation' @@ -117,14 +117,6 @@ visualizationOptions.forEach(option => { break; case "aas-tab": - if (fileType === "yaml") { - AASJsonBtn.disabled = false - AASYamlBtn.disabled = true - } else { - AASJsonBtn.disabled = true - AASYamlBtn.disabled = false - } - AASView.classList.remove("hidden") generateAAS(fileType, editorInstance) diff --git a/packages/web-new/src/template.html b/packages/web-new/src/template.html index 6686928ed..c6b4c30fe 100644 --- a/packages/web-new/src/template.html +++ b/packages/web-new/src/template.html @@ -445,7 +445,6 @@

Thing Description Playground - BETA Version

-