diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ContactDetails.vue | 18 | ||||
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAvatar.vue | 14 | ||||
-rw-r--r-- | src/components/ContactsList.vue | 8 | ||||
-rw-r--r-- | src/components/Properties/PropertyText.vue | 2 | ||||
-rw-r--r-- | src/components/Settings/SettingsAddressbook.vue | 11 | ||||
-rw-r--r-- | src/components/Settings/SettingsAddressbookSharee.vue | 5 | ||||
-rw-r--r-- | src/components/Settings/SettingsNewAddressbook.vue | 3 |
7 files changed, 37 insertions, 24 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue index e806904a..81806cc3 100644 --- a/src/components/ContactDetails.vue +++ b/src/components/ContactDetails.vue @@ -21,7 +21,7 @@ --> <template> - <div id="contact-details" class="app-content-details"> + <AppContentDetails> <!-- nothing selected or contact not found --> <EmptyContent v-if="!contact && !loading" icon="icon-contacts"> {{ t('contacts', 'No contact selected') }} @@ -37,7 +37,7 @@ <template v-else> <!-- contact header --> - <header> + <header class="contact-header"> <!-- avatar and upload photo --> <ContactAvatar :contact="contact" @@ -46,7 +46,7 @@ contact-avatar ? :avatar="contact.photo"--> <!-- fullname, org, title --> - <div id="contact-header-infos"> + <div class="contact-header__infos"> <h2> <input id="contact-fullname" ref="fullname" @@ -86,7 +86,7 @@ </div> <!-- actions --> - <div id="contact-header-actions"> + <div class="contact-header__actions"> <!-- warning message --> <a v-if="loadingUpdate || warning" v-tooltip.bottom="{ @@ -234,7 +234,7 @@ <PropertyRev v-if="contact.rev" :value="contact.rev" /> </section> </template> - </div> + </AppContentDetails> </template> <script> @@ -249,6 +249,7 @@ import { VueMasonryPlugin } from 'vue-masonry' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import ActionLink from '@nextcloud/vue/dist/Components/ActionLink' import Actions from '@nextcloud/vue/dist/Components/Actions' +import AppContentDetails from '@nextcloud/vue/dist/Components/AppContentDetails' import Modal from '@nextcloud/vue/dist/Components/Modal' import Multiselect from '@nextcloud/vue/dist/Components/Multiselect' @@ -274,6 +275,7 @@ export default { ActionLink, Actions, AddNewProp, + AppContentDetails, ContactAvatar, ContactProperty, EmptyContent, @@ -775,7 +777,7 @@ export default { </script> <style lang="scss"> -#contact-details { +.app-content-details { flex: 1 1 100%; min-width: 0; @@ -787,7 +789,7 @@ export default { font-weight: bold; // ORG-TITLE-NAME - #contact-header-infos { + .contact-header__infos { display: flex; flex: 1 1 auto; // shrink avatar before this one flex-direction: column; @@ -819,7 +821,7 @@ export default { } // ACTIONS - #contact-header-actions { + .contact-header__actions { position: relative; display: flex; .header-menu { diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue index b5eb5323..9ae83770 100644 --- a/src/components/ContactDetails/ContactDetailsAvatar.vue +++ b/src/components/ContactDetails/ContactDetailsAvatar.vue @@ -162,7 +162,7 @@ import Actions from '@nextcloud/vue/dist/Components/Actions' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import ActionLink from '@nextcloud/vue/dist/Components/ActionLink' -import { getFilePickerBuilder } from '@nextcloud/dialogs' +import { showError, showInfo, getFilePickerBuilder, showSuccess } from '@nextcloud/dialogs' import { generateUrl, generateRemoteUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' import { loadState } from '@nextcloud/initial-state' @@ -274,7 +274,7 @@ export default { self.setPhoto(imageBase64, type) } catch (error) { console.error(error) - OC.Notification.showTemporary(t('contacts', 'Invalid image')) + showError(t('contacts', 'Invalid image')) } finally { self.resetPicker() } @@ -284,7 +284,7 @@ export default { const blob = file.slice(0, 4) reader.readAsArrayBuffer(blob) } else { - OC.Notification.showTemporary(t('contacts', 'Image is too big (max 1MB).')) + showError(t('contacts', 'Image is too big (max 1MB).')) this.resetPicker() } } @@ -412,7 +412,7 @@ export default { const data = Buffer.from(response.data, 'binary').toString('base64') this.setPhoto(data, type) } catch (error) { - OC.Notification.showTemporary(t('contacts', 'Error while processing the picture.')) + showError(t('contacts', 'Error while processing the picture.')) console.error(error) this.loading = false } @@ -448,12 +448,12 @@ export default { await this.$emit('updateLocalContact', contact) // Notify user - OC.Notification.showTemporary(t('contacts', 'Avatar downloaded from social network')) + showSuccess(t('contacts', 'Avatar downloaded from social network')) } catch (error) { if (error.response.status === 304) { - OC.Notification.showTemporary(t('contacts', 'Avatar already up to date')) + showInfo(t('contacts', 'Avatar already up to date')) } else { - OC.Notification.showTemporary(t('contacts', 'Avatar download failed')) + showError(t('contacts', 'Avatar download failed')) console.debug(error) } } diff --git a/src/components/ContactsList.vue b/src/components/ContactsList.vue index 6548faf5..743dc77c 100644 --- a/src/components/ContactsList.vue +++ b/src/components/ContactsList.vue @@ -186,6 +186,14 @@ export default { </script> <style lang="scss" scoped> +.app-content-list { + flex: 1 1 300px; + + .empty-content { + padding: 20px; + } +} + // Virtual scroller overrides .vue-recycle-scroller { position: sticky !important; diff --git a/src/components/Properties/PropertyText.vue b/src/components/Properties/PropertyText.vue index 129bd811..0cbbecac 100644 --- a/src/components/Properties/PropertyText.vue +++ b/src/components/Properties/PropertyText.vue @@ -72,7 +72,7 @@ :class="{'property__value--with-ext': haveExtHandler}" type="text" class="property__value" - :placeholder="type" + :placeholder="localType.placeholder" @input="updateValue"> <!-- external link --> diff --git a/src/components/Settings/SettingsAddressbook.vue b/src/components/Settings/SettingsAddressbook.vue index e62ca5cf..2f75bb5b 100644 --- a/src/components/Settings/SettingsAddressbook.vue +++ b/src/components/Settings/SettingsAddressbook.vue @@ -99,6 +99,7 @@ import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import ActionInput from '@nextcloud/vue/dist/Components/ActionInput' import ActionCheckbox from '@nextcloud/vue/dist/Components/ActionCheckbox' import ShareAddressBook from './SettingsAddressbookShare' +import { showError, showSuccess } from '@nextcloud/dialogs' export default { name: 'SettingsAddressbook', @@ -195,7 +196,7 @@ export default { } catch (err) { // error handling console.error(err) - OC.Notification.showTemporary(t('contacts', 'Toggling of address book was not successful')) + showError(t('contacts', 'Toggling of address book was not successful')) } finally { // stop loading status regardless of outcome this.toggleEnabledLoading = false @@ -220,7 +221,7 @@ export default { } catch (err) { // error handling console.error(err) - OC.Notification.showTemporary(t('contacts', 'Deletion of address book was not successful.')) + showError(t('contacts', 'Deletion of address book was not successful.')) } finally { // stop loading status regardless of outcome this.deleteAddressbookLoading = false @@ -241,7 +242,7 @@ export default { } catch (err) { // error handling console.error(err) - OC.Notification.showTemporary(t('contacts', 'Renaming of address book was not successful.')) + showError(t('contacts', 'Renaming of address book was not successful.')) } finally { this.editingName = false // stop loading status regardless of outcome @@ -260,11 +261,11 @@ export default { this.copySuccess = true this.copied = true // Notify addressbook was copied - OC.Notification.showTemporary(t('contacts', 'Address book copied to clipboard')) + showSuccess(t('contacts', 'Address book copied to clipboard')) } catch (error) { this.copySuccess = false this.copied = true - OC.Notification.showTemporary(t('contacts', 'Address book was not copied to clipboard.')) + showError(t('contacts', 'Address book was not copied to clipboard.')) } finally { this.copyLoading = false setTimeout(() => { diff --git a/src/components/Settings/SettingsAddressbookSharee.vue b/src/components/Settings/SettingsAddressbookSharee.vue index ddb43a37..f9bb7af0 100644 --- a/src/components/Settings/SettingsAddressbookSharee.vue +++ b/src/components/Settings/SettingsAddressbookSharee.vue @@ -53,6 +53,7 @@ </template> <script> +import { showError } from '@nextcloud/dialogs' export default { name: 'SettingsAddressbookSharee', @@ -98,7 +99,7 @@ export default { }) } catch (error) { console.error(error) - OC.Notification.showTemporary(t('contacts', 'Unable to delete the share.')) + showError(t('contacts', 'Unable to delete the share')) } finally { this.loading = false } @@ -117,7 +118,7 @@ export default { }) } catch (error) { console.error(error) - OC.Notification.showTemporary(t('contacts', 'Unable to change permissions.')) + showError(t('contacts', 'Unable to change permissions')) } finally { this.loading = false } diff --git a/src/components/Settings/SettingsNewAddressbook.vue b/src/components/Settings/SettingsNewAddressbook.vue index 7d5f72d2..2b4a764c 100644 --- a/src/components/Settings/SettingsNewAddressbook.vue +++ b/src/components/Settings/SettingsNewAddressbook.vue @@ -45,6 +45,7 @@ </template> <script> +import { showError } from '@nextcloud/dialogs' export default { name: 'SettingsNewAddressbook', @@ -71,7 +72,7 @@ export default { }) .catch((error) => { console.error(error) - OC.Notification.showTemporary(t('contacts', 'An error occurred, unable to create the address book.')) + showError(t('contacts', 'An error occurred, unable to create the address book')) this.loading = false }) }, |