otf: replace button by link in show modale

This commit is contained in:
Mathieu Jaumotte 2021-09-30 13:44:04 +02:00
parent 1eb8d04a32
commit decc3c7463

View File

@ -42,16 +42,16 @@
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<button v-if="action === 'show'" <a v-if="action === 'show'"
@click="goToLocation(id, type)" :href="buildLocation(id, type)"
:title="$t(titleMessage)" :title="$t(titleMessage)"
class="btn btn-show">{{ $t(buttonMessage) }} class="btn btn-show">{{ $t(buttonMessage) }}
</button> </a>
<button v-else <a v-else
class="btn btn-save" class="btn btn-save"
@click="saveAction"> @click="saveAction">
{{ $t('action.save')}} {{ $t('action.save')}}
</button> </a>
</template> </template>
</modal> </modal>
@ -174,11 +174,12 @@ export default {
this.modal.showModal = false; this.modal.showModal = false;
}, },
goToLocation(id, type) { buildLocation(id, type) {
if (type == 'person') { if (type == 'person') {
window.location = `../../person/${id}/general`; // TODO i18n
return `/fr/person/${id}/general`;
} else if (type == 'thirdparty') { } else if (type == 'thirdparty') {
window.location = `../../thirdparty/thirdparty/${id}/show`; return `/fr/thirdparty/thirdparty/${id}/show`;
} }
} }
} }