2026-06-02 18:09:12 +03:00
|
|
|
import Popover from 'src/components/popover/popover.vue'
|
|
|
|
|
|
2026-08-10 22:26:22 +03:00
|
|
|
import { useStatusesStore } from 'src/stores/statuses.js'
|
|
|
|
|
|
2026-01-08 17:26:52 +02:00
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
|
|
|
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
2026-01-06 16:22:52 +02:00
|
|
|
library.add(faCircleNotch)
|
2019-10-24 16:53:36 -04:00
|
|
|
|
|
|
|
|
const StatusPopover = {
|
|
|
|
|
name: 'StatusPopover',
|
2026-01-06 16:22:52 +02:00
|
|
|
props: ['statusId'],
|
|
|
|
|
data() {
|
2020-03-02 08:35:57 +02:00
|
|
|
return {
|
2026-01-06 16:22:52 +02:00
|
|
|
error: false,
|
2020-03-02 08:35:57 +02:00
|
|
|
}
|
|
|
|
|
},
|
2019-10-24 22:14:53 -04:00
|
|
|
computed: {
|
2026-01-06 16:22:52 +02:00
|
|
|
status() {
|
2026-08-10 22:26:22 +03:00
|
|
|
return useStatusesStore().allStatuses.get(this.statusId)
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
2019-10-24 22:14:53 -04:00
|
|
|
},
|
2019-10-24 16:53:36 -04:00
|
|
|
components: {
|
2026-06-02 18:09:12 +03:00
|
|
|
Popover,
|
2019-10-24 16:53:36 -04:00
|
|
|
},
|
|
|
|
|
methods: {
|
2026-01-06 16:22:52 +02:00
|
|
|
enter() {
|
2019-10-24 22:14:53 -04:00
|
|
|
if (!this.status) {
|
2020-06-30 15:15:27 +03:00
|
|
|
if (!this.statusId) {
|
|
|
|
|
this.error = true
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-08-10 22:26:22 +03:00
|
|
|
useStatusesStore()
|
|
|
|
|
.fetchStatus(this.statusId)
|
2025-02-04 15:23:21 +02:00
|
|
|
.then(() => (this.error = false))
|
|
|
|
|
.catch(() => (this.error = true))
|
2019-10-24 16:53:36 -04:00
|
|
|
}
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
2022-06-22 00:34:22 +03:00
|
|
|
},
|
|
|
|
|
watch: {
|
2026-01-06 16:22:52 +02:00
|
|
|
status(newStatus, oldStatus) {
|
2022-06-22 00:34:22 +03:00
|
|
|
if (newStatus !== oldStatus) {
|
2022-06-27 14:28:51 +03:00
|
|
|
this.$nextTick(() => this.$refs.popover.updateStyles())
|
2022-06-22 00:34:22 +03:00
|
|
|
}
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
|
|
|
|
},
|
2019-10-24 16:53:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default StatusPopover
|