summaryrefslogtreecommitdiffstats
path: root/apps/settings/src/components/PersonalInfo
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src/components/PersonalInfo')
-rw-r--r--apps/settings/src/components/PersonalInfo/EmailSection/Email.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/LanguageSection/Language.vue7
-rw-r--r--apps/settings/src/components/PersonalInfo/LocaleSection/Locale.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/ProfileSection/ProfileCheckbox.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/VisibilityDropdown.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/shared/AccountPropertySection.vue6
-rw-r--r--apps/settings/src/components/PersonalInfo/shared/FederationControl.vue6
8 files changed, 16 insertions, 33 deletions
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
index ca83be9aafe..5fb59d3d797 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
+++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
@@ -90,11 +90,10 @@ import { NcActions, NcActionButton } from '@nextcloud/vue'
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
import AlertOctagon from 'vue-material-design-icons/AlertOctagon.vue'
import Check from 'vue-material-design-icons/Check.vue'
-import { showError } from '@nextcloud/dialogs'
import debounce from 'debounce'
import FederationControl from '../shared/FederationControl.vue'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
import { ACCOUNT_PROPERTY_READABLE_ENUM, VERIFICATION_ENUM } from '../../../constants/AccountPropertyConstants.js'
import {
@@ -358,8 +357,7 @@ export default {
this.showCheckmarkIcon = true
setTimeout(() => { this.showCheckmarkIcon = false }, 2000)
} else {
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
this.showErrorIcon = true
setTimeout(() => { this.showErrorIcon = false }, 2000)
}
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
index 6bfb8bfee8b..613b90356c3 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
+++ b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
@@ -63,7 +63,6 @@
<script>
import { loadState } from '@nextcloud/initial-state'
-import { showError } from '@nextcloud/dialogs'
import Email from './Email.vue'
import HeaderBar from '../shared/HeaderBar.vue'
@@ -71,7 +70,7 @@ import HeaderBar from '../shared/HeaderBar.vue'
import { ACCOUNT_PROPERTY_READABLE_ENUM, DEFAULT_ADDITIONAL_EMAIL_SCOPE, NAME_READABLE_ENUM } from '../../../constants/AccountPropertyConstants.js'
import { savePrimaryEmail, savePrimaryEmailScope, removeAdditionalEmail } from '../../../service/PersonalInfo/EmailService.js'
import { validateEmail } from '../../../utils/validate.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
const { emailMap: { additionalEmails, primaryEmail, notificationEmail } } = loadState('settings', 'personalInfoParameters', {})
const { displayNameChangeSupported } = loadState('settings', 'accountParameters', {})
@@ -186,8 +185,7 @@ export default {
handleResponse(status, errorMessage, error) {
if (status !== 'ok') {
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
},
diff --git a/apps/settings/src/components/PersonalInfo/LanguageSection/Language.vue b/apps/settings/src/components/PersonalInfo/LanguageSection/Language.vue
index adff44b2565..959e7153e17 100644
--- a/apps/settings/src/components/PersonalInfo/LanguageSection/Language.vue
+++ b/apps/settings/src/components/PersonalInfo/LanguageSection/Language.vue
@@ -51,12 +51,10 @@
</template>
<script>
-import { showError } from '@nextcloud/dialogs'
-
import { ACCOUNT_SETTING_PROPERTY_ENUM } from '../../../constants/AccountPropertyConstants.js'
import { savePrimaryAccountProperty } from '../../../service/PersonalInfo/PersonalInfoService.js'
import { validateLanguage } from '../../../utils/validate.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
export default {
name: 'Language',
@@ -133,8 +131,7 @@ export default {
// Ensure that local state reflects server state
this.initialLanguage = language
} else {
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
},
diff --git a/apps/settings/src/components/PersonalInfo/LocaleSection/Locale.vue b/apps/settings/src/components/PersonalInfo/LocaleSection/Locale.vue
index f5eb6f13320..7bb78f74cc2 100644
--- a/apps/settings/src/components/PersonalInfo/LocaleSection/Locale.vue
+++ b/apps/settings/src/components/PersonalInfo/LocaleSection/Locale.vue
@@ -58,14 +58,13 @@
</template>
<script>
-import { showError } from '@nextcloud/dialogs'
import moment from '@nextcloud/moment'
import Web from 'vue-material-design-icons/Web.vue'
import { ACCOUNT_SETTING_PROPERTY_ENUM } from '../../../constants/AccountPropertyConstants.js'
import { savePrimaryAccountProperty } from '../../../service/PersonalInfo/PersonalInfoService.js'
import { validateLocale } from '../../../utils/validate.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
export default {
name: 'Locale',
@@ -155,8 +154,7 @@ export default {
this.initialLocale = locale
} else {
this.$emit('update:locale', this.initialLocale)
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
},
diff --git a/apps/settings/src/components/PersonalInfo/ProfileSection/ProfileCheckbox.vue b/apps/settings/src/components/PersonalInfo/ProfileSection/ProfileCheckbox.vue
index 433daa0ca89..b8e8d6301d3 100644
--- a/apps/settings/src/components/PersonalInfo/ProfileSection/ProfileCheckbox.vue
+++ b/apps/settings/src/components/PersonalInfo/ProfileSection/ProfileCheckbox.vue
@@ -32,13 +32,12 @@
</template>
<script>
-import { showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
import { savePrimaryAccountProperty } from '../../../service/PersonalInfo/PersonalInfoService.js'
import { ACCOUNT_PROPERTY_ENUM } from '../../../constants/AccountPropertyConstants.js'
-import logger from '../../../logger.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
+import { handleError } from '../../../utils/handlers.js'
export default {
name: 'ProfileCheckbox',
@@ -82,8 +81,7 @@ export default {
if (status === 'ok') {
emit('settings:profile-enabled:updated', isProfileEnabled)
} else {
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
this.loading = false
},
diff --git a/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/VisibilityDropdown.vue b/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/VisibilityDropdown.vue
index f00130ec0a4..91c4dfffc0c 100644
--- a/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/VisibilityDropdown.vue
+++ b/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/VisibilityDropdown.vue
@@ -36,7 +36,6 @@
</template>
<script>
-import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
@@ -44,7 +43,7 @@ import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import { saveProfileParameterVisibility } from '../../../service/ProfileService.js'
import { VISIBILITY_PROPERTY_ENUM } from '../../../constants/ProfileConstants.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
const { profileEnabled } = loadState('settings', 'personalInfoParameters', false)
@@ -136,8 +135,7 @@ export default {
// Ensure that local state reflects server state
this.initialVisibility = visibility
} else {
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
},
diff --git a/apps/settings/src/components/PersonalInfo/shared/AccountPropertySection.vue b/apps/settings/src/components/PersonalInfo/shared/AccountPropertySection.vue
index 7ab5619ab87..4da187e2b67 100644
--- a/apps/settings/src/components/PersonalInfo/shared/AccountPropertySection.vue
+++ b/apps/settings/src/components/PersonalInfo/shared/AccountPropertySection.vue
@@ -71,7 +71,6 @@
<script>
import debounce from 'debounce'
-import { showError } from '@nextcloud/dialogs'
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
import AlertOctagon from 'vue-material-design-icons/AlertOctagon.vue'
@@ -80,7 +79,7 @@ import Check from 'vue-material-design-icons/Check.vue'
import HeaderBar from '../shared/HeaderBar.vue'
import { savePrimaryAccountProperty } from '../../../service/PersonalInfo/PersonalInfoService.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
export default {
name: 'AccountPropertySection',
@@ -196,8 +195,7 @@ export default {
setTimeout(() => { this.showCheckmarkIcon = false }, 2000)
} else {
this.$emit('update:value', this.initialValue)
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
this.showErrorIcon = true
setTimeout(() => { this.showErrorIcon = false }, 2000)
}
diff --git a/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue b/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue
index 11a6beef534..51c4afbe8da 100644
--- a/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue
+++ b/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue
@@ -42,7 +42,6 @@
<script>
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import { loadState } from '@nextcloud/initial-state'
-import { showError } from '@nextcloud/dialogs'
import FederationControlAction from './FederationControlAction.vue'
@@ -56,7 +55,7 @@ import {
UNPUBLISHED_READABLE_PROPERTIES,
} from '../../../constants/AccountPropertyConstants.js'
import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService.js'
-import logger from '../../../logger.js'
+import { handleError } from '../../../utils/handlers.js'
const {
federationEnabled,
@@ -188,8 +187,7 @@ export default {
this.initialScope = scope
} else {
this.$emit('update:scope', this.initialScope)
- showError(errorMessage)
- logger.error(errorMessage, error)
+ handleError(error, errorMessage)
}
},
},