diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-12-02 18:32:57 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-01-08 10:14:05 +0100 |
commit | 74b980310852a0b406fa9d073870f92c409d5444 (patch) | |
tree | 055cbdf57886077bf3a6ea476813deedb54064e0 /apps/settings | |
parent | 85bc8513557f5ff37fc283d53893d4cb77ec7c3b (diff) | |
download | nextcloud-server-74b980310852a0b406fa9d073870f92c409d5444.tar.gz nextcloud-server-74b980310852a0b406fa9d073870f92c409d5444.zip |
Eslint fix
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/settings')
19 files changed, 166 insertions, 147 deletions
diff --git a/apps/settings/src/components/AdminDelegation/GroupSelect.vue b/apps/settings/src/components/AdminDelegation/GroupSelect.vue index 8f27efdfef0..eb7fd3e0c34 100644 --- a/apps/settings/src/components/AdminDelegation/GroupSelect.vue +++ b/apps/settings/src/components/AdminDelegation/GroupSelect.vue @@ -42,7 +42,7 @@ export default { selected: this.authorizedGroups .filter((group) => group.class === this.setting.class) .map((groupToMap) => this.availableGroups.find((group) => group.gid === groupToMap.group_id)) - .filter((group) => group !== undefined) + .filter((group) => group !== undefined), } }, watch: { @@ -63,7 +63,7 @@ export default { logger.error('Unable to modify setting', e) } }, - } + }, } </script> diff --git a/apps/settings/src/components/AuthToken.vue b/apps/settings/src/components/AuthToken.vue index dd1ec87e4eb..ce9d59936b9 100644 --- a/apps/settings/src/components/AuthToken.vue +++ b/apps/settings/src/components/AuthToken.vue @@ -48,7 +48,7 @@ :open.sync="actionOpen"> <ActionCheckbox v-if="token.type === 1" :checked="token.scope.filesystem" - @change.stop.prevent="$emit('toggleScope', token, 'filesystem', !token.scope.filesystem)"> + @change.stop.prevent="$emit('toggle-scope', token, 'filesystem', !token.scope.filesystem)"> <!-- TODO: add text/longtext with some description --> {{ t('settings', 'Allow filesystem access') }} </ActionCheckbox> diff --git a/apps/settings/src/components/AuthTokenList.vue b/apps/settings/src/components/AuthTokenList.vue index 4483d914dc4..9f98294c21c 100644 --- a/apps/settings/src/components/AuthTokenList.vue +++ b/apps/settings/src/components/AuthTokenList.vue @@ -67,7 +67,7 @@ export default { methods: { toggleScope(token, scope, value) { // Just pass it on - this.$emit('toggleScope', token, scope, value) + this.$emit('toggle-scope', token, scope, value) }, rename(token, newName) { // Just pass it on diff --git a/apps/settings/src/components/AuthTokenSection.vue b/apps/settings/src/components/AuthTokenSection.vue index 2624433eca2..87895e48219 100644 --- a/apps/settings/src/components/AuthTokenSection.vue +++ b/apps/settings/src/components/AuthTokenSection.vue @@ -55,8 +55,9 @@ const confirm = () => { /** * Tap into a promise without losing the value + * * @param {Function} cb the callback - * @returns {any} val the value + * @return {any} val the value */ const tap = cb => val => { cb(val) diff --git a/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/ProfileVisibilitySection.vue b/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/ProfileVisibilitySection.vue index cb59fd6dfd0..a0ccec5e55c 100644 --- a/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/ProfileVisibilitySection.vue +++ b/apps/settings/src/components/PersonalInfo/ProfileVisibilitySection/ProfileVisibilitySection.vue @@ -85,7 +85,7 @@ export default { // TODO remove this when not used once the settings layout is updated marginLeft: window.matchMedia('(min-width: 1600px)').matches ? window.getComputedStyle(document.getElementById('personal-settings-avatar-container')).getPropertyValue('width').trim() - : '0px' + : '0px', } }, diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index 7c67a422929..0ea68fb40e6 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -438,7 +438,7 @@ export default { * Validate quota string to make sure it's a valid human file size * * @param {string} quota Quota in readable format '5 GB' - * @returns {Object} + * @return {object} */ validateQuota(quota) { // only used for new presets sent through @Tag @@ -550,7 +550,7 @@ export default { * Create a new group * * @param {string} gid Group id - * @returns {Promise} + * @return {Promise} */ createGroup(gid) { this.loading.groups = true @@ -568,8 +568,8 @@ export default { /** * If the selected group is the disabled group but the count is 0 * redirect to the all users page. - * * we only check for 0 because we don't have the count on ldap - * * and we therefore set the usercount to -1 in this specific case + * we only check for 0 because we don't have the count on ldap + * and we therefore set the usercount to -1 in this specific case */ redirectIfDisabled() { const allGroups = this.$store.getters.getGroups diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index 9f41d464e1a..0dd742267d1 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -432,10 +432,10 @@ export default { }, /** - * Set user displayName - * - * @param {string} displayName The display name - */ + * Set user displayName + * + * @param {string} displayName The display name + */ updateDisplayName() { const displayName = this.$refs.displayName.value this.loading.displayName = true @@ -450,10 +450,10 @@ export default { }, /** - * Set user password - * - * @param {string} password The email adress - */ + * Set user password + * + * @param {string} password The email adress + */ updatePassword() { const password = this.$refs.password.value this.loading.password = true @@ -468,10 +468,10 @@ export default { }, /** - * Set user mailAddress - * - * @param {string} mailAddress The email adress - */ + * Set user mailAddress + * + * @param {string} mailAddress The email adress + */ updateEmail() { const mailAddress = this.$refs.mailAddress.value this.loading.mailAddress = true @@ -486,10 +486,10 @@ export default { }, /** - * Create a new group and add user to it - * - * @param {string} gid Group id - */ + * Create a new group and add user to it + * + * @param {string} gid Group id + */ async createGroup(gid) { this.loading = { groups: true, subadmins: true } try { @@ -505,10 +505,10 @@ export default { }, /** - * Add user to group - * - * @param {object} group Group object - */ + * Add user to group + * + * @param {object} group Group object + */ async addUserGroup(group) { if (group.canAdd === false) { return false @@ -526,10 +526,10 @@ export default { }, /** - * Remove user from group - * - * @param {object} group Group object - */ + * Remove user from group + * + * @param {object} group Group object + */ async removeUserGroup(group) { if (group.canRemove === false) { return false @@ -555,10 +555,10 @@ export default { }, /** - * Add user to group - * - * @param {object} group Group object - */ + * Add user to group + * + * @param {object} group Group object + */ async addUserSubAdmin(group) { this.loading.subadmins = true const userid = this.user.id @@ -576,10 +576,10 @@ export default { }, /** - * Remove user from group - * - * @param {object} group Group object - */ + * Remove user from group + * + * @param {object} group Group object + */ async removeUserSubAdmin(group) { this.loading.subadmins = true const userid = this.user.id @@ -598,11 +598,11 @@ export default { }, /** - * Dispatch quota set request - * - * @param {string|Object} quota Quota in readable format '5 GB' or Object {id: '5 GB', label: '5GB'} - * @returns {string} - */ + * Dispatch quota set request + * + * @param {string | object} quota Quota in readable format '5 GB' or Object {id: '5 GB', label: '5GB'} + * @return {string} + */ async setUserQuota(quota = 'none') { this.loading.quota = true // ensure we only send the preset id @@ -623,11 +623,11 @@ export default { }, /** - * Validate quota string to make sure it's a valid human file size - * - * @param {string} quota Quota in readable format '5 GB' - * @returns {Promise|boolean} - */ + * Validate quota string to make sure it's a valid human file size + * + * @param {string} quota Quota in readable format '5 GB' + * @return {Promise|boolean} + */ validateQuota(quota) { // only used for new presets sent through @Tag const validQuota = OC.Util.computerFileSize(quota) @@ -640,11 +640,11 @@ export default { }, /** - * Dispatch language set request - * - * @param {Object} lang language object {code:'en', name:'English'} - * @returns {Object} - */ + * Dispatch language set request + * + * @param {object} lang language object {code:'en', name:'English'} + * @return {object} + */ async setUserLanguage(lang) { this.loading.languages = true // ensure we only send the preset id @@ -663,8 +663,8 @@ export default { }, /** - * Dispatch new welcome mail request - */ + * Dispatch new welcome mail request + */ sendWelcomeMail() { this.loading.all = true this.$store.dispatch('sendWelcomeMail', this.user.id) diff --git a/apps/settings/src/components/UserList/UserRowSimple.vue b/apps/settings/src/components/UserList/UserRowSimple.vue index 8c97bd10f2d..9b00a0597bc 100644 --- a/apps/settings/src/components/UserList/UserRowSimple.vue +++ b/apps/settings/src/components/UserList/UserRowSimple.vue @@ -69,7 +69,7 @@ v-click-outside="hideMenu" class="icon-more" :aria-label="t('settings', 'Toggle user actions menu')" - @click.prevent="$emit('toggleMenu')" /> + @click.prevent="$emit('toggle-menu')" /> <div class="popovermenu" :class="{ 'open': openedMenu }" :aria-expanded="openedMenu"> <PopoverMenu :menu="userActions" /> </div> @@ -177,7 +177,7 @@ export default { }, methods: { hideMenu() { - this.$emit('hideMenu') + this.$emit('hide-menu') }, toggleEdit() { this.$emit('update:editing', true) diff --git a/apps/settings/src/constants/AccountPropertyConstants.js b/apps/settings/src/constants/AccountPropertyConstants.js index 285e32ea92f..fb637ea95b2 100644 --- a/apps/settings/src/constants/AccountPropertyConstants.js +++ b/apps/settings/src/constants/AccountPropertyConstants.js @@ -86,7 +86,7 @@ export const PROPERTY_READABLE_KEYS_ENUM = Object.freeze({ /** * Enum of account setting properties * - * *Account setting properties unlike account properties do not support scopes* + * Account setting properties unlike account properties do not support scopes* */ export const ACCOUNT_SETTING_PROPERTY_ENUM = Object.freeze({ LANGUAGE: 'language', @@ -136,7 +136,7 @@ export const SCOPE_SUFFIX = 'Scope' /** * Enum of scope names to properties * - * *Used for federation control* + * Used for federation control* */ export const SCOPE_PROPERTY_ENUM = Object.freeze({ [SCOPE_ENUM.PRIVATE]: { @@ -182,7 +182,7 @@ export const VERIFICATION_ENUM = Object.freeze({ /** * Email validation regex * - * *Sourced from https://github.com/mpyw/FILTER_VALIDATE_EMAIL.js/blob/71e62ca48841d2246a1b531e7e84f5a01f15e615/src/regexp/ascii.ts* + * Sourced from https://github.com/mpyw/FILTER_VALIDATE_EMAIL.js/blob/71e62ca48841d2246a1b531e7e84f5a01f15e615/src/regexp/ascii.ts* */ // eslint-disable-next-line no-control-regex export const VALIDATE_EMAIL_REGEX = /^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/i diff --git a/apps/settings/src/mixins/UserRowMixin.js b/apps/settings/src/mixins/UserRowMixin.js index 1c33f3d33cb..603f7a87837 100644 --- a/apps/settings/src/mixins/UserRowMixin.js +++ b/apps/settings/src/mixins/UserRowMixin.js @@ -159,7 +159,7 @@ export default { * * @param {string} user The user name * @param {int} size Size integer, default 32 - * @returns {string} + * @return {string} */ generateAvatar(user, size = 32) { return generateUrl( diff --git a/apps/settings/src/service/PersonalInfo/EmailService.js b/apps/settings/src/service/PersonalInfo/EmailService.js index a1f7a57f72b..477fff7fa62 100644 --- a/apps/settings/src/service/PersonalInfo/EmailService.js +++ b/apps/settings/src/service/PersonalInfo/EmailService.js @@ -31,9 +31,9 @@ import { ACCOUNT_PROPERTY_ENUM, SCOPE_SUFFIX } from '../../constants/AccountProp * Save the primary email of the user * * @param {string} email the primary email - * @returns {object} + * @return {object} */ -export const savePrimaryEmail = async(email) => { +export const savePrimaryEmail = async (email) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}', { userId }) @@ -50,12 +50,12 @@ export const savePrimaryEmail = async(email) => { /** * Save an additional email of the user * - * *Will be appended to the user's additional emails* + * Will be appended to the user's additional emails* * * @param {string} email the additional email - * @returns {object} + * @return {object} */ -export const saveAdditionalEmail = async(email) => { +export const saveAdditionalEmail = async (email) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}', { userId }) @@ -73,9 +73,9 @@ export const saveAdditionalEmail = async(email) => { * Save the notification email of the user * * @param {string} email the notification email - * @returns {object} + * @return {object} */ -export const saveNotificationEmail = async(email) => { +export const saveNotificationEmail = async (email) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}', { userId }) @@ -93,9 +93,9 @@ export const saveNotificationEmail = async(email) => { * Remove an additional email of the user * * @param {string} email the additional email - * @returns {object} + * @return {object} */ -export const removeAdditionalEmail = async(email) => { +export const removeAdditionalEmail = async (email) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}/{collection}', { userId, collection: ACCOUNT_PROPERTY_ENUM.EMAIL_COLLECTION }) @@ -114,9 +114,9 @@ export const removeAdditionalEmail = async(email) => { * * @param {string} prevEmail the additional email to be updated * @param {string} newEmail the new additional email - * @returns {object} + * @return {object} */ -export const updateAdditionalEmail = async(prevEmail, newEmail) => { +export const updateAdditionalEmail = async (prevEmail, newEmail) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}/{collection}', { userId, collection: ACCOUNT_PROPERTY_ENUM.EMAIL_COLLECTION }) @@ -134,9 +134,9 @@ export const updateAdditionalEmail = async(prevEmail, newEmail) => { * Save the federation scope for the primary email of the user * * @param {string} scope the federation scope - * @returns {object} + * @return {object} */ -export const savePrimaryEmailScope = async(scope) => { +export const savePrimaryEmailScope = async (scope) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}', { userId }) @@ -155,9 +155,9 @@ export const savePrimaryEmailScope = async(scope) => { * * @param {string} email the additional email * @param {string} scope the federation scope - * @returns {object} + * @return {object} */ -export const saveAdditionalEmailScope = async(email, scope) => { +export const saveAdditionalEmailScope = async (email, scope) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}/{collectionScope}', { userId, collectionScope: `${ACCOUNT_PROPERTY_ENUM.EMAIL_COLLECTION}${SCOPE_SUFFIX}` }) diff --git a/apps/settings/src/service/PersonalInfo/PersonalInfoService.js b/apps/settings/src/service/PersonalInfo/PersonalInfoService.js index e725300675c..31124c15987 100644 --- a/apps/settings/src/service/PersonalInfo/PersonalInfoService.js +++ b/apps/settings/src/service/PersonalInfo/PersonalInfoService.js @@ -32,9 +32,9 @@ import { SCOPE_SUFFIX } from '../../constants/AccountPropertyConstants' * * @param {string} accountProperty the account property * @param {string|boolean} value the primary value - * @returns {object} + * @return {object} */ -export const savePrimaryAccountProperty = async(accountProperty, value) => { +export const savePrimaryAccountProperty = async (accountProperty, value) => { // TODO allow boolean values on backend route handler // Convert boolean to string for compatibility if (typeof value === 'boolean') { @@ -59,9 +59,9 @@ export const savePrimaryAccountProperty = async(accountProperty, value) => { * * @param {string} accountProperty the account property * @param {string} scope the federation scope - * @returns {object} + * @return {object} */ -export const savePrimaryAccountPropertyScope = async(accountProperty, scope) => { +export const savePrimaryAccountPropertyScope = async (accountProperty, scope) => { const userId = getCurrentUser().uid const url = generateOcsUrl('cloud/users/{userId}', { userId }) diff --git a/apps/settings/src/service/ProfileService.js b/apps/settings/src/service/ProfileService.js index 8748db46152..15300155bbc 100644 --- a/apps/settings/src/service/ProfileService.js +++ b/apps/settings/src/service/ProfileService.js @@ -30,9 +30,9 @@ import confirmPassword from '@nextcloud/password-confirmation' * * @param {string} paramId the profile parameter ID * @param {string} visibility the visibility - * @returns {object} + * @return {object} */ -export const saveProfileParameterVisibility = async(paramId, visibility) => { +export const saveProfileParameterVisibility = async (paramId, visibility) => { const userId = getCurrentUser().uid const url = generateOcsUrl('/profile/{userId}', { userId }) diff --git a/apps/settings/src/service/WebAuthnRegistrationSerice.js b/apps/settings/src/service/WebAuthnRegistrationSerice.js index 98af818217b..91ee0dae2b2 100644 --- a/apps/settings/src/service/WebAuthnRegistrationSerice.js +++ b/apps/settings/src/service/WebAuthnRegistrationSerice.js @@ -23,6 +23,9 @@ import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' +/** + * + */ export async function startRegistration() { const url = generateUrl('/settings/api/personal/webauthn/registration') @@ -30,6 +33,10 @@ export async function startRegistration() { return resp.data } +/** + * @param name + * @param data + */ export async function finishRegistration(name, data) { const url = generateUrl('/settings/api/personal/webauthn/registration') @@ -37,6 +44,9 @@ export async function finishRegistration(name, data) { return resp.data } +/** + * @param id + */ export async function removeRegistration(id) { const url = generateUrl(`/settings/api/personal/webauthn/registration/${id}`) diff --git a/apps/settings/src/store/api.js b/apps/settings/src/store/api.js index 4eae9f5c95d..f65c963769a 100644 --- a/apps/settings/src/store/api.js +++ b/apps/settings/src/store/api.js @@ -62,7 +62,7 @@ export default { * .catch((error) => {throw error;}); * }).catch((error) => {requireAdmin OR API failure}); * - * @returns {Promise} + * @return {Promise} */ requireAdmin() { return confirmPassword() diff --git a/apps/settings/src/store/oc.js b/apps/settings/src/store/oc.js index a6d3bffc34e..35fbfcd34d1 100644 --- a/apps/settings/src/store/oc.js +++ b/apps/settings/src/store/oc.js @@ -29,10 +29,10 @@ const mutations = {} const getters = {} const actions = { /** - * Set application config in database - * - * @param {Object} context store context - * @param {Object} options destructuring object + * Set application config in database + * + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.app Application name * @param {boolean} options.key Config key * @param {boolean} options.value Value to set diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js index ef93f7e40ab..7bc04e25d9f 100644 --- a/apps/settings/src/store/users.js +++ b/apps/settings/src/store/users.js @@ -163,7 +163,8 @@ const mutations = { /** * Reset users list - * @param {Object} state the store state + * + * @param {object} state the store state */ resetUsers(state) { state.users = [] @@ -204,13 +205,13 @@ const actions = { /** * Get all users with full details * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {int} options.offset List offset to request * @param {int} options.limit List number to return from offset * @param {string} options.search Search amongst users * @param {string} options.group Get users from group - * @returns {Promise} + * @return {Promise} */ getUsers(context, { offset, limit, search, group }) { if (searchRequestCancelSource) { @@ -273,11 +274,12 @@ const actions = { /** * Get all users with full details * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {int} options.offset List offset to request * @param {int} options.limit List number to return from offset - * @returns {Promise} + * @param options.search + * @return {Promise} */ getUsersFromList(context, { offset, limit, search }) { search = typeof search === 'string' ? search : '' @@ -295,11 +297,12 @@ const actions = { /** * Get all users with full details from a groupid * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {int} options.offset List offset to request * @param {int} options.limit List number to return from offset - * @returns {Promise} + * @param options.groupid + * @return {Promise} */ getUsersFromGroup(context, { groupid, offset, limit }) { return api.get(generateOcsUrl('cloud/users/{groupId}/details?offset={offset}&limit={limit}', { groupId: encodeURIComponent(groupid), offset, limit })) @@ -318,9 +321,9 @@ const actions = { /** * Add group * - * @param {Object} context store context + * @param {object} context store context * @param {string} gid Group id - * @returns {Promise} + * @return {Promise} */ addGroup(context, gid) { return api.requireAdmin().then((response) => { @@ -341,9 +344,9 @@ const actions = { /** * Remove group * - * @param {Object} context store context + * @param {object} context store context * @param {string} gid Group id - * @returns {Promise} + * @return {Promise} */ removeGroup(context, gid) { return api.requireAdmin().then((response) => { @@ -356,11 +359,11 @@ const actions = { /** * Add user to group * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.gid Group id - * @returns {Promise} + * @return {Promise} */ addUserGroup(context, { userid, gid }) { return api.requireAdmin().then((response) => { @@ -373,11 +376,11 @@ const actions = { /** * Remove user from group * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.gid Group id - * @returns {Promise} + * @return {Promise} */ removeUserGroup(context, { userid, gid }) { return api.requireAdmin().then((response) => { @@ -395,11 +398,11 @@ const actions = { /** * Add user to group admin * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.gid Group id - * @returns {Promise} + * @return {Promise} */ addUserSubAdmin(context, { userid, gid }) { return api.requireAdmin().then((response) => { @@ -412,11 +415,11 @@ const actions = { /** * Remove user from group admin * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.gid Group id - * @returns {Promise} + * @return {Promise} */ removeUserSubAdmin(context, { userid, gid }) { return api.requireAdmin().then((response) => { @@ -429,9 +432,9 @@ const actions = { /** * Mark all user devices for remote wipe * - * @param {Object} context store context + * @param {object} context store context * @param {string} userid User id - * @returns {Promise} + * @return {Promise} */ wipeUserDevices(context, userid) { return api.requireAdmin().then((response) => { @@ -443,9 +446,9 @@ const actions = { /** * Delete a user * - * @param {Object} context store context + * @param {object} context store context * @param {string} userid User id - * @returns {Promise} + * @return {Promise} */ deleteUser(context, userid) { return api.requireAdmin().then((response) => { @@ -458,8 +461,8 @@ const actions = { /** * Add a user * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.password User password * @param {string} options.displayName User display name @@ -467,7 +470,10 @@ const actions = { * @param {string} options.groups User groups * @param {string} options.subadmin User subadmin groups * @param {string} options.quota User email - * @returns {Promise} + * @param context.commit + * @param context.dispatch + * @param options.language + * @return {Promise} */ addUser({ commit, dispatch }, { userid, password, displayName, email, groups, subadmin, quota, language }) { return api.requireAdmin().then((response) => { @@ -483,9 +489,9 @@ const actions = { /** * Get user data and commit addition * - * @param {Object} context store context + * @param {object} context store context * @param {string} userid User id - * @returns {Promise} + * @return {Promise} */ addUserData(context, userid) { return api.requireAdmin().then((response) => { @@ -495,13 +501,14 @@ const actions = { }).catch((error) => context.commit('API_FAILURE', { userid, error })) }, - /** Enable or disable user + /** + * Enable or disable user * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {boolean} options.enabled User enablement status - * @returns {Promise} + * @return {Promise} */ enableDisableUser(context, { userid, enabled = true }) { const userStatus = enabled ? 'enable' : 'disable' @@ -515,12 +522,12 @@ const actions = { /** * Edit user data * - * @param {Object} context store context - * @param {Object} options destructuring object + * @param {object} context store context + * @param {object} options destructuring object * @param {string} options.userid User id * @param {string} options.key User field to edit * @param {string} options.value Value of the change - * @returns {Promise} + * @return {Promise} */ setUserData(context, { userid, key, value }) { const allowedEmpty = ['email', 'displayname'] @@ -545,9 +552,9 @@ const actions = { /** * Send welcome mail * - * @param {Object} context store context + * @param {object} context store context * @param {string} userid User id - * @returns {Promise} + * @return {Promise} */ sendWelcomeMail(context, userid) { return api.requireAdmin().then((response) => { diff --git a/apps/settings/src/utils/validate.js b/apps/settings/src/utils/validate.js index f7371301909..291223c0737 100644 --- a/apps/settings/src/utils/validate.js +++ b/apps/settings/src/utils/validate.js @@ -31,10 +31,10 @@ import { VALIDATE_EMAIL_REGEX } from '../constants/AccountPropertyConstants' /** * Validate the string input * - * *Generic validator just to check that input is not an empty string* + * Generic validator just to check that input is not an empty string* * * @param {string} input the input - * @returns {boolean} + * @return {boolean} */ export function validateStringInput(input) { return input !== '' @@ -43,12 +43,12 @@ export function validateStringInput(input) { /** * Validate the email input * - * *Compliant with PHP core FILTER_VALIDATE_EMAIL validator* + * Compliant with PHP core FILTER_VALIDATE_EMAIL validator* * - * *Reference implementation https://github.com/mpyw/FILTER_VALIDATE_EMAIL.js/blob/71e62ca48841d2246a1b531e7e84f5a01f15e615/src/index.ts* + * Reference implementation https://github.com/mpyw/FILTER_VALIDATE_EMAIL.js/blob/71e62ca48841d2246a1b531e7e84f5a01f15e615/src/index.ts* * * @param {string} input the input - * @returns {boolean} + * @return {boolean} */ export function validateEmail(input) { return typeof input === 'string' @@ -62,7 +62,7 @@ export function validateEmail(input) { * Validate the language input * * @param {object} input the input - * @returns {boolean} + * @return {boolean} */ export function validateLanguage(input) { return input.code !== '' @@ -74,7 +74,7 @@ export function validateLanguage(input) { * Validate boolean input * * @param {boolean} input the input - * @returns {boolean} + * @return {boolean} */ export function validateBoolean(input) { return typeof input === 'boolean' diff --git a/apps/settings/src/views/Users.vue b/apps/settings/src/views/Users.vue index d57c16cc44a..bf191111853 100644 --- a/apps/settings/src/views/Users.vue +++ b/apps/settings/src/views/Users.vue @@ -390,7 +390,7 @@ export default { /** * Dispatch default quota set request * - * @param {string|Object} quota Quota in readable format '5 GB' or Object {id: '5 GB', label: '5GB'} + * @param {string | object} quota Quota in readable format '5 GB' or Object {id: '5 GB', label: '5GB'} */ setDefaultQuota(quota = 'none') { this.$store.dispatch('setAppConfig', { @@ -410,7 +410,7 @@ export default { * Validate quota string to make sure it's a valid human file size * * @param {string} quota Quota in readable format '5 GB' - * @returns {Promise|boolean} + * @return {Promise|boolean} */ validateQuota(quota) { // only used for new presets sent through @Tag @@ -429,7 +429,7 @@ export default { * @param {string} icon the icon class * @param {string} text the text to display * @param {Function} action the function to run - * @returns {Array} + * @return {Array} */ registerAction(icon, text, action) { this.externalActions.push({ @@ -484,8 +484,9 @@ export default { /** * Format a group to a menu entry - * @param {Object} group the group - * @returns {Object} + * + * @param {object} group the group + * @return {object} */ formatGroupMenu(group) { const item = {} |