1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Partial implementation of fields edit

This commit is contained in:
2020-06-27 15:14:08 +02:00
parent 28c3f87dd8
commit f350fe8203
11 changed files with 95 additions and 27 deletions

View File

@ -87,7 +87,7 @@
<h4>{{ appName }}</h4>
<p>
{{ $t('word.version') }}: {{ appVersion }}<br>
<a class="c-hand" @click="openOutside('https://github.com/Fabio286/antares')">GitHub</a><br>
<a class="c-hand" @click="openOutside('https://github.com/EStarium/antares')">GitHub</a><br>
<small>{{ $t('message.madeWithJS') }}</small>
</p>
</div>

View File

@ -11,11 +11,11 @@
<div class="footer-right-elements">
<ul class="footer-elements">
<li class="footer-element footer-link">
<li class="footer-element footer-link" @click="openOutside('https://www.patreon.com/fabio286')">
<i class="material-icons md-18 mr-1">favorite</i>
<small>{{ $t('word.donate') }}</small>
</li>
<li class="footer-element footer-link">
<li class="footer-element footer-link" @click="openOutside('https://github.com/EStarium/antares/issues')">
<i class="material-icons md-18">bug_report</i>
</li>
<li class="footer-element footer-link" @click="showSettingModal('about')">
@ -28,6 +28,7 @@
<script>
import { mapActions, mapGetters } from 'vuex';
const { shell } = require('electron');
export default {
name: 'TheFooter',
@ -40,7 +41,10 @@ export default {
methods: {
...mapActions({
showSettingModal: 'application/showSettingModal'
})
}),
openOutside (link) {
shell.openExternal(link);
}
}
};
</script>

View File

@ -40,7 +40,7 @@
:content="col"
:field="cKey"
:type="fieldType(cKey)"
@updateField="updateField"
@updateField="updateField($event, row[primaryField.name])"
/>
</div>
</div>
@ -128,10 +128,17 @@ export default {
}
}
},
updateField (payload) {
updateField (event, id) {
if (!this.primaryField)
this.addNotification({ status: 'warning', message: this.$t('message.unableEditFieldWithoutPrimary') });
console.log(payload);
else {
const params = {
primary: this.primaryField.name,
id,
...event
};
this.$emit('updateField', params);
}
}
}
};

View File

@ -120,8 +120,8 @@ export default {
this.isEditing = false;
if (this.localContent === this.content) return;
const { field, localContent: content } = this;
this.$emit('updateField', { field, content });
const { field, type, localContent: content } = this;
this.$emit('updateField', { field, type, content });
}
}
};

View File

@ -31,6 +31,7 @@
v-if="results"
:results="results"
:fields="resultsFields"
@updateField="updateField"
/>
</div>
</div>
@ -134,6 +135,24 @@ export default {
}
this.isQuering = false;
},
async updateField (payload) {
const params = {
uid: this.connection.uid,
schema: this.workspace.breadcrumbs.schema,
table: this.workspace.breadcrumbs.table,
...payload
};
console.log(params);
try {
const { status, response } = await Structure.updateTableCell(params);
if (status !== 'success')
this.addNotification({ status: 'error', message: response });
}
catch (err) {
this.addNotification({ status: 'error', message: err.stack });
}
}
}
};