Skip to content

fix: show submailboxes for filtering #11031

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/components/MailboxInlinePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default {
input.vue-treeselect__input {
margin: 0;
padding: 0;
border: 1px solid var(--color-border-maxcontrast) !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treeselect borders are 2px by default. Ours are 1px.

}
.vue-treeselect__menu {
background: var(--color-main-background);
Expand Down
1 change: 0 additions & 1 deletion src/components/mailFilter/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,5 @@ export default {
.mail-filter-row {
display: flex;
gap: 5px;
align-items: baseline;
}
</style>
32 changes: 17 additions & 15 deletions src/components/mailFilter/ActionFileinto.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<NcSelect ref="select"
:value="mailbox"
:options="mailboxes"
:required="true"
@input="onInput" />
<MailboxInlinePicker v-model="selectedMailbox" :account="account" />
</template>
<script>

import NcSelect from '@nextcloud/vue/components/NcSelect'
import { mailboxHasRights } from '../../util/acl.js'
import { mapStores } from 'pinia'
import useMainStore from '../../store/mainStore.js'
import MailboxInlinePicker from '../MailboxInlinePicker.vue'
import logger from '../../logger.js'

export default {
name: 'ActionFileinto',
components: {
NcSelect,
MailboxInlinePicker,
},
props: {
action: {
Expand All @@ -31,18 +27,24 @@ export default {
required: true,
},
},
data() {
return {
currentSelectedMailboxId: null,
}
},
computed: {
...mapStores(useMainStore),
mailbox() {
return this.action.mailbox ?? undefined
},
mailboxes() {
const mailboxes = this.mainStore.getMailboxes(this.account.accountId)
.filter(mailbox => mailboxHasRights(mailbox, 'i'))

return mailboxes.map((mailbox) => {
return mailbox.displayName
})
selectedMailbox: {
get() {
return this.currentSelectedMailboxId
},
set(selectedMailboxId) {
logger.debug('Selected mailbox set to', selectedMailboxId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added this because thats what we do on accountdefaultsettings.vue where we also use the MailboxInlinePicker.

this.currentSelectedMailboxId = selectedMailboxId
},
},
},
methods: {
Expand Down
Loading