Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable visual editor #442

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tools/api-designer/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>

<title>Rapid API Designer</title>
</head>

Expand Down Expand Up @@ -44,8 +43,10 @@
RSDL editor
</button>
</li>
<!-- Hide Visual Designer-->
<li class="nav-item" role="presentation">
<button
<button
hidden="true"
type="button"
class="nav-link"
id="visual-editor-gui-tab"
Expand All @@ -59,26 +60,28 @@
</button>
</li>
</ul>

<div class="tab-content" id="editorTabContent">
<div
class="tab-pane fade show active"
id="rsdl-editor"
role="tabpanel"
aria-labelledby="swagger-ui-tab"
aria-labelledby="rsdl-editor-tab"
>
<div id="editor" class="mirror-editor"></div>
</div>

<div
class="tab-pane fade"
id="visual-editor-gui"
role="tabpanel"
aria-labelledby="swagger-ui-tab"
aria-labelledby="visual-editor-gui-tab"
>
<div id="visual-editor-gui-content"></div>
</div>
</div>

<!--
</div>
<!-- Hide Mock Service
<div class="row">
<div class="col">
<div class="input-group input-group-sm">
Expand Down Expand Up @@ -114,6 +117,7 @@
</div>
-->
</div>

<div class="col-md-6">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
Expand Down Expand Up @@ -212,6 +216,7 @@
</div>
</div>

<!--URL Editor-->
<div class="my-3">
<label for="uri-editor" class="form-label">
Generate a request here
Expand All @@ -231,6 +236,7 @@
<pre><code id="results" class="language-json"></code></pre>
</div>
-->
<!-- Export -->
<div class="row">
<div class="col">
<div class="dropdown">
Expand Down
9 changes: 6 additions & 3 deletions tools/api-designer/src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
// this was a quick hack, not the best solution
const app = new App();

// RSDL Editor
const rsdlEditor = initRsdlEditor(
document.getElementById("editor"),
(rsdl) => {
Expand All @@ -28,11 +29,12 @@ document.addEventListener("DOMContentLoaded", function (event) {
() => {}
);
app.addListener(
new Listener("urlEditor", (rsdl) =>
urlEditor.updateSchema(rsdl, schemaFormat.rsdl)
)
new Listener("urlEditor", (rsdl) => {
urlEditor.updateSchema(rsdl, schemaFormat.rsdl);
})
);

// Visual Editor
const mermaidEditor = new MermaidEditor(
document.getElementById("visual-editor-gui-content"),
window,
Expand Down Expand Up @@ -62,6 +64,7 @@ document.addEventListener("DOMContentLoaded", function (event) {

app.publishRsdl("main", currentRsdl);

// Export
const dropdown = document.getElementById("export-dropdown");

const downloadToFile = (content, filename, contentType) => {
Expand Down
17 changes: 12 additions & 5 deletions tools/api-explorer/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
Swagger UI
</button>
</li>
<!--
<li class="nav-item" role="presentation">
<button
type="button"
Expand All @@ -100,8 +101,10 @@
Visualize
</button>
</li>
-->
</ul>
<div class="tab-content" id="schemaViewContent">
<!-- CSDL Tab -->
<div
class="tab-pane fade show active"
id="csdl"
Expand All @@ -110,25 +113,29 @@
>
<pre><code id="csdl-desc" class="language-json"></code></pre>
</div>

<!-- Swagger Tab -->
<div
class="tab-pane fade"
id="swagger-ui"
role="tabpanel"
aria-labelledby="swagger-ui-tab"
>
<div>
<div id="swagger-ui-desc"></div>
</div>
<div id="swagger-ui-desc"></div>
</div>

<!-- Visual Editor Tab -->
<!--
<div
class="tab-pane fade"
id="visual-editor-gui"
role="tabpanel"
aria-labelledby="swagger-ui-tab"
aria-labelledby="visual-editor-gui-tab"
>
<div id="visual-editor-gui-content"></div>
</div>
</div>
-->
</div>
</div>
</div>

Expand Down