Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Feb 16, 2021
1 parent 9c1f389 commit 739b864
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ import { basename, join } from 'path'
import { cloneStateObject } from '../../helpers/store'
import MixinsGeneral from '../../mixins'
import MoveSidebarMainContent from './MoveSidebarMainContent.vue'
import NoContentMessage from '../NoContentMessage.vue'
// import NoContentMessage from '../NoContentMessage.vue'
import CopySidebarMainContent from './CopySidebarMainContent.vue'
export default {
name: 'LocationPicker',
components: {
NoContentMessage
},
// components: {
// NoContentMessage
// },
mixins: [MixinsGeneral],
Expand Down
8 changes: 4 additions & 4 deletions packages/web-app-files/src/helpers/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async function buildSharedResource(share, incomingShares = false, allowSharePerm
resource.basename.length - resource.extension.length - 1
)
}
resource.share = _buildShare(share, resource, allowSharePerm)
resource.share = buildShare(share, resource, allowSharePerm)
resource.indicators = []
resource.icon =
resource.type === 'folder' ? 'folder' : getFileIcon(getFileExtension(resource.name))
Expand All @@ -241,11 +241,11 @@ async function buildSharedResource(share, incomingShares = false, allowSharePerm
return resource
}

function _buildShare(s, file, allowSharePerm) {
export function buildShare(s, file, allowSharePerm) {
if (parseInt(s.share_type, 10) === shareTypes.link) {
return _buildLink(s)
}
return _buildCollaboratorShare(s, file, allowSharePerm)
return buildCollaboratorShare(s, file, allowSharePerm)
}

function _buildLink(link) {
Expand Down Expand Up @@ -296,7 +296,7 @@ function _fixAdditionalInfo(data) {
return data
}

function _buildCollaboratorShare(s, file, allowSharePerm) {
export function buildCollaboratorShare(s, file, allowSharePerm) {
const share = {
shareType: parseInt(s.share_type, 10),
id: s.id
Expand Down
28 changes: 12 additions & 16 deletions packages/web-app-files/src/store/actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getParentPaths } from '../helpers/path'
import { shareTypes } from '../helpers/shareTypes'
import PQueue from 'p-queue'
import { buildResource } from '../helpers/resources'
import { buildResource, buildShare, buildCollaboratorShare } from '../helpers/resources'
import { $gettext, $gettextInterpolate } from '../gettext'

export default {
Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
addFiles(context, payload) {
const files = payload.files
for (const file of files) {
context.commit('ADD_FILE', _buildFile(file))
context.commit('ADD_FILE', buildResource(file))
}
},
deleteFiles(context, { files, client, publicPage }) {
Expand Down Expand Up @@ -130,7 +130,7 @@ export default {
.search(searchTerm, null, context.state.davProperties)
.then(filesSearched => {
filesSearched = filesSearched.map(f => {
return _buildFile(f)
return buildResource(f)
})
context.commit('LOAD_FILES_SEARCHED', filesSearched)
resolve(filesSearched)
Expand Down Expand Up @@ -165,7 +165,7 @@ export default {
context.commit(
'CURRENT_FILE_OUTGOING_SHARES_SET',
data.map(element => {
return _buildShare(
return buildShare(
element.shareInfo,
context.getters.highlightedFile,
!context.rootGetters.isOcis
Expand Down Expand Up @@ -194,7 +194,7 @@ export default {
context.commit(
'INCOMING_SHARES_LOAD',
data.map(element => {
return _buildCollaboratorShare(
return buildCollaboratorShare(
element.shareInfo,
context.getters.highlightedFile,
!context.rootGetters.isOcis
Expand Down Expand Up @@ -235,7 +235,7 @@ export default {
client.shares
.updateShare(share.id, params)
.then(updatedShare => {
const share = _buildCollaboratorShare(
const share = buildCollaboratorShare(
updatedShare.shareInfo,
getters.highlightedFile,
!rootGetters.isOcis
Expand All @@ -258,7 +258,7 @@ export default {
.then(share => {
context.commit(
'CURRENT_FILE_OUTGOING_SHARES_ADD',
_buildCollaboratorShare(
buildCollaboratorShare(
share.shareInfo,
context.getters.highlightedFile,
!context.rootGetters.isOcis
Expand Down Expand Up @@ -293,7 +293,7 @@ export default {
.then(share => {
context.commit(
'CURRENT_FILE_OUTGOING_SHARES_ADD',
_buildCollaboratorShare(
buildCollaboratorShare(
share.shareInfo,
context.getters.highlightedFile,
!context.rootGetters.isOcis
Expand Down Expand Up @@ -376,11 +376,7 @@ export default {
.then(data => {
data.forEach(element => {
sharesTree[queryPath].push({
..._buildShare(
element.shareInfo,
{ type: 'folder' },
!context.rootGetters.isOcis
),
...buildShare(element.shareInfo, { type: 'folder' }, !context.rootGetters.isOcis),
outgoing: true,
indirect: true
})
Expand All @@ -401,7 +397,7 @@ export default {
.then(data => {
data.forEach(element => {
sharesTree[queryPath].push({
..._buildCollaboratorShare(
...buildCollaboratorShare(
element.shareInfo,
{ type: 'folder' },
!context.rootGetters.isOcis
Expand Down Expand Up @@ -440,7 +436,7 @@ export default {
client.shares
.shareFileWithLink(path, params)
.then(data => {
const link = _buildShare(data.shareInfo, null, !context.rootGetters.isOcis)
const link = buildShare(data.shareInfo, null, !context.rootGetters.isOcis)
context.commit('CURRENT_FILE_OUTGOING_SHARES_ADD', link)
context.commit('UPDATE_CURRENT_FILE_SHARE_TYPES')
resolve(link)
Expand All @@ -455,7 +451,7 @@ export default {
client.shares
.updateShare(id, params)
.then(data => {
const link = _buildShare(data.shareInfo, null, !context.rootGetters.isOcis)
const link = buildShare(data.shareInfo, null, !context.rootGetters.isOcis)
context.commit('CURRENT_FILE_OUTGOING_SHARES_UPDATE', link)
resolve(link)
})
Expand Down

0 comments on commit 739b864

Please sign in to comment.