@@ -56,7 +56,7 @@
@@ -196,7 +196,7 @@ export default {
},
computed: {
selectedParamObj () {
- return this.parametersProxy.find(param => param._id === this.selectedParam);
+ return this.parametersProxy.find(param => param._antares_id === this.selectedParam);
},
isChanged () {
return JSON.stringify(this.localParameters) !== JSON.stringify(this.parametersProxy);
@@ -238,7 +238,7 @@ export default {
},
addParameter () {
this.parametersProxy = [...this.parametersProxy, {
- _id: uidGen(),
+ _antares_id: uidGen(),
name: `param${this.i++}`,
type: this.workspace.dataTypes[0].types[0].name,
context: 'IN',
@@ -253,7 +253,7 @@ export default {
}, 20);
},
removeParameter (uid) {
- this.parametersProxy = this.parametersProxy.filter(param => param._id !== uid);
+ this.parametersProxy = this.parametersProxy.filter(param => param._antares_id !== uid);
if (this.selectedParam === name && this.parametersProxy.length)
this.resetSelectedID();
@@ -266,7 +266,7 @@ export default {
this.resetSelectedID();
},
resetSelectedID () {
- this.selectedParam = this.parametersProxy.length ? this.parametersProxy[0]._id : '';
+ this.selectedParam = this.parametersProxy.length ? this.parametersProxy[0]._antares_id : '';
}
}
};
diff --git a/src/renderer/components/WorkspaceTabPropsTable.vue b/src/renderer/components/WorkspaceTabPropsTable.vue
index 10db2a23..3e392d61 100644
--- a/src/renderer/components/WorkspaceTabPropsTable.vue
+++ b/src/renderer/components/WorkspaceTabPropsTable.vue
@@ -342,7 +342,7 @@ export default {
field.default = `'${field.default}'`;
}
- return { ...field, _id: uidGen() };
+ return { ...field, _antares_id: uidGen() };
});
this.localFields = JSON.parse(JSON.stringify(this.originalFields));
}
@@ -365,7 +365,7 @@ export default {
this.originalIndexes = Object.keys(indexesObj).map(index => {
return {
- _id: uidGen(),
+ _antares_id: uidGen(),
name: index,
fields: indexesObj[index].map(field => field.column),
type: indexesObj[index][0].type,
@@ -391,7 +391,7 @@ export default {
if (status === 'success') {
this.originalKeyUsage = response.map(foreign => {
return {
- _id: uidGen(),
+ _antares_id: uidGen(),
...foreign
};
});
@@ -411,25 +411,25 @@ export default {
this.isSaving = true;
// FIELDS
- const originalIDs = this.originalFields.reduce((acc, curr) => [...acc, curr._id], []);
- const localIDs = this.localFields.reduce((acc, curr) => [...acc, curr._id], []);
+ const originalIDs = this.originalFields.reduce((acc, curr) => [...acc, curr._antares_id], []);
+ const localIDs = this.localFields.reduce((acc, curr) => [...acc, curr._antares_id], []);
// Fields Additions
- const additions = this.localFields.filter((field, i) => !originalIDs.includes(field._id)).map(field => {
- const lI = this.localFields.findIndex(localField => localField._id === field._id);
+ const additions = this.localFields.filter((field, i) => !originalIDs.includes(field._antares_id)).map(field => {
+ const lI = this.localFields.findIndex(localField => localField._antares_id === field._antares_id);
const after = lI > 0 ? this.localFields[lI - 1].name : false;
return { ...field, after };
});
// Fields Deletions
- const deletions = this.originalFields.filter(field => !localIDs.includes(field._id));
+ const deletions = this.originalFields.filter(field => !localIDs.includes(field._antares_id));
// Fields Changes
const changes = [];
this.originalFields.forEach((originalField, oI) => {
- const lI = this.localFields.findIndex(localField => localField._id === originalField._id);
- const originalSibling = oI > 0 ? this.originalFields[oI - 1]._id : false;
- const localSibling = lI > 0 ? this.localFields[lI - 1]._id : false;
+ const lI = this.localFields.findIndex(localField => localField._antares_id === originalField._antares_id);
+ const originalSibling = oI > 0 ? this.originalFields[oI - 1]._antares_id : false;
+ const localSibling = lI > 0 ? this.localFields[lI - 1]._antares_id : false;
const after = lI > 0 ? this.localFields[lI - 1].name : false;
const orgName = originalField.name;
@@ -450,15 +450,15 @@ export default {
changes: [],
deletions: []
};
- const originalIndexIDs = this.originalIndexes.reduce((acc, curr) => [...acc, curr._id], []);
- const localIndexIDs = this.localIndexes.reduce((acc, curr) => [...acc, curr._id], []);
+ const originalIndexIDs = this.originalIndexes.reduce((acc, curr) => [...acc, curr._antares_id], []);
+ const localIndexIDs = this.localIndexes.reduce((acc, curr) => [...acc, curr._antares_id], []);
// Index Additions
- indexChanges.additions = this.localIndexes.filter(index => !originalIndexIDs.includes(index._id));
+ indexChanges.additions = this.localIndexes.filter(index => !originalIndexIDs.includes(index._antares_id));
// Index Changes
this.originalIndexes.forEach(originalIndex => {
- const lI = this.localIndexes.findIndex(localIndex => localIndex._id === originalIndex._id);
+ const lI = this.localIndexes.findIndex(localIndex => localIndex._antares_id === originalIndex._antares_id);
if (JSON.stringify(originalIndex) !== JSON.stringify(this.localIndexes[lI])) {
if (this.localIndexes[lI]) {
indexChanges.changes.push({
@@ -471,7 +471,7 @@ export default {
});
// Index Deletions
- indexChanges.deletions = this.originalIndexes.filter(index => !localIndexIDs.includes(index._id));
+ indexChanges.deletions = this.originalIndexes.filter(index => !localIndexIDs.includes(index._antares_id));
// FOREIGN KEYS
const foreignChanges = {
@@ -479,15 +479,15 @@ export default {
changes: [],
deletions: []
};
- const originalForeignIDs = this.originalKeyUsage.reduce((acc, curr) => [...acc, curr._id], []);
- const localForeignIDs = this.localKeyUsage.reduce((acc, curr) => [...acc, curr._id], []);
+ const originalForeignIDs = this.originalKeyUsage.reduce((acc, curr) => [...acc, curr._antares_id], []);
+ const localForeignIDs = this.localKeyUsage.reduce((acc, curr) => [...acc, curr._antares_id], []);
// Foreigns Additions
- foreignChanges.additions = this.localKeyUsage.filter(foreign => !originalForeignIDs.includes(foreign._id));
+ foreignChanges.additions = this.localKeyUsage.filter(foreign => !originalForeignIDs.includes(foreign._antares_id));
// Foreigns Changes
this.originalKeyUsage.forEach(originalForeign => {
- const lI = this.localKeyUsage.findIndex(localForeign => localForeign._id === originalForeign._id);
+ const lI = this.localKeyUsage.findIndex(localForeign => localForeign._antares_id === originalForeign._antares_id);
if (JSON.stringify(originalForeign) !== JSON.stringify(this.localKeyUsage[lI])) {
if (this.localKeyUsage[lI]) {
foreignChanges.changes.push({
@@ -499,7 +499,7 @@ export default {
});
// Foreigns Deletions
- foreignChanges.deletions = this.originalKeyUsage.filter(foreign => !localForeignIDs.includes(foreign._id));
+ foreignChanges.deletions = this.originalKeyUsage.filter(foreign => !localForeignIDs.includes(foreign._antares_id));
// ALTER
const params = {
@@ -555,7 +555,7 @@ export default {
},
addField () {
this.localFields.push({
- _id: uidGen(),
+ _antares_id: uidGen(),
name: `${this.$tc('word.field', 1)}_${++this.newFieldsCounter}`,
key: '',
type: this.workspace.dataTypes[0].types[0].name,
@@ -597,8 +597,8 @@ export default {
});
},
duplicateField (uid) {
- const fieldToClone = Object.assign({}, this.localFields.find(field => field._id === uid));
- fieldToClone._id = uidGen();
+ const fieldToClone = Object.assign({}, this.localFields.find(field => field._antares_id === uid));
+ fieldToClone._antares_id = uidGen();
fieldToClone.name = `${fieldToClone.name}_copy`;
fieldToClone.order = this.localFields.length + 1;
this.localFields = [...this.localFields, fieldToClone];
@@ -609,11 +609,11 @@ export default {
}, 20);
},
removeField (uid) {
- this.localFields = this.localFields.filter(field => field._id !== uid);
+ this.localFields = this.localFields.filter(field => field._antares_id !== uid);
},
addNewIndex (payload) {
this.localIndexes = [...this.localIndexes, {
- _id: uidGen(),
+ _antares_id: uidGen(),
name: payload.index === 'PRIMARY' ? 'PRIMARY' : payload.field,
fields: [payload.field],
type: payload.index,
@@ -625,7 +625,7 @@ export default {
},
addToIndex (payload) {
this.localIndexes = this.localIndexes.map(index => {
- if (index._id === payload.index) index.fields.push(payload.field);
+ if (index._antares_id === payload.index) index.fields.push(payload.field);
return index;
});
},
diff --git a/src/renderer/components/WorkspaceTabPropsTableContext.vue b/src/renderer/components/WorkspaceTabPropsTableContext.vue
index 3e8b2982..feebd394 100644
--- a/src/renderer/components/WorkspaceTabPropsTableContext.vue
+++ b/src/renderer/components/WorkspaceTabPropsTableContext.vue
@@ -27,7 +27,7 @@
:key="index.name"
class="context-element"
:class="{'disabled': index.fields.includes(selectedField.name)}"
- @click="addToIndex(index._id)"
+ @click="addToIndex(index._antares_id)"
>
{{ index.name }}
diff --git a/src/renderer/components/WorkspaceTabPropsTableFields.vue b/src/renderer/components/WorkspaceTabPropsTableFields.vue
index a77cd8fa..dafc3cfb 100644
--- a/src/renderer/components/WorkspaceTabPropsTableFields.vue
+++ b/src/renderer/components/WorkspaceTabPropsTableFields.vue
@@ -109,7 +109,7 @@
>
field._id === uid);
+ this.selectedField = this.fields.find(field => field._antares_id === uid);
this.contextEvent = event;
this.isContext = true;
},
duplicateField () {
- this.$emit('duplicate-field', this.selectedField._id);
+ this.$emit('duplicate-field', this.selectedField._antares_id);
},
removeField () {
- this.$emit('remove-field', this.selectedField._id);
+ this.$emit('remove-field', this.selectedField._antares_id);
},
getIndexes (field) {
return this.indexes.reduce((acc, curr) => {
diff --git a/src/renderer/components/WorkspaceTabPropsTableForeignModal.vue b/src/renderer/components/WorkspaceTabPropsTableForeignModal.vue
index 5dcdd8ed..7289a099 100644
--- a/src/renderer/components/WorkspaceTabPropsTableForeignModal.vue
+++ b/src/renderer/components/WorkspaceTabPropsTableForeignModal.vue
@@ -36,10 +36,10 @@
@@ -68,7 +68,7 @@
@@ -238,7 +238,7 @@ export default {
},
computed: {
selectedForeignObj () {
- return this.foreignProxy.find(foreign => foreign._id === this.selectedForeignID);
+ return this.foreignProxy.find(foreign => foreign._antares_id === this.selectedForeignID);
},
isChanged () {
return JSON.stringify(this.localKeyUsage) !== JSON.stringify(this.foreignProxy);
@@ -288,7 +288,7 @@ export default {
},
addForeign () {
this.foreignProxy = [...this.foreignProxy, {
- _id: uidGen(),
+ _antares_id: uidGen(),
constraintName: `FK_${this.foreignProxy.length + 1}`,
refSchema: this.schema,
table: this.table,
@@ -307,19 +307,19 @@ export default {
}, 20);
},
removeIndex (id) {
- this.foreignProxy = this.foreignProxy.filter(foreign => foreign._id !== id);
+ this.foreignProxy = this.foreignProxy.filter(foreign => foreign._antares_id !== id);
if (this.selectedForeignID === id && this.foreignProxy.length)
this.resetSelectedID();
},
clearChanges () {
this.foreignProxy = JSON.parse(JSON.stringify(this.localKeyUsage));
- if (!this.foreignProxy.some(foreign => foreign._id === this.selectedForeignID))
+ if (!this.foreignProxy.some(foreign => foreign._antares_id === this.selectedForeignID))
this.resetSelectedID();
},
toggleField (field) {
this.foreignProxy = this.foreignProxy.map(foreign => {
- if (foreign._id === this.selectedForeignID)
+ if (foreign._antares_id === this.selectedForeignID)
foreign.field = field;
return foreign;
@@ -327,14 +327,14 @@ export default {
},
toggleRefField (field) {
this.foreignProxy = this.foreignProxy.map(foreign => {
- if (foreign._id === this.selectedForeignID)
+ if (foreign._antares_id === this.selectedForeignID)
foreign.refField = field;
return foreign;
});
},
resetSelectedID () {
- this.selectedForeignID = this.foreignProxy.length ? this.foreignProxy[0]._id : '';
+ this.selectedForeignID = this.foreignProxy.length ? this.foreignProxy[0]._antares_id : '';
},
async getRefFields () {
if (!this.selectedForeignObj.refTable) return;
diff --git a/src/renderer/components/WorkspaceTabPropsTableIndexesModal.vue b/src/renderer/components/WorkspaceTabPropsTableIndexesModal.vue
index 4b520a98..72b14fbc 100644
--- a/src/renderer/components/WorkspaceTabPropsTableIndexesModal.vue
+++ b/src/renderer/components/WorkspaceTabPropsTableIndexesModal.vue
@@ -36,10 +36,10 @@
@@ -56,7 +56,7 @@
@@ -163,7 +163,7 @@ export default {
},
computed: {
selectedIndexObj () {
- return this.indexesProxy.find(index => index._id === this.selectedIndexID);
+ return this.indexesProxy.find(index => index._antares_id === this.selectedIndexID);
},
isChanged () {
return JSON.stringify(this.localIndexes) !== JSON.stringify(this.indexesProxy);
@@ -200,7 +200,7 @@ export default {
},
addIndex () {
this.indexesProxy = [...this.indexesProxy, {
- _id: uidGen(),
+ _antares_id: uidGen(),
name: 'NEW_INDEX',
fields: [],
type: 'INDEX',
@@ -218,19 +218,19 @@ export default {
}, 20);
},
removeIndex (id) {
- this.indexesProxy = this.indexesProxy.filter(index => index._id !== id);
+ this.indexesProxy = this.indexesProxy.filter(index => index._antares_id !== id);
if (this.selectedIndexID === id && this.indexesProxy.length)
this.resetSelectedID();
},
clearChanges () {
this.indexesProxy = JSON.parse(JSON.stringify(this.localIndexes));
- if (!this.indexesProxy.some(index => index._id === this.selectedIndexID))
+ if (!this.indexesProxy.some(index => index._antares_id === this.selectedIndexID))
this.resetSelectedID();
},
toggleField (field) {
this.indexesProxy = this.indexesProxy.map(index => {
- if (index._id === this.selectedIndexID) {
+ if (index._antares_id === this.selectedIndexID) {
if (index.fields.includes(field))
index.fields = index.fields.filter(f => f !== field);
else
@@ -240,7 +240,7 @@ export default {
});
},
resetSelectedID () {
- this.selectedIndexID = this.indexesProxy.length ? this.indexesProxy[0]._id : '';
+ this.selectedIndexID = this.indexesProxy.length ? this.indexesProxy[0]._antares_id : '';
}
}
};
diff --git a/src/renderer/components/WorkspaceTabPropsTableRow.vue b/src/renderer/components/WorkspaceTabPropsTableRow.vue
index 21d247d5..a3590e36 100644
--- a/src/renderer/components/WorkspaceTabPropsTableRow.vue
+++ b/src/renderer/components/WorkspaceTabPropsTableRow.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/renderer/components/WorkspaceTabPropsTriggerFunction.vue b/src/renderer/components/WorkspaceTabPropsTriggerFunction.vue
index e812dea0..1ba2843d 100644
--- a/src/renderer/components/WorkspaceTabPropsTriggerFunction.vue
+++ b/src/renderer/components/WorkspaceTabPropsTriggerFunction.vue
@@ -238,7 +238,7 @@ export default {
this.originalFunction = response;
this.originalFunction.parameters = [...this.originalFunction.parameters.map(param => {
- param._id = uidGen();
+ param._antares_id = uidGen();
return param;
})];
diff --git a/src/renderer/components/WorkspaceTabQueryTable.vue b/src/renderer/components/WorkspaceTabQueryTable.vue
index d9d8c273..41a4fed3 100644
--- a/src/renderer/components/WorkspaceTabQueryTable.vue
+++ b/src/renderer/components/WorkspaceTabQueryTable.vue
@@ -70,13 +70,13 @@
@@ -196,7 +196,7 @@ export default {
if (this.sortedResults.length) {
const fieldsObj = {};
for (const key in this.sortedResults[0]) {
- if (key === '_id') continue;
+ if (key === '_antares_id') continue;
const fieldObj = this.fields.find(field => {
let fieldNames = [
@@ -310,7 +310,7 @@ export default {
setLocalResults () {
this.localResults = this.resultsWithRows[this.resultsetIndex] && this.resultsWithRows[this.resultsetIndex].rows
? this.resultsWithRows[this.resultsetIndex].rows.map(item => {
- return { ...item, _id: uidGen() };
+ return { ...item, _antares_id: uidGen() };
})
: [];
},
@@ -330,7 +330,7 @@ export default {
this.resizeResults();
},
updateField (payload, row) {
- const orgRow = this.localResults.find(lr => lr._id === row._id);
+ const orgRow = this.localResults.find(lr => lr._antares_id === row._antares_id);
Object.keys(orgRow).forEach(key => { // remap the row
if (orgRow[key] instanceof Date && moment(orgRow[key]).isValid()) { // if datetime
@@ -367,8 +367,8 @@ export default {
},
deleteSelected () {
this.closeContext();
- const rows = JSON.parse(JSON.stringify(this.localResults)).filter(row => this.selectedRows.includes(row._id)).map(row => {
- delete row._id;
+ const rows = JSON.parse(JSON.stringify(this.localResults)).filter(row => this.selectedRows.includes(row._antares_id)).map(row => {
+ delete row._antares_id;
return row;
});
@@ -381,7 +381,7 @@ export default {
this.$emit('delete-selected', params);
},
setNull () {
- const row = this.localResults.find(row => this.selectedRows.includes(row._id));
+ const row = this.localResults.find(row => this.selectedRows.includes(row._antares_id));
const params = {
primary: this.primaryField.name,
@@ -396,7 +396,7 @@ export default {
this.$emit('update-field', params);
},
copyCell () {
- const row = this.localResults.find(row => this.selectedRows.includes(row._id));
+ const row = this.localResults.find(row => this.selectedRows.includes(row._antares_id));
const cellName = Object.keys(row).find(prop => [
this.selectedCell.field,
`${this.fields[0].table}.${this.selectedCell.field}`,
@@ -406,9 +406,9 @@ export default {
navigator.clipboard.writeText(valueToCopy);
},
copyRow () {
- const row = this.localResults.find(row => this.selectedRows.includes(row._id));
+ const row = this.localResults.find(row => this.selectedRows.includes(row._antares_id));
const rowToCopy = JSON.parse(JSON.stringify(row));
- delete rowToCopy._id;
+ delete rowToCopy._antares_id;
navigator.clipboard.writeText(JSON.stringify(rowToCopy));
},
applyUpdate (params) {
@@ -435,15 +435,15 @@ export default {
this.selectedRows.push(row);
else {
const lastID = this.selectedRows.slice(-1)[0];
- const lastIndex = this.sortedResults.findIndex(el => el._id === lastID);
- const clickedIndex = this.sortedResults.findIndex(el => el._id === row);
+ const lastIndex = this.sortedResults.findIndex(el => el._antares_id === lastID);
+ const clickedIndex = this.sortedResults.findIndex(el => el._antares_id === row);
if (lastIndex > clickedIndex) {
for (let i = clickedIndex; i < lastIndex; i++)
- this.selectedRows.push(this.sortedResults[i]._id);
+ this.selectedRows.push(this.sortedResults[i]._antares_id);
}
else if (lastIndex < clickedIndex) {
for (let i = clickedIndex; i > lastIndex; i--)
- this.selectedRows.push(this.sortedResults[i]._id);
+ this.selectedRows.push(this.sortedResults[i]._antares_id);
}
}
}
@@ -452,7 +452,7 @@ export default {
},
selectAllRows () {
this.selectedRows = this.localResults.reduce((acc, curr) => {
- acc.push(curr._id);
+ acc.push(curr._antares_id);
return acc;
}, []);
},
@@ -501,7 +501,7 @@ export default {
if (!this.sortedResults) return;
const rows = JSON.parse(JSON.stringify(this.sortedResults)).map(row => {
- delete row._id;
+ delete row._antares_id;
return row;
});
diff --git a/src/renderer/components/WorkspaceTabQueryTableRow.vue b/src/renderer/components/WorkspaceTabQueryTableRow.vue
index 462a7edc..4a36d259 100644
--- a/src/renderer/components/WorkspaceTabQueryTableRow.vue
+++ b/src/renderer/components/WorkspaceTabQueryTableRow.vue
@@ -1,14 +1,14 @@
-