Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Bugfix: Issues related to transfer/upload and keyboard actions #7735

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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