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

Feature/four 9923 data tree visualization on the request data tab #5183

Merged
merged 2 commits into from
Aug 22, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions resources/js/components/TreeView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<div>
<iframe id="jsoncrackEmbed" ref="jsonCrackEmbed" src="/json-browser/widget.html"/>
<iframe
id="jsoncrackEmbed"
ref="jsonCrackEmbed"
src="/json-browser/widget.html"
:style="{ height: iframeHeight }"
/>
</div>
</template>

Expand All @@ -10,6 +15,10 @@ export default {
value: {
type: String,
},
iframeHeight: {
type: String,
default: "700px",
},
},
data() {
return {
Expand All @@ -26,16 +35,13 @@ export default {
},
mounted() {
const jsonCrackEmbed = this.$refs.jsonCrackEmbed;

const json = this.jsonData;
const options = {
theme: "light",
direction: "RIGHT",
};

this.handleMessage = () => {
const iframeOrigin = jsonCrackEmbed.src;

jsonCrackEmbed.contentWindow.postMessage(
{
json,
Expand All @@ -44,7 +50,6 @@ export default {
iframeOrigin,
);
};

window?.addEventListener("message", this.handleMessage);
},
beforeDestroy() {
Expand All @@ -63,7 +68,6 @@ export default {
flex: 1;
order: 2;
width: 100%;
height: 700px;
border: none;
}
</style>
4 changes: 4 additions & 0 deletions resources/js/requests/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import RequestErrors from "./components/RequestErrors.vue";
import Timeline from "../components/Timeline.vue";
import TimelineItem from "../components/TimelineItem.vue";
import RequestScreens from "./components/RequestScreens.vue";
import DataTreeToggle from "../components/common/data-tree-toggle.vue";
import TreeView from "../components/TreeView.vue";

Vue.component("DataSummary", DataSummary);
Vue.component("RequestDetail", RequestDetail);
Expand All @@ -18,5 +20,7 @@ Vue.component("MonacoEditor", MonacoEditor);
Vue.component("Timeline", Timeline);
Vue.component("TimelineItem", TimelineItem);
Vue.component("RequestScreens", RequestScreens);
Vue.component("TreeView", TreeView);
Vue.component("DataTreeToggle", DataTreeToggle);
Vue.use("vue-form-renderer", VueFormRenderer);
window.debounce = debounce;
1 change: 1 addition & 0 deletions resources/views/requests/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ class="d-inline-flex pull-left align-items-center" :input-data="requestBy" displ
remove: false,
},
iframeLoading: false,
showTree: false,
};
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/tasks/editdata.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<monaco-editor v-if="!showTree" ref="monaco" :options="monacoLargeOptions" v-model="jsonData"
language="json" style="border:1px solid gray; min-height:700px;"></monaco-editor>

<tree-view v-if="showTree" v-model="jsonData" style="border:1px; solid gray; min-height:700px;"></tree-view>
<tree-view v-if="showTree" v-model="jsonData" style="border:1px; solid gray; min-height:700px;"></tree-view>

<div class="d-flex justify-content-between mt-3">
<data-tree-toggle v-model="showTree"></data-tree-toggle>
Expand Down