Skip to content

Commit ce21e69

Browse files
committed
fix bug in graph overview & iframe link
1 parent 2cf23f3 commit ce21e69

File tree

6 files changed

+41
-35
lines changed

6 files changed

+41
-35
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iyp-browser",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"private": true,
55
"type": "module",
66
"scripts": {

src/components/Iframe.vue

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,33 @@ const GlobalVariables = inject('GlobalVariables')
99
const props = defineProps(['query'])
1010
1111
const showIframeDialog = ref(false)
12-
const iFrameCode = ref('')
12+
const showGraphOverview = ref(true)
1313
14-
watch(
15-
() => props.query,
16-
() => {
17-
const query = {
18-
query: props.query
19-
}
20-
const session = btoa(JSON.stringify([query]))
21-
const pathName =
22-
GlobalVariables.basePath.slice(-1) === '/'
23-
? GlobalVariables.basePath
24-
: `${GlobalVariables.basePath}/`
25-
iFrameCode.value = `<iframe src="${window.location.origin}${pathName}embed/?session=${session}" width="100%" height="500px"></iframe>`
14+
const createIframeCode = () => {
15+
const query = {
16+
query: props.query
2617
}
27-
)
18+
const session = btoa(JSON.stringify([query]))
19+
const pathName =
20+
GlobalVariables.basePath.slice(-1) === '/'
21+
? GlobalVariables.basePath
22+
: `${GlobalVariables.basePath}/`
23+
return `<iframe src="${window.location.origin}${pathName}embed/?session=${session}&showGraphOverview=${showGraphOverview.value}" width="100%" height="500px"></iframe>`
24+
}
25+
// watch(
26+
// () => props.query,
27+
// () => {
28+
// const query = {
29+
// query: props.query
30+
// }
31+
// const session = btoa(JSON.stringify([query]))
32+
// const pathName =
33+
// GlobalVariables.basePath.slice(-1) === '/'
34+
// ? GlobalVariables.basePath
35+
// : `${GlobalVariables.basePath}/`
36+
// iFrameCode.value = `<iframe src="${window.location.origin}${pathName}embed/?session=${session}&showGraphOverview=${showGraphOverview.value}" width="100%" height="500px"></iframe>`
37+
// }
38+
// )
2839
</script>
2940

3041
<template>
@@ -39,20 +50,12 @@ watch(
3950
<q-card-section>
4051
<div>
4152
You can embed this content within your webpage.
42-
<br />
43-
<q-btn
44-
no-caps
45-
dense
46-
flat
47-
@click="copyToClipboard(iFrameCode)"
48-
style="width: 100%"
49-
align="left"
50-
>
51-
<pre
52-
style="text-align: left"
53-
><code style="white-space: pre-wrap;" v-html="hljs.highlight(iFrameCode, {language: 'html'}).value"></code></pre>
54-
<q-tooltip> Click to copy </q-tooltip>
55-
</q-btn>
53+
</div>
54+
<div>
55+
<q-checkbox v-model="showGraphOverview" label="Show graph overview" />
56+
</div>
57+
<div>
58+
<q-btn no-caps outline @click="copyToClipboard(createIframeCode())" label="Copy iFrame code" />
5659
</div>
5760
</q-card-section>
5861
<q-card-actions align="right">

src/components/OutputPanel.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const GlobalVariables = inject('GlobalVariables')
1212
1313
const emits = defineEmits(['clear', 'share', 'update'])
1414
15-
const props = defineProps(['query', 'disableInput', 'disableTopBar', 'disableResizer'])
15+
const props = defineProps(['query', 'disableInput', 'disableTopBar', 'disableResizer', 'hideGraphOverview'])
1616
1717
const cypherQuery = ref('')
1818
const tab = ref('graph')
@@ -192,6 +192,7 @@ onMounted(() => {
192192
:relationships="relationships"
193193
:expanded-nodes-state="expandedNodesState"
194194
:disable-resizer="GlobalVariables.disableGraphOverviewPanelResizer"
195+
:hide-overview="hideGraphOverview"
195196
@nodeExpanded="handleNodeExpanded"
196197
@nodeUnexpanded="handleNodeUnexpanded"
197198
@nodeDeleted="handleNodeDeleted"

src/components/output/GraphOutput.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import interact from 'interactjs'
1414
const Neo4jApi = inject('Neo4jApi')
1515
const GlobalVariables = inject('GlobalVariables')
1616
const emit = defineEmits(['nodeExpanded', 'nodeUnexpanded', 'nodeDeleted', 'updateNodeProperties'])
17-
const props = defineProps(['nodes', 'relationships', 'expandedNodesState', 'disableResizer'])
17+
const props = defineProps(['nodes', 'relationships', 'expandedNodesState', 'disableResizer', 'hideOverview'])
1818
1919
const q = useQuasar()
2020
const expandedNodesMap = ref(props.expandedNodesState)
@@ -30,8 +30,8 @@ const selectedElement = ref({
3030
properties: {},
3131
clicked: false
3232
})
33-
const hideOverviewBtn = ref(false)
34-
const hideOverviewBtnIcon = ref('keyboard_arrow_up')
33+
const hideOverviewBtn = ref(props.hideOverview)
34+
const hideOverviewBtnIcon = ref(props.hideOverview ? 'keyboard_arrow_down' : 'keyboard_arrow_up')
3535
const overview = ref()
3636
let nvl = null
3737
const nodeRightClickMenu = ref({
@@ -477,7 +477,7 @@ onUnmounted(() => {
477477
</q-list>
478478
</q-menu>
479479
</div>
480-
<div class="overview" ref="overview">
480+
<div class="overview" ref="overview" :style="{ height: !hideOverviewBtn ? '100%' : 'auto' }">
481481
<q-card class="overview-card" :style="{ height: !hideOverviewBtn ? '100%' : 'auto' }">
482482
<q-bar class="fixed-top overview-bar">
483483
<div class="row justify-between" style="width: 100%">
@@ -635,7 +635,6 @@ onUnmounted(() => {
635635
top: 0px;
636636
right: 0px;
637637
width: v-bind('graphOverviewPanelWidth');
638-
height: 100%;
639638
overflow-y: auto;
640639
}
641640
.overview-card {

src/views/BrowserView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ watch(
9696
:disable-input="false"
9797
:disable-top-bar="false"
9898
:disable-resizer="GlobalVariables.disableOutputPanelResizer"
99+
:hide-graph-overview="false"
99100
@clear="clearQuery(query.uuid)"
100101
@share="shareQuery(query)"
101102
@update="updateQuery($event, query.uuid)"

src/views/EmbedView.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import OutputPanel from '@/components/OutputPanel.vue'
55
66
const route = useRoute()
77
const query = ref(JSON.parse(atob(route.query.session))[0])
8+
const showGraphOverview = ref(JSON.parse(route.query.showGraphOverview))
89
</script>
910

1011
<template>
@@ -13,6 +14,7 @@ const query = ref(JSON.parse(atob(route.query.session))[0])
1314
:disable-input="true"
1415
:disable-top-bar="true"
1516
:disable-resizer="true"
17+
:hide-graph-overview="!showGraphOverview"
1618
class="fullscreen"
1719
/>
1820
</template>

0 commit comments

Comments
 (0)