Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Jan 31, 2024
1 parent 278c1b6 commit 649e0e7
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 160 deletions.
25 changes: 5 additions & 20 deletions src/components/ShellView/CypherEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,10 @@
class="shell-editor__tools_container"
:style="{ width: toolbarWidth + 'px' }"
>
<div
v-show="!isMaximized"
class="shell-editor__button"
>
<i
class="fa-lg fa-solid fa-times"
@click="removeCell"
/>
<div v-show="!isMaximized" class="shell-editor__button">
<i class="fa-lg fa-solid fa-times" @click="removeCell" />
</div>
<div
v-show="!isLoading"
class="shell-editor__button"
>
<div v-show="!isLoading" class="shell-editor__button">
<i
class="fa-lg fa-solid fa-play"
data-bs-toggle="tooltip"
Expand All @@ -48,10 +39,7 @@
@click="evaluateCell"
/>
</div>
<div
v-show="!isLoading"
class="shell-editor__button"
>
<div v-show="!isLoading" class="shell-editor__button">
<i
:class="gptButtonClass"
data-bs-toggle="tooltip"
Expand All @@ -60,10 +48,7 @@
@click="toggleQueryGeneration"
/>
</div>
<div
v-show="isMaximizable"
class="shell-editor__button"
>
<div v-show="isMaximizable" class="shell-editor__button">
<i
:class="maximizeButtonClass"
data-bs-toggle="tooltip"
Expand Down
11 changes: 2 additions & 9 deletions src/components/ShellView/ResultCode.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<template>
<div
ref="wrapper"
class="result-code__wrapper"
:style="{ height: containerHeight }"
>
<div
ref="editor"
class="result-code__editor"
/>
<div ref="wrapper" class="result-code__wrapper" :style="{ height: containerHeight }">
<div ref="editor" class="result-code__editor" />
</div>
</template>

Expand Down
11 changes: 4 additions & 7 deletions src/components/ShellView/ResultContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
v-show="!isGraphEmpty"
:class="
`result-container__button` +
(showGraph ? ` result-container__button--active` : ``)
(showGraph ? ` result-container__button--active` : ``)
"
>
<i
Expand All @@ -28,7 +28,7 @@
<div
:class="
`result-container__button` +
(showTable ? ` result-container__button--active` : ``)
(showTable ? ` result-container__button--active` : ``)
"
>
<i
Expand All @@ -42,7 +42,7 @@
<div
:class="
`result-container__button` +
(showCode ? ` result-container__button--active` : ``)
(showCode ? ` result-container__button--active` : ``)
"
>
<i
Expand All @@ -54,10 +54,7 @@
/>
</div>

<div
v-show="showGraph"
class="result-container__tools_container--bottom"
>
<div v-show="showGraph" class="result-container__tools_container--bottom">
<div class="result-container__button">
<i
class="fa-lg fa-solid fa-magnifying-glass-plus"
Expand Down
19 changes: 4 additions & 15 deletions src/components/ShellView/ResultError.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
<template>
<div
ref="wrapper"
class="result-error__wrapper"
>
<div
v-if="!isInfo"
class="alert alert-danger"
role="alert"
>
<div ref="wrapper" class="result-error__wrapper">
<div v-if="!isInfo" class="alert alert-danger" role="alert">
<div>
<i class="fa-solid fa-circle-exclamation" />
The evaluation of this cell failed with the following error:
<br>
<br />
<b>
{{ errorMessage }}
</b>
</div>
</div>

<div
v-if="isInfo"
class="alert alert-info"
role="alert"
>
<div v-if="isInfo" class="alert alert-info" role="alert">
<div>
<i class="fa-solid fa-circle-info" />
{{ errorMessage }}
Expand Down
53 changes: 19 additions & 34 deletions src/components/ShellView/ResultGraph.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<div
ref="wrapper"
class="result-graph__wrapper"
>
<div ref="wrapper" class="result-graph__wrapper">
<div
ref="graph"
class="result_container__graph"
Expand All @@ -23,12 +20,8 @@
/>
</div>
</div>
<div
v-show="isSidePanelOpen"
ref="sidePanel"
class="result-container__side-panel"
>
<br>
<div v-show="isSidePanelOpen" ref="sidePanel" class="result-container__side-panel">
<br />
<div v-if="displayLabel">
<div class="result-container__summary-section">
<h5>{{ sidePanelPropertyTitlePrefix }} Properties</h5>
Expand All @@ -47,20 +40,15 @@
color: `${getTextColor(displayLabel)} !important`,
}"
>
{{ displayLabel }}</span>
<hr>
{{ displayLabel }}</span
>
<hr />
<table class="table table-sm table-bordered result-container__result-table">
<tbody>
<tr
v-for="property in displayProperties"
:key="property.name"
>
<tr v-for="property in displayProperties" :key="property.name">
<th scope="row">
{{ property.name }}
<span
v-if="property.isPrimaryKey"
class="badge bg-primary"
>PK</span>
<span v-if="property.isPrimaryKey" class="badge bg-primary">PK</span>
</th>
<td>{{ property.value }}</td>
</tr>
Expand All @@ -74,7 +62,8 @@
<p>
Showing
<span v-if="numHiddenNodes > 0">
{{ counters.total.node - numHiddenNodes }}/</span>{{ counters.total.node }} nodes
{{ counters.total.node - numHiddenNodes }}/</span
>{{ counters.total.node }} nodes
<span v-if="numHiddenNodes > 0"> ({{ numHiddenNodes }} hidden) </span>
</p>
<button
Expand All @@ -86,40 +75,36 @@
Show All
</button>
</div>
<hr>
<hr />
<table class="table table-sm table-bordered result-container__overview-table">
<tbody>
<tr
v-for="label in Object.keys(counters.node)"
:key="label"
>
<tr v-for="label in Object.keys(counters.node)" :key="label">
<th scope="row">
<span
class="badge bg-primary"
:style="{ backgroundColor: ` ${getColor(label)} !important` }"
>{{ label }}</span>
>{{ label }}</span
>
</th>
<td>{{ counters.node[label] }}</td>
</tr>
</tbody>
</table>
<br>
<br />
</div>

<div v-if="counters.total.rel > 0">
<p>
Showing
<span v-if="numHiddenRels > 0">
{{ counters.total.rel - numHiddenRels }}/</span>{{ counters.total.rel }} rels
{{ counters.total.rel - numHiddenRels }}/</span
>{{ counters.total.rel }} rels
<span v-if="numHiddenRels > 0"> ({{ numHiddenRels }} hidden) </span>
</p>
<hr>
<hr />
<table class="table table-sm table-bordered result-container__overview-table">
<tbody>
<tr
v-for="label in Object.keys(counters.rel)"
:key="label"
>
<tr v-for="label in Object.keys(counters.rel)" :key="label">
<th scope="row">
<span
class="badge bg-primary"
Expand Down
71 changes: 13 additions & 58 deletions src/components/ShellView/ResultTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
class="result-table__wrapper"
:style="{ height: containerHeight, width: tableWidth + 'px' }"
>
<div
v-if="totalPages > 1"
class="result-table__pagination__wrapper"
>
<div v-if="totalPages > 1" class="result-table__pagination__wrapper">
<nav>
<ul class="pagination">
<li :class="['page-item', { disabled: isPrevDisabled }]">
<a
class="page-link"
href="#"
@click="page -= 1"
>
<a class="page-link" href="#" @click="page -= 1">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
Expand All @@ -23,25 +16,13 @@
:key="currPage"
:class="['page-item', { active: currPage === page }]"
>
<a
v-if="currPage > 0"
class="page-link"
href="#"
@click="page = currPage"
>
<a v-if="currPage > 0" class="page-link" href="#" @click="page = currPage">
{{ currPage }}
</a>
<span
v-else
class="page-link"
>...</span>
<span v-else class="page-link">...</span>
</li>
<li :class="['page-item', { disabled: isNextDisabled }]">
<a
class="page-link"
href="#"
@click="page += 1"
>
<a class="page-link" href="#" @click="page += 1">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
Expand All @@ -53,54 +34,28 @@
<table class="table table-hover">
<thead class="fixed-top">
<tr>
<th
v-for="header in tableHeaders"
:key="header.text"
>
<th v-for="header in tableHeaders" :key="header.text">
{{ header.text }}
<span class="badge bg-primary">{{ header.type }}</span>
</th>
</tr>
</thead>
<tbody>
<tr
v-for="(row, i) in rows"
:key="i"
>
<td
v-for="(cell, j) in row"
:key="j"
>
<ul
v-if="Array.isArray(cell)"
class="list-group"
>
<li
v-for="(item, k) in cell"
:key="k"
class="list-group-item"
>
<tr v-for="(row, i) in rows" :key="i">
<td v-for="(cell, j) in row" :key="j">
<ul v-if="Array.isArray(cell)" class="list-group">
<li v-for="(item, k) in cell" :key="k" class="list-group-item">
<b>{{ item.name }}:</b> {{ item.value }}
</li>
</ul>
<div
v-else-if="isColumnRecursiveRel(j)"
class="result-table__recursive-rel__wrapper"
>
<div
v-for="(subcolumn, subcolumnId) in cell"
:key="subcolumnId"
>
<div
v-for="(item, k) in subcolumn"
:key="k"
>
<div v-for="(subcolumn, subcolumnId) in cell" :key="subcolumnId">
<div v-for="(item, k) in subcolumn" :key="k">
<ul class="list-group">
<li
v-for="(field, m) in item"
:key="m"
class="list-group-item"
>
<li v-for="(field, m) in item" :key="m" class="list-group-item">
<b>{{ m === 0 ? field.value : field.name + ":" }}</b>
<span v-if="m > 0">{{ field.value }}</span>
</li>
Expand Down
7 changes: 2 additions & 5 deletions src/components/ShellView/ShellCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
:is-maximized="isMaximized"
:navbar-height="navbarHeight"
/>
<div
v-if="isLoading"
class="d-flex align-items-center"
>
<div v-if="isLoading" class="d-flex align-items-center">
<strong class="text-secondary">{{
loadingText ? loadingText : "Loading..."
}}</strong>
Expand Down Expand Up @@ -82,7 +79,7 @@ export default {
},
methods: {
isActive(){
isActive() {
return this.$refs.editor.isActive();
},
evaluateCypher(query) {
Expand Down
Loading

0 comments on commit 649e0e7

Please sign in to comment.