Skip to content

Commit

Permalink
Removed the AAS AID protocol error msg
Browse files Browse the repository at this point in the history
Removed the protocol error message, and substituted it for a general warning message in the input section on top of the download button
  • Loading branch information
SergioCasCeb committed Oct 20, 2023
1 parent a3e60cf commit 073b8d5
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/web-new/src/scripts/aas.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ initAASEditor()
AASDownload.addEventListener("click", () => {
const editorData = getEditorData(window.AASEditor)
const contentType = `application/${editorData[0]};charset=utf-8;`
const visualizationName = editorData[2]["submodelElements"][0]["value"][0]["value"]
const visualizationName = editorData[2]["description"][0]["text"]

offerFileDownload(
`${visualizationName}-AAS.${editorData[0]}`,
Expand Down
14 changes: 3 additions & 11 deletions packages/web-new/src/scripts/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import { openApiTab, openApiJsonBtn, openApiYamlBtn, openApiView } from './open-api'
import { asyncApiTab, asyncApiJsonBtn, asyncApiYamlBtn, asyncApiView } from './async-api'
import { AASTab, AASView } from './aas'
import { AASView } from './aas'
import { defaultsView, defaultsJsonBtn, defaultsYamlBtn, defaultsAddBtn } from './defaults'
import { visualize } from './visualize'
import { validationView } from './validation'
Expand Down Expand Up @@ -118,7 +118,8 @@ visualizationOptions.forEach(option => {

case "aas-tab":

enableAPIConversionWithProtocol(editorInstance)
generateAAS(fileType, editorInstance)
AASView.classList.remove("hidden")

break;

Expand Down Expand Up @@ -196,15 +197,6 @@ function enableAPIConversionWithProtocol(editorInstance) {
showConsoleError("Please insert a TD which uses MQTT!")
}
}

if (AASTab.checked === true) {
if (["mqtt", "mqtts", "http", "https", "coap", "modbus"].some(p => protocolSchemes.includes(p))) {
generateAAS(editorInstance["_domElement"].dataset.modeId, editorInstance)
AASView.classList.remove("hidden")
} else {
showConsoleError("Please insert a TD which uses HTTP, MQTT, CoAP or Modbus!")
}
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions packages/web-new/src/styles/_console.scss
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@
overflow-x: hidden;
gap: 1rem;

.warning-txt{
font-size: var(--fs-p);
font-family: var(--ff-primary);
color: var(--clr-neutral-300);
line-height: var(--lh-p);

}

button {
appearance: none;
border: none;
Expand Down
32 changes: 31 additions & 1 deletion packages/web-new/src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
--lh-h1: 4rem;
--lh-h2: 4rem;
--lh-h3: 3.5rem;
--lh-sub-header: 3.25rem;
--lh-sub-header: 3rem;
--lh-p: 1.8rem;
--lh-footer: 1.25rem;
--lh-i: 2rem;
Expand Down Expand Up @@ -982,6 +982,36 @@ main .console {
overflow-x: hidden;
gap: 1rem;
}
.console__content .open-api-view .open-api-inputs .warning-txt,
.console__content .open-api-view .async-api-inputs .warning-txt,
.console__content .open-api-view .aas-inputs .warning-txt,
.console__content .open-api-view .defaults-inputs .warning-txt,
.console__content .open-api-view .visualize-inputs .warning-txt,
.console__content .async-api-view .open-api-inputs .warning-txt,
.console__content .async-api-view .async-api-inputs .warning-txt,
.console__content .async-api-view .aas-inputs .warning-txt,
.console__content .async-api-view .defaults-inputs .warning-txt,
.console__content .async-api-view .visualize-inputs .warning-txt,
.console__content .aas-view .open-api-inputs .warning-txt,
.console__content .aas-view .async-api-inputs .warning-txt,
.console__content .aas-view .aas-inputs .warning-txt,
.console__content .aas-view .defaults-inputs .warning-txt,
.console__content .aas-view .visualize-inputs .warning-txt,
.console__content .defaults-view .open-api-inputs .warning-txt,
.console__content .defaults-view .async-api-inputs .warning-txt,
.console__content .defaults-view .aas-inputs .warning-txt,
.console__content .defaults-view .defaults-inputs .warning-txt,
.console__content .defaults-view .visualize-inputs .warning-txt,
.console__content .visualize-view .open-api-inputs .warning-txt,
.console__content .visualize-view .async-api-inputs .warning-txt,
.console__content .visualize-view .aas-inputs .warning-txt,
.console__content .visualize-view .defaults-inputs .warning-txt,
.console__content .visualize-view .visualize-inputs .warning-txt {
font-size: var(--fs-p);
font-family: var(--ff-primary);
color: var(--clr-neutral-300);
line-height: var(--lh-p);
}
.console__content .open-api-view .open-api-inputs button,
.console__content .open-api-view .async-api-inputs button,
.console__content .open-api-view .aas-inputs button,
Expand Down
2 changes: 1 addition & 1 deletion packages/web-new/src/styles/styles.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/web-new/src/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
--lh-h1: 4rem;
--lh-h2: 4rem;
--lh-h3: 3.5rem;
--lh-sub-header: 3.25rem;
--lh-sub-header: 3rem;
--lh-p: 1.8rem;
--lh-footer: 1.25rem;
--lh-i: 2rem;
Expand Down
1 change: 1 addition & 0 deletions packages/web-new/src/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ <h1>Thing Description Playground <span>- BETA Version</span></h1>
<div class="console-view aas-view hidden" id="aas-view">
<div class="aas-container" id="aas-container"></div>
<div class="aas-inputs">
<p class="warning-txt">*Protocols other than HTTP, MQTT and Modbus are not officially supported by AID, do not use the resulting AID in production*</p>
<div class="view-download">
<button id="aas-download"><i class="fa-solid fa-download"></i>Download</button>
</div>
Expand Down

0 comments on commit 073b8d5

Please sign in to comment.