Merge pull request #1774 from nextcloud/bugfix/noid/deprecated-js-api
This commit is contained in:
@@ -40,6 +40,55 @@
|
||||
</div>
|
||||
</Modal>
|
||||
</template>
|
||||
<script>
|
||||
import Modal from '@nextcloud/vue/dist/Components/Modal'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
export default {
|
||||
name: 'BoardSelector',
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filter: '',
|
||||
boards: [],
|
||||
selectedBoard: null,
|
||||
loading: true,
|
||||
currentBoard: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
availableBoards() {
|
||||
return this.boards.filter((board) => (
|
||||
'' + board.id !== '' + this.currentBoard
|
||||
&& board.title.match(this.filter)
|
||||
))
|
||||
},
|
||||
},
|
||||
beforeMount() {
|
||||
this.fetchBoards()
|
||||
const hash = window.location.hash.match(/\/boards\/([0-9]+)/)
|
||||
this.currentBoard = hash.length > 0 ? hash[1] : null
|
||||
},
|
||||
methods: {
|
||||
fetchBoards() {
|
||||
axios.get(generateUrl('/apps/deck/boards')).then((response) => {
|
||||
this.boards = response.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$root.$emit('close')
|
||||
},
|
||||
select() {
|
||||
this.$root.$emit('select', this.selectedBoard)
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#modal-inner {
|
||||
width: 90vw;
|
||||
@@ -47,15 +96,8 @@
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
ul {
|
||||
min-height: 50vh;
|
||||
max-height: 300px;
|
||||
overflow: scroll;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
li {
|
||||
@@ -87,51 +129,3 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
import Modal from '@nextcloud/vue/dist/Components/Modal'
|
||||
import axios from '@nextcloud/axios'
|
||||
|
||||
export default {
|
||||
name: 'BoardSelector',
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filter: '',
|
||||
boards: [],
|
||||
selectedBoard: null,
|
||||
loading: true,
|
||||
currentBoard: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
availableBoards() {
|
||||
return this.boards.filter((board) => (
|
||||
'' + board.id !== '' + this.currentBoard
|
||||
&& board.title.match(this.filter)
|
||||
))
|
||||
},
|
||||
},
|
||||
beforeMount() {
|
||||
this.fetchBoards()
|
||||
const hash = window.location.hash.match(/\/boards\/([0-9]+)/)
|
||||
this.currentBoard = hash.length > 0 ? hash[1] : null
|
||||
},
|
||||
methods: {
|
||||
fetchBoards() {
|
||||
axios.get(OC.generateUrl('/apps/deck/boards')).then((response) => {
|
||||
this.boards = response.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$root.$emit('close')
|
||||
},
|
||||
select() {
|
||||
this.$root.$emit('select', this.selectedBoard)
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import Modal from '@nextcloud/vue/dist/Components/Modal'
|
||||
import Multiselect from '@nextcloud/vue/dist/Components/Multiselect'
|
||||
import axios from '@nextcloud/axios'
|
||||
@@ -77,7 +78,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchBoards() {
|
||||
axios.get(OC.generateUrl('/apps/deck/boards')).then((response) => {
|
||||
axios.get(generateUrl('/apps/deck/boards')).then((response) => {
|
||||
this.boards = response.data
|
||||
this.loading = false
|
||||
})
|
||||
@@ -85,7 +86,7 @@ export default {
|
||||
async fetchCardsFromBoard(board) {
|
||||
try {
|
||||
this.cardsFromBoard = []
|
||||
const url = OC.generateUrl('/apps/deck/stacks/' + board.id)
|
||||
const url = generateUrl('/apps/deck/stacks/' + board.id)
|
||||
const response = await axios.get(url)
|
||||
response.data.forEach(stack => {
|
||||
this.cardsFromBoard.push(...stack.cards)
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { Container, Draggable } from 'vue-smooth-dnd'
|
||||
import { Actions, ActionButton } from '@nextcloud/vue'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
import CardItem from '../cards/CardItem'
|
||||
|
||||
export default {
|
||||
@@ -208,7 +209,7 @@ export default {
|
||||
})
|
||||
this.$router.push({ name: 'card', params: { cardId: newCard.id } })
|
||||
} catch (e) {
|
||||
OCP.Toast.error('Could not create card: ' + e.response.data.message)
|
||||
showError('Could not create card: ' + e.response.data.message)
|
||||
} finally {
|
||||
this.stateCardCreating = false
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
import { Actions, ActionButton } from '@nextcloud/vue'
|
||||
import relativeDate from '../../mixins/relativeDate'
|
||||
import { formatFileSize } from '@nextcloud/files'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
export default {
|
||||
name: 'AttachmentList',
|
||||
@@ -101,7 +102,7 @@ export default {
|
||||
}
|
||||
},
|
||||
attachmentUrl() {
|
||||
return (attachment) => OC.generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`)
|
||||
return (attachment) => generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`)
|
||||
},
|
||||
formattedFileSize() {
|
||||
return (filesize) => formatFileSize(filesize)
|
||||
|
||||
@@ -202,6 +202,7 @@ import MarkdownItTaskLists from 'markdown-it-task-lists'
|
||||
import { formatFileSize } from '@nextcloud/files'
|
||||
import relativeDate from '../../mixins/relativeDate'
|
||||
import AttachmentList from './AttachmentList'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
const markdownIt = new MarkdownIt({
|
||||
linkify: true,
|
||||
@@ -279,7 +280,7 @@ export default {
|
||||
}
|
||||
},
|
||||
attachmentUrl() {
|
||||
return (attachment) => OC.generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`)
|
||||
return (attachment) => generateUrl(`/apps/deck/cards/${attachment.cardId}/attachment/${attachment.id}`)
|
||||
},
|
||||
formattedFileSize() {
|
||||
return (filesize) => formatFileSize(filesize)
|
||||
|
||||
@@ -35,7 +35,7 @@ import { Avatar } from '@nextcloud/vue'
|
||||
import CommentItem from './CommentItem'
|
||||
import CommentForm from './CommentForm'
|
||||
import InfiniteLoading from 'vue-infinite-loading'
|
||||
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
export default {
|
||||
name: 'CardSidebarTabComments',
|
||||
components: {
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
return {
|
||||
newComment: '',
|
||||
isLoading: false,
|
||||
currentUser: OC.getCurrentUser(),
|
||||
currentUser: getCurrentUser(),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
<script>
|
||||
import { Avatar, PopoverMenu, Tooltip } from '@nextcloud/vue'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
export default {
|
||||
name: 'AvatarList',
|
||||
@@ -93,7 +94,7 @@ export default {
|
||||
}
|
||||
const user = assignable.participant.uid
|
||||
const size = 32
|
||||
const avatarUrl = OC.generateUrl('/avatar/{user}/{size}',
|
||||
const avatarUrl = generateUrl('/avatar/{user}/{size}',
|
||||
{
|
||||
user: user,
|
||||
size: size,
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
import { Modal, Actions, ActionButton, Multiselect } from '@nextcloud/vue'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
|
||||
export default {
|
||||
name: 'CardMenu',
|
||||
@@ -127,7 +129,7 @@ export default {
|
||||
this.$store.dispatch('assignCardToUser', {
|
||||
card: this.copiedCard,
|
||||
assignee: {
|
||||
userId: OC.getCurrentUser().uid,
|
||||
userId: getCurrentUser()?.uid,
|
||||
type: 0,
|
||||
},
|
||||
})
|
||||
@@ -140,7 +142,7 @@ export default {
|
||||
},
|
||||
async loadStacksFromBoard(board) {
|
||||
try {
|
||||
const url = OC.generateUrl('/apps/deck/stacks/' + board.id)
|
||||
const url = generateUrl('/apps/deck/stacks/' + board.id)
|
||||
const response = await axios.get(url)
|
||||
this.stacksFromBoard = response.data
|
||||
} catch (err) {
|
||||
|
||||
@@ -76,6 +76,7 @@ import { Multiselect } from '@nextcloud/vue'
|
||||
import AppNavigationAddBoard from './AppNavigationAddBoard'
|
||||
import AppNavigationBoardCategory from './AppNavigationBoardCategory'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { generateUrl, generateOcsUrl } from '@nextcloud/router'
|
||||
|
||||
const canCreateState = loadState('deck', 'canCreate')
|
||||
|
||||
@@ -118,13 +119,13 @@ export default {
|
||||
},
|
||||
beforeMount() {
|
||||
if (this.isAdmin) {
|
||||
axios.get(OC.generateUrl('apps/deck/config')).then((response) => {
|
||||
axios.get(generateUrl('apps/deck/config')).then((response) => {
|
||||
this.groupLimit = response.data.groupLimit
|
||||
this.groupLimitDisabled = false
|
||||
}, (error) => {
|
||||
console.error('Error while loading groupLimit', error.response)
|
||||
})
|
||||
axios.get(OC.linkToOCS('cloud', 2) + 'groups').then((response) => {
|
||||
axios.get(generateOcsUrl('cloud', 2) + 'groups').then((response) => {
|
||||
this.groups = response.data.ocs.data.groups.reduce((obj, item) => {
|
||||
obj.push({
|
||||
id: item,
|
||||
@@ -146,7 +147,7 @@ export default {
|
||||
},
|
||||
updateConfig() {
|
||||
this.groupLimitDisabled = true
|
||||
axios.post(OC.generateUrl('apps/deck/config/groupLimit'), {
|
||||
axios.post(generateUrl('apps/deck/config/groupLimit'), {
|
||||
value: this.groupLimit,
|
||||
}).then(() => {
|
||||
this.groupLimitDisabled = false
|
||||
|
||||
@@ -26,6 +26,7 @@ import store from './store/main'
|
||||
import { sync } from 'vuex-router-sync'
|
||||
import { translate, translatePlural } from '@nextcloud/l10n'
|
||||
import { generateFilePath } from '@nextcloud/router'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
import { Tooltip } from '@nextcloud/vue'
|
||||
import ClickOutside from 'vue-click-outside'
|
||||
import './models'
|
||||
@@ -60,7 +61,7 @@ Vue.directive('focus', {
|
||||
Vue.config.errorHandler = (err, vm, info) => {
|
||||
if (err.response && err.response.data.message) {
|
||||
const errorMessage = t('deck', 'Something went wrong')
|
||||
OCP.Toast.error(`${errorMessage}: ${err.response.data.status} ${err.response.data.message}`)
|
||||
showError(`${errorMessage}: ${err.response.data.status} ${err.response.data.message}`)
|
||||
}
|
||||
console.error(err)
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
*/
|
||||
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
import { generateOcsUrl, generateRemoteUrl } from '@nextcloud/router'
|
||||
|
||||
export class CommentApi {
|
||||
|
||||
url(url) {
|
||||
url = `dav/comments/deckCard/${url}`
|
||||
return OC.linkToRemote(url)
|
||||
return generateRemoteUrl(url)
|
||||
}
|
||||
|
||||
async loadComments({ cardId, limit, offset }) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import 'url-search-params-polyfill'
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
import { BoardApi } from './../services/BoardApi'
|
||||
import stack from './stack'
|
||||
import card from './card'
|
||||
@@ -344,7 +345,7 @@ export default new Vuex.Store({
|
||||
params.append('perPage', 20)
|
||||
params.append('itemType', [0, 1, 7])
|
||||
|
||||
axios.get(OC.linkToOCS('apps/files_sharing/api/v1') + 'sharees', { params }).then((response) => {
|
||||
axios.get(generateOcsUrl('apps/files_sharing/api/v1') + 'sharees', { params }).then((response) => {
|
||||
commit('setSharees', response.data.ocs.data)
|
||||
})
|
||||
}, 250),
|
||||
|
||||
Reference in New Issue
Block a user