Skip to content

Commit 71cdc36

Browse files
author
Soroush Saffari
authored
Release Workbase 1.2.10 (#297)
## What is the goal of this PR? Prepares Workbase for the 1.2.10 release. ## What are the changes implemented in this PR?
1 parent 7436abc commit 71cdc36

File tree

21 files changed

+155
-63
lines changed

21 files changed

+155
-63
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.9
1+
1.2.10

dependencies/graknlabs/dependencies.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def graknlabs_grakn_core():
2929
git_repository(
3030
name = "graknlabs_grakn_core",
3131
remote = "https://github.com/graknlabs/grakn",
32-
commit = "ababa285be4d0d71a537d77d1990c4291da7c16e", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_grakn_core
32+
tag = "1.7.2", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_grakn_core
3333
)
3434

3535
def graknlabs_client_nodejs():
3636
git_repository(
3737
name = "graknlabs_client_nodejs",
3838
remote = "https://github.com/graknlabs/client-nodejs",
39-
commit = "b85668f7063b2313ed02ab35cd0922e67d1f9f4b", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_client_nodejs
39+
tag = "1.7.0", # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_client_nodejs
4040
)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@blueprintjs/table": "^3.1.1",
5252
"codemirror": "^5.38.0",
5353
"electron-store": "^1.3.0",
54-
"grakn-client": "https://repo.grakn.ai/repository/npm-snapshot-group/grakn-client/-/grakn-client-0.0.0-b85668f7063b2313ed02ab35cd0922e67d1f9f4b.tgz",
54+
"grakn-client": "1.7.0",
5555
"grpc": "^1.18.0",
5656
"hex-to-hsl": "^1.0.2",
5757
"image-data-uri": "^1.1.1",
@@ -165,5 +165,5 @@
165165
"prebuild": "node version.js",
166166
"unit": "node ./node_modules/jest/bin/jest.js ./test/unit"
167167
},
168-
"version": "1.2.9"
168+
"version": "1.2.10"
169169
}

src/renderer/components/SchemaDesign/LeftBar/NewAttributePanel.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
<div class="row">
2525
<div class="data-type-options">
2626
<div class="list-label">data type</div>
27-
<div v-if="superType === 'attribute'" class="btn data-type-btn" :class="(showDataTypeList) ? 'type-list-shown' : ''" @click="toggleDataList"><div class="type-btn-text" >{{valueType}}</div><div class="type-btn-caret"><vue-icon className="vue-icon" icon="caret-down"></vue-icon></div></div>
28-
<div v-else class="inherited-data-type">{{valueType}}</div>
27+
<div v-if="superType === 'attribute'" class="btn data-type-btn" :class="(showDataTypeList) ? 'type-list-shown' : ''" @click="toggleDataList"><div class="type-btn-text" >{{dataType}}</div><div class="type-btn-caret"><vue-icon className="vue-icon" icon="caret-down"></vue-icon></div></div>
28+
<div v-else class="inherited-data-type">{{dataType}}</div>
2929

3030
<div class="data-type-list" v-show="showDataTypeList">
31-
<ul v-for="type in valueTypes" :key=type>
32-
<li class="type-item" @click="selectDataType(type)" :class="[(type === valueType) ? 'type-item-selected' : '']">{{type}}</li>
31+
<ul v-for="type in dataTypes" :key=type>
32+
<li class="type-item" @click="selectDataType(type)" :class="[(type === dataType) ? 'type-item-selected' : '']">{{type}}</li>
3333
</ul>
3434
</div>
3535
</div>
@@ -371,8 +371,8 @@
371371
superTypes: [],
372372
superType: undefined,
373373
showDataTypeList: false,
374-
valueTypes: ['string', 'long', 'double', 'boolean', 'datetime'],
375-
valueType: undefined,
374+
dataTypes: ['string', 'long', 'double', 'boolean', 'date'],
375+
dataType: undefined,
376376
showSpinner: false,
377377
toggledAttributeTypes: [],
378378
toggledRoleTypes: [],
@@ -411,15 +411,15 @@
411411
if (val !== 'attribute') { // if super type is not 'attribute' set data type of super type
412412
const graknTx = await this[OPEN_GRAKN_TX]();
413413
const attributeType = await graknTx.getSchemaConcept(val);
414-
this.valueType = (await attributeType.valueType()).toLowerCase();
414+
this.dataType = (await attributeType.dataType()).toLowerCase();
415415
this.showDataTypeList = false;
416416
417417
const sup = await graknTx.getSchemaConcept(val);
418418
this.supAttributes = await Promise.all((await (await sup.attributes()).collect()).map(async x => x.label()));
419419
this.hasAttributes = this.hasAttributes.filter(x => !this.supAttributes.includes(x));
420420
graknTx.close();
421421
} else {
422-
this.valueType = this.valueTypes[0];
422+
this.dataType = this.dataTypes[0];
423423
424424
this.hasAttributes = this.metaTypeInstances.attributes;
425425
this.supAttributes = [];
@@ -433,7 +433,7 @@
433433
} else {
434434
this.showSpinner = true;
435435
this[DEFINE_ATTRIBUTE_TYPE]({
436-
attributeLabel: this.attributeLabel, superType: this.superType, valueType: this.valueType, attributeTypes: this.toggledAttributeTypes, roleTypes: this.toggledRoleTypes,
436+
attributeLabel: this.attributeLabel, superType: this.superType, dataType: this.dataType, attributeTypes: this.toggledAttributeTypes, roleTypes: this.toggledRoleTypes,
437437
})
438438
.then(() => {
439439
this.showSpinner = false;
@@ -452,7 +452,7 @@
452452
this.showAttributeTypeList = false;
453453
},
454454
selectDataType(type) {
455-
this.valueType = type;
455+
this.dataType = type;
456456
this.showDataTypeList = false;
457457
},
458458
resetPanel() {
@@ -461,7 +461,7 @@
461461
this.showDataTypeList = false;
462462
this.superTypes = ['attribute', ...this.metaTypeInstances.attributes];
463463
this.superType = this.superTypes[0];
464-
this.valueType = this.valueTypes[0];
464+
this.dataType = this.dataTypes[0];
465465
this.toggledAttributeTypes = [];
466466
this.toggledRoleTypes = [];
467467
this.showHasPanel = false;

src/renderer/components/SchemaDesign/RightBar/ConceptInfoTab/AttributesPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div v-for="(value, index) in attributes" :key="index">
1414
<div class="content-item">
15-
<div class="label">{{value.type}}: {{value.valueType}}</div>
15+
<div class="label">{{value.type}}: {{value.dataType}}</div>
1616
<div class="btn right-bar-btn reset-setting-btn" @click="removeAttributeType(value.type, index)"><vue-icon icon="trash" className="vue-icon" iconSize="12"></vue-icon></div>
1717
</div>
1818
</div>

src/renderer/components/SchemaDesign/SchemaHandler.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { valueType } from 'grakn-client';
1+
import { dataType } from 'grakn-client';
22

33
let tx;
44

55
function SchemaHandler(graknTx) {
66
tx = graknTx;
77
}
88

9-
function toGraknDatatype(valueTypeParam) {
10-
switch (valueTypeParam) {
11-
case 'string': return valueType.STRING;
12-
case 'datetime': return valueType.DATETIME;
13-
case 'boolean': return valueType.BOOLEAN;
14-
case 'long': return valueType.LONG;
15-
case 'double': return valueType.DOUBLE;
16-
default: throw new Error(`Datatype not recognised. Received [${valueTypeParam}]`);
9+
function toGraknDatatype(dataTypeParam) {
10+
switch (dataTypeParam) {
11+
case 'string': return dataType.STRING;
12+
case 'date': return dataType.DATETIME;
13+
case 'boolean': return dataType.BOOLEAN;
14+
case 'long': return dataType.LONG;
15+
case 'double': return dataType.DOUBLE;
16+
default: throw new Error(`Datatype not recognised. Received [${dataTypeParam}]`);
1717
}
1818
}
1919

@@ -37,8 +37,8 @@ SchemaHandler.prototype.defineRelationType = async function define({ relationLab
3737
return type;
3838
};
3939

40-
SchemaHandler.prototype.defineAttributeType = async function define({ attributeLabel, superType, valueType }) {
41-
const type = await tx.putAttributeType(attributeLabel, toGraknDatatype(valueType));
40+
SchemaHandler.prototype.defineAttributeType = async function define({ attributeLabel, superType, dataType }) {
41+
const type = await tx.putAttributeType(attributeLabel, toGraknDatatype(dataType));
4242
const directSuper = await tx.getSchemaConcept(superType);
4343
await type.sup(directSuper);
4444
};

src/renderer/components/SchemaDesign/SchemaUtils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export async function loadMetaTypeInstances(graknTx) {
2727
.then(labels => labels.filter(l => l !== 'entity')
2828
.concat()
2929
.sort());
30-
metaTypeInstances.relations = await Promise.all(rels.map(async type => type.label()))
30+
metaTypeInstances.relations = await Promise.all(rels.map(async type => ((!await type.isImplicit()) ? type.label() : null)))
3131
.then(labels => labels.filter(l => l && l !== 'relation')
3232
.concat()
3333
.sort());
3434
metaTypeInstances.attributes = await Promise.all(attributes.map(type => type.label()))
3535
.then(labels => labels.filter(l => l !== 'attribute')
3636
.concat()
3737
.sort());
38-
metaTypeInstances.roles = await Promise.all(roles.map(async type => type.label()))
38+
metaTypeInstances.roles = await Promise.all(roles.map(async type => ((!await type.isImplicit()) ? type.label() : null)))
3939
.then(labels => labels.filter(l => l && l !== 'role')
4040
.concat()
4141
.sort());
@@ -47,7 +47,7 @@ export async function computeAttributes(nodes, graknTx) {
4747
return Promise.all(nodes.map(async (node) => {
4848
const concept = await graknTx.getSchemaConcept(node.label);
4949
const attributes = await (await concept.attributes()).collect();
50-
node.attributes = await Promise.all(attributes.map(async concept => ({ type: await concept.label(), valueType: await concept.valueType() })));
50+
node.attributes = await Promise.all(attributes.map(async concept => ({ type: await concept.label(), dataType: await concept.dataType() })));
5151
return node;
5252
}));
5353
}
@@ -57,7 +57,7 @@ export async function computeRoles(nodes, graknTx) {
5757
return Promise.all(nodes.map(async (node) => {
5858
const concept = await graknTx.getSchemaConcept(node.label);
5959
const roles = await (await concept.playing()).collect();
60-
node.roles = await Promise.all(roles.map(concept => concept.label())).then(nodes => nodes.filter(x => x));
60+
node.roles = await Promise.all(roles.map(async concept => ((await concept.isImplicit()) ? null : concept.label()))).then(nodes => nodes.filter(x => x));
6161
return node;
6262
}));
6363
}

src/renderer/components/SchemaDesign/store/actions.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import CDB from '../../shared/CanvasDataBuilder';
3131
import { META_LABELS } from '../../shared/SharedUtils';
3232

3333
export default {
34-
async [OPEN_GRAKN_TX]({ state, commit }) {
35-
const graknTx = await state.graknSession.transaction().write();
34+
async [OPEN_GRAKN_TX]({ commit }) {
35+
const graknTx = await global.graknSession.transaction().write();
3636
if (!global.graknTx) global.graknTx = {};
3737
global.graknTx.schemaDesign = graknTx;
3838
commit('setSchemaHandler', new SchemaHandler(graknTx));
@@ -43,7 +43,8 @@ export default {
4343
if (keyspace !== state.currentKeyspace) {
4444
dispatch(CANVAS_RESET);
4545
commit('currentKeyspace', keyspace);
46-
await commit('graknSession', await global.grakn.session(keyspace));
46+
if (global.graknSession) await global.graknSession.close();
47+
global.graknSession = await global.grakn.session(keyspace);
4748
dispatch(UPDATE_METATYPE_INSTANCES);
4849
dispatch(LOAD_SCHEMA);
4950
}

src/renderer/components/SchemaDesign/store/mutations.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ export default {
55
loadingSchema(state, isRunning) {
66
state.loadingSchema = isRunning;
77
},
8-
graknSession(state, session) {
9-
state.graknSession = session;
10-
},
118
setVisFacade(state, facade) {
129
state.visFacade = Object.freeze(facade); // Freeze it so that Vue does not attach watchers to its properties
1310
},

src/renderer/components/SchemaDesign/store/state.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export default {
77
currentKeyspace: null,
88
selectedNodes: null,
99
loadingSchema: false,
10-
graknSession: undefined,
1110
canvasData: { entities: 0, attributes: 0, relations: 0 },
1211
contextMenu: { show: false, x: null, y: null },
1312
schemaHandler: undefined,

0 commit comments

Comments
 (0)