2019-10-25 07:53:36 +11:00
|
|
|
import { find } from 'lodash'
|
|
|
|
|
|
|
|
const StatusPopover = {
|
|
|
|
name: 'StatusPopover',
|
|
|
|
props: [
|
|
|
|
'statusId'
|
|
|
|
],
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
popperOptions: {
|
|
|
|
modifiers: {
|
|
|
|
preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-10-25 13:14:53 +11:00
|
|
|
computed: {
|
|
|
|
status () {
|
|
|
|
return find(this.$store.state.statuses.allStatuses, { id: this.statusId })
|
|
|
|
}
|
|
|
|
},
|
2019-10-25 07:53:36 +11:00
|
|
|
components: {
|
|
|
|
Status: () => import('../status/status.vue')
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
enter () {
|
2019-10-25 13:14:53 +11:00
|
|
|
if (!this.status) {
|
|
|
|
this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })
|
|
|
|
.then((status) => {
|
|
|
|
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
2019-10-25 07:53:36 +11:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default StatusPopover
|