Skip to content

Commit

Permalink
Merge branch 'refactor/db-overhaul' into 'master'
Browse files Browse the repository at this point in the history
Database Overhaul

Closes #140, #137, #136, #111, #113, and #112

See merge request b650/Deep-Lynx!86
  • Loading branch information
DnOberon committed Oct 19, 2021
2 parents 08d919a + ae917ce commit ad61a94
Show file tree
Hide file tree
Showing 133 changed files with 2,729 additions and 8,471 deletions.
98 changes: 55 additions & 43 deletions API Documentation/Core.swagger_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,6 @@ paths:
in: query
name: description
description: Filter metatypes with descriptions that match this pattern
- schema:
type: string
in: query
name: archived
description: Set to true to include archived metatypes
- schema:
type: string
in: query
Expand Down Expand Up @@ -1233,11 +1228,6 @@ paths:
in: query
name: description
description: Filter metatype relationships with descriptions that match this pattern
- schema:
type: string
in: query
name: archived
description: Set to true to include archived metatype relationships
- schema:
type: string
in: query
Expand Down Expand Up @@ -4281,21 +4271,27 @@ components:
metatype_id: required
modified_at: optional - set to update node along with the id to update if it exists
properties: {}
x-examples:
example-1:
container_id: required
id: optional - including this field will attempt to update a node with this id
original_data_id: 'optional - including this field will attempt to update a node with the same composite id (data source id + metatype id + original data id) if it exists, if not it will create it'
data_source_id: required
metatype_id: required
properties: {}
properties:
id:
type: string
description: ''
container_id:
type: string
original_data_id:
type: string
description: 'Passing in just the original data id will attempt to update a node with the same composite id (data source id, metatype id, and original data id).'
data_source_id:
type: string
data_type_mapping_id:
type: string
metatype_id:
type: string
modified_at:
type: string
properties:
type: object
required:
Expand All @@ -4305,51 +4301,67 @@ components:
- properties
CreateOrUpdateEdgesRequest:
title: CreateOrUpdateEdgesRequest
required:
- container_id
- data_source_id
- destination_node_id
- destination_node_original_id
- modified_at
- origin_node_id
- origin_node_original_id
- original_data_id
- properties
- relationship_pair_id
type: object
example:
container_id: required
original_data_id: required
data_source_id: required
origin_node_id: required (if origin_node_original_id not set)
destination_node_id: required (if destination_node_original_id not set)
origin_node_original_id: 'create edge based on original ID of node, not Deep Lynx ID'
destination_node_original_id: 'create edge based on original ID of node, not Deep Lynx ID'
relationship_pair_id: required
modified_at: will attempt to update edge if exists
properties: {}
properties:
container_id:
type: string
original_data_id:
type: string
data_source_id:
type: string
origin_node_id:
origin_id:
type: string
destination_node_id:
destination_id:
type: string
origin_node_original_id:
origin_original_id:
type: string
destination_node_original_id:
destination_original_id:
type: string
relationship_pair_id:
type: string
modified_at:
origin_data_source_id:
type: string
destination_data_source_id:
type: string
destination_metatype_id:
type: string
origin_metatype_id:
type: string
properties:
type: object
required:
- container_id
- data_source_id
- origin_id
- destination_id
- origin_original_id
- destination_original_id
- relationship_pair_id
- properties
x-examples:
example-1:
container_id: required
data_source_id: required
origin_id: required (if origin_original_id not set)
destination_id: required (if destination_original_id not set)
origin_original_id: create edge based on composite id of node ( data source id + metatype id + original id of node)
origin_metatype_id: required if using original id for edge creation
origin_data_source_id: required if using original id for edge creation
destination_original_id: create edge based on composite id of node (data source id + metatype id + original id of node)D
destination_metatype_id: required if using original id for edge creation
destination_data_source_id: required if using original id for edge creation
relationship_pair_id: required
modified_at: will attempt to update edge if exists
properties: {}
example:
container_id: required
original_data_id: required
data_source_id: required
origin_node_id: required (if origin_node_original_id not set)
destination_node_id: required (if destination_node_original_id not set)
origin_node_original_id: 'create edge based on original ID of node, not Deep Lynx ID'
destination_node_original_id: 'create edge based on original ID of node, not Deep Lynx ID'
relationship_pair_id: required
modified_at: will attempt to update edge if exists
properties: {}
NewMetatypeRequest:
title: NewMetatypeRequest
required:
Expand Down
8 changes: 7 additions & 1 deletion Admin Web App/src/components/searchMetatypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:clearable="multiple"
:disabled="disabled"
>
<template slot="append-outer"><info-tooltip :message="$t('dataMapping.metatypeSearchHelp')"></info-tooltip> </template>
<template v-if="tooltip" slot="append-outer"><info-tooltip :message="tooltipHelp"></info-tooltip> </template>
</v-combobox>
</div>
</template>
Expand All @@ -35,6 +35,12 @@ export default class SearchMetatypes extends Vue {
@Prop({required: false, default: false})
disabled?: boolean
@Prop({required: false, default: false})
tooltip!: boolean
@Prop({required: false, default: ''})
tooltipHelp!: string
@Prop({required: false})
metatypeID?: string | string[]
Expand Down
9 changes: 9 additions & 0 deletions Admin Web App/src/components/selectDataSource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<span v-if="data.item.archived" class="text--disabled">{{data.item.name}} - <i class="text-caption">{{$t('dataSources.archived')}}</i></span>
<span v-else>{{data.item.name}}</span>
</template>


<template v-if="tooltip" slot="append-outer"><info-tooltip :message="tooltipHelp"></info-tooltip> </template>
</v-combobox>
</div>
</template>
Expand All @@ -32,6 +35,12 @@ export default class SelectDataSource extends Vue {
@Prop({required: false, default: false})
showArchived!: boolean
@Prop({required: false, default: false})
tooltip!: boolean
@Prop({required: false, default: ''})
tooltipHelp!: string
@Prop({required: false, default: false})
multiple!: boolean
Expand Down
138 changes: 114 additions & 24 deletions Admin Web App/src/components/transformationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -340,30 +340,78 @@
</v-autocomplete>

<v-row v-if="this.selectedRelationshipPair">
<v-col>
<v-select
:items="payloadKeys"
v-model="origin_key"
:rules="[v => !!v || 'Item is required']"
required
>

<template v-slot:label>{{$t('dataMapping.originKey')}} <small style="color:red">{{$t('dataMapping.required')}}</small></template>
<template slot="append-outer">{{$t('dataMapping.and')}}</template>
</v-select>
</v-col>
<v-col>
<v-select
:items="payloadKeys"
v-model="destination_key"
:rules="[v => !!v || 'Item is required']"
required
>

<template v-slot:label>{{$t('dataMapping.destinationKey')}} <small style="color:red">{{$t('dataMapping.required')}}</small></template>
<template slot="append-outer"><info-tooltip :message="$t('dataMapping.originDestinationKeyHelp')"></info-tooltip> </template>
</v-select>
</v-col>
<v-row>
<v-col>
<h3>{{$t('dataMapping.parentInformation')}}</h3>
</v-col>
<v-col>
<h3>{{$t('dataMapping.childInformation')}}</h3>
</v-col>
</v-row>

<!-- ID Keys -->
<v-row>
<v-col>
<v-select
:items="payloadKeys"
v-model="origin_key"
:rules="[v => !!v || 'Item is required']"
required
>

<template v-slot:label>{{$t('dataMapping.originKey')}} <small style="color:red">{{$t('dataMapping.required')}}</small></template>
</v-select>
</v-col>
<v-col>
<v-select
:items="payloadKeys"
v-model="destination_key"
:rules="[v => !!v || 'Item is required']"
required
>

<template v-slot:label>{{$t('dataMapping.destinationKey')}} <small style="color:red">{{$t('dataMapping.required')}}</small></template>
<template slot="append-outer"><info-tooltip :message="$t('dataMapping.originDestinationKeyHelp')"></info-tooltip> </template>
</v-select>
</v-col>
</v-row>

<!-- Data Sources -->
<v-row>
<v-col style="padding: 0px">
<select-data-source
@selected="setParentDataSource"
:containerID="containerID">
</select-data-source>
</v-col>
<v-col style="padding: 0px">
<select-data-source
:tooltip="true"
@selected="setChildDataSource"
:tooltipHelp="$t('dataMapping.dataSourceRelationshipHelp')"
:containerID="containerID">
</select-data-source>
</v-col>
</v-row>


<!-- Metatypes -->
<v-row>
<v-col>
<search-metatypes
@selected="setParentMetatype"
:containerID="containerID">
</search-metatypes>
</v-col>
<v-col>
<search-metatypes
:tooltip="true"
@selected="setChildMetatype"
:tooltipHelp="$t('dataMapping.metatypeRelationshipHelp')"
:containerID="containerID">
</search-metatypes>
</v-col>
</v-row>
</v-row>

<br>
Expand Down Expand Up @@ -495,6 +543,7 @@
<script lang="ts">
import {Component, Prop, Vue, Watch} from 'vue-property-decorator'
import {
DataSourceT,
MetatypeKeyT,
MetatypeRelationshipKeyT,
MetatypeRelationshipPairT,
Expand All @@ -505,8 +554,11 @@ import {
TypeMappingTransformationT
} from "@/api/types";
import {getNestedValue} from "@/utilities";
import SelectDataSource from "@/components/selectDataSource.vue";
import SearchMetatypes from "@/components/searchMetatypes.vue";

@Component({
components: {SelectDataSource, SearchMetatypes},
filters: {
pretty: function(value: any) {
return JSON.stringify(value, null, 2)
Expand Down Expand Up @@ -586,7 +638,13 @@ export default class TransformationDialog extends Vue {
selectedMetatypeKeys: MetatypeKeyT[] = []

origin_key: any = null
origin_data_source_id: any = null
origin_metatype_id: any = null

destination_key: any = null
destination_data_source_id: any = null
destination_metatype_id: any = null

uniqueIdentifierKey: any = null
propertyMapping: {[key: string]: any}[] = []

Expand Down Expand Up @@ -951,7 +1009,11 @@ export default class TransformationDialog extends Vue {
} else if(this.selectedRelationshipPair) {
payload.metatype_relationship_pair_id = this.selectedRelationshipPair.id
payload.origin_id_key = this.origin_key
payload.origin_data_source_id = this.origin_data_source_id
payload.origin_metatype_id = this.origin_metatype_id
payload.destination_id_key = this.destination_key
payload.destination_metatype_id = this.destination_metatype_id
payload.destination_data_source_id = this.destination_data_source_id
}

payload.conditions = this.conditions
Expand All @@ -977,7 +1039,11 @@ export default class TransformationDialog extends Vue {
payload.metatype_id = (this.selectedMetatype?.id) ? this.selectedMetatype.id : ""
payload.metatype_relationship_pair_id = (this.selectedRelationshipPair?.id) ? this.selectedRelationshipPair.id : ""
payload.origin_id_key = this.origin_key
payload.origin_data_source_id = this.origin_data_source_id
payload.origin_metatype_id = this.origin_metatype_id
payload.destination_id_key = this.destination_key
payload.destination_metatype_id = this.destination_metatype_id
payload.destination_data_source_id = this.destination_data_source_id

payload.conditions = this.conditions
payload.keys = this.propertyMapping
Expand Down Expand Up @@ -1209,6 +1275,30 @@ export default class TransformationDialog extends Vue {
condition.subexpressions = condition.subexpressions.filter(s => s !== subexpression)
}

setParentDataSource(ds: DataSourceT) {
if(ds) {
this.origin_data_source_id = ds.id as string
}
}

setChildDataSource(ds: DataSourceT) {
if(ds) {
this.destination_data_source_id = ds.id as string
}
}

setParentMetatype(m: MetatypeT) {
if(m) {
this.origin_metatype_id = m.id
}
}

setChildMetatype(m: MetatypeT) {
if(m) {
this.destination_metatype_id = m.id
}
}

get isMainFormValid() {
if(!this.requiredKeysMapped) {
return false
Expand Down
Loading

0 comments on commit ad61a94

Please sign in to comment.