mirror of
https://github.com/lana-k/sqliteviz.git
synced 2026-02-04 15:38:55 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e5adc147f | ||
|
|
7edc196a02 |
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CloseIcon from '@/components/svg/close'
|
import CloseIcon from '@/components/svg/close'
|
||||||
import { version } from '../../../package.json'
|
import { version } from '../../package.json'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppDiagnosticInfo',
|
name: 'AppDiagnosticInfo',
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tooltipMixin from '@/tooltipMixin'
|
import tooltipMixin from '@/tooltipMixin'
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SideBarButton',
|
name: 'SideBarButton',
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
import CloseIcon from '@/components/svg/close'
|
import CloseIcon from '@/components/svg/close'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Logs',
|
name: 'Logs',
|
||||||
@@ -102,11 +102,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import csv from '@/lib/csv'
|
import csv from '@/lib/csv'
|
||||||
import CloseIcon from '@/components/svg/close'
|
import CloseIcon from '@/components/svg/close'
|
||||||
import TextField from '@/components/TextField'
|
import TextField from '@/components/Common/TextField'
|
||||||
import DelimiterSelector from './DelimiterSelector'
|
import DelimiterSelector from './DelimiterSelector'
|
||||||
import CheckBox from '@/components/CheckBox'
|
import CheckBox from '@/components/Common/CheckBox'
|
||||||
import SqlTable from '@/components/SqlTable'
|
import SqlTable from '@/components/SqlTable'
|
||||||
import Logs from '@/components/Logs'
|
import Logs from '@/components/Common/Logs'
|
||||||
import time from '@/lib/utils/time'
|
import time from '@/lib/utils/time'
|
||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
|
|||||||
@@ -113,11 +113,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Chart from './Chart/index.vue'
|
import Chart from '@/components/Chart.vue'
|
||||||
import Pivot from './Pivot/index.vue'
|
import Pivot from '@/components/Pivot'
|
||||||
import Graph from './Graph/index.vue'
|
import Graph from '@/components/Graph/index.vue'
|
||||||
import SideToolBar from '../SideToolBar'
|
import SideToolBar from '@/components/SideToolBar'
|
||||||
import IconButton from '@/components/IconButton'
|
import IconButton from '@/components/Common/IconButton'
|
||||||
import ChartIcon from '@/components/svg/chart'
|
import ChartIcon from '@/components/svg/chart'
|
||||||
import PivotIcon from '@/components/svg/pivot'
|
import PivotIcon from '@/components/svg/pivot'
|
||||||
import GraphIcon from '@/components/svg/graph.vue'
|
import GraphIcon from '@/components/svg/graph.vue'
|
||||||
@@ -127,7 +127,7 @@ import ExportToSvgIcon from '@/components/svg/exportToSvg'
|
|||||||
import PngIcon from '@/components/svg/png'
|
import PngIcon from '@/components/svg/png'
|
||||||
import ClipboardIcon from '@/components/svg/clipboard'
|
import ClipboardIcon from '@/components/svg/clipboard'
|
||||||
import cIo from '@/lib/utils/clipboardIo'
|
import cIo from '@/lib/utils/clipboardIo'
|
||||||
import loadingDialog from '@/components/LoadingDialog.vue'
|
import loadingDialog from '@/components/Common/LoadingDialog.vue'
|
||||||
import time from '@/lib/utils/time'
|
import time from '@/lib/utils/time'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
|
|
||||||
@@ -319,7 +319,8 @@ export default {
|
|||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: 'constant',
|
type: 'constant',
|
||||||
value: '#1F77B4'
|
value: '#1F77B4',
|
||||||
|
opacity: 100
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
source: null,
|
source: null,
|
||||||
|
|||||||
@@ -57,10 +57,20 @@
|
|||||||
</template>
|
</template>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
|
<Field label="Opacity" fieldContainerClassName="test_node_opacity">
|
||||||
|
<NumericInput
|
||||||
|
:value="modelValue.opacity"
|
||||||
|
:showSlider="true"
|
||||||
|
:integerOnly="true"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
units="%"
|
||||||
|
@update="updateSettings('opacity', $event)"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
v-if="
|
v-if="modelValue.type === 'map_to' || modelValue.type === 'calculated'"
|
||||||
modelValue.sourceUsage === 'map_to' || modelValue.type === 'calculated'
|
|
||||||
"
|
|
||||||
label="Color as"
|
label="Color as"
|
||||||
fieldContainerClassName="test_node_color_as"
|
fieldContainerClassName="test_node_color_as"
|
||||||
>
|
>
|
||||||
@@ -89,6 +99,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { markRaw } from 'vue'
|
import { markRaw } from 'vue'
|
||||||
import { applyPureReactInVue } from 'veaury'
|
import { applyPureReactInVue } from 'veaury'
|
||||||
|
import NumericInput from 'react-chart-editor/lib/components/widgets/NumericInput'
|
||||||
import Dropdown from 'react-chart-editor/lib/components/widgets/Dropdown'
|
import Dropdown from 'react-chart-editor/lib/components/widgets/Dropdown'
|
||||||
import RadioBlocks from 'react-chart-editor/lib/components/widgets/RadioBlocks'
|
import RadioBlocks from 'react-chart-editor/lib/components/widgets/RadioBlocks'
|
||||||
import ColorscalePicker from 'react-chart-editor/lib/components/widgets/ColorscalePicker'
|
import ColorscalePicker from 'react-chart-editor/lib/components/widgets/ColorscalePicker'
|
||||||
@@ -98,6 +109,7 @@ import 'react-chart-editor/lib/react-chart-editor.css'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
NumericInput: applyPureReactInVue(NumericInput),
|
||||||
Dropdown: applyPureReactInVue(Dropdown),
|
Dropdown: applyPureReactInVue(Dropdown),
|
||||||
RadioBlocks: applyPureReactInVue(RadioBlocks),
|
RadioBlocks: applyPureReactInVue(RadioBlocks),
|
||||||
Field: applyPureReactInVue(Field),
|
Field: applyPureReactInVue(Field),
|
||||||
@@ -134,19 +146,21 @@ export default {
|
|||||||
{ label: 'Map to', value: 'map_to' }
|
{ label: 'Map to', value: 'map_to' }
|
||||||
]),
|
]),
|
||||||
defaultColorSettings: {
|
defaultColorSettings: {
|
||||||
constant: { value: '#1F77B4' },
|
constant: { value: '#1F77B4', opacity: 100 },
|
||||||
variable: {
|
variable: {
|
||||||
source: null,
|
source: null,
|
||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale: null,
|
colorscale: null,
|
||||||
mode: 'categorical',
|
mode: 'categorical',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 100
|
||||||
},
|
},
|
||||||
calculated: {
|
calculated: {
|
||||||
method: 'degree',
|
method: 'degree',
|
||||||
colorscale: null,
|
colorscale: null,
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TextField from '@/components/TextField'
|
import TextField from '@/components/Common/TextField'
|
||||||
import CloseIcon from '@/components/svg/close'
|
import CloseIcon from '@/components/svg/close'
|
||||||
import storedInquiries from '@/lib/storedInquiries'
|
import storedInquiries from '@/lib/storedInquiries'
|
||||||
import AppDiagnosticInfo from './AppDiagnosticInfo'
|
import AppDiagnosticInfo from './AppDiagnosticInfo'
|
||||||
@@ -33,7 +33,7 @@ import 'pivottable'
|
|||||||
import 'pivottable/dist/pivot.css'
|
import 'pivottable/dist/pivot.css'
|
||||||
import PivotUi from './PivotUi/index.vue'
|
import PivotUi from './PivotUi/index.vue'
|
||||||
import pivotHelper from './pivotHelper'
|
import pivotHelper from './pivotHelper'
|
||||||
import Chart from '@/views/MainView/Workspace/Tabs/Tab/DataView/Chart'
|
import Chart from '@/components/Chart'
|
||||||
import chartHelper from '@/lib/chartHelper'
|
import chartHelper from '@/lib/chartHelper'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
import plotly from 'plotly.js'
|
import plotly from 'plotly.js'
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import IconButton from '@/components/IconButton'
|
import IconButton from '@/components/Common/IconButton'
|
||||||
import ArrowIcon from '@/components/svg/arrow'
|
import ArrowIcon from '@/components/svg/arrow'
|
||||||
import EdgeArrowIcon from '@/components/svg/edgeArrow'
|
import EdgeArrowIcon from '@/components/svg/edgeArrow'
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ import 'codemirror/addon/fold/foldgutter.css'
|
|||||||
import 'codemirror/addon/fold/brace-fold.js'
|
import 'codemirror/addon/fold/brace-fold.js'
|
||||||
import 'codemirror/theme/neo.css'
|
import 'codemirror/theme/neo.css'
|
||||||
import cIo from '@/lib/utils/clipboardIo'
|
import cIo from '@/lib/utils/clipboardIo'
|
||||||
import Logs from '@/components/Logs'
|
import Logs from '@/components/Common/Logs'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -135,21 +135,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Logs from '@/components/Logs'
|
import Logs from '@/components/Common/Logs'
|
||||||
import SqlTable from '@/components/SqlTable/index.vue'
|
import SqlTable from '@/components/SqlTable'
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
import SideToolBar from '../SideToolBar'
|
import SideToolBar from '@/components/SideToolBar'
|
||||||
import Splitpanes from '@/components/Splitpanes'
|
import Splitpanes from '@/components/Common/Splitpanes'
|
||||||
import ExportToCsvIcon from '@/components/svg/exportToCsv'
|
import ExportToCsvIcon from '@/components/svg/exportToCsv'
|
||||||
import ClipboardIcon from '@/components/svg/clipboard'
|
import ClipboardIcon from '@/components/svg/clipboard'
|
||||||
import ViewCellValueIcon from '@/components/svg/viewCellValue'
|
import ViewCellValueIcon from '@/components/svg/viewCellValue'
|
||||||
import RowIcon from '@/components/svg/row'
|
import RowIcon from '@/components/svg/row'
|
||||||
import IconButton from '@/components/IconButton'
|
import IconButton from '@/components/Common/IconButton'
|
||||||
import csv from '@/lib/csv'
|
import csv from '@/lib/csv'
|
||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
import cIo from '@/lib/utils/clipboardIo'
|
import cIo from '@/lib/utils/clipboardIo'
|
||||||
import time from '@/lib/utils/time'
|
import time from '@/lib/utils/time'
|
||||||
import loadingDialog from '@/components/LoadingDialog'
|
import loadingDialog from '@/components/Common/LoadingDialog'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
import ValueViewer from './ValueViewer'
|
import ValueViewer from './ValueViewer'
|
||||||
import Record from './Record/index.vue'
|
import Record from './Record/index.vue'
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
import TableDescription from './TableDescription'
|
import TableDescription from './TableDescription'
|
||||||
import TextField from '@/components/TextField'
|
import TextField from '@/components/Common/TextField'
|
||||||
import TreeChevron from '@/components/svg/treeChevron'
|
import TreeChevron from '@/components/svg/treeChevron'
|
||||||
import DbUploader from '@/components/DbUploader'
|
import DbUploader from '@/components/DbUploader'
|
||||||
import ExportIcon from '@/components/svg/export'
|
import ExportIcon from '@/components/svg/export'
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import IconButton from '@/components/IconButton'
|
import IconButton from '@/components/Common/IconButton'
|
||||||
import TableIcon from '@/components/svg/table'
|
import TableIcon from '@/components/svg/table'
|
||||||
import SqlEditorIcon from '@/components/svg/sqlEditor'
|
import SqlEditorIcon from '@/components/svg/sqlEditor'
|
||||||
import DataViewIcon from '@/components/svg/dataView'
|
import DataViewIcon from '@/components/svg/dataView'
|
||||||
@@ -34,7 +34,7 @@ import 'codemirror/theme/neo.css'
|
|||||||
import 'codemirror/addon/hint/show-hint.css'
|
import 'codemirror/addon/hint/show-hint.css'
|
||||||
import 'codemirror/addon/display/autorefresh.js'
|
import 'codemirror/addon/display/autorefresh.js'
|
||||||
import SideToolBar from '../SideToolBar'
|
import SideToolBar from '../SideToolBar'
|
||||||
import IconButton from '@/components/IconButton'
|
import IconButton from '@/components/Common/IconButton'
|
||||||
import RunIcon from '@/components/svg/run'
|
import RunIcon from '@/components/svg/run'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Pager from './Pager.vue'
|
import Pager from '@/components/Common/Pager.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SqlTable',
|
name: 'SqlTable',
|
||||||
@@ -64,10 +64,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Splitpanes from '@/components/Splitpanes'
|
import Splitpanes from '@/components/Common/Splitpanes'
|
||||||
import SqlEditor from './SqlEditor'
|
import SqlEditor from '@/components/SqlEditor'
|
||||||
import DataView from './DataView'
|
import DataView from '@/components/DataView'
|
||||||
import RunResult from './RunResult'
|
import RunResult from '@/components/RunResult'
|
||||||
import { nextTick, computed } from 'vue'
|
import { nextTick, computed } from 'vue'
|
||||||
|
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
@@ -161,9 +161,14 @@ function getUpdateSizeMethod(graph, sizeSettings) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDirectVariableColorUpdateMethod(source) {
|
function getDirectVariableColorUpdateMethod(source, opacity = 100) {
|
||||||
return attributes =>
|
return attributes => {
|
||||||
(attributes.color = tinycolor(attributes.data[source]).toHexString())
|
const color = tinycolor(attributes.data[source])
|
||||||
|
const colorOpacity = color.getAlpha()
|
||||||
|
attributes.color = color
|
||||||
|
.setAlpha((opacity / 100) * colorOpacity)
|
||||||
|
.toHex8String()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdateNodeColorMethod(graph, colorSettings) {
|
function getUpdateNodeColorMethod(graph, colorSettings) {
|
||||||
@@ -175,10 +180,16 @@ function getUpdateNodeColorMethod(graph, colorSettings) {
|
|||||||
colorscale,
|
colorscale,
|
||||||
colorscaleDirection,
|
colorscaleDirection,
|
||||||
mode,
|
mode,
|
||||||
method
|
method,
|
||||||
|
opacity
|
||||||
} = colorSettings
|
} = colorSettings
|
||||||
if (type === 'constant') {
|
if (type === 'constant') {
|
||||||
return attributes => (attributes.color = value)
|
const color = tinycolor(value)
|
||||||
|
const colorOpacity = color.getAlpha()
|
||||||
|
return attributes =>
|
||||||
|
(attributes.color = color
|
||||||
|
.setAlpha((opacity / 100) * colorOpacity)
|
||||||
|
.toHex8String())
|
||||||
} else if (type === 'variable') {
|
} else if (type === 'variable') {
|
||||||
return sourceUsage === 'map_to'
|
return sourceUsage === 'map_to'
|
||||||
? getColorMethod(
|
? getColorMethod(
|
||||||
@@ -187,9 +198,10 @@ function getUpdateNodeColorMethod(graph, colorSettings) {
|
|||||||
(nodeId, attributes) => attributes.data[source],
|
(nodeId, attributes) => attributes.data[source],
|
||||||
colorscale,
|
colorscale,
|
||||||
colorscaleDirection,
|
colorscaleDirection,
|
||||||
getNodeValueScale
|
getNodeValueScale,
|
||||||
|
opacity
|
||||||
)
|
)
|
||||||
: getDirectVariableColorUpdateMethod(source)
|
: getDirectVariableColorUpdateMethod(source, opacity)
|
||||||
} else {
|
} else {
|
||||||
return getColorMethod(
|
return getColorMethod(
|
||||||
graph,
|
graph,
|
||||||
@@ -197,7 +209,8 @@ function getUpdateNodeColorMethod(graph, colorSettings) {
|
|||||||
nodeId => graph[method](nodeId),
|
nodeId => graph[method](nodeId),
|
||||||
colorscale,
|
colorscale,
|
||||||
colorscaleDirection,
|
colorscaleDirection,
|
||||||
getNodeValueScale
|
getNodeValueScale,
|
||||||
|
opacity
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -244,8 +257,10 @@ function getColorMethod(
|
|||||||
sourceGetter,
|
sourceGetter,
|
||||||
selectedColorscale,
|
selectedColorscale,
|
||||||
colorscaleDirection,
|
colorscaleDirection,
|
||||||
valueScaleGetter
|
valueScaleGetter,
|
||||||
|
opacity = 100
|
||||||
) {
|
) {
|
||||||
|
const opacityFactor = opacity / 100
|
||||||
const valueScale = valueScaleGetter(graph, sourceGetter)
|
const valueScale = valueScaleGetter(graph, sourceGetter)
|
||||||
let colorscale = selectedColorscale || DEFAULT_SCALE
|
let colorscale = selectedColorscale || DEFAULT_SCALE
|
||||||
if (colorscaleDirection === 'reversed') {
|
if (colorscaleDirection === 'reversed') {
|
||||||
@@ -261,7 +276,9 @@ function getColorMethod(
|
|||||||
)
|
)
|
||||||
return (attributes, nodeId) => {
|
return (attributes, nodeId) => {
|
||||||
const category = sourceGetter(nodeId, attributes)
|
const category = sourceGetter(nodeId, attributes)
|
||||||
attributes.color = colorMap[category]
|
attributes.color = tinycolor(colorMap[category])
|
||||||
|
.setAlpha(opacityFactor)
|
||||||
|
.toHex8String()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const min = valueScale[0]
|
const min = valueScale[0]
|
||||||
@@ -274,14 +291,18 @@ function getColorMethod(
|
|||||||
const value = sourceGetter(nodeId, attributes)
|
const value = sourceGetter(nodeId, attributes)
|
||||||
const normalizedValue = (value - min) / (max - min)
|
const normalizedValue = (value - min) / (max - min)
|
||||||
if (isNaN(normalizedValue)) {
|
if (isNaN(normalizedValue)) {
|
||||||
attributes.color = '#000000'
|
attributes.color = tinycolor('#000000')
|
||||||
|
.setAlpha(opacityFactor)
|
||||||
|
.toHex8String()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const exactMatch = normalizedColorscale.find(
|
const exactMatch = normalizedColorscale.find(
|
||||||
([value]) => value === normalizedValue
|
([value]) => value === normalizedValue
|
||||||
)
|
)
|
||||||
if (exactMatch) {
|
if (exactMatch) {
|
||||||
attributes.color = tinycolor(exactMatch[1]).toHexString()
|
attributes.color = tinycolor(exactMatch[1])
|
||||||
|
.setAlpha(opacityFactor)
|
||||||
|
.toHex8String()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,7 +326,9 @@ function getColorMethod(
|
|||||||
r: r0 + interpolationFactor * (r1 - r0),
|
r: r0 + interpolationFactor * (r1 - r0),
|
||||||
g: g0 + interpolationFactor * (g1 - g0),
|
g: g0 + interpolationFactor * (g1 - g0),
|
||||||
b: b0 + interpolationFactor * (b1 - b0)
|
b: b0 + interpolationFactor * (b1 - b0)
|
||||||
}).toHexString()
|
})
|
||||||
|
.setAlpha(opacityFactor)
|
||||||
|
.toHex8String()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
export default {
|
export default {
|
||||||
_migrate(installedVersion, inquiries) {
|
_migrate(installedVersion, inquiries) {
|
||||||
if (installedVersion === 1) {
|
if (installedVersion < 2) {
|
||||||
inquiries.forEach(inquire => {
|
inquiries.forEach(inquiry => {
|
||||||
inquire.viewType = 'chart'
|
inquiry.viewType = 'chart'
|
||||||
inquire.viewOptions = inquire.chart
|
inquiry.viewOptions = inquiry.chart
|
||||||
delete inquire.chart
|
delete inquiry.chart
|
||||||
})
|
})
|
||||||
return inquiries
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (installedVersion < 3) {
|
||||||
|
inquiries.forEach(inquiry => {
|
||||||
|
if (inquiry.viewType === 'graph') {
|
||||||
|
inquiry.viewOptions.style.nodes.color.opacity = 100
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return inquiries
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const migrate = migration._migrate
|
|||||||
const myInquiriesKey = 'myInquiries'
|
const myInquiriesKey = 'myInquiries'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
version: 2,
|
version: 3,
|
||||||
myInquiriesKey,
|
myInquiriesKey,
|
||||||
getStoredInquiries() {
|
getStoredInquiries() {
|
||||||
let myInquiries = JSON.parse(localStorage.getItem(myInquiriesKey))
|
let myInquiries = JSON.parse(localStorage.getItem(myInquiriesKey))
|
||||||
@@ -21,7 +21,13 @@ export default {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
return (myInquiries && myInquiries.inquiries) || []
|
if (myInquiries.version === 2) {
|
||||||
|
myInquiries = migrate(2, myInquiries.inquiries)
|
||||||
|
this.updateStorage(myInquiries)
|
||||||
|
return myInquiries
|
||||||
|
}
|
||||||
|
|
||||||
|
return myInquiries.inquiries || []
|
||||||
},
|
},
|
||||||
|
|
||||||
duplicateInquiry(baseInquiry) {
|
duplicateInquiry(baseInquiry) {
|
||||||
@@ -82,11 +88,11 @@ export default {
|
|||||||
|
|
||||||
importInquiries() {
|
importInquiries() {
|
||||||
return fu.importFile().then(str => {
|
return fu.importFile().then(str => {
|
||||||
const inquires = this.deserialiseInquiries(str)
|
const inquiries = this.deserialiseInquiries(str)
|
||||||
|
|
||||||
events.send('inquiry.import', inquires.length)
|
events.send('inquiry.import', inquiries.length)
|
||||||
|
|
||||||
return inquires
|
return inquiries
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
export(inquiryList, fileName) {
|
export(inquiryList, fileName) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import Workspace from '@/views/MainView/Workspace'
|
import Workspace from '@/views/Workspace'
|
||||||
import Inquiries from '@/views/MainView/Inquiries'
|
import Inquiries from '@/views/Inquiries'
|
||||||
import Welcome from '@/views/Welcome'
|
import Welcome from '@/views/Welcome'
|
||||||
import MainView from '@/views/MainView'
|
import MainView from '@/views/MainView'
|
||||||
import LoadView from '@/views/LoadView'
|
import LoadView from '@/views/LoadView'
|
||||||
|
|||||||
@@ -184,14 +184,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import RenameIcon from './svg/rename'
|
import RenameIcon from '@/components/svg/rename'
|
||||||
import CopyIcon from './svg/copy'
|
import CopyIcon from '@/components/svg/copy'
|
||||||
import ExportIcon from '@/components/svg/export'
|
import ExportIcon from '@/components/svg/export'
|
||||||
import DeleteIcon from './svg/delete'
|
import DeleteIcon from '@/components/svg/delete'
|
||||||
import CloseIcon from '@/components/svg/close'
|
import CloseIcon from '@/components/svg/close'
|
||||||
import TextField from '@/components/TextField'
|
import TextField from '@/components/Common/TextField'
|
||||||
import CheckBox from '@/components/CheckBox'
|
import CheckBox from '@/components/Common/CheckBox'
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
import tooltipMixin from '@/tooltipMixin'
|
import tooltipMixin from '@/tooltipMixin'
|
||||||
import storedInquiries from '@/lib/storedInquiries'
|
import storedInquiries from '@/lib/storedInquiries'
|
||||||
import eventBus from '@/lib/eventBus'
|
import eventBus from '@/lib/eventBus'
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import fu from '@/lib/utils/fileIo'
|
import fu from '@/lib/utils/fileIo'
|
||||||
import database from '@/lib/database'
|
import database from '@/lib/database'
|
||||||
import Logs from '@/components/Logs'
|
import Logs from '@/components/Common/Logs'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MainMenu from './MainMenu'
|
import MainMenu from '@/components/MainMenu'
|
||||||
import '@/assets/styles/scrollbars.css'
|
import '@/assets/styles/scrollbars.css'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Splitpanes from '@/components/Splitpanes'
|
import Splitpanes from '@/components/Common/Splitpanes'
|
||||||
import Schema from './Schema'
|
import Schema from '@/components/Schema'
|
||||||
import Tabs from './Tabs'
|
import Tabs from '@/components/Tabs'
|
||||||
import events from '@/lib/utils/events'
|
import events from '@/lib/utils/events'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { mount, flushPromises } from '@vue/test-utils'
|
import { mount, flushPromises } from '@vue/test-utils'
|
||||||
import Chart from '@/views/MainView/Workspace/Tabs/Tab/DataView/Chart/index.vue'
|
import Chart from '@/components/Chart.vue'
|
||||||
import chartHelper from '@/lib/chartHelper'
|
import chartHelper from '@/lib/chartHelper'
|
||||||
import * as dereference from 'react-chart-editor/lib/lib/dereference'
|
import * as dereference from 'react-chart-editor/lib/lib/dereference'
|
||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
@@ -128,6 +128,8 @@ describe('Chart.vue', () => {
|
|||||||
expect(plot.scrollWidth).not.to.equal(initialPlotWidth)
|
expect(plot.scrollWidth).not.to.equal(initialPlotWidth)
|
||||||
expect(plot.scrollHeight).not.to.equal(initialPlotHeight)
|
expect(plot.scrollHeight).not.to.equal(initialPlotHeight)
|
||||||
|
|
||||||
|
container.style.width = 'unset'
|
||||||
|
container.style.height = 'unset'
|
||||||
wrapper.unmount()
|
wrapper.unmount()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import CheckBox from '@/components/CheckBox'
|
import CheckBox from '@/components/Common/CheckBox'
|
||||||
|
|
||||||
describe('CheckBox', () => {
|
describe('CheckBox', () => {
|
||||||
it('unchecked by default', () => {
|
it('unchecked by default', () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import LoadingIndicator from '@/components/LoadingIndicator'
|
import LoadingIndicator from '@/components/Common/LoadingIndicator'
|
||||||
|
|
||||||
describe('LoadingIndicator.vue', () => {
|
describe('LoadingIndicator.vue', () => {
|
||||||
it('Calculates animation class', async () => {
|
it('Calculates animation class', async () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import Logs from '@/components/Logs'
|
import Logs from '@/components/Common/Logs'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
let place
|
let place
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import Pager from '@/components/SqlTable/Pager'
|
import Pager from '@/components/Common/Pager'
|
||||||
|
|
||||||
describe('Pager.vue', () => {
|
describe('Pager.vue', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import Splitpanes from '@/components/Splitpanes'
|
import Splitpanes from '@/components/Common/Splitpanes'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
describe('Splitpanes.vue', () => {
|
describe('Splitpanes.vue', () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import splitter from '@/components/Splitpanes/splitter'
|
import splitter from '@/components/Common/Splitpanes/splitter'
|
||||||
|
|
||||||
describe('splitter.js', () => {
|
describe('splitter.js', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import DataView from '@/views/MainView/Workspace/Tabs/Tab/DataView/index.vue'
|
import DataView from '@/components/DataView.vue'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import cIo from '@/lib/utils/clipboardIo'
|
import cIo from '@/lib/utils/clipboardIo'
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { mount, flushPromises } from '@vue/test-utils'
|
import { mount, flushPromises } from '@vue/test-utils'
|
||||||
import Graph from '@/views/MainView/Workspace/Tabs/Tab/DataView/Graph/index.vue'
|
import Graph from '@/components/Graph/index.vue'
|
||||||
|
|
||||||
function getPixels(canvas) {
|
function getPixels(canvas) {
|
||||||
const context = canvas.getContext('webgl2')
|
const context = canvas.getContext('webgl2')
|
||||||
@@ -24,7 +24,8 @@ const defaultInitOptions = {
|
|||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: 'constant',
|
type: 'constant',
|
||||||
value: '#1F77B4'
|
value: '#1F77B4',
|
||||||
|
opacity: 100
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
source: null,
|
source: null,
|
||||||
@@ -404,7 +405,7 @@ describe('GraphEditor', () => {
|
|||||||
doc: [
|
doc: [
|
||||||
'{"type": 0, "node_id": 1, "color": "#ff0000", "points": 5}',
|
'{"type": 0, "node_id": 1, "color": "#ff0000", "points": 5}',
|
||||||
'{"type": 0, "node_id": 2, "color": "#abcdff", "points": 15}',
|
'{"type": 0, "node_id": 2, "color": "#abcdff", "points": 15}',
|
||||||
'{"type": 0, "node_id": 3, "color": "#123456", "points": 10}',
|
'{"type": 0, "node_id": 3, "color": "#12345680", "points": 10}',
|
||||||
'{"type": 1, "source": 2, "target": 3}'
|
'{"type": 1, "source": 2, "target": 3}'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -440,11 +441,11 @@ describe('GraphEditor', () => {
|
|||||||
// Set constant color
|
// Set constant color
|
||||||
await wrapper
|
await wrapper
|
||||||
.findAllComponents({ name: 'ColorPicker' })[1]
|
.findAllComponents({ name: 'ColorPicker' })[1]
|
||||||
.vm.$emit('colorChange', '#ff00ff')
|
.vm.$emit('colorChange', '#ff00ff80')
|
||||||
|
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#ff00ff80')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#ff00ff80')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#ff00ff80')
|
||||||
|
|
||||||
// Switch to Variable
|
// Switch to Variable
|
||||||
const variable = wrapper.findAll('.test_node_color .radio-block__option')[1]
|
const variable = wrapper.findAll('.test_node_color .radio-block__option')[1]
|
||||||
@@ -459,27 +460,27 @@ describe('GraphEditor', () => {
|
|||||||
|
|
||||||
await wrapper.findAll('.Select__menu .Select__option')[2].trigger('click')
|
await wrapper.findAll('.Select__menu .Select__option')[2].trigger('click')
|
||||||
|
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#bdea75')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#bdea75ff')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#86d780')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#86d780ff')
|
||||||
|
|
||||||
// Select Direct mapping
|
// Select Direct mapping
|
||||||
await wrapper
|
await wrapper
|
||||||
.find('.test_node_color_mapping_mode .radio-block__option')
|
.find('.test_node_color_mapping_mode .radio-block__option')
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
|
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#ff0000')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#ff0000ff')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#abcdff')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#abcdffff')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#123456')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#12345680')
|
||||||
|
|
||||||
// Switch to Calculated
|
// Switch to Calculated
|
||||||
const calculated = wrapper.findAll(
|
const calculated = wrapper.findAll(
|
||||||
'.test_node_color .radio-block__option'
|
'.test_node_color .radio-block__option'
|
||||||
)[2]
|
)[2]
|
||||||
await calculated.trigger('click')
|
await calculated.trigger('click')
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#2a4858')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#2a4858ff')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#2a4858')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#2a4858ff')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Choose in-degree
|
// Choose in-degree
|
||||||
@@ -491,45 +492,68 @@ describe('GraphEditor', () => {
|
|||||||
|
|
||||||
await wrapper.findAll('.Select__menu .Select__option')[1].trigger('click')
|
await wrapper.findAll('.Select__menu .Select__option')[1].trigger('click')
|
||||||
|
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#2a4858')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#2a4858ff')
|
||||||
|
await nextTick()
|
||||||
|
|
||||||
|
// Set another opacity for calculated color
|
||||||
|
let opacityInput = wrapper.find(
|
||||||
|
'.test_node_opacity input.numeric-input__number'
|
||||||
|
)
|
||||||
|
await opacityInput.setValue(50)
|
||||||
|
opacityInput.wrapperElement.dispatchEvent(
|
||||||
|
new Event('blur', { bubbles: true })
|
||||||
|
)
|
||||||
|
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e80')
|
||||||
|
expect(graph.export().nodes[1].attributes.color).to.equal('#fafa6e80')
|
||||||
|
expect(graph.export().nodes[2].attributes.color).to.equal('#2a485880')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Set Color as to Categorical
|
// Set Color as to Categorical
|
||||||
await wrapper
|
await wrapper
|
||||||
.findAll('.test_node_color_as .radio-block__option')[1]
|
.findAll('.test_node_color_as .radio-block__option')[1]
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#fafa6e80')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#fafa6e80')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#bdea75')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#bdea7580')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Change colorscale direction
|
// Change colorscale direction
|
||||||
await wrapper
|
await wrapper
|
||||||
.findAll('.test_node_color_colorscale_direction .radio-block__option')[1]
|
.findAll('.test_node_color_colorscale_direction .radio-block__option')[1]
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#2a4858')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#2a485880')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#2a4858')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#2a485880')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#1f5f70')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#1f5f7080')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Switch to Variable
|
// Switch to Variable
|
||||||
await variable.trigger('click')
|
await variable.trigger('click')
|
||||||
|
|
||||||
// The latest settings from variable mode are applied
|
// The latest settings from variable mode are applied
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#ff0000')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#ff0000ff')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#abcdff')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#abcdffff')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#123456')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#12345680')
|
||||||
|
|
||||||
// Switch to Constant
|
// Switch to Constant
|
||||||
const constant = wrapper.findAll('.test_node_color .radio-block__option')[0]
|
const constant = wrapper.findAll('.test_node_color .radio-block__option')[0]
|
||||||
await constant.trigger('click')
|
await constant.trigger('click')
|
||||||
|
|
||||||
// The latest settings from constant mode are applied
|
// The latest settings from constant mode are applied
|
||||||
expect(graph.export().nodes[0].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[0].attributes.color).to.equal('#ff00ff80')
|
||||||
expect(graph.export().nodes[1].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[1].attributes.color).to.equal('#ff00ff80')
|
||||||
expect(graph.export().nodes[2].attributes.color).to.equal('#ff00ff')
|
expect(graph.export().nodes[2].attributes.color).to.equal('#ff00ff80')
|
||||||
|
|
||||||
|
// Set another opacity for constant color
|
||||||
|
await opacityInput.setValue(50)
|
||||||
|
opacityInput.wrapperElement.dispatchEvent(
|
||||||
|
new Event('blur', { bubbles: true })
|
||||||
|
)
|
||||||
|
expect(graph.export().nodes[0].attributes.color).to.equal('#ff00ff40')
|
||||||
|
expect(graph.export().nodes[1].attributes.color).to.equal('#ff00ff40')
|
||||||
|
expect(graph.export().nodes[2].attributes.color).to.equal('#ff00ff40')
|
||||||
|
await nextTick()
|
||||||
|
|
||||||
wrapper.unmount()
|
wrapper.unmount()
|
||||||
})
|
})
|
||||||
@@ -840,26 +864,26 @@ describe('GraphEditor', () => {
|
|||||||
)
|
)
|
||||||
await wrapper.findAll('.Select__menu .Select__option')[5].trigger('click')
|
await wrapper.findAll('.Select__menu .Select__option')[5].trigger('click')
|
||||||
|
|
||||||
expect(graph.export().edges[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().edges[0].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().edges[1].attributes.color).to.equal('#bdea75')
|
expect(graph.export().edges[1].attributes.color).to.equal('#bdea75ff')
|
||||||
expect(graph.export().edges[2].attributes.color).to.equal('#86d780')
|
expect(graph.export().edges[2].attributes.color).to.equal('#86d780ff')
|
||||||
|
|
||||||
// Set Color as to Continious
|
// Set Color as to Continious
|
||||||
await wrapper
|
await wrapper
|
||||||
.findAll('.test_edge_color_as .radio-block__option')[0]
|
.findAll('.test_edge_color_as .radio-block__option')[0]
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
expect(graph.export().edges[0].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().edges[0].attributes.color).to.equal('#fafa6eff')
|
||||||
expect(graph.export().edges[1].attributes.color).to.equal('#39b48d')
|
expect(graph.export().edges[1].attributes.color).to.equal('#39b48dff')
|
||||||
expect(graph.export().edges[2].attributes.color).to.equal('#2a4858')
|
expect(graph.export().edges[2].attributes.color).to.equal('#2a4858ff')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Change colorscale direction
|
// Change colorscale direction
|
||||||
await wrapper
|
await wrapper
|
||||||
.findAll('.test_edge_color_colorscale_direction .radio-block__option')[1]
|
.findAll('.test_edge_color_colorscale_direction .radio-block__option')[1]
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
expect(graph.export().edges[0].attributes.color).to.equal('#2a4858')
|
expect(graph.export().edges[0].attributes.color).to.equal('#2a4858ff')
|
||||||
expect(graph.export().edges[1].attributes.color).to.equal('#139f8e')
|
expect(graph.export().edges[1].attributes.color).to.equal('#139f8eff')
|
||||||
expect(graph.export().edges[2].attributes.color).to.equal('#fafa6e')
|
expect(graph.export().edges[2].attributes.color).to.equal('#fafa6eff')
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
// Clear color source
|
// Clear color source
|
||||||
@@ -883,9 +907,9 @@ describe('GraphEditor', () => {
|
|||||||
.find('.test_edge_color_mapping_mode .radio-block__option')
|
.find('.test_edge_color_mapping_mode .radio-block__option')
|
||||||
.trigger('click')
|
.trigger('click')
|
||||||
|
|
||||||
expect(graph.export().edges[0].attributes.color).to.equal('#ff0000')
|
expect(graph.export().edges[0].attributes.color).to.equal('#ff0000ff')
|
||||||
expect(graph.export().edges[1].attributes.color).to.equal('#abcdff')
|
expect(graph.export().edges[1].attributes.color).to.equal('#abcdffff')
|
||||||
expect(graph.export().edges[2].attributes.color).to.equal('#123456')
|
expect(graph.export().edges[2].attributes.color).to.equal('#123456ff')
|
||||||
|
|
||||||
// Switch to Constant
|
// Switch to Constant
|
||||||
const constant = wrapper.findAll('.test_edge_color .radio-block__option')[0]
|
const constant = wrapper.findAll('.test_edge_color .radio-block__option')[0]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { expect } from 'chai'
|
|||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { mount, shallowMount } from '@vue/test-utils'
|
import { mount, shallowMount } from '@vue/test-utils'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import MainMenu from '@/views/MainView/MainMenu'
|
import MainMenu from '@/components/MainMenu'
|
||||||
import storedInquiries from '@/lib/storedInquiries'
|
import storedInquiries from '@/lib/storedInquiries'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import eventBus from '@/lib/eventBus'
|
import eventBus from '@/lib/eventBus'
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount, flushPromises } from '@vue/test-utils'
|
import { mount, flushPromises } from '@vue/test-utils'
|
||||||
import Pivot from '@/views/MainView/Workspace/Tabs/Tab/DataView/Pivot/index.vue'
|
import Pivot from '@/components/Pivot/index.vue'
|
||||||
import chartHelper from '@/lib/chartHelper'
|
import chartHelper from '@/lib/chartHelper'
|
||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import pivotHelper from '@/views/MainView/Workspace/Tabs/Tab/DataView/Pivot/pivotHelper'
|
import pivotHelper from '@/components/Pivot/pivotHelper'
|
||||||
|
|
||||||
describe('Pivot.vue', () => {
|
describe('Pivot.vue', () => {
|
||||||
let container
|
let container
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import PivotSortBtn from '@/views/MainView/Workspace/Tabs/Tab/DataView/Pivot/PivotUi/PivotSortBtn'
|
import PivotSortBtn from '@/components/Pivot/PivotUi/PivotSortBtn'
|
||||||
|
|
||||||
describe('PivotSortBtn.vue', () => {
|
describe('PivotSortBtn.vue', () => {
|
||||||
it('switches order', async () => {
|
it('switches order', async () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import PivotUi from '@/views/MainView/Workspace/Tabs/Tab/DataView/Pivot/PivotUi'
|
import PivotUi from '@/components/Pivot/PivotUi'
|
||||||
|
|
||||||
describe('PivotUi.vue', () => {
|
describe('PivotUi.vue', () => {
|
||||||
it('returns value when settings changed', async () => {
|
it('returns value when settings changed', async () => {
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
_getDataSources,
|
_getDataSources,
|
||||||
getPivotCanvas,
|
getPivotCanvas,
|
||||||
getPivotHtml
|
getPivotHtml
|
||||||
} from '@/views/MainView/Workspace/Tabs/Tab/DataView/Pivot/pivotHelper'
|
} from '@/components/Pivot/pivotHelper'
|
||||||
|
|
||||||
describe('pivotHelper.js', () => {
|
describe('pivotHelper.js', () => {
|
||||||
it('_getDataSources returns data sources', () => {
|
it('_getDataSources returns data sources', () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import Record from '@/views/MainView/Workspace/Tabs/Tab/RunResult/Record'
|
import Record from '@/components/RunResult/Record'
|
||||||
|
|
||||||
describe('Record.vue', () => {
|
describe('Record.vue', () => {
|
||||||
it('shows record with selected cell', async () => {
|
it('shows record with selected cell', async () => {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import RunResult from '@/views/MainView/Workspace/Tabs/Tab/RunResult'
|
import RunResult from '@/components/RunResult'
|
||||||
import csv from '@/lib/csv'
|
import csv from '@/lib/csv'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import ValueViewer from '@/views/MainView/Workspace/Tabs/Tab/RunResult/ValueViewer.vue'
|
import ValueViewer from '@/components/RunResult/ValueViewer.vue'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
|
|
||||||
describe('ValueViewer.vue', () => {
|
describe('ValueViewer.vue', () => {
|
||||||
@@ -4,8 +4,8 @@ import { mount } from '@vue/test-utils'
|
|||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import actions from '@/store/actions'
|
import actions from '@/store/actions'
|
||||||
import mutations from '@/store/mutations'
|
import mutations from '@/store/mutations'
|
||||||
import Schema from '@/views/MainView/Workspace/Schema'
|
import Schema from '@/components/Schema'
|
||||||
import TableDescription from '@/views/MainView/Workspace/Schema/TableDescription'
|
import TableDescription from '@/components/Schema/TableDescription'
|
||||||
import database from '@/lib/database'
|
import database from '@/lib/database'
|
||||||
import fIo from '@/lib/utils/fileIo'
|
import fIo from '@/lib/utils/fileIo'
|
||||||
import csv from '@/lib/csv'
|
import csv from '@/lib/csv'
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { shallowMount } from '@vue/test-utils'
|
import { shallowMount } from '@vue/test-utils'
|
||||||
import TableDescription from '@/views/MainView/Workspace/Schema/TableDescription'
|
import TableDescription from '@/components/Schema/TableDescription'
|
||||||
|
|
||||||
describe('TableDescription.vue', () => {
|
describe('TableDescription.vue', () => {
|
||||||
it('Initially the columns are hidden and table name is rendered', () => {
|
it('Initially the columns are hidden and table name is rendered', () => {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import SqlEditor from '@/views/MainView/Workspace/Tabs/Tab/SqlEditor'
|
import SqlEditor from '@/components/SqlEditor'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
describe('SqlEditor.vue', () => {
|
describe('SqlEditor.vue', () => {
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import state from '@/store/state'
|
import state from '@/store/state'
|
||||||
import showHint, {
|
import showHint, { getHints } from '@/components/SqlEditor/hint'
|
||||||
getHints
|
|
||||||
} from '@/views/MainView/Workspace/Tabs/Tab/SqlEditor/hint'
|
|
||||||
import CM from 'codemirror'
|
import CM from 'codemirror'
|
||||||
|
|
||||||
describe('hint.js', () => {
|
describe('hint.js', () => {
|
||||||
@@ -3,7 +3,7 @@ import sinon from 'sinon'
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import mutations from '@/store/mutations'
|
import mutations from '@/store/mutations'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import Tab from '@/views/MainView/Workspace/Tabs/Tab'
|
import Tab from '@/components/Tab'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
|
|
||||||
let place
|
let place
|
||||||
@@ -3,7 +3,7 @@ import sinon from 'sinon'
|
|||||||
import { shallowMount, mount } from '@vue/test-utils'
|
import { shallowMount, mount } from '@vue/test-utils'
|
||||||
import mutations from '@/store/mutations'
|
import mutations from '@/store/mutations'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import Tabs from '@/views/MainView/Workspace/Tabs'
|
import Tabs from '@/components/Tabs'
|
||||||
import eventBus from '@/lib/eventBus'
|
import eventBus from '@/lib/eventBus'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import cIo from '@/lib/utils/clipboardIo'
|
import cIo from '@/lib/utils/clipboardIo'
|
||||||
@@ -533,7 +533,8 @@ describe('graphHelper.js', () => {
|
|||||||
graphHelper.updateNodes(graph, {
|
graphHelper.updateNodes(graph, {
|
||||||
color: {
|
color: {
|
||||||
type: 'constant',
|
type: 'constant',
|
||||||
value: '#a1b8c3'
|
value: '#a1b8c380',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -541,14 +542,14 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1 },
|
data: { type: 0, node_id: 1 },
|
||||||
color: '#a1b8c3'
|
color: '#a1b8c340'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2 },
|
data: { type: 0, node_id: 2 },
|
||||||
color: '#a1b8c3'
|
color: '#a1b8c340'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -592,7 +593,7 @@ describe('graphHelper.js', () => {
|
|||||||
doc: [
|
doc: [
|
||||||
'{"type": 0, "node_id": 1, "color": "red", "points": 5}',
|
'{"type": 0, "node_id": 1, "color": "red", "points": 5}',
|
||||||
'{"type": 0, "node_id": 2, "color": "#abcdff", "points": 15}',
|
'{"type": 0, "node_id": 2, "color": "#abcdff", "points": 15}',
|
||||||
'{"type": 0, "node_id": 3, "color": "#123456", "points": 10}'
|
'{"type": 0, "node_id": 3, "color": "#12345680", "points": 10}'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
const graph = new Graph()
|
const graph = new Graph()
|
||||||
@@ -609,7 +610,8 @@ describe('graphHelper.js', () => {
|
|||||||
color: {
|
color: {
|
||||||
type: 'variable',
|
type: 'variable',
|
||||||
source: 'color',
|
source: 'color',
|
||||||
sourceUsage: 'direct'
|
sourceUsage: 'direct',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -617,21 +619,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#ff0000'
|
color: '#ff000080'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#abcdff'
|
color: '#abcdff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#123456'
|
color: '#12345640'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -644,7 +646,8 @@ describe('graphHelper.js', () => {
|
|||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'categorical',
|
mode: 'categorical',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -652,21 +655,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#6666ff'
|
color: '#6666ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#8888ff'
|
color: '#8888ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -678,7 +681,8 @@ describe('graphHelper.js', () => {
|
|||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'categorical',
|
mode: 'categorical',
|
||||||
colorscaleDirection: 'reversed'
|
colorscaleDirection: 'reversed',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -687,21 +691,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#6666ff'
|
color: '#6666ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#4444ff'
|
color: '#4444ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -713,7 +717,8 @@ describe('graphHelper.js', () => {
|
|||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -721,21 +726,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#6666ff'
|
color: '#6666ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -747,7 +752,8 @@ describe('graphHelper.js', () => {
|
|||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'reversed'
|
colorscaleDirection: 'reversed',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -756,21 +762,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#6666ff'
|
color: '#6666ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -782,7 +788,8 @@ describe('graphHelper.js', () => {
|
|||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
colorscale: ['#aaaaff', '#0000ff'],
|
colorscale: ['#aaaaff', '#0000ff'],
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -791,21 +798,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
data: { type: 0, node_id: 1, color: 'red', points: 5 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
data: { type: 0, node_id: 2, color: '#abcdff', points: 15 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3, color: '#123456', points: 10 },
|
data: { type: 0, node_id: 3, color: '#12345680', points: 10 },
|
||||||
color: '#5555ff'
|
color: '#5555ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -834,7 +841,8 @@ describe('graphHelper.js', () => {
|
|||||||
source: 'country',
|
source: 'country',
|
||||||
sourceUsage: 'map_to',
|
sourceUsage: 'map_to',
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 100
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -842,14 +850,14 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1, country: 'NL' },
|
data: { type: 0, node_id: 1, country: 'NL' },
|
||||||
color: '#000000'
|
color: '#000000ff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2, country: 'GB' },
|
data: { type: 0, node_id: 2, country: 'GB' },
|
||||||
color: '#000000'
|
color: '#000000ff'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -887,15 +895,15 @@ describe('graphHelper.js', () => {
|
|||||||
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
||||||
color: '#ff0000'
|
color: '#ff0000ff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
||||||
color: '#ff0000'
|
color: '#ff0000ff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
||||||
color: '#ff0000'
|
color: '#ff0000ff'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -914,15 +922,15 @@ describe('graphHelper.js', () => {
|
|||||||
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
||||||
color: '#6666ff'
|
color: '#6666ffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
||||||
color: '#8888ff'
|
color: '#8888ffff'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -940,15 +948,15 @@ describe('graphHelper.js', () => {
|
|||||||
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
||||||
color: '#6666ff'
|
color: '#6666ffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
||||||
color: '#4444ff'
|
color: '#4444ffff'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -966,15 +974,15 @@ describe('graphHelper.js', () => {
|
|||||||
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
||||||
color: '#6666ff'
|
color: '#6666ffff'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -992,15 +1000,15 @@ describe('graphHelper.js', () => {
|
|||||||
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
expect(graph.export().edges.map(edge => edge.attributes)).to.eql([
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
data: { type: 1, source: 1, target: 2, color: 'red', weight: 5 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
data: { type: 1, source: 1, target: 3, color: 'red', weight: 15 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
data: { type: 1, source: 2, target: 3, color: 'red', weight: 10 },
|
||||||
color: '#6666ff'
|
color: '#6666ffff'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
@@ -1035,7 +1043,8 @@ describe('graphHelper.js', () => {
|
|||||||
method: 'degree',
|
method: 'degree',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'categorical',
|
mode: 'categorical',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -1043,21 +1052,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1 },
|
data: { type: 0, node_id: 1 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2 },
|
data: { type: 0, node_id: 2 },
|
||||||
color: '#8888ff'
|
color: '#8888ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3 },
|
data: { type: 0, node_id: 3 },
|
||||||
color: '#8888ff'
|
color: '#8888ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -1068,7 +1077,8 @@ describe('graphHelper.js', () => {
|
|||||||
method: 'outDegree',
|
method: 'outDegree',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'categorical',
|
mode: 'categorical',
|
||||||
colorscaleDirection: 'reversed'
|
colorscaleDirection: 'reversed',
|
||||||
|
opacity: 50
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1077,21 +1087,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1 },
|
data: { type: 0, node_id: 1 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2 },
|
data: { type: 0, node_id: 2 },
|
||||||
color: '#4444ff'
|
color: '#4444ff80'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3 },
|
data: { type: 0, node_id: 3 },
|
||||||
color: '#0000ff'
|
color: '#0000ff80'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -1102,7 +1112,8 @@ describe('graphHelper.js', () => {
|
|||||||
method: 'degree',
|
method: 'degree',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'normal'
|
colorscaleDirection: 'normal',
|
||||||
|
opacity: 100
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
expect(graph.export().nodes).to.eql([
|
expect(graph.export().nodes).to.eql([
|
||||||
@@ -1110,21 +1121,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1 },
|
data: { type: 0, node_id: 1 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2 },
|
data: { type: 0, node_id: 2 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3 },
|
data: { type: 0, node_id: 3 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -1135,7 +1146,8 @@ describe('graphHelper.js', () => {
|
|||||||
method: 'degree',
|
method: 'degree',
|
||||||
colorscale,
|
colorscale,
|
||||||
mode: 'continious',
|
mode: 'continious',
|
||||||
colorscaleDirection: 'reversed'
|
colorscaleDirection: 'reversed',
|
||||||
|
opacity: 100
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1144,21 +1156,21 @@ describe('graphHelper.js', () => {
|
|||||||
key: '1',
|
key: '1',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 1 },
|
data: { type: 0, node_id: 1 },
|
||||||
color: '#0000ff'
|
color: '#0000ffff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '2',
|
key: '2',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 2 },
|
data: { type: 0, node_id: 2 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: '3',
|
key: '3',
|
||||||
attributes: {
|
attributes: {
|
||||||
data: { type: 0, node_id: 3 },
|
data: { type: 0, node_id: 3 },
|
||||||
color: '#aaaaff'
|
color: '#aaaaffff'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ describe('storedInquiries.js', () => {
|
|||||||
expect(inquiries).to.eql([])
|
expect(inquiries).to.eql([])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('getStoredInquiries migrate and returns inquiries of v1', () => {
|
it('getStoredInquiries migrates and returns inquiries of v1', () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
'myQueries',
|
'myQueries',
|
||||||
JSON.stringify([
|
JSON.stringify([
|
||||||
@@ -55,6 +55,113 @@ describe('storedInquiries.js', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('getStoredInquiries migrates and returns inquiries of v2', () => {
|
||||||
|
localStorage.setItem(
|
||||||
|
'myInquiries',
|
||||||
|
JSON.stringify({
|
||||||
|
version: 2,
|
||||||
|
inquiries: [
|
||||||
|
{
|
||||||
|
id: 'Xh1Hc9v7P3mRPZVM59QiC',
|
||||||
|
query: 'SELECT * from doc',
|
||||||
|
viewType: 'graph',
|
||||||
|
viewOptions: {
|
||||||
|
structure: {
|
||||||
|
nodeId: 'node_id',
|
||||||
|
objectType: 'object_type',
|
||||||
|
edgeSource: 'source',
|
||||||
|
edgeTarget: 'target'
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
backgroundColor: 'white',
|
||||||
|
nodes: {
|
||||||
|
size: { type: 'constant', value: 10 },
|
||||||
|
color: {
|
||||||
|
type: 'calculated',
|
||||||
|
method: 'degree',
|
||||||
|
colorscale: null,
|
||||||
|
mode: 'continious',
|
||||||
|
colorscaleDirection: 'reversed'
|
||||||
|
},
|
||||||
|
label: { source: 'label', color: '#444444' }
|
||||||
|
},
|
||||||
|
edges: {
|
||||||
|
showDirection: true,
|
||||||
|
size: { type: 'constant', value: 2 },
|
||||||
|
color: { type: 'constant', value: '#a2b1c6' },
|
||||||
|
label: { source: null, color: '#a2b1c6' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
layout: { type: 'circular', options: null }
|
||||||
|
},
|
||||||
|
name: 'student graph',
|
||||||
|
updatedAt: '2026-01-19T21:49:40.708Z',
|
||||||
|
createdAt: '2026-01-19T21:46:13.899Z'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'Yh1Hc9v7P3mRPZVM59QiD',
|
||||||
|
query: 'SELECT * from test',
|
||||||
|
viewType: 'chart',
|
||||||
|
viewOptions: 'some chart view options',
|
||||||
|
name: 'student chart',
|
||||||
|
updatedAt: '2026-01-19T21:49:40.708Z',
|
||||||
|
createdAt: '2026-01-19T21:46:13.899Z'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
)
|
||||||
|
const inquiries = storedInquiries.getStoredInquiries()
|
||||||
|
expect(inquiries).to.eql([
|
||||||
|
{
|
||||||
|
id: 'Xh1Hc9v7P3mRPZVM59QiC',
|
||||||
|
query: 'SELECT * from doc',
|
||||||
|
viewType: 'graph',
|
||||||
|
viewOptions: {
|
||||||
|
structure: {
|
||||||
|
nodeId: 'node_id',
|
||||||
|
objectType: 'object_type',
|
||||||
|
edgeSource: 'source',
|
||||||
|
edgeTarget: 'target'
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
backgroundColor: 'white',
|
||||||
|
nodes: {
|
||||||
|
size: { type: 'constant', value: 10 },
|
||||||
|
color: {
|
||||||
|
type: 'calculated',
|
||||||
|
method: 'degree',
|
||||||
|
colorscale: null,
|
||||||
|
mode: 'continious',
|
||||||
|
colorscaleDirection: 'reversed',
|
||||||
|
opacity: 100
|
||||||
|
},
|
||||||
|
label: { source: 'label', color: '#444444' }
|
||||||
|
},
|
||||||
|
edges: {
|
||||||
|
showDirection: true,
|
||||||
|
size: { type: 'constant', value: 2 },
|
||||||
|
color: { type: 'constant', value: '#a2b1c6' },
|
||||||
|
label: { source: null, color: '#a2b1c6' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
layout: { type: 'circular', options: null }
|
||||||
|
},
|
||||||
|
name: 'student graph',
|
||||||
|
updatedAt: '2026-01-19T21:49:40.708Z',
|
||||||
|
createdAt: '2026-01-19T21:46:13.899Z'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'Yh1Hc9v7P3mRPZVM59QiD',
|
||||||
|
query: 'SELECT * from test',
|
||||||
|
viewType: 'chart',
|
||||||
|
viewOptions: 'some chart view options',
|
||||||
|
name: 'student chart',
|
||||||
|
updatedAt: '2026-01-19T21:49:40.708Z',
|
||||||
|
createdAt: '2026-01-19T21:46:13.899Z'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
it('updateStorage and getStoredInquiries', () => {
|
it('updateStorage and getStoredInquiries', () => {
|
||||||
const data = [{ id: 1 }, { id: 2 }]
|
const data = [{ id: 1 }, { id: 2 }]
|
||||||
storedInquiries.updateStorage(data)
|
storedInquiries.updateStorage(data)
|
||||||
@@ -136,7 +243,7 @@ describe('storedInquiries.js', () => {
|
|||||||
const str = storedInquiries.serialiseInquiries(inquiryList)
|
const str = storedInquiries.serialiseInquiries(inquiryList)
|
||||||
const parsedJson = JSON.parse(str)
|
const parsedJson = JSON.parse(str)
|
||||||
|
|
||||||
expect(parsedJson.version).to.equal(2)
|
expect(parsedJson.version).to.equal(3)
|
||||||
expect(parsedJson.inquiries).to.have.lengthOf(2)
|
expect(parsedJson.inquiries).to.have.lengthOf(2)
|
||||||
expect(parsedJson.inquiries[1]).to.eql(inquiryList[1])
|
expect(parsedJson.inquiries[1]).to.eql(inquiryList[1])
|
||||||
expect(parsedJson.inquiries[0]).to.eql({
|
expect(parsedJson.inquiries[0]).to.eql({
|
||||||
@@ -215,7 +322,7 @@ describe('storedInquiries.js', () => {
|
|||||||
it('deserialiseInquiries generates new id to avoid duplication', () => {
|
it('deserialiseInquiries generates new id to avoid duplication', () => {
|
||||||
storedInquiries.updateStorage([{ id: 1 }])
|
storedInquiries.updateStorage([{ id: 1 }])
|
||||||
const str = `{
|
const str = `{
|
||||||
"version": 2,
|
"version": 3,
|
||||||
"inquiries": [
|
"inquiries": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -275,7 +382,7 @@ describe('storedInquiries.js', () => {
|
|||||||
|
|
||||||
it('importInquiries', async () => {
|
it('importInquiries', async () => {
|
||||||
const str = `{
|
const str = `{
|
||||||
"version": 2,
|
"version": 3,
|
||||||
"inquiries": [{
|
"inquiries": [{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": "foo",
|
"name": "foo",
|
||||||
@@ -327,7 +434,7 @@ describe('storedInquiries.js', () => {
|
|||||||
|
|
||||||
it('readPredefinedInquiries', async () => {
|
it('readPredefinedInquiries', async () => {
|
||||||
const str = `{
|
const str = `{
|
||||||
"version": 2,
|
"version": 3,
|
||||||
"inquiries": [
|
"inquiries": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { expect } from 'chai'
|
|||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import { mount, shallowMount } from '@vue/test-utils'
|
import { mount, shallowMount } from '@vue/test-utils'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import Inquiries from '@/views/MainView/Inquiries'
|
import Inquiries from '@/views/Inquiries'
|
||||||
import storedInquiries from '@/lib/storedInquiries'
|
import storedInquiries from '@/lib/storedInquiries'
|
||||||
import mutations from '@/store/mutations'
|
import mutations from '@/store/mutations'
|
||||||
import actions from '@/store/actions'
|
import actions from '@/store/actions'
|
||||||
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'
|
|||||||
import actions from '@/store/actions'
|
import actions from '@/store/actions'
|
||||||
import mutations from '@/store/mutations'
|
import mutations from '@/store/mutations'
|
||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import Workspace from '@/views/MainView/Workspace'
|
import Workspace from '@/views/Workspace'
|
||||||
|
|
||||||
describe('Workspace.vue', () => {
|
describe('Workspace.vue', () => {
|
||||||
it('Creates a tab with example if schema is empty', () => {
|
it('Creates a tab with example if schema is empty', () => {
|
||||||
Reference in New Issue
Block a user