|
24 | 24 | <div class="row"> |
25 | 25 | <div class="data-type-options"> |
26 | 26 | <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> |
29 | 29 |
|
30 | 30 | <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> |
33 | 33 | </ul> |
34 | 34 | </div> |
35 | 35 | </div> |
|
371 | 371 | superTypes: [], |
372 | 372 | superType: undefined, |
373 | 373 | showDataTypeList: false, |
374 | | - valueTypes: ['string', 'long', 'double', 'boolean', 'datetime'], |
375 | | - valueType: undefined, |
| 374 | + dataTypes: ['string', 'long', 'double', 'boolean', 'date'], |
| 375 | + dataType: undefined, |
376 | 376 | showSpinner: false, |
377 | 377 | toggledAttributeTypes: [], |
378 | 378 | toggledRoleTypes: [], |
|
411 | 411 | if (val !== 'attribute') { // if super type is not 'attribute' set data type of super type |
412 | 412 | const graknTx = await this[OPEN_GRAKN_TX](); |
413 | 413 | const attributeType = await graknTx.getSchemaConcept(val); |
414 | | - this.valueType = (await attributeType.valueType()).toLowerCase(); |
| 414 | + this.dataType = (await attributeType.dataType()).toLowerCase(); |
415 | 415 | this.showDataTypeList = false; |
416 | 416 |
|
417 | 417 | const sup = await graknTx.getSchemaConcept(val); |
418 | 418 | this.supAttributes = await Promise.all((await (await sup.attributes()).collect()).map(async x => x.label())); |
419 | 419 | this.hasAttributes = this.hasAttributes.filter(x => !this.supAttributes.includes(x)); |
420 | 420 | graknTx.close(); |
421 | 421 | } else { |
422 | | - this.valueType = this.valueTypes[0]; |
| 422 | + this.dataType = this.dataTypes[0]; |
423 | 423 |
|
424 | 424 | this.hasAttributes = this.metaTypeInstances.attributes; |
425 | 425 | this.supAttributes = []; |
|
433 | 433 | } else { |
434 | 434 | this.showSpinner = true; |
435 | 435 | 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, |
437 | 437 | }) |
438 | 438 | .then(() => { |
439 | 439 | this.showSpinner = false; |
|
452 | 452 | this.showAttributeTypeList = false; |
453 | 453 | }, |
454 | 454 | selectDataType(type) { |
455 | | - this.valueType = type; |
| 455 | + this.dataType = type; |
456 | 456 | this.showDataTypeList = false; |
457 | 457 | }, |
458 | 458 | resetPanel() { |
|
461 | 461 | this.showDataTypeList = false; |
462 | 462 | this.superTypes = ['attribute', ...this.metaTypeInstances.attributes]; |
463 | 463 | this.superType = this.superTypes[0]; |
464 | | - this.valueType = this.valueTypes[0]; |
| 464 | + this.dataType = this.dataTypes[0]; |
465 | 465 | this.toggledAttributeTypes = []; |
466 | 466 | this.toggledRoleTypes = []; |
467 | 467 | this.showHasPanel = false; |
|
0 commit comments