Skip to content

Commit

Permalink
Merge branch 'master' into downloadPreiosVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor authored Nov 19, 2021
2 parents 32c936f + 5bf9512 commit c4f1467
Show file tree
Hide file tree
Showing 66 changed files with 1,217 additions and 1,928 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Changelog for ownCloud Web [unreleased] (UNRELEASED)
=======================================
The following sections list the changes in ownCloud web unreleased relevant to
ownCloud admins and users.

[unreleased]: https://github.com/owncloud/web/compare/v4.5.0...master

Summary
-------

* Enhancement - Contextmenu for multiple files: [#5973](https://github.com/owncloud/web/pull/5973)

Details
-------

* Enhancement - Contextmenu for multiple files: [#5973](https://github.com/owncloud/web/pull/5973)

We have enabled batch actions in the context menu for when multiple resources are selected.

https://github.com/owncloud/web/issues/5968
https://github.com/owncloud/web/issues/5977
https://github.com/owncloud/web/pull/5973

Changelog for ownCloud Web [4.5.0] (2021-11-16)
=======================================
The following sections list the changes in ownCloud web 4.5.0 relevant to
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-contextmenu-multiple-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Contextmenu for multiple files

We have enabled batch actions in the context menu for when multiple resources are selected.

https://github.com/owncloud/web/pull/5973
https://github.com/owncloud/web/issues/5968
https://github.com/owncloud/web/issues/5977
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.15.8",
"@babel/eslint-parser": "^7.16.3",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.7",
"@babel/register": "^7.13.16",
Expand Down Expand Up @@ -88,7 +88,7 @@
"join-path": "^1.1.1",
"lodash": "^4.17.21",
"node-fetch": "^2.6.1",
"playwright": "^1.15.0",
"playwright": "^1.16.3",
"postcss": "^8.3.6",
"prettier": "^2.3.2",
"react": "^17.0.2",
Expand Down
95 changes: 95 additions & 0 deletions packages/web-app-files/src/components/ActionMenuItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<template>
<li>
<component
:is="action.componentType"
v-bind="getComponentProps(action, items)"
:class="['oc-text-bold', action.class]"
data-testid="action-handler"
v-on="getComponentListeners(action, items)"
>
<oc-icon v-if="action.icon" data-testid="action-icon" :name="action.icon" size="medium" />
<oc-img
v-else-if="action.img"
data-testid="action-img"
:src="action.img"
alt=""
class="oc-icon oc-icon-m"
/>
<span class="oc-files-context-action-label" data-testid="action-label">{{
action.label(filterParams)
}}</span>
<span
v-if="action.opensInNewWindow"
data-testid="action-sr-hint"
class="oc-invisible-sr"
v-text="$gettext('(Opens in new window)')"
/>
</component>
</li>
</template>

<script>
export default {
name: 'ActionMenuItem',
props: {
action: {
type: Object,
required: true
},
items: {
type: Array,
required: true
},
appearance: {
type: String,
default: 'raw'
}
},
computed: {
filterParams() {
return {
resources: this.items
}
}
},
methods: {
getComponentProps(action, resources) {
if (action.componentType === 'router-link' && action.route) {
return {
to: {
name: action.route,
params: {
item: resources.map((resource) => resource.path)
}
}
}
}
return {
appearance: this.appearance,
...(action.isDisabled && { disabled: action.isDisabled() }),
...(action.variation && { variation: action.variation })
}
},
getComponentListeners(action, resources) {
if (typeof action.handler !== 'function' || action.componentType !== 'oc-button') {
return {}
}
const callback = () => action.handler({ resources, ...action.handlerData })
if (action.keepOpen) {
return {
click: (event) => {
event.stopPropagation()
callback()
}
}
}
return {
click: callback
}
}
}
}
</script>
12 changes: 8 additions & 4 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<h1 class="oc-invisible-sr" v-text="pageTitle" />
<div class="files-app-bar-actions">
<div
v-if="showActions || selectedFiles.length > 0 || isTrashbinRoute"
v-if="showActions || selectedFiles.length > 0 || hasBulkActions"
class="uk-flex-1 uk-flex uk-flex-start"
>
<template v-if="showActions && areDefaultActionsVisible">
Expand All @@ -33,6 +33,7 @@
variation="primary"
appearance="filled"
:disabled="isNewBtnDisabled"
class="oc-mb-xs"
>
<oc-icon name="add" />
<translate>New</translate>
Expand Down Expand Up @@ -97,8 +98,8 @@
</ul>
</oc-drop>
</template>
<size-info v-if="selectedFiles.length > 0" class="oc-mr-s uk-visible@l" />
<batch-actions />
<size-info v-if="hasBulkActions && selectedFiles.length > 0" class="oc-mr uk-visible@l" />
<batch-actions v-if="hasBulkActions" />
</div>
<view-options />
</div>
Expand Down Expand Up @@ -205,6 +206,9 @@ export default {
showActions() {
return this.$route.meta.hideFilelistActions !== true
},
hasBulkActions() {
return this.$route.meta.hasBulkActions === true
},
showBreadcrumb() {
return this.isPublicFilesRoute || this.isPersonalRoute
Expand Down Expand Up @@ -578,7 +582,7 @@ export default {
display: flex;
gap: var(--oc-space-small);
justify-content: flex-end;
padding: var(--oc-space-small);
padding: 0 var(--oc-space-small);
}
}
</style>
Loading

0 comments on commit c4f1467

Please sign in to comment.