Skip to content

Commit

Permalink
fix(media-viewer): fix davProperties
Browse files Browse the repository at this point in the history
mediaViewer still used davProperties from component scope, updated to
use shared DavProperties
  • Loading branch information
fschade committed Aug 20, 2021
1 parent 443bd72 commit d08f33a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ We've fixed the loading of a folder in the Media viewer extension.
If a user reloads the Media viewer now, it load all the medias both in private and public context.

https://github.com/owncloud/web/issues/5427
https://github.com/owncloud/web/pull/5585
https://github.com/owncloud/web/pull/5585
https://github.com/owncloud/web/pull/5710
18 changes: 8 additions & 10 deletions packages/web-app-media-viewer/src/mixins/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { mapGetters, mapMutations } from 'vuex'
import queryString from 'query-string'
import { basename, dirname } from 'path'
import { buildResource } from '../../../web-app-files/src/helpers/resources' // TODO: place the helper in more global space not to create dep on files app
import { DavProperties } from 'web-pkg/src/constants'

// TODO: this file is a first attempt to separate file/folder loading logic out of the mediaviewer
// Discussion how to progress from here can be found in this issue:
// https://github.com/owncloud/web/issues/3301

export default {
computed: {
...mapGetters('Files', ['publicLinkPassword', 'davProperties']),
...mapGetters('Files', ['publicLinkPassword']),
...mapGetters(['configuration']),
$_loader_publicContext() {
return this.$route.params.contextRouteName === 'files-public-list'
Expand Down Expand Up @@ -39,17 +40,14 @@ export default {
this.CLEAR_CURRENT_FILES_LIST()

try {
const properties = this.davProperties.concat([
this.$client.publicFiles.PUBLIC_LINK_ITEM_TYPE,
this.$client.publicFiles.PUBLIC_LINK_PERMISSION,
this.$client.publicFiles.PUBLIC_LINK_EXPIRATION,
this.$client.publicFiles.PUBLIC_LINK_SHARE_DATETIME,
this.$client.publicFiles.PUBLIC_LINK_SHARE_OWNER
])
const absolutePath = filePath.substring(0, filePath.lastIndexOf('/'))
const promise = this.$_loader_publicContext
? this.$client.publicFiles.list(absolutePath, this.publicLinkPassword, properties)
: this.$client.files.list(absolutePath, 1, this.davProperties)
? this.$client.publicFiles.list(
absolutePath,
this.publicLinkPassword,
DavProperties.PublicLink
)
: this.$client.files.list(absolutePath, 1, DavProperties.Default)
let resources = await promise

resources = resources.map(buildResource)
Expand Down

0 comments on commit d08f33a

Please sign in to comment.