Files
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00

83 lines
1.7 KiB
Vue

<template>
<Modal ref="modal">
<h2 class="box__title">{{ $t('viewRotateSlugModal.title') }}</h2>
<Error :error="error"></Error>
<div>
<p>
{{
$t('viewRotateSlugModal.refreshWarning', {
viewName: view.name,
viewTypeSharingLinkName,
})
}}
</p>
<div class="actions">
<div class="align-right">
<Button
type="primary"
size="large"
:loading="loading"
:disabled="loading"
@click="rotateSlug()"
>
{{ $t('viewRotateSlugModal.generateNewURL') }}
</Button>
</div>
</div>
</div>
</Modal>
</template>
<script>
import modal from '@baserow/modules/core/mixins/modal'
import error from '@baserow/modules/core/mixins/error'
export default {
name: 'ViewRotateSlugModal',
mixins: [modal, error],
props: {
view: {
type: Object,
required: true,
},
/**
* Service to call to rotate the slug.
* It should have .rotateSlug(viewId) method.
*/
service: {
type: Object,
required: true,
},
},
data() {
return {
loading: false,
}
},
computed: {
viewTypeSharingLinkName() {
return this.$registry.get('view', this.view.type).getSharingLinkName()
},
},
methods: {
async rotateSlug() {
this.hideError()
this.loading = true
try {
const { data } = await this.service.rotateSlug(this.view.id)
await this.$store.dispatch('view/forceUpdate', {
view: this.view,
values: data,
})
this.hide()
} catch (error) {
this.handleError(error, 'table')
}
this.loading = false
},
},
}
</script>