diff --git a/css/src/Calendars/CalendarSharee.scss b/css/src/Calendars/CalendarSharee.scss deleted file mode 100644 index 68fd914ed..000000000 --- a/css/src/Calendars/CalendarSharee.scss +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @copyright Copyright (c) 2019 John Molakvoæ - * - * @author John Molakvoæ - * @author Team Popcorn - * @author Raimund Schlüßler - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -.calendar-sharee { - padding: 0 5px; - display: inline-flex; - align-items: center; - width: 100%; - - .icon { - margin-right: 5px; - opacity: 0.2; - width: 16px; - height: 16px; - display: inline-block; - margin-bottom: 2px; - &.icon-loading-small { - opacity: 1; - } - } - - &__identifier { - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - display: inline-block; - vertical-align: top; - opacity: 0.7; - } - - &__utils { - padding: 0 !important; - float: right; - position: relative !important; - display: inline-flex; - align-items: center; - flex-shrink: 0; - height: 20px; - - .icon-delete { - display: inline-block; - width: 20px; - height: 20px; - opacity: 0.4; - margin-bottom: 2px; - margin-left: 4px; - &:hover { - box-shadow: unset !important; - } - } - - // loading state - &--disabled { - opacity: .2 !important; - } - .checkbox + label { - padding: 0 !important; - } - label { - opacity: 0.7; - } - } -} diff --git a/css/src/Calendars/CalendarShares.scss b/css/src/Calendars/CalendarShares.scss index 425c0fed1..387be4343 100644 --- a/css/src/Calendars/CalendarShares.scss +++ b/css/src/Calendars/CalendarShares.scss @@ -23,40 +23,49 @@ */ .calendar-shares { - width: calc(100% - 6px); - margin: 6px; - &__list { - margin-top: 8px; - margin-bottom: 12px; - display: flex; - flex-direction: column; - } - &__shareematch--bold { font-weight: bold; } - - .icon-loading::after { - top: 70%; - left: 95%; - height: 14px; - width: 14px; - } - .multiselect { - width: inherit; - margin: 0; - .multiselect__tags:focus-within, - .multiselect__tags:hover { - border-color: var(--color-primary-element); + .app-navigation-entry { + padding-left: 0 !important; + + .avatar { + width: 32px; + height: 32px; + background-color: var(--color-border-dark); + background-size: 16px; } - &:not(.showContent) .multiselect__content-wrapper { - display: none; + &__utils { + .action-checkbox__label { + padding-right: 0 !important; + } + + .action-checkbox__label::before { + margin: 4px 4px 0 !important; + } } + + &__multiselect { + padding-left: 6px !important; + + .multiselect { + width: calc(100% - 14px); + margin: 0; + .multiselect__tags:focus-within, + .multiselect__tags:hover { + border-color: var(--color-primary-element); + } + + &:not(.showContent) .multiselect__content-wrapper { + display: none; + } - .multiselect__content-wrapper { - z-index: 101 !important; + .multiselect__content-wrapper { + z-index: 101 !important; + } + } } } } diff --git a/css/src/style.scss b/css/src/style.scss index ee6c10607..4ea8c3783 100644 --- a/css/src/style.scss +++ b/css/src/style.scss @@ -31,6 +31,11 @@ display: none; } } + + .app-navigation-entry__utils .icon-loading { + height: 32px; + width: 32px; + } } &.edit { diff --git a/css/tasks.scss b/css/tasks.scss index 1814a8627..1f0af6659 100644 --- a/css/tasks.scss +++ b/css/tasks.scss @@ -27,4 +27,3 @@ @import './src/Calendars/Calendar.scss'; @import './src/Calendars/CalendarShares.scss'; -@import './src/Calendars/CalendarSharee.scss'; diff --git a/src/App.vue b/src/App.vue index c1add7b67..c1c6ccbc7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -61,27 +61,34 @@ export default { calendars: state => state.calendars.calendars, }), }, - beforeMount() { + async beforeMount() { // get calendars then get tasks - client.connect({ enableCalDAV: true }).then(() => { - this.$store.dispatch('getCalendars') - .then((calendars) => { - // No calendars? Create a new one! - if (calendars.length === 0) { - let color = '#0082C9' - if (this.$OCA.Theming) { - color = this.$OCA.Theming.color - } - this.$store.dispatch('appendCalendar', { displayName: this.$t('tasks', 'Tasks'), color }) - .then(() => { - this.fetchTasks() - }) - // else, let's get those tasks! - } else { - this.fetchTasks() - } - }) + await client.connect({ enableCalDAV: true }) + await this.$store.dispatch('fetchCurrentUserPrincipal') + const calendars = await this.$store.dispatch('getCalendars') + const owners = [] + calendars.forEach((calendar) => { + if (owners.indexOf(calendar.owner) === -1) { + owners.push(calendar.owner) + } + }) + owners.forEach((owner) => { + this.$store.dispatch('fetchPrincipalByUrl', { + url: owner, + }) }) + // No calendars? Create a new one! + if (calendars.length === 0) { + let color = '#0082C9' + if (this.$OCA.Theming) { + color = this.$OCA.Theming.color + } + await this.$store.dispatch('appendCalendar', { displayName: this.$t('tasks', 'Tasks'), color }) + this.fetchTasks() + // else, let's get those tasks! + } else { + this.fetchTasks() + } }, methods: { /** diff --git a/src/components/AppNavigation/CalendarShare.vue b/src/components/AppNavigation/CalendarShare.vue index 6ca4b77b5..707b30e67 100644 --- a/src/components/AppNavigation/CalendarShare.vue +++ b/src/components/AppNavigation/CalendarShare.vue @@ -23,23 +23,25 @@ along with this program. If not, see .