Skip to content

Commit

Permalink
Merge pull request #143 from Digital-Engineering/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
DnOberon authored and GitHub Enterprise committed Dec 7, 2022
2 parents 8fcea52 + a99ca49 commit c659bc0
Show file tree
Hide file tree
Showing 40 changed files with 1,487 additions and 372 deletions.
51 changes: 51 additions & 0 deletions API Documentation/Core.swagger_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4837,6 +4837,57 @@ paths:
'200':
description: OK
description: 'This endpoint copies transformations from the {originalMappingID} type mapping (final parameter) to the {mappingID} type mapping. This POST has NO body.'
'/containers/:container_id/import/datasources/:data_source_id/files/:file_id':
parameters: []
put:
summary: Update files
operationId: put-containers-container_id-import-datasources-datasource_id-files-file_id
responses:
'200':
description: OK
'500':
description: Internal Server Error
description: Update a file
parameters:
- schema:
type: string
in: header
name: Authorization
description: Bearer token
requestBody:
content:
application/json:
schema:
type: object
properties:
file:
type: object
metadata:
type: object
examples: {}
multipart/form-data:
schema:
type: object
properties:
file:
type: object
metadata:
type: string
required:
- file
examples:
example-1:
value:
file: null
application/xml:
schema:
type: object
properties: {}
description: |-
Key/value pair where the key is named 'file' and the file is any file.
Optionally, any metadata can be added
x-internal: false
components:
securitySchemes:
BearerAuth:
Expand Down
14 changes: 10 additions & 4 deletions AdminWebApp/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ export class Client {
if (config) this.config = config;
}

submitGraphQLQuery(containerID: string, query: any): Promise<any> {
submitGraphQLQuery(containerID: string, query: any, pointInTime?: string): Promise<any> {
if (query.query) {
query.query = query.query.replace(/\n/g, '');
}

return this.postRawReturn<any>(`/containers/${containerID}/data`, query);
const queryParams: {[key: string]: any} = {};
if (pointInTime) queryParams.pointInTime = pointInTime;

return this.postRawReturn<any>(`/containers/${containerID}/data`, query, queryParams);
}

submitNodeGraphQLQuery(containerID: string, nodeID: string, query: any): Promise<any> {
Expand Down Expand Up @@ -652,8 +655,11 @@ export class Client {
return this.get<FileT[]>(`/containers/${containerID}/graphs/nodes/${nodeID}/files`);
}

listEdgesForNodeIDs(containerID: string, nodeIDS: string[]): Promise<EdgeT[]> {
return this.post<EdgeT[]>(`/containers/${containerID}/graphs/nodes/edges`, {node_ids: nodeIDS});
listEdgesForNodeIDs(containerID: string, nodeIDS: string[], pointInTime?: string): Promise<EdgeT[]> {
const query: {[key: string]: any} = {};
if (pointInTime) query.pointInTime = pointInTime;

return this.post<EdgeT[]>(`/containers/${containerID}/graphs/nodes/edges`, {node_ids: nodeIDS}, query);
}

listDataSources(containerID: string, archived = false, timeseries = false): Promise<DataSourceT[]> {
Expand Down
27 changes: 18 additions & 9 deletions AdminWebApp/src/components/data/editNodeDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<!-- Add Property Dialog -->
<v-dialog
v-model="addPropertyDialog"
@click:outside="closeDialog"
@click:outside="closeAddPropertyDialog"
max-width="50%"
>
<template v-slot:activator="{ on, attrs }">
Expand Down Expand Up @@ -98,7 +98,7 @@
<v-btn
color="blue darken-1"
text
@click="closeDialog"
@click="closeAddPropertyDialog"
>
{{$t("editNode.cancel")}}
</v-btn>
Expand Down Expand Up @@ -157,7 +157,7 @@ import {MetatypeKeyT, NodeT, PropertyT} from "../../api/types";
@Component({components: {}})
export default class EditNodeDialog extends Vue {
@Prop({required: true})
node!: NodeT;
node!: any;
@Prop({required: true})
containerID!: string;
Expand Down Expand Up @@ -225,6 +225,11 @@ export default class EditNodeDialog extends Vue {
this.nodeProperties.forEach( (property: any) => {
// look at supplied data type to determine property value changes
// types: ['number', 'number64', 'float', 'float64', 'date', 'string', 'boolean', 'enumeration', 'file', 'list', 'unknown']
const key = this.metatypeKeys.filter((key: MetatypeKeyT) => {
return key.property_name === property.key
})
if (key.length > 0) property.type = key[0].data_type
if (property.type === 'boolean') {
if (String(property.value).toLowerCase() === "true") {
property.value = true
Expand Down Expand Up @@ -262,26 +267,30 @@ export default class EditNodeDialog extends Vue {
"id": this.selectedNode!.id
}
)
.then(results => {
.then((results: NodeT[]) => {
this.close()
this.$emit('nodeUpdated', results[0])
const emitNode = results[0]
emitNode.metatype_id = this.node.metatype.id!
emitNode.metatype_name = this.node.metatype.name
this.$emit('nodeUpdated', emitNode)
})
.catch(e => this.errorMessage = this.$t('createNode.errorCreatingAPI') as string + e)
}
addProperty() {
this.nodeProperties.push(this.newProperty)
this.closeDialog()
this.closeAddPropertyDialog()
}
deleteProperty(item: any) {
deleteProperty(item: PropertyT) {
this.nodeProperties = this.nodeProperties.filter(( property: PropertyT ) => {
return property.key !== item.key && property.value !== item.value;
})
}
getKey() {
const key = this.metatypeKeys.filter((key: any) => {
const key = this.metatypeKeys.filter((key: MetatypeKeyT) => {
return key.property_name === this.newProperty.key
})
if (key.length > 0) this.newProperty.type = key[0].data_type
Expand All @@ -296,7 +305,7 @@ export default class EditNodeDialog extends Vue {
this.dialog = false
}
closeDialog() {
closeAddPropertyDialog() {
// reset property
this.newProperty = {
key: '',
Expand Down
2 changes: 1 addition & 1 deletion AdminWebApp/src/components/etl/transformationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
<template v-if="item.type === 'property'">
<metatype-keys-select
:containerID="containerID"
:metatypeID="selectedRelationshipPair.origin_metatype_id"
:metatypeID="selectedRelationshipPair.destination_metatype_id"
:multiple="false"
:propertyName="item.property"
@selected="setFilterPropertyKey(item, ...arguments)"
Expand Down
38 changes: 28 additions & 10 deletions AdminWebApp/src/components/queryBuilder/IDFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
<v-row>
<v-col :cols="3" style="padding-top:30px" class="text-right">{{$t('queryBuilder.deepLynxID')}}</v-col>
<v-col :cols="3">
<operators-select @selected="setOperator" :operator="operator" :disabled="disabled"></operators-select>
<operators-select
@selected="setOperator"
:operator="operator"
:disabled="disabled"
:custom_operators="operators"
></operators-select>
</v-col>
<v-col :cols="6">
<v-combobox
:multiple="operator === 'in'"
:clearable="operator === 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
>
</v-combobox>
<v-text-field v-if="operator !== 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
></v-text-field>
<v-combobox v-if="operator === 'in'"
multiple
clearable
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
></v-combobox>
</v-col>
</v-row>
</v-container>
Expand All @@ -36,6 +46,14 @@ export default class IDFilter extends Vue {
operator = ""
value = ""
operators = [
{text: 'equals', value: 'eq'},
{text: 'not equals', value: 'neq'},
{text: 'in', value: 'in'},
{text: 'less than', value: '<'},
{text: 'greater than', value: '>'},
]
beforeMount() {
if(this.queryPart) {
this.operator = this.queryPart.operator
Expand Down
23 changes: 14 additions & 9 deletions AdminWebApp/src/components/queryBuilder/OriginalIDFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@
<operators-select @selected="setOperator" :operator="operator" :disabled="disabled"></operators-select>
</v-col>
<v-col :cols="6">
<v-combobox
:multiple="operator === 'in'"
:clearable="operator === 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
>
</v-combobox>
<v-text-field v-if="operator !== 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
></v-text-field>
<v-combobox v-if="operator === 'in'"
multiple
clearable
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
></v-combobox>
</v-col>
</v-row>
</v-container>
Expand Down
24 changes: 15 additions & 9 deletions AdminWebApp/src/components/queryBuilder/PropertyFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@
item-value="property_name"
:disabled="disabled"
v-model="property"
:label="$t('queryBuilder.propertyKey')"
></v-combobox>
</v-col>
<v-col :cols="3">
<operators-select :disabled="disabled" @selected="setOperator" :operator="operator"></operators-select>
</v-col>
<v-col :cols="6">
<v-combobox
:disabled="disabled"
:multiple="operator === 'in'"
:clearable="operator === 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
v-model="value"
>
</v-combobox>
<v-text-field v-if="operator !== 'in'"
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
:disabled="disabled"
v-model="value"
></v-text-field>
<v-combobox v-if="operator === 'in'"
:disabled="disabled"
multiple
clearable
:placeholder="$t('queryBuilder.typeToAdd')"
@change="setValue"
v-model="value"
></v-combobox>
</v-col>
</v-row>
</v-container>
Expand Down
10 changes: 9 additions & 1 deletion AdminWebApp/src/components/queryBuilder/dataSourceFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<operators-select
:disabled="disabled"
@selected="setOperator"
:operator="operator"></operators-select>
:operator="operator"
:custom_operators="operators"
></operators-select>
</v-col>
<v-col :cols="6">
<select-data-source
Expand Down Expand Up @@ -37,6 +39,12 @@ export default class DataSourceFilter extends Vue {
@Prop({required: false, default: false})
disabled?: boolean
operators = [
{text: 'equals', value: 'eq'},
{text: 'not equals', value: 'neq'},
{text: 'in', value: 'in'},
]
operator = ""
dataSource: string | string[] = ""
Expand Down
16 changes: 14 additions & 2 deletions AdminWebApp/src/components/queryBuilder/metatypeFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<operators-select
:disabled="disabled"
@selected="setOperator"
:operator="operator"></operators-select>
:operator="operator"
:custom_operators="operators"
></operators-select>
</v-col>
<v-col :cols="6">
<search-metatypes
Expand All @@ -15,7 +17,11 @@
:metatypeID="metatype"
:multiple="operator === 'in'"
@selected="setMetatype"></search-metatypes>
<v-checkbox v-model="limitOntologyVersion" :label="$t('queryBuilder.limitOntology')"></v-checkbox>
<v-checkbox
v-model="limitOntologyVersion"
:label="$t('queryBuilder.limitOntology')"
:disabled="disabled"
/>
</v-col>
</v-row>
<v-row v-if="metatype !== ''">
Expand Down Expand Up @@ -73,6 +79,12 @@ export default class MetatypeFilter extends Vue {
keyQueryParts: QueryPart[] = []
limitOntologyVersion = false
operators = [
{text: 'equals', value: 'eq'},
{text: 'not equals', value: 'neq'},
{text: 'in', value: 'in'},
]
beforeMount() {
if(this.queryPart) {
this.operator = this.queryPart.operator
Expand Down
8 changes: 7 additions & 1 deletion AdminWebApp/src/components/queryBuilder/operatorsSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export default class OperatorsSelect extends Vue {
@Prop({required: false, default: false})
disabled?: boolean
operators = [
@Prop()
custom_operators?: {[key: string]: any}[]
default_operators = [
{text: 'equals', value: 'eq'},
{text: 'not equals', value: 'neq'},
{text: 'like', value: 'like'},
Expand All @@ -29,6 +32,9 @@ export default class OperatorsSelect extends Vue {
{text: 'greater than', value: '>'},
]
// override default operators if specified
operators = this.custom_operators !== undefined ? this.custom_operators : this.default_operators
selected = ""
beforeMount() {
Expand Down
Loading

0 comments on commit c659bc0

Please sign in to comment.