mirror of https://github.com/Fabio286/antares.git
fix: disable cell editor for not editable results
This commit is contained in:
parent
d560c384f5
commit
b7c779eef6
|
@ -197,8 +197,9 @@ export class MySQLClient extends AntaresCore {
|
|||
const remappedFields = fields ? fields.map(field => {
|
||||
return {
|
||||
name: field.name,
|
||||
db: field.db,
|
||||
table: field.orgTable
|
||||
schema: field.db,
|
||||
table: field.orgTable,
|
||||
type: 'varchar'
|
||||
};
|
||||
}) : [];
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ export default {
|
|||
if (field.table) cachedTable = field.table;// Needed for some queries on information_schema
|
||||
return {
|
||||
table: field.table || cachedTable,
|
||||
schema: field.db || 'INFORMATION_SCHEMA'
|
||||
schema: field.schema || 'INFORMATION_SCHEMA'
|
||||
};
|
||||
}).filter((val, i, arr) => arr.findIndex(el => el.schema === val.schema && el.table === val.table) === i);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
fieldsArr[qI] = fieldsArr[qI] ? [...fieldsArr[qI], ...fields] : fields.length ? fields : result.fields;
|
||||
fieldsArr[qI] = fieldsArr[qI] ? [...fieldsArr[qI], ...fields] : fields.length >= result.fields.length ? fields : result.fields;
|
||||
}
|
||||
else
|
||||
this.addNotification({ status: 'error', message: response });
|
||||
|
|
|
@ -212,7 +212,7 @@ export default {
|
|||
},
|
||||
getSchema (index) {
|
||||
if (this.resultsWithRows[index] && this.resultsWithRows[index].fields && this.resultsWithRows[index].fields.length)
|
||||
return this.resultsWithRows[index].fields[0].db;
|
||||
return this.resultsWithRows[index].fields[0].schema;
|
||||
return this.workspaceSchema;
|
||||
},
|
||||
getPrimaryValue (row) {
|
||||
|
|
|
@ -254,6 +254,9 @@ export default {
|
|||
},
|
||||
foreignKeys () {
|
||||
return this.keyUsage.map(key => key.column);
|
||||
},
|
||||
isEditable () {
|
||||
return this.fields ? !!(this.fields[0].schema && this.fields[0].table) : false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -296,6 +299,8 @@ export default {
|
|||
return bufferToBase64(val);
|
||||
},
|
||||
editON (event, content, field) {
|
||||
if (!this.isEditable) return;
|
||||
|
||||
const type = this.getFieldType(field);
|
||||
this.originalContent = content;
|
||||
this.editingType = type;
|
||||
|
|
Loading…
Reference in New Issue