Skip to content

Commit

Permalink
Remove all occurrences of share.info.*
Browse files Browse the repository at this point in the history
The info object was just the dirty object returned by the API. Now that
the relevant data has been copied to the parent object in a cleaner
manner, we don't need to pass it in any more.
  • Loading branch information
Vincent Petry committed Feb 24, 2020
1 parent e9e6fe4 commit 83baccc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="files-collaborators-collaborator-edit-dialog">
<div v-if="user.id !== collaborator.info.uid_owner" class="uk-text-meta uk-flex uk-flex-middle uk-margin-small-bottom"><oc-icon name="repeat" class="uk-margin-small-right" /> {{ collaborator.info.displayname_owner }}</div>
<div v-if="user.id !== collaborator.owner.name" class="uk-text-meta uk-flex uk-flex-middle uk-margin-small-bottom"><oc-icon name="repeat" class="uk-margin-small-right" /> {{ collaborator.owner.displayName }}</div>
<collaborator class="uk-width-expand" :collaborator="collaborator" :first-column="false" />
<collaborators-edit-options
:existingRole="$_originalRole"
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/components/FileLinkSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default {
const name2 = l2.name.toLowerCase().trim()
// sorting priority 1: display name (lower case, ascending), 2: id (ascending)
if (name1 === name2) {
return textUtils.naturalSortCompare(l1.info.id + '', l2.info.id + '')
return textUtils.naturalSortCompare(l1.id + '', l2.id + '')
} else {
return textUtils.naturalSortCompare(name1, name2)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
shares.forEach((share) => {
// note: no distinction between incoming and outgoing shares as we display the same
// indirect indicator for them
shareTypes[share.info.share_type] = true
shareTypes[share.shareType] = true
})
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export default {
return null
}
const translated = this.$gettext('Via %{folderName}')
return this.$gettextInterpolate(translated, { folderName: basename(this.link.info.path) }, true)
return this.$gettextInterpolate(translated, { folderName: basename(this.link.path) }, true)
},
$_viaRouterParams () {
const viaPath = this.link.info.path
const viaPath = this.link.path
return {
name: 'files-list',
params: {
Expand Down
6 changes: 2 additions & 4 deletions apps/files/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ function _buildLink (link, $gettext) {
password: !!(link.share_with && link.share_with_displayname),
expiration: (typeof link.expiration === 'string') ? moment(link.expiration).format('YYYY-MM-DD') : null,
itemSource: link.item_source,
info: link,
file: {
parent: link.file_parent,
source: link.file_source,
Expand All @@ -241,7 +240,6 @@ function _fixAdditionalInfo (data) {
function _buildCollaboratorShare (s, file) {
const share = {
shareType: parseInt(s.share_type, 10),
info: s,
id: s.id
}
switch (share.shareType) {
Expand Down Expand Up @@ -638,7 +636,7 @@ export default {
})
}

return client.shares.updateShare(share.info.id, params)
return client.shares.updateShare(share.id, params)
.then((updatedShare) => {
commit('CURRENT_FILE_OUTGOING_SHARES_UPDATE', _buildCollaboratorShare(updatedShare.shareInfo, getters.highlightedFile))
})
Expand Down Expand Up @@ -678,7 +676,7 @@ export default {
})
},
deleteShare (context, { client, share }) {
client.shares.deleteShare(share.info.id)
client.shares.deleteShare(share.id)
.then(() => {
context.commit('CURRENT_FILE_OUTGOING_SHARES_REMOVE', share)
context.commit('UPDATE_CURRENT_FILE_SHARE_TYPES')
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {
},
CURRENT_FILE_OUTGOING_SHARES_UPDATE (state, share) {
const fileIndex = state.currentFileOutgoingShares.findIndex((s) => {
return s.info.id === share.info.id
return s.id === share.id
})
if (fileIndex >= 0) {
Vue.set(state.currentFileOutgoingShares, fileIndex, share)
Expand Down

0 comments on commit 83baccc

Please sign in to comment.