Skip to content

Commit

Permalink
[full-ci] Bugfix: Issues related to transfer/upload and keyboard acti…
Browse files Browse the repository at this point in the history
…ons (#7735)

* Fix several issues related to copy/upload and keyboard actions

* Add conflict dialog custom content

* Use div instead of p, changelog
  • Loading branch information
lookacat authored Oct 5, 2022
1 parent f0b3f95 commit 22eeffc
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
3 changes: 2 additions & 1 deletion changelog/unreleased/bugfix-move-files-between-spaces
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Bugfix: Inhibit move files between spaces
We've inhibited moving files between spaces and will offer the user to copy instead.

https://github.com/owncloud/web/pull/7652
https://github.com/owncloud/web/issues/6892
https://github.com/owncloud/web/issues/6892
https://github.com/owncloud/web/pull/7735
3 changes: 2 additions & 1 deletion changelog/unreleased/enhancement-make-keybindings-global
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Enhancement: Make keybindings global
We've made keybindings global and introduced a data-attribute to mark elements that need custom keybindings

https://github.com/owncloud/web/pull/7569
https://github.com/owncloud/web/pull/7648
https://github.com/owncloud/web/pull/7648
https://github.com/owncloud/web/pull/7735
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ export default defineComponent({
areCustomKeyBindingsEnabled() {
const activeElementTag = document.activeElement.tagName
if (['textarea', 'input', 'select'].includes(activeElementTag.toLowerCase())) {
const type = document.activeElement.getAttribute('type')
if (
['textarea', 'input', 'select'].includes(activeElementTag.toLowerCase()) &&
type !== 'checkbox'
) {
return true
}
const closestSelectionEl = window.getSelection().focusNode as HTMLElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export class ResourceTransfer extends ConflictDialog {
showResultMessage(errors, movedResources: Array<Resource>, transferType: TransferType) {
if (errors.length === 0) {
const count = movedResources.length
if (count === 0) {
return
}
const ntitle =
transferType === TransferType.COPY
? this.$ngettext(
Expand Down
6 changes: 3 additions & 3 deletions packages/web-app-files/src/helpers/resource/actions/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ export class ResourcesUpload extends ConflictDialog {
})
continue
}

const conflictsLeft = allConflictsCount - count
const resolvedConflict: ResolveConflict = await this.resolveFileExists(
{ name: conflict.name, isFolder } as Resource,
allConflictsCount - count,
false,
conflictsLeft,
conflictsLeft === 1,
isFolder
)
count++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ export class ConflictDialog {
variation: 'danger',
icon: 'alarm-warning',
title: this.$gettext('Copy here?'),
message: this.$gettext(
'Moving files from one space to another is not possible. Do you want to copy instead? Note: Links and shares of the original file are not copied.'
),
customContent:
'<p>Moving files from one space to another is not possible. Do you want to copy instead?</p><p>Note: Links and shares of the original file are not copied.</p>',
cancelText: this.$gettext('Cancel'),
confirmText: this.$gettext('Copy here'),
onCancel: () => {
Expand Down
6 changes: 5 additions & 1 deletion packages/web-runtime/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
@confirm-secondary="modal.onConfirmSecondary"
@mounted="focusModal"
@beforeDestroy="focusModal"
/>
>
<template v-if="modal.customContent" #content>
<div v-html="modal.customContent"></div>
</template>
</oc-modal>
</div>
</template>
<script lang="ts">
Expand Down
4 changes: 3 additions & 1 deletion packages/web-runtime/src/store/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const state = {
onCheckboxValueChanged: emptyReturn,
onConfirmSecondary: emptyReturn,
contextualHelperLabel: '',
contextualHelperData: {}
contextualHelperData: {},
customContent: ''
}

const actions = {
Expand Down Expand Up @@ -75,6 +76,7 @@ const mutations = {
state.onConfirmSecondary = modal.onConfirmSecondary || emptyReturn
state.contextualHelperLabel = modal.contextualHelperLabel
state.contextualHelperData = modal.contextualHelperData
state.customContent = modal.customContent || ''
},

HIDE_MODAL(state) {
Expand Down

0 comments on commit 22eeffc

Please sign in to comment.