@@ -71,7 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'card': {
|
card: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler() {
|
handler() {
|
||||||
this.loadComments()
|
this.loadComments()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const AtMention = {
|
|||||||
const { user, displayName } = context.props
|
const { user, displayName } = context.props
|
||||||
return createElement(
|
return createElement(
|
||||||
'span',
|
'span',
|
||||||
{ attrs: { 'data-at-embedded': true, 'contenteditable': false } },
|
{ attrs: { 'data-at-embedded': true, contenteditable: false } },
|
||||||
[createElement(UserBubble, { props: { user, displayName }, attrs: { 'data-mention-id': user } })]
|
[createElement(UserBubble, { props: { user, displayName }, attrs: { 'data-mention-id': user } })]
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export default {
|
|||||||
async onLocalAttachmentSelected(file) {
|
async onLocalAttachmentSelected(file) {
|
||||||
if (this.maxUploadSize > 0 && file.size > this.maxUploadSize) {
|
if (this.maxUploadSize > 0 && file.size > this.maxUploadSize) {
|
||||||
showError(
|
showError(
|
||||||
t('deck', `Failed to upload {name}`, { name: file.name }) + ' - '
|
t('deck', 'Failed to upload {name}', { name: file.name }) + ' - '
|
||||||
+ t('deck', 'Maximum file size of {size} exceeded', { size: formatFileSize(this.maxUploadSize) })
|
+ t('deck', 'Maximum file size of {size} exceeded', { size: formatFileSize(this.maxUploadSize) })
|
||||||
)
|
)
|
||||||
event.target.value = ''
|
event.target.value = ''
|
||||||
@@ -49,7 +49,8 @@ export default {
|
|||||||
bodyFormData.append('file', file)
|
bodyFormData.append('file', file)
|
||||||
await queue.add(async() => {
|
await queue.add(async() => {
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('createAttachment', { cardId: this.cardId,
|
await this.$store.dispatch('createAttachment', {
|
||||||
|
cardId: this.cardId,
|
||||||
formData: bodyFormData,
|
formData: bodyFormData,
|
||||||
onUploadProgress: (e) => {
|
onUploadProgress: (e) => {
|
||||||
const percentCompleted = Math.round((e.loaded * 100) / e.total)
|
const percentCompleted = Math.round((e.loaded * 100) / e.total)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class CardApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addCard(card) {
|
addCard(card) {
|
||||||
return axios.post(this.url(`/cards`), card)
|
return axios.post(this.url('/cards'), card)
|
||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => {
|
||||||
return Promise.resolve(response.data)
|
return Promise.resolve(response.data)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadComments({ cardId, limit, offset }) {
|
async loadComments({ cardId, limit, offset }) {
|
||||||
const api = await axios.get(generateOcsUrl(`apps/deck/api/v1.0/cards`, 2) + `${cardId}/comments`, {
|
const api = await axios.get(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments`, {
|
||||||
params: { limit, offset },
|
params: { limit, offset },
|
||||||
headers: { 'OCS-APIRequest': 'true' },
|
headers: { 'OCS-APIRequest': 'true' },
|
||||||
})
|
})
|
||||||
@@ -39,7 +39,7 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createComment({ cardId, comment, replyTo }) {
|
async createComment({ cardId, comment, replyTo }) {
|
||||||
const api = await axios.post(generateOcsUrl(`apps/deck/api/v1.0/cards`, 2) + `${cardId}/comments`, {
|
const api = await axios.post(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments`, {
|
||||||
message: `${comment}`,
|
message: `${comment}`,
|
||||||
parentId: replyTo ? replyTo.id : null,
|
parentId: replyTo ? replyTo.id : null,
|
||||||
})
|
})
|
||||||
@@ -47,14 +47,14 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateComment({ cardId, id, comment }) {
|
async updateComment({ cardId, id, comment }) {
|
||||||
const api = await axios.put(generateOcsUrl(`apps/deck/api/v1.0/cards`, 2) + `${cardId}/comments/${id}`, {
|
const api = await axios.put(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments/${id}`, {
|
||||||
message: `${comment}`,
|
message: `${comment}`,
|
||||||
})
|
})
|
||||||
return api.data.ocs.data
|
return api.data.ocs.data
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteComment({ cardId, id }) {
|
async deleteComment({ cardId, id }) {
|
||||||
const api = await axios.delete(generateOcsUrl(`apps/deck/api/v1.0/cards`, 2) + `${cardId}/comments/${id}`)
|
const api = await axios.delete(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments/${id}`)
|
||||||
return api.data.ocs.data
|
return api.data.ocs.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { generateOcsUrl } from '@nextcloud/router'
|
|||||||
export class OverviewApi {
|
export class OverviewApi {
|
||||||
|
|
||||||
url(url) {
|
url(url) {
|
||||||
return generateOcsUrl(`apps/deck/api/v1.0`) + url
|
return generateOcsUrl('apps/deck/api/v1.0') + url
|
||||||
}
|
}
|
||||||
|
|
||||||
get(filter) {
|
get(filter) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class StackApi {
|
|||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
createStack(stack) {
|
createStack(stack) {
|
||||||
return axios.post(this.url(`/stacks`), stack)
|
return axios.post(this.url('/stacks'), stack)
|
||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => {
|
||||||
return Promise.resolve(response.data)
|
return Promise.resolve(response.data)
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ export default new Vuex.Store({
|
|||||||
async setConfig({ commit }, config) {
|
async setConfig({ commit }, config) {
|
||||||
for (const key in config) {
|
for (const key in config) {
|
||||||
try {
|
try {
|
||||||
await axios.post(generateOcsUrl(`apps/deck/api/v1.0/config`) + key, {
|
await axios.post(generateOcsUrl('apps/deck/api/v1.0/config') + key, {
|
||||||
value: config[key],
|
value: config[key],
|
||||||
})
|
})
|
||||||
commit('SET_CONFIG', { key, value: config[key] })
|
commit('SET_CONFIG', { key, value: config[key] })
|
||||||
|
|||||||
Reference in New Issue
Block a user