Commit 5cb5d7bd authored by Anton's avatar Anton

Refactor delete map functionality, update changelog, catch access denied...

Refactor delete map functionality, update changelog, catch access denied exception on delete annotation in delete map
parent 7b606923
......@@ -13,8 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Moved delete map functionality to [mbjs-quasar](https://gitlab.rlp.net/motionbank/mbjs/quasar) module
- Moved ACL functionality to [mbjs-quasar](https://gitlab.rlp.net/motionbank/mbjs/quasar) module
### Fixed
- Delete map no longer fails when encountering access denied errors (still suffers from [#119](https://gitlab.rlp.net/motionbank/systems-frontend/issues/119))
## [1.2.1] - 2019-02-15
......
......@@ -8692,9 +8692,9 @@
}
},
"mbjs-quasar": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mbjs-quasar/-/mbjs-quasar-1.2.0.tgz",
"integrity": "sha512-CjXtdTyMQfY81+IW5N637DHBhnuuHImIl8XUHwqphzUod5eFExAG+u0u4YrZwwkQ8K3zTJmTQ8xXpGlRhuf2yA==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/mbjs-quasar/-/mbjs-quasar-1.3.0.tgz",
"integrity": "sha512-DagehO5kwlx9mLzhh2sDHUKnPinGZcjMlMieEULOkw/rlZbOca4aTVkEKeRjzf2pSQw9xmwNzGrX1xwnysPT2w==",
"requires": {
"marked": "^0.5.2",
"sanitize-html": "^1.19.2"
......
......@@ -19,6 +19,7 @@
<script>
import constants from 'mbjs-data-models/src/constants'
import { DateTime } from 'luxon'
import { deleteHelper } from 'mbjs-quasar/src/lib'
export default {
data () {
......@@ -88,27 +89,8 @@
},
methods: {
async handleConfirmModal (item) {
try {
const result = await this.$store.dispatch('annotations/find', { 'target.id': item.id })
for (let a of result.items) {
await this.$store.dispatch('annotations/delete', a.uuid)
}
await this.$store.dispatch('maps/delete', item.uuid)
this.$store.commit('notifications/addMessage', {
body: 'messages.grid_deleted',
mode: 'alert',
type: 'success'
})
this.$refs.listTable.request()
}
catch (err) {
console.error('grid delete failed', err.message)
this.$store.commit('notifications/addMessage', {
body: 'errors.grid_delete_failed',
mode: 'alert',
type: 'error'
})
}
await deleteHelper.deleteMap(this, item)
this.$refs.listTable.request()
}
}
}
......
......@@ -29,6 +29,7 @@
<script>
import constants from 'mbjs-data-models/src/constants'
import { DateTime } from 'luxon'
import { deleteHelper } from 'mbjs-quasar/src/lib'
export default {
data () {
......@@ -143,27 +144,8 @@
},
methods: {
async handleConfirmModal (item) {
try {
const result = await this.$store.dispatch('annotations/find', { 'target.id': item.id })
for (let a of result.items) {
await this.$store.dispatch('annotations/delete', a.uuid)
}
await this.$store.dispatch('maps/delete', item.uuid)
this.$store.commit('notifications/addMessage', {
body: 'messages.timeline_deleted',
mode: 'alert',
type: 'success'
})
this.$refs.listTable.request()
}
catch (err) {
console.error('timeline delete failed', err.message)
this.$store.commit('notifications/addMessage', {
body: 'errors.timeline_delete_failed',
mode: 'alert',
type: 'error'
})
}
await deleteHelper.deleteMap(this, item)
this.$refs.listTable.request()
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment