From 66a8a9fba1b92d63b852b1606d9f3bb0400a99cf Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 16 May 2023 15:50:25 -0700 Subject: Use consistent imports for Vue components This makes tree shaking possible Signed-off-by: Varun Patil --- apps/settings/src/components/AdminTwoFactor.vue | 10 ++++++---- apps/settings/src/components/AuthToken.vue | 8 +++----- .../src/components/PersonalInfo/EmailSection/Email.vue | 3 ++- apps/settings/src/components/UserList/UserRow.vue | 10 ++++------ 4 files changed, 15 insertions(+), 16 deletions(-) (limited to 'apps/settings/src') diff --git a/apps/settings/src/components/AdminTwoFactor.vue b/apps/settings/src/components/AdminTwoFactor.vue index 78dba7f3a7e..a8ade52694d 100644 --- a/apps/settings/src/components/AdminTwoFactor.vue +++ b/apps/settings/src/components/AdminTwoFactor.vue @@ -73,7 +73,9 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadi import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js' import { loadState } from '@nextcloud/initial-state' -import _ from 'lodash' +import sortedUniq from 'lodash/sortedUniq' +import uniq from 'lodash/uniq' +import debounce from 'lodash/debounce' import { generateUrl, generateOcsUrl } from '@nextcloud/router' export default { @@ -125,19 +127,19 @@ export default { mounted() { // Groups are loaded dynamically, but the assigned ones *should* // be valid groups, so let's add them as initial state - this.groups = _.sortedUniq(_.uniq(this.enforcedGroups.concat(this.excludedGroups))) + this.groups = sortedUniq(uniq(this.enforcedGroups.concat(this.excludedGroups))) // Populate the groups with a first set so the dropdown is not empty // when opening the page the first time this.searchGroup('') }, methods: { - searchGroup: _.debounce(function(query) { + searchGroup: debounce(function(query) { this.loadingGroups = true axios.get(generateOcsUrl('cloud/groups?offset=0&search={query}&limit=20', { query })) .then(res => res.data.ocs) .then(ocs => ocs.data.groups) - .then(groups => { this.groups = _.sortedUniq(_.uniq(this.groups.concat(groups))) }) + .then(groups => { this.groups = sortedUniq(uniq(this.groups.concat(groups))) }) .catch(err => console.error('could not search groups', err)) .then(() => { this.loadingGroups = false }) }, 500), diff --git a/apps/settings/src/components/AuthToken.vue b/apps/settings/src/components/AuthToken.vue index d7ed81a35ab..b231af8d387 100644 --- a/apps/settings/src/components/AuthToken.vue +++ b/apps/settings/src/components/AuthToken.vue @@ -83,11 +83,9 @@