From 8baf298832532aa3025978dbfca9b6c4fe30e5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 2 Dec 2021 18:57:53 +0100 Subject: [PATCH] Eslint fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .eslintrc.js | 4 + apps/comments/src/components/Comment.vue | 7 +- .../comments/src/services/CommentsInstance.js | 2 +- apps/comments/src/services/GetComments.js | 14 +- apps/comments/src/services/NewComment.js | 2 +- apps/comments/src/utils/cancelableRequest.js | 9 +- apps/comments/src/views/Comments.vue | 11 +- apps/dashboard/src/App.vue | 2 +- apps/dav/src/service/CalendarService.js | 10 ++ apps/dav/src/views/CalDavSettings.spec.js | 2 +- apps/files/src/components/TemplatePreview.vue | 3 +- apps/files/src/models/Tab.js | 2 +- apps/files/src/services/FileInfo.js | 3 + apps/files/src/services/Settings.js | 5 +- apps/files/src/services/Sidebar.js | 8 +- apps/files/src/utils/davUtils.js | 3 +- apps/files/src/utils/fileUtils.js | 4 +- apps/files/src/views/Sidebar.vue | 49 ++++--- apps/files/src/views/TemplatePicker.vue | 8 +- .../src/components/SharingEntry.vue | 16 ++- .../src/components/SharingEntryInternal.vue | 6 +- .../src/components/SharingEntryLink.vue | 59 ++++++--- .../src/components/SharingInput.vue | 17 ++- .../files_sharing/src/mixins/ShareRequests.js | 6 +- apps/files_sharing/src/models/Share.js | 80 +++++------ .../src/services/ConfigService.js | 50 +++---- .../src/services/ExternalLinkActions.js | 6 +- .../src/services/ExternalShareActions.js | 8 +- .../files_sharing/src/services/ShareSearch.js | 10 +- .../src/utils/GeneratePassword.js | 2 +- .../src/views/SharingLinkList.vue | 4 +- apps/files_sharing/src/views/SharingTab.vue | 13 +- apps/files_versions/src/versioncollection.js | 2 +- apps/files_versions/src/versionmodel.js | 4 +- apps/files_versions/src/versionstabview.js | 3 +- .../AdminDelegation/GroupSelect.vue | 4 +- apps/settings/src/components/AuthToken.vue | 2 +- .../settings/src/components/AuthTokenList.vue | 2 +- .../src/components/AuthTokenSection.vue | 3 +- .../ProfileVisibilitySection.vue | 2 +- apps/settings/src/components/UserList.vue | 8 +- .../src/components/UserList/UserRow.vue | 98 +++++++------- .../src/components/UserList/UserRowSimple.vue | 4 +- .../src/constants/AccountPropertyConstants.js | 6 +- apps/settings/src/mixins/UserRowMixin.js | 2 +- .../src/service/PersonalInfo/EmailService.js | 30 ++--- .../PersonalInfo/PersonalInfoService.js | 8 +- apps/settings/src/service/ProfileService.js | 4 +- .../src/service/WebAuthnRegistrationSerice.js | 10 ++ apps/settings/src/store/api.js | 2 +- apps/settings/src/store/oc.js | 8 +- apps/settings/src/store/users.js | 95 +++++++------- apps/settings/src/utils/validate.js | 14 +- apps/settings/src/views/Users.vue | 11 +- apps/systemtags/src/systemtagsfilelist.js | 8 +- apps/systemtags/src/systemtagsinfoview.js | 6 +- .../src/service/BackupCodesService.js | 3 + .../src/service/PrintService.js | 3 + .../src/components/UpdateNotification.vue | 4 +- apps/user_status/src/UserStatus.vue | 4 +- .../src/components/ClearAtSelect.vue | 6 +- .../src/components/PredefinedStatusesList.vue | 6 +- .../src/components/SetStatusModal.vue | 14 +- apps/user_status/src/filters/clearAtFilter.js | 4 +- .../src/mixins/OnlineStatusMixin.js | 6 +- .../src/services/clearAtOptionsService.js | 2 +- .../src/services/clearAtService.js | 4 +- .../src/services/heartbeatService.js | 6 +- .../src/services/predefinedStatusService.js | 4 +- .../src/services/statusOptionsService.js | 2 +- .../user_status/src/services/statusService.js | 32 ++--- .../src/store/predefinedStatuses.js | 7 +- apps/user_status/src/store/userStatus.js | 124 +++++++++--------- apps/weather_status/src/App.vue | 2 +- .../src/services/weatherStatusService.js | 44 +++---- apps/workflowengine/src/store.js | 7 +- apps/workflowengine/src/workflowengine.js | 10 +- core/src/OC/admin.js | 2 +- core/src/OC/apps.js | 10 +- core/src/OC/capabilities.js | 2 +- core/src/OC/get_set.js | 3 +- core/src/OC/host.js | 6 +- core/src/OC/index.js | 12 +- core/src/OC/l10n-registry.js | 22 ++-- core/src/OC/l10n.js | 34 ++--- core/src/OC/legacy-loader.js | 4 +- core/src/OC/menu.js | 8 +- core/src/OC/msg.js | 20 +-- core/src/OC/navigation.js | 1 + core/src/OC/notification.js | 17 +-- core/src/OC/password-confirmation.js | 2 +- core/src/OC/plugins.js | 18 +-- core/src/OC/query-string.js | 8 +- core/src/OC/requesttoken.js | 6 +- core/src/OC/routing.js | 3 +- core/src/OC/util-history.js | 11 +- core/src/OC/util.js | 24 ++-- core/src/OC/xhr-error.js | 1 + core/src/OCA/index.js | 1 + core/src/OCP/appconfig.js | 38 +++--- core/src/OCP/collaboration.js | 9 +- core/src/OCP/comments.js | 12 ++ core/src/OCP/loader.js | 4 +- core/src/OCP/toast.js | 10 +- core/src/OCP/whatsnew.js | 24 ++++ core/src/Util/get-url-parameter.js | 3 + core/src/components/setup/RecommendedApps.vue | 6 +- core/src/globals.js | 6 +- core/src/jquery/exists.js | 3 +- core/src/jquery/filterattr.js | 2 +- core/src/jquery/selectrange.js | 3 +- core/src/services/UnifiedSearchService.js | 11 +- .../services/WebAuthnAuthenticationService.js | 6 + core/src/session-heartbeat.js | 12 +- .../systemtags/systemtagsmappingcollection.js | 36 ++--- core/src/views/UnifiedSearch.vue | 37 ++++-- dist/core-main.js | 4 +- dist/core-main.js.map | 2 +- dist/settings-users-351.js | 4 +- dist/settings-users-351.js.map | 2 +- ...ings-vue-settings-apps-users-management.js | 4 +- ...-vue-settings-apps-users-management.js.map | 2 +- ...settings-vue-settings-personal-security.js | 4 +- ...ings-vue-settings-personal-security.js.map | 2 +- dist/user-status-modal-299.js | 4 +- dist/user-status-modal-299.js.map | 2 +- dist/user_status-menu.js | 4 +- dist/user_status-menu.js.map | 2 +- 128 files changed, 870 insertions(+), 658 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index deae31d24c3fe..4a47bcb571742 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,5 +16,9 @@ module.exports = { // TODO: make sure we fix this as this is bad vue coding style. // Use proper sync modifier 'vue/no-mutating-props': 'warn', + 'vue/custom-event-name-casing': ['error', 'kebab-case', { + // allows custom xxxx:xxx events formats + ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'], + }], }, } diff --git a/apps/comments/src/components/Comment.vue b/apps/comments/src/components/Comment.vue index feeb32441cfe2..5bab02262aa61 100644 --- a/apps/comments/src/components/Comment.vue +++ b/apps/comments/src/components/Comment.vue @@ -166,7 +166,8 @@ export default { /** * Is the current user the author of this comment - * @returns {boolean} + * + * @return {boolean} */ isOwnComment() { return getCurrentUser().uid === this.actorId @@ -174,7 +175,8 @@ export default { /** * Rendered content as html string - * @returns {string} + * + * @return {string} */ renderedContent() { if (this.isEmptyMessage) { @@ -208,6 +210,7 @@ export default { methods: { /** * Update local Message on outer change + * * @param {string} message the message to set */ updateLocalMessage(message) { diff --git a/apps/comments/src/services/CommentsInstance.js b/apps/comments/src/services/CommentsInstance.js index bf0199fe7534a..9aac3e6c69e0e 100644 --- a/apps/comments/src/services/CommentsInstance.js +++ b/apps/comments/src/services/CommentsInstance.js @@ -49,7 +49,7 @@ export default class CommentInstance { * Initialize a new Comments instance for the desired type * * @param {string} commentsType the comments endpoint type - * @param {Object} options the vue options (propsData, parent, el...) + * @param {object} options the vue options (propsData, parent, el...) */ constructor(commentsType = 'files', options) { // Add comments type as a global mixin diff --git a/apps/comments/src/services/GetComments.js b/apps/comments/src/services/GetComments.js index b6b2db5721790..bfce1bf9f9b73 100644 --- a/apps/comments/src/services/GetComments.js +++ b/apps/comments/src/services/GetComments.js @@ -28,11 +28,11 @@ export const DEFAULT_LIMIT = 20 /** * Retrieve the comments list * - * @param {Object} data destructuring object + * @param {object} data destructuring object * @param {string} data.commentsType the ressource type * @param {number} data.ressourceId the ressource ID - * @param {Object} [options] optional options for axios - * @returns {Object[]} the comments list + * @param {object} [options] optional options for axios + * @return {object[]} the comments list */ export default async function({ commentsType, ressourceId }, options = {}) { let response = null @@ -64,6 +64,10 @@ export default async function({ commentsType, ressourceId }, options = {}) { } // https://github.com/perry-mitchell/webdav-client/blob/9de2da4a2599e06bd86c2778145b7ade39fe0b3c/source/interface/directoryContents.js#L32 +/** + * @param result + * @param isDetailed + */ function processMultistatus(result, isDetailed = false) { // Extract the response items (directory contents) const { @@ -86,6 +90,10 @@ function processMultistatus(result, isDetailed = false) { }) } +/** + * @param value + * @param passes + */ function decodeHtmlEntities(value, passes = 1) { const parser = new DOMParser() let decoded = value diff --git a/apps/comments/src/services/NewComment.js b/apps/comments/src/services/NewComment.js index 8f54e18d26e10..6a242713696c3 100644 --- a/apps/comments/src/services/NewComment.js +++ b/apps/comments/src/services/NewComment.js @@ -31,7 +31,7 @@ import client from './DavClient' * @param {string} commentsType the ressource type * @param {number} ressourceId the ressource ID * @param {string} message the message - * @returns {Object} the new comment + * @return {object} the new comment */ export default async function(commentsType, ressourceId, message) { const ressourcePath = ['', commentsType, ressourceId].join('/') diff --git a/apps/comments/src/utils/cancelableRequest.js b/apps/comments/src/utils/cancelableRequest.js index c678e42dae3ea..1b9b33c37dc6b 100644 --- a/apps/comments/src/utils/cancelableRequest.js +++ b/apps/comments/src/utils/cancelableRequest.js @@ -24,15 +24,16 @@ import axios from '@nextcloud/axios' /** * Create a cancel token - * @returns {CancelTokenSource} + * + * @return {CancelTokenSource} */ const createCancelToken = () => axios.CancelToken.source() /** * Creates a cancelable axios 'request object'. * - * @param {function} request the axios promise request - * @returns {Object} + * @param {Function} request the axios promise request + * @return {object} */ const cancelableRequest = function(request) { /** @@ -44,7 +45,7 @@ const cancelableRequest = function(request) { * Execute the request * * @param {string} url the url to send the request to - * @param {Object} [options] optional config for the request + * @param {object} [options] optional config for the request */ const fetch = async function(url, options) { return request( diff --git a/apps/comments/src/views/Comments.vue b/apps/comments/src/views/Comments.vue index 53693fa891923..c101c2c5c39ca 100644 --- a/apps/comments/src/views/Comments.vue +++ b/apps/comments/src/views/Comments.vue @@ -126,7 +126,8 @@ export default { methods: { /** * Update current ressourceId and fetch new data - * @param {Number} ressourceId the current ressourceId (fileId...) + * + * @param {number} ressourceId the current ressourceId (fileId...) */ async update(ressourceId) { this.ressourceId = ressourceId @@ -152,8 +153,9 @@ export default { /** * Make sure we have all mentions as Array of objects + * * @param {Array} mentions the mentions list - * @returns {Object[]} + * @return {object[]} */ genMentionsData(mentions) { const list = Object.values(mentions).flat() @@ -217,6 +219,7 @@ export default { /** * Autocomplete @mentions + * * @param {string} search the query * @param {Function} callback the callback to process the results with */ @@ -235,7 +238,8 @@ export default { /** * Add newly created comment to the list - * @param {Object} comment the new comment + * + * @param {object} comment the new comment */ onNewComment(comment) { this.comments.unshift(comment) @@ -243,6 +247,7 @@ export default { /** * Remove deleted comment from the list + * * @param {number} id the deleted comment */ onDelete(id) { diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue index d98f1ec1133f3..75e8e6c010827 100644 --- a/apps/dashboard/src/App.vue +++ b/apps/dashboard/src/App.vue @@ -266,7 +266,7 @@ export default { * Method to register panels that will be called by the integrating apps * * @param {string} app The unique app id for the widget - * @param {function} callback The callback function to register a panel which gets the DOM element passed as parameter + * @param {Function} callback The callback function to register a panel which gets the DOM element passed as parameter */ register(app, callback) { Vue.set(this.callbacks, app, callback) diff --git a/apps/dav/src/service/CalendarService.js b/apps/dav/src/service/CalendarService.js index caac6874907b7..9de0d0b594604 100644 --- a/apps/dav/src/service/CalendarService.js +++ b/apps/dav/src/service/CalendarService.js @@ -25,6 +25,9 @@ import { parseXML } from 'webdav/dist/node/tools/dav' import { getZoneString } from 'icalzone' import { v4 as uuidv4 } from 'uuid' +/** + * + */ export function getEmptySlots() { return { MO: [], @@ -37,6 +40,9 @@ export function getEmptySlots() { } } +/** + * + */ export async function findScheduleInboxAvailability() { const client = getClient('calendars') @@ -101,6 +107,10 @@ export async function findScheduleInboxAvailability() { } } +/** + * @param slots + * @param timezoneId + */ export async function saveScheduleInboxAvailability(slots, timezoneId) { const all = [...Object.keys(slots).flatMap(dayId => slots[dayId].map(slot => ({ ...slot, diff --git a/apps/dav/src/views/CalDavSettings.spec.js b/apps/dav/src/views/CalDavSettings.spec.js index 3f9254a3010cb..0dc4c44537afe 100644 --- a/apps/dav/src/views/CalDavSettings.spec.js +++ b/apps/dav/src/views/CalDavSettings.spec.js @@ -31,7 +31,7 @@ describe('CalDavSettings', () => { global.OCP = originalOCP }) - test('interactions', async() => { + test('interactions', async () => { const TLUtils = render( CalDavSettings, { diff --git a/apps/files/src/components/TemplatePreview.vue b/apps/files/src/components/TemplatePreview.vue index 89162ba4efdaf..ad152af9ea3b5 100644 --- a/apps/files/src/components/TemplatePreview.vue +++ b/apps/files/src/components/TemplatePreview.vue @@ -102,7 +102,8 @@ export default { computed: { /** * Strip away extension from name - * @returns {string} + * + * @return {string} */ nameWithoutExt() { return this.basename.indexOf('.') > -1 ? this.basename.split('.').slice(0, -1).join('.') : this.basename diff --git a/apps/files/src/models/Tab.js b/apps/files/src/models/Tab.js index b425fc16b2dec..e2c3d9310240e 100644 --- a/apps/files/src/models/Tab.js +++ b/apps/files/src/models/Tab.js @@ -34,7 +34,7 @@ export default class Tab { /** * Create a new tab instance * - * @param {Object} options destructuring object + * @param {object} options destructuring object * @param {string} options.id the unique id of this tab * @param {string} options.name the translated tab name * @param {string} options.icon the vue component diff --git a/apps/files/src/services/FileInfo.js b/apps/files/src/services/FileInfo.js index 33284df503293..a94436e16a54a 100644 --- a/apps/files/src/services/FileInfo.js +++ b/apps/files/src/services/FileInfo.js @@ -22,6 +22,9 @@ import axios from '@nextcloud/axios' +/** + * @param url + */ export default async function(url) { const response = await axios({ method: 'PROPFIND', diff --git a/apps/files/src/services/Settings.js b/apps/files/src/services/Settings.js index d07033891a51d..887a04005130d 100644 --- a/apps/files/src/services/Settings.js +++ b/apps/files/src/services/Settings.js @@ -34,7 +34,7 @@ export default class Settings { * * @since 19.0.0 * @param {OCA.Files.Settings.Setting} view element to add to settings - * @returns {boolean} whether registering was successful + * @return {boolean} whether registering was successful */ register(view) { if (this._settings.filter(e => e.name === view.name).length > 0) { @@ -47,7 +47,8 @@ export default class Settings { /** * All settings elements - * @returns {OCA.Files.Settings.Setting[]} All currently registered settings + * + * @return {OCA.Files.Settings.Setting[]} All currently registered settings */ get settings() { return this._settings diff --git a/apps/files/src/services/Sidebar.js b/apps/files/src/services/Sidebar.js index c7b6ada2aeab9..6db1d5fa5e49c 100644 --- a/apps/files/src/services/Sidebar.js +++ b/apps/files/src/services/Sidebar.js @@ -41,7 +41,7 @@ export default class Sidebar { * * @readonly * @memberof Sidebar - * @returns {Object} the data state + * @return {object} the data state */ get state() { return this._state @@ -51,8 +51,8 @@ export default class Sidebar { * Register a new tab view * * @memberof Sidebar - * @param {Object} tab a new unregistered tab - * @returns {Boolean} + * @param {object} tab a new unregistered tab + * @return {boolean} */ registerTab(tab) { const hasDuplicate = this._state.tabs.findIndex(check => check.id === tab.id) > -1 @@ -78,7 +78,7 @@ export default class Sidebar { * Return current opened file * * @memberof Sidebar - * @returns {String} the current opened file + * @return {string} the current opened file */ get file() { return this._state.file diff --git a/apps/files/src/utils/davUtils.js b/apps/files/src/utils/davUtils.js index b2a0bb2ebd88e..513821df4116f 100644 --- a/apps/files/src/utils/davUtils.js +++ b/apps/files/src/utils/davUtils.js @@ -41,7 +41,8 @@ export const getToken = function() { /** * Return the current directory, fallback to root - * @returns {string} + * + * @return {string} */ export const getCurrentDirectory = function() { const currentDirInfo = OCA?.Files?.App?.currentFileList?.dirInfo diff --git a/apps/files/src/utils/fileUtils.js b/apps/files/src/utils/fileUtils.js index 7b78a85dc0ea1..f37e939e1740c 100644 --- a/apps/files/src/utils/fileUtils.js +++ b/apps/files/src/utils/fileUtils.js @@ -34,8 +34,8 @@ const encodeFilePath = function(path) { /** * Extract dir and name from file path * - * @param {String} path the full path - * @returns {String[]} [dirPath, fileName] + * @param {string} path the full path + * @return {string[]} [dirPath, fileName] */ const extractFilePaths = function(path) { const pathSections = path.split('/') diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index efbcdc35134e2..ec41240e3f2c3 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -121,7 +121,8 @@ export default { * Current filename * This is bound to the Sidebar service and * is used to load a new file - * @returns {string} + * + * @return {string} */ file() { return this.Sidebar.file @@ -129,7 +130,8 @@ export default { /** * List of all the registered tabs - * @returns {Array} + * + * @return {Array} */ tabs() { return this.Sidebar.tabs @@ -137,7 +139,8 @@ export default { /** * List of all the registered views - * @returns {Array} + * + * @return {Array} */ views() { return this.Sidebar.views @@ -145,7 +148,8 @@ export default { /** * Current user dav root path - * @returns {string} + * + * @return {string} */ davPath() { const user = OC.getCurrentUser().uid @@ -154,8 +158,9 @@ export default { /** * Current active tab handler + * * @param {string} id the tab id to set as active - * @returns {string} the current active tab + * @return {string} the current active tab */ activeTab() { return this.Sidebar.activeTab @@ -163,7 +168,8 @@ export default { /** * Sidebar subtitle - * @returns {string} + * + * @return {string} */ subtitle() { return `${this.size}, ${this.time}` @@ -171,7 +177,8 @@ export default { /** * File last modified formatted string - * @returns {string} + * + * @return {string} */ time() { return OC.Util.relativeModifiedDate(this.fileInfo.mtime) @@ -179,7 +186,8 @@ export default { /** * File last modified full string - * @returns {string} + * + * @return {string} */ fullTime() { return moment(this.fileInfo.mtime).format('LLL') @@ -187,7 +195,8 @@ export default { /** * File size formatted string - * @returns {string} + * + * @return {string} */ size() { return OC.Util.humanFileSize(this.fileInfo.size) @@ -195,7 +204,8 @@ export default { /** * File background/figure to illustrate the sidebar header - * @returns {string} + * + * @return {string} */ background() { return this.getPreviewIfAny(this.fileInfo) @@ -204,7 +214,7 @@ export default { /** * App sidebar v-binding object * - * @returns {Object} + * @return {object} */ appSidebar() { if (this.fileInfo) { @@ -243,7 +253,7 @@ export default { /** * Default action object for the current file * - * @returns {Object} + * @return {object} */ defaultAction() { return this.fileInfo @@ -260,7 +270,7 @@ export default { * nothing is listening for a click if there * is no default action * - * @returns {string|null} + * @return {string|null} */ defaultActionListener() { return this.defaultAction ? 'figure-click' : null @@ -275,8 +285,8 @@ export default { /** * Can this tab be displayed ? * - * @param {Object} tab a registered tab - * @returns {boolean} + * @param {object} tab a registered tab + * @return {boolean} */ canDisplay(tab) { return tab.enabled(this.fileInfo) @@ -302,8 +312,8 @@ export default { * Copied from https://github.com/nextcloud/server/blob/16e0887ec63591113ee3f476e0c5129e20180cde/apps/files/js/filelist.js#L1377 * TODO: We also need this as a standalone library * - * @param {Object} fileInfo the fileinfo - * @returns {string} Url to the icon for mimeType + * @param {object} fileInfo the fileinfo + * @return {string} Url to the icon for mimeType */ getIconUrl(fileInfo) { const mimeType = fileInfo.mimetype || 'application/octet-stream' @@ -341,7 +351,7 @@ export default { * Toggle favourite state * TODO: better implementation * - * @param {Boolean} state favourited or not + * @param {boolean} state favourited or not */ async toggleStarred(state) { try { @@ -397,7 +407,7 @@ export default { * Open the sidebar for the given file * * @param {string} path the file path to load - * @returns {Promise} + * @return {Promise} * @throws {Error} loading failure */ async open(path) { @@ -446,6 +456,7 @@ export default { /** * Allow to set the Sidebar as fullscreen from OCA.Files.Sidebar + * * @param {boolean} isFullScreen - Wether or not to render the Sidebar in fullscreen. */ setFullScreenMode(isFullScreen) { diff --git a/apps/files/src/views/TemplatePicker.vue b/apps/files/src/views/TemplatePicker.vue index 7c866db8a586b..a4ceefeb1961b 100644 --- a/apps/files/src/views/TemplatePicker.vue +++ b/apps/files/src/views/TemplatePicker.vue @@ -109,7 +109,8 @@ export default { computed: { /** * Strip away extension from name - * @returns {string} + * + * @return {string} */ nameWithoutExt() { return this.name.indexOf('.') > -1 @@ -133,7 +134,8 @@ export default { /** * Style css vars bin,d - * @returns {Object} + * + * @return {object} */ style() { return { @@ -149,6 +151,7 @@ export default { methods: { /** * Open the picker + * * @param {string} name the file name to create * @param {object} provider the template provider picked */ @@ -188,6 +191,7 @@ export default { /** * Manages the radio template picker change + * * @param {number} fileid the selected template file id */ onCheck(fileid) { diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 8167172ceeae3..1c3d19605325d 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -233,7 +233,7 @@ export default { /** * Can the sharer set whether the sharee can edit the file ? * - * @returns {boolean} + * @return {boolean} */ canSetEdit() { // If the owner revoked the permission after the resharer granted it @@ -245,7 +245,7 @@ export default { /** * Can the sharer set whether the sharee can create the file ? * - * @returns {boolean} + * @return {boolean} */ canSetCreate() { // If the owner revoked the permission after the resharer granted it @@ -257,7 +257,7 @@ export default { /** * Can the sharer set whether the sharee can delete the file ? * - * @returns {boolean} + * @return {boolean} */ canSetDelete() { // If the owner revoked the permission after the resharer granted it @@ -269,7 +269,7 @@ export default { /** * Can the sharer set whether the sharee can reshare the file ? * - * @returns {boolean} + * @return {boolean} */ canSetReshare() { // If the owner revoked the permission after the resharer granted it @@ -338,7 +338,8 @@ export default { /** * Is the current share a folder ? - * @returns {boolean} + * + * @return {boolean} */ isFolder() { return this.fileInfo.type === 'dir' @@ -346,7 +347,8 @@ export default { /** * Does the current share have an expiration date - * @returns {boolean} + * + * @return {boolean} */ hasExpirationDate: { get() { @@ -372,7 +374,7 @@ export default { }, /** - * @returns {bool} + * @return {bool} */ hasStatus() { if (this.share.type !== this.SHARE_TYPES.SHARE_TYPE_USER) { diff --git a/apps/files_sharing/src/components/SharingEntryInternal.vue b/apps/files_sharing/src/components/SharingEntryInternal.vue index af677eca8436e..e96a85340a60f 100644 --- a/apps/files_sharing/src/components/SharingEntryInternal.vue +++ b/apps/files_sharing/src/components/SharingEntryInternal.vue @@ -49,7 +49,8 @@ export default { computed: { /** * Get the internal link to this file id - * @returns {string} + * + * @return {string} */ internalLink() { return window.location.protocol + '//' + window.location.host + generateUrl('/f/') + this.fileInfo.id @@ -57,7 +58,8 @@ export default { /** * Clipboard v-tooltip message - * @returns {string} + * + * @return {string} */ clipboardTooltip() { if (this.copied) { diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index d860ee2080581..993a5e255214b 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -401,7 +401,8 @@ export default { * Return the current share permissions * We always ignore the SHARE permission as this is used for the * federated sharing. - * @returns {number} + * + * @return {number} */ sharePermissions() { return this.share.permissions & ~OC.PERMISSION_SHARE @@ -410,7 +411,8 @@ export default { * Generate a unique random id for this SharingEntryLink only * This allows ActionRadios to have the same name prop * but not to impact others SharingEntryLink - * @returns {string} + * + * @return {string} */ randomId() { return Math.random().toString(27).substr(2) @@ -418,7 +420,8 @@ export default { /** * Link share label - * @returns {string} + * + * @return {string} */ title() { // if we have a valid existing share (not pending) @@ -453,7 +456,8 @@ export default { /** * Show the email on a second line if a label is set for mail shares - * @returns {string} + * + * @return {string} */ subtitle() { if (this.isEmailShareType @@ -465,7 +469,8 @@ export default { /** * Does the current share have an expiration date - * @returns {boolean} + * + * @return {boolean} */ hasExpirationDate: { get() { @@ -491,7 +496,8 @@ export default { /** * Is the current share password protected ? - * @returns {boolean} + * + * @return {boolean} */ isPasswordProtected: { get() { @@ -507,7 +513,8 @@ export default { /** * Is Talk enabled? - * @returns {boolean} + * + * @return {boolean} */ isTalkEnabled() { return OC.appswebroots.spreed !== undefined @@ -515,7 +522,8 @@ export default { /** * Is it possible to protect the password by Talk? - * @returns {boolean} + * + * @return {boolean} */ isPasswordProtectedByTalkAvailable() { return this.isPasswordProtected && this.isTalkEnabled @@ -523,7 +531,8 @@ export default { /** * Is the current share password protected by Talk? - * @returns {boolean} + * + * @return {boolean} */ isPasswordProtectedByTalk: { get() { @@ -536,7 +545,8 @@ export default { /** * Is the current share an email share ? - * @returns {boolean} + * + * @return {boolean} */ isEmailShareType() { return this.share @@ -562,7 +572,8 @@ export default { * Pending data. * If the share still doesn't have an id, it is not synced * Therefore this is still not valid and requires user input - * @returns {boolean} + * + * @return {boolean} */ pendingPassword() { return this.config.enforcePasswordForPublicLink && this.share && !this.share.id @@ -573,7 +584,8 @@ export default { /** * Can the recipient edit the file ? - * @returns {boolean} + * + * @return {boolean} */ canUpdate: { get() { @@ -595,7 +607,8 @@ export default { /** * Is the current share a folder ? * TODO: move to a proper FileInfo model? - * @returns {boolean} + * + * @return {boolean} */ isFolder() { return this.fileInfo.type === 'dir' @@ -604,7 +617,8 @@ export default { /** * Does the current file/folder have create permissions * TODO: move to a proper FileInfo model? - * @returns {boolean} + * + * @return {boolean} */ fileHasCreatePermission() { return !!(this.fileInfo.permissions & OC.PERMISSION_CREATE) @@ -612,7 +626,8 @@ export default { /** * Return the public share link - * @returns {string} + * + * @return {string} */ shareLink() { return window.location.protocol + '//' + window.location.host + generateUrl('/s/') + this.share.token @@ -620,7 +635,8 @@ export default { /** * Clipboard v-tooltip message - * @returns {string} + * + * @return {string} */ clipboardTooltip() { if (this.copied) { @@ -633,8 +649,9 @@ export default { /** * External additionnai actions for the menu + * * @deprecated use OCA.Sharing.ExternalShareActions - * @returns {Array} + * @return {Array} */ externalLegacyLinkActions() { return this.ExternalLegacyLinkActions.actions @@ -642,7 +659,8 @@ export default { /** * Additional actions for the menu - * @returns {Array} + * + * @return {Array} */ externalLinkActions() { // filter only the registered actions for said link @@ -795,6 +813,7 @@ export default { /** * On permissions change + * * @param {Event} event js event */ togglePermissions(event) { @@ -805,7 +824,8 @@ export default { /** * Label changed, let's save it to a different key - * @param {String} label the share label + * + * @param {string} label the share label */ onLabelChange(label) { this.$set(this.share, 'newLabel', label.trim()) @@ -847,6 +867,7 @@ export default { * If both co-exists, the password have changed and * we show it in plain text. * Then on submit (or menu close), we sync it. + * * @param {string} password the changed password */ onPasswordChange(password) { diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 9bc4e04e722c3..02c1f27f17309 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -114,7 +114,7 @@ export default { * results into the autocomplete dropdown * Used for the guests app * - * @returns {Array} + * @return {Array} */ externalResults() { return this.ShareSearch.results @@ -321,8 +321,8 @@ export default { * Filter out existing shares from * the provided shares search results * - * @param {Object[]} shares the array of shares object - * @returns {Object[]} + * @param {object[]} shares the array of shares object + * @return {object[]} */ filterOutExistingShares(shares) { return shares.reduce((arr, share) => { @@ -376,8 +376,9 @@ export default { /** * Get the icon based on the share type + * * @param {number} type the share type - * @returns {string} the icon class + * @return {string} the icon class */ shareTypeToIcon(type) { switch (type) { @@ -406,8 +407,9 @@ export default { /** * Format shares for the multiselect options - * @param {Object} result select entry item - * @returns {Object} + * + * @param {object} result select entry item + * @return {object} */ formatForMultiselect(result) { let subtitle @@ -438,7 +440,8 @@ export default { /** * Process the new share request - * @param {Object} value the multiselect option + * + * @param {object} value the multiselect option */ async addShare(value) { if (value.lookup) { diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js index ef45f9171b28f..960e418d0fcb9 100644 --- a/apps/files_sharing/src/mixins/ShareRequests.js +++ b/apps/files_sharing/src/mixins/ShareRequests.js @@ -40,7 +40,7 @@ export default { /** * Create a new share * - * @param {Object} data destructuring object + * @param {object} data destructuring object * @param {string} data.path path to the file/folder which should be shared * @param {number} data.shareType 0 = user; 1 = group; 3 = public link; 6 = federated cloud share * @param {string} data.shareWith user/group id with which the file should be shared (optional for shareType > 1) @@ -50,7 +50,7 @@ export default { * @param {boolean} [data.sendPasswordByTalk=false] send the password via a talk conversation * @param {string} [data.expireDate=''] expire the shareautomatically after * @param {string} [data.label=''] custom label - * @returns {Share} the new share + * @return {Share} the new share * @throws {Error} */ async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) { @@ -99,7 +99,7 @@ export default { * Update a share * * @param {number} id share id - * @param {Object} properties key-value object of the properties to update + * @param {object} properties key-value object of the properties to update */ async updateShare(id, properties) { try { diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js index 32d9a78e5f968..239eb8c947e32 100644 --- a/apps/files_sharing/src/models/Share.js +++ b/apps/files_sharing/src/models/Share.js @@ -32,7 +32,7 @@ export default class Share { /** * Create the share object * - * @param {Object} ocsData ocs request response + * @param {object} ocsData ocs request response */ constructor(ocsData) { if (ocsData.ocs && ocsData.ocs.data && ocsData.ocs.data[0]) { @@ -54,7 +54,7 @@ export default class Share { * inject its watchers into the #share * state and make the whole class reactive * - * @returns {Object} the share raw state + * @return {object} the share raw state * @readonly * @memberof Sidebar */ @@ -65,7 +65,7 @@ export default class Share { /** * get the share id * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -76,7 +76,7 @@ export default class Share { /** * Get the share type * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -88,7 +88,7 @@ export default class Share { * Get the share permissions * See OC.PERMISSION_* variables * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -111,7 +111,7 @@ export default class Share { /** * Get the share owner uid * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -122,7 +122,7 @@ export default class Share { /** * Get the share owner's display name * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -134,7 +134,7 @@ export default class Share { /** * Get the share with entity uid * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -146,7 +146,7 @@ export default class Share { * Get the share with entity display name * fallback to its uid if none * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -159,7 +159,7 @@ export default class Share { * Unique display name in case of multiple * duplicates results with the same name. * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -171,7 +171,7 @@ export default class Share { /** * Get the share with entity link * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -182,7 +182,7 @@ export default class Share { /** * Get the share with avatar if any * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -194,7 +194,7 @@ export default class Share { /** * Get the shared item owner uid * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -206,7 +206,7 @@ export default class Share { * Get the shared item display name * fallback to its uid if none * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -219,7 +219,7 @@ export default class Share { /** * Get the share creation timestamp * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -230,7 +230,7 @@ export default class Share { /** * Get the expiration date as a string format * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -253,7 +253,7 @@ export default class Share { /** * Get the public share token * - * @returns {string} the token + * @return {string} the token * @readonly * @memberof Share */ @@ -264,7 +264,7 @@ export default class Share { /** * Get the share note if any * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -286,7 +286,7 @@ export default class Share { * Get the share label if any * Should only exist on link shares * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -308,7 +308,7 @@ export default class Share { /** * Have a mail been sent * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -319,7 +319,7 @@ export default class Share { /** * Hide the download button on public page * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -340,7 +340,7 @@ export default class Share { /** * Password protection of the share * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -361,7 +361,7 @@ export default class Share { /** * Password protection by Talk of the share * - * @returns {Boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -372,7 +372,7 @@ export default class Share { /** * Password protection by Talk of the share * - * @param {Boolean} sendPasswordByTalk whether to send the password by Talk + * @param {boolean} sendPasswordByTalk whether to send the password by Talk * or not * @memberof Share */ @@ -384,7 +384,7 @@ export default class Share { /** * Get the shared item absolute full path * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -395,7 +395,7 @@ export default class Share { /** * Return the item type: file or folder * - * @returns {string} 'folder' or 'file' + * @return {string} 'folder' or 'file' * @readonly * @memberof Share */ @@ -406,7 +406,7 @@ export default class Share { /** * Get the shared item mimetype * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -417,7 +417,7 @@ export default class Share { /** * Get the shared item id * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -430,7 +430,7 @@ export default class Share { * e.g the file /xxx/aaa will be shared in * the receiving root as /aaa, the fileTarget is /aaa * - * @returns {string} + * @return {string} * @readonly * @memberof Share */ @@ -441,7 +441,7 @@ export default class Share { /** * Get the parent folder id if any * - * @returns {int} + * @return {int} * @readonly * @memberof Share */ @@ -454,7 +454,7 @@ export default class Share { /** * Does this share have READ permissions * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -465,7 +465,7 @@ export default class Share { /** * Does this share have CREATE permissions * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -476,7 +476,7 @@ export default class Share { /** * Does this share have DELETE permissions * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -487,7 +487,7 @@ export default class Share { /** * Does this share have UPDATE permissions * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -498,7 +498,7 @@ export default class Share { /** * Does this share have SHARE permissions * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -512,7 +512,7 @@ export default class Share { /** * Can the current user EDIT this share ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -523,7 +523,7 @@ export default class Share { /** * Can the current user DELETE this share ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Share */ @@ -533,7 +533,8 @@ export default class Share { /** * Top level accessible shared folder fileid for the current user - * @returns {string} + * + * @return {string} * @readonly * @memberof Share */ @@ -543,7 +544,8 @@ export default class Share { /** * Top level accessible shared folder path for the current user - * @returns {string} + * + * @return {string} * @readonly * @memberof Share */ diff --git a/apps/files_sharing/src/services/ConfigService.js b/apps/files_sharing/src/services/ConfigService.js index 4c8326b157030..919c0db7b36ae 100644 --- a/apps/files_sharing/src/services/ConfigService.js +++ b/apps/files_sharing/src/services/ConfigService.js @@ -27,7 +27,7 @@ export default class Config { /** * Is public upload allowed on link shares ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -39,7 +39,7 @@ export default class Config { /** * Are link share allowed ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -51,7 +51,7 @@ export default class Config { /** * Get the federated sharing documentation link * - * @returns {string} + * @return {string} * @readonly * @memberof Config */ @@ -62,7 +62,7 @@ export default class Config { /** * Get the default link share expiration date as string * - * @returns {string} + * @return {string} * @readonly * @memberof Config */ @@ -80,7 +80,7 @@ export default class Config { /** * Get the default internal expiration date as string * - * @returns {string} + * @return {string} * @readonly * @memberof Config */ @@ -98,7 +98,7 @@ export default class Config { /** * Get the default remote expiration date as string * - * @returns {string} + * @return {string} * @readonly * @memberof Config */ @@ -116,7 +116,7 @@ export default class Config { /** * Are link shares password-enforced ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -127,7 +127,7 @@ export default class Config { /** * Is password asked by default on link shares ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -138,7 +138,7 @@ export default class Config { /** * Is link shares expiration enforced ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -149,7 +149,7 @@ export default class Config { /** * Is there a default expiration date for new link shares ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -160,7 +160,7 @@ export default class Config { /** * Is internal shares expiration enforced ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -171,7 +171,7 @@ export default class Config { /** * Is remote shares expiration enforced ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -182,7 +182,7 @@ export default class Config { /** * Is there a default expiration date for new internal shares ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -193,7 +193,7 @@ export default class Config { /** * Are users on this server allowed to send shares to other servers ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -204,7 +204,7 @@ export default class Config { /** * Is sharing my mail (link share) enabled ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -219,7 +219,7 @@ export default class Config { /** * Get the default days to link shares expiration * - * @returns {int} + * @return {int} * @readonly * @memberof Config */ @@ -230,7 +230,7 @@ export default class Config { /** * Get the default days to internal shares expiration * - * @returns {int} + * @return {int} * @readonly * @memberof Config */ @@ -241,7 +241,7 @@ export default class Config { /** * Get the default days to remote shares expiration * - * @returns {int} + * @return {int} * @readonly * @memberof Config */ @@ -252,7 +252,7 @@ export default class Config { /** * Is resharing allowed ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -263,7 +263,7 @@ export default class Config { /** * Is password enforced for mail shares ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -272,7 +272,7 @@ export default class Config { } /** - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -283,7 +283,7 @@ export default class Config { /** * Is sharing with groups allowed ? * - * @returns {boolean} + * @return {boolean} * @readonly * @memberof Config */ @@ -294,7 +294,7 @@ export default class Config { /** * Get the maximum results of a share search * - * @returns {int} + * @return {int} * @readonly * @memberof Config */ @@ -306,7 +306,7 @@ export default class Config { * Get the minimal string length * to initiate a share search * - * @returns {int} + * @return {int} * @readonly * @memberof Config */ @@ -317,7 +317,7 @@ export default class Config { /** * Get the password policy config * - * @returns {Object} + * @return {object} * @readonly * @memberof Config */ diff --git a/apps/files_sharing/src/services/ExternalLinkActions.js b/apps/files_sharing/src/services/ExternalLinkActions.js index 3903bec643f28..c9229d13163b5 100644 --- a/apps/files_sharing/src/services/ExternalLinkActions.js +++ b/apps/files_sharing/src/services/ExternalLinkActions.js @@ -38,7 +38,7 @@ export default class ExternalLinkActions { * * @readonly * @memberof ExternalLinkActions - * @returns {Object} the data state + * @return {object} the data state */ get state() { return this._state @@ -48,8 +48,8 @@ export default class ExternalLinkActions { * Register a new action for the link share * Mostly used by the social sharing app. * - * @param {Object} action new action component to register - * @returns {boolean} + * @param {object} action new action component to register + * @return {boolean} */ registerAction(action) { console.warn('OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead') diff --git a/apps/files_sharing/src/services/ExternalShareActions.js b/apps/files_sharing/src/services/ExternalShareActions.js index 821bf4797558c..dd5b73e1345de 100644 --- a/apps/files_sharing/src/services/ExternalShareActions.js +++ b/apps/files_sharing/src/services/ExternalShareActions.js @@ -38,7 +38,7 @@ export default class ExternalShareActions { * * @readonly * @memberof ExternalLinkActions - * @returns {Object} the data state + * @return {object} the data state */ get state() { return this._state @@ -47,12 +47,12 @@ export default class ExternalShareActions { /** * Register a new option/entry for the a given share type * - * @param {Object} action new action component to register + * @param {object} action new action component to register * @param {string} action.id unique action id * @param {Function} action.data data to bind the component to * @param {Array} action.shareType list of OC.Share.SHARE_XXX to be mounted on - * @param {Object} action.handlers list of listeners - * @returns {boolean} + * @param {object} action.handlers list of listeners + * @return {boolean} */ registerAction(action) { // Validate action diff --git a/apps/files_sharing/src/services/ShareSearch.js b/apps/files_sharing/src/services/ShareSearch.js index a96822223c5c4..00750c0e0b426 100644 --- a/apps/files_sharing/src/services/ShareSearch.js +++ b/apps/files_sharing/src/services/ShareSearch.js @@ -38,7 +38,7 @@ export default class ShareSearch { * * @readonly * @memberof ShareSearch - * @returns {Object} the data state + * @return {object} the data state */ get state() { return this._state @@ -49,14 +49,14 @@ export default class ShareSearch { * Mostly used by the guests app. * We should consider deprecation and add results via php ? * - * @param {Object} result entry to append + * @param {object} result entry to append * @param {string} [result.user] entry user * @param {string} result.displayName entry first line * @param {string} [result.desc] entry second line * @param {string} [result.icon] entry icon - * @param {function} result.handler function to run on entry selection - * @param {function} [result.condition] condition to add entry or not - * @returns {boolean} + * @param {Function} result.handler function to run on entry selection + * @param {Function} [result.condition] condition to add entry or not + * @return {boolean} */ addNewResult(result) { if (result.displayName.trim() !== '' diff --git a/apps/files_sharing/src/utils/GeneratePassword.js b/apps/files_sharing/src/utils/GeneratePassword.js index 49a58596f7aec..a12e1c66f4989 100644 --- a/apps/files_sharing/src/utils/GeneratePassword.js +++ b/apps/files_sharing/src/utils/GeneratePassword.js @@ -31,7 +31,7 @@ const passwordSet = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789' * request a valid password if password_policy * is enabled * - * @returns {string} a valid password + * @return {string} a valid password */ export default async function() { // password policy is enabled, let's request a pass diff --git a/apps/files_sharing/src/views/SharingLinkList.vue b/apps/files_sharing/src/views/SharingLinkList.vue index c87dcb5958563..14ea879e0042a 100644 --- a/apps/files_sharing/src/views/SharingLinkList.vue +++ b/apps/files_sharing/src/views/SharingLinkList.vue @@ -87,7 +87,7 @@ export default { * Using this to still show the `new link share` * button regardless of mail shares * - * @returns {Array} + * @return {Array} */ hasLinkShares() { return this.shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK).length > 0 @@ -96,7 +96,7 @@ export default { /** * Do we have any link or email shares? * - * @returns {boolean} + * @return {boolean} */ hasShares() { return this.shares.length > 0 diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index e08ce261522e1..2e4176c4de5ca 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -144,7 +144,7 @@ export default { /** * Is this share shared with me? * - * @returns {boolean} + * @return {boolean} */ isSharedWithMe() { return Object.keys(this.sharedWithMe).length > 0 @@ -159,7 +159,8 @@ export default { methods: { /** * Update current fileInfo and fetch new data - * @param {Object} fileInfo the current file FileInfo + * + * @param {object} fileInfo the current file FileInfo */ async update(fileInfo) { this.fileInfo = fileInfo @@ -246,8 +247,8 @@ export default { * Process the current shares data * and init shares[] * - * @param {Object} share the share ocs api request data - * @param {Object} share.data the request data + * @param {object} share the share ocs api request data + * @param {object} share.data the request data */ processShares({ data }) { if (data.ocs && data.ocs.data && data.ocs.data.length > 0) { @@ -268,8 +269,8 @@ export default { * Process the sharedWithMe share data * and init sharedWithMe * - * @param {Object} share the share ocs api request data - * @param {Object} share.data the request data + * @param {object} share the share ocs api request data + * @param {object} share.data the request data */ processSharedWithMe({ data }) { if (data.ocs && data.ocs.data && data.ocs.data[0]) { diff --git a/apps/files_versions/src/versioncollection.js b/apps/files_versions/src/versioncollection.js index a5339fc64591a..9ed1c7fa86ba1 100644 --- a/apps/files_versions/src/versioncollection.js +++ b/apps/files_versions/src/versioncollection.js @@ -31,7 +31,7 @@ sync: OC.Backbone.davSync, /** - * @var OCA.Files.FileInfoModel + * @member OCA.Files.FileInfoModel */ _fileInfo: null, diff --git a/apps/files_versions/src/versionmodel.js b/apps/files_versions/src/versionmodel.js index ca1c4716b05e9..06f55d6fa4765 100644 --- a/apps/files_versions/src/versionmodel.js +++ b/apps/files_versions/src/versionmodel.js @@ -38,8 +38,8 @@ /** * Restores the original file to this revision * - * @param {Object} [options] options - * @returns {Promise} + * @param {object} [options] options + * @return {Promise} */ revert(options) { options = options ? _.clone(options) : {} diff --git a/apps/files_versions/src/versionstabview.js b/apps/files_versions/src/versionstabview.js index 7ae5ad0fb2fb1..6adc3e61a18d5 100644 --- a/apps/files_versions/src/versionstabview.js +++ b/apps/files_versions/src/versionstabview.js @@ -213,8 +213,9 @@ import Template from './templates/template.handlebars'; /** * Returns true for files, false for folders. + * * @param {FileInfo} fileInfo fileInfo - * @returns {bool} true for files, false for folders + * @return {bool} true for files, false for folders */ canDisplay(fileInfo) { if (!fileInfo) { diff --git a/apps/settings/src/components/AdminDelegation/GroupSelect.vue b/apps/settings/src/components/AdminDelegation/GroupSelect.vue index 8f27efdfef0eb..eb7fd3e0c343d 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) } }, - } + }, } diff --git a/apps/settings/src/components/AuthToken.vue b/apps/settings/src/components/AuthToken.vue index dd1ec87e4eb49..ce9d59936b9f8 100644 --- a/apps/settings/src/components/AuthToken.vue +++ b/apps/settings/src/components/AuthToken.vue @@ -48,7 +48,7 @@ :open.sync="actionOpen"> + @change.stop.prevent="$emit('toggle-scope', token, 'filesystem', !token.scope.filesystem)"> {{ t('settings', 'Allow filesystem access') }} diff --git a/apps/settings/src/components/AuthTokenList.vue b/apps/settings/src/components/AuthTokenList.vue index d0dfa6d92fc0b..5e962a1ee9803 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 2624433eca2a6..87895e4821936 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 d13b26b2d9210..a36dac801196b 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 68c07d1ab2178..d419b6a3c437e 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 9f41d464e1af0..0dd742267d17b 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 8c97bd10f2dfe..9b00a0597bc3f 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')" />
@@ -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 285e32ea92f68..fb637ea95b2a3 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 1c33f3d33cb67..603f7a87837d3 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 a1f7a57f72b3f..477fff7fa62e9 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 e725300675c3b..31124c1598745 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 8748db46152cb..15300155bbcdc 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 98af818217b14..91ee0dae2b223 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 4eae9f5c95dee..f65c963769a95 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 a6d3bffc34e6a..35fbfcd34d10e 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 ef93f7e40abf1..7bc04e25d9fbe 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 f737130190986..291223c0737de 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 d57c16cc44a6a..bf191111853f1 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 = {} diff --git a/apps/systemtags/src/systemtagsfilelist.js b/apps/systemtags/src/systemtagsfilelist.js index e21388b8ddf76..4821f14022253 100644 --- a/apps/systemtags/src/systemtagsfilelist.js +++ b/apps/systemtags/src/systemtagsfilelist.js @@ -30,7 +30,7 @@ * @classdesc SystemTags file list. * Contains a list of files filtered by system tags. * - * @param {Object} $el container element with existing markup for the #controls and a table + * @param {object} $el container element with existing markup for the #controls and a table * @param {Array} [options] map of options, see other parameters * @param {Array.} [options.systemTagIds] array of system tag ids to * filter by @@ -60,8 +60,8 @@ /** * @private - * @param {Object} $el container element - * @param {Object} [options] map of options, see other parameters + * @param {object} $el container element + * @param {object} [options] map of options, see other parameters */ initialize($el, options) { OCA.Files.FileList.prototype.initialize.apply(this, arguments) @@ -190,7 +190,7 @@ /** * Autocomplete function for dropdown results * - * @param {Object} query select2 query object + * @param {object} query select2 query object */ _queryTagsAutocomplete(query) { OC.SystemTags.collection.fetch({ diff --git a/apps/systemtags/src/systemtagsinfoview.js b/apps/systemtags/src/systemtagsinfoview.js index 7753b4d53400d..b2a11fbc9593b 100644 --- a/apps/systemtags/src/systemtagsinfoview.js +++ b/apps/systemtags/src/systemtagsinfoview.js @@ -26,6 +26,9 @@ (function(OCA) { + /** + * @param model + */ function modelToSelection(model) { const data = model.toJSON() if (!OC.isUserAdmin() && !data.canAssign) { @@ -82,7 +85,8 @@ /** * Event handler whenever a tag was selected - * @param {Object} tag the tag to create + * + * @param {object} tag the tag to create */ _onSelectTag(tag) { // create a mapping entry for this tag diff --git a/apps/twofactor_backupcodes/src/service/BackupCodesService.js b/apps/twofactor_backupcodes/src/service/BackupCodesService.js index 856c4ace0b862..3674a6fccdcdd 100644 --- a/apps/twofactor_backupcodes/src/service/BackupCodesService.js +++ b/apps/twofactor_backupcodes/src/service/BackupCodesService.js @@ -25,6 +25,9 @@ import Axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' +/** + * + */ export function generateCodes() { const url = generateUrl('/apps/twofactor_backupcodes/settings/create') diff --git a/apps/twofactor_backupcodes/src/service/PrintService.js b/apps/twofactor_backupcodes/src/service/PrintService.js index 2e73e62f52512..e8b315165323a 100644 --- a/apps/twofactor_backupcodes/src/service/PrintService.js +++ b/apps/twofactor_backupcodes/src/service/PrintService.js @@ -21,6 +21,9 @@ * */ +/** + * @param data + */ export function print(data) { const name = OC.theme.name || 'Nextcloud' const newTab = window.open('', t('twofactor_backupcodes', '{name} backup codes', { name })) diff --git a/apps/updatenotification/src/components/UpdateNotification.vue b/apps/updatenotification/src/components/UpdateNotification.vue index 5d13f740dcbbb..b9e28e4ec2c31 100644 --- a/apps/updatenotification/src/components/UpdateNotification.vue +++ b/apps/updatenotification/src/components/UpdateNotification.vue @@ -372,8 +372,8 @@ export default { methods: { /** - * Creates a new authentication token and loads the updater URL - */ + * Creates a new authentication token and loads the updater URL + */ clickUpdaterButton() { $.ajax({ url: generateUrl('/apps/updatenotification/credentials'), diff --git a/apps/user_status/src/UserStatus.vue b/apps/user_status/src/UserStatus.vue index 608966b9d9a02..bac84e8650059 100644 --- a/apps/user_status/src/UserStatus.vue +++ b/apps/user_status/src/UserStatus.vue @@ -99,7 +99,7 @@ export default { /** * The profile page link * - * @returns {String|null} + * @return {string | null} */ profilePageLink() { if (this.profileEnabled) { @@ -194,7 +194,7 @@ export default { /** * Sends the status heartbeat to the server * - * @returns {Promise} + * @return {Promise} * @private */ async _backgroundHeartbeat() { diff --git a/apps/user_status/src/components/ClearAtSelect.vue b/apps/user_status/src/components/ClearAtSelect.vue index 96cc171416ccd..cd8865edb4314 100644 --- a/apps/user_status/src/components/ClearAtSelect.vue +++ b/apps/user_status/src/components/ClearAtSelect.vue @@ -59,7 +59,7 @@ export default { /** * Returns an object of the currently selected option * - * @returns {Object} + * @return {object} */ option() { return { @@ -72,14 +72,14 @@ export default { /** * Triggered when the user selects a new option. * - * @param {Object=} option The new selected option + * @param {object=} option The new selected option */ select(option) { if (!option) { return } - this.$emit('selectClearAt', option.clearAt) + this.$emit('select-clear-at', option.clearAt) }, }, } diff --git a/apps/user_status/src/components/PredefinedStatusesList.vue b/apps/user_status/src/components/PredefinedStatusesList.vue index 844fdbbdfe32d..c0b53a6d650f7 100644 --- a/apps/user_status/src/components/PredefinedStatusesList.vue +++ b/apps/user_status/src/components/PredefinedStatusesList.vue @@ -55,7 +55,7 @@ export default { /** * Indicator whether the predefined statuses have already been loaded * - * @returns {boolean} + * @return {boolean} */ hasLoaded() { return this.predefinedStatuses.length > 0 @@ -72,10 +72,10 @@ export default { /** * Emits an event when the user selects a status * - * @param {Object} status The selected status + * @param {object} status The selected status */ selectStatus(status) { - this.$emit('selectStatus', status) + this.$emit('select-status', status) }, }, } diff --git a/apps/user_status/src/components/SetStatusModal.vue b/apps/user_status/src/components/SetStatusModal.vue index db56ea282bc0a..875ac3f67826e 100644 --- a/apps/user_status/src/components/SetStatusModal.vue +++ b/apps/user_status/src/components/SetStatusModal.vue @@ -110,7 +110,7 @@ export default { /** * Returns the user-set icon or a smiley in case no icon is set * - * @returns {String} + * @return {string} */ visibleIcon() { return this.icon || '😀' @@ -142,7 +142,7 @@ export default { /** * Sets a new icon * - * @param {String} icon The new icon + * @param {string} icon The new icon */ setIcon(icon) { this.messageId = null @@ -154,7 +154,7 @@ export default { /** * Sets a new message * - * @param {String} message The new message + * @param {string} message The new message */ setMessage(message) { this.messageId = null @@ -163,7 +163,7 @@ export default { /** * Sets a new clearAt value * - * @param {Object} clearAt The new clearAt object + * @param {object} clearAt The new clearAt object */ setClearAt(clearAt) { this.clearAt = clearAt @@ -171,7 +171,7 @@ export default { /** * Sets new icon/message/clearAt based on a predefined message * - * @param {Object} status The predefined status object + * @param {object} status The predefined status object */ selectPredefinedMessage(status) { this.messageId = status.id @@ -182,7 +182,7 @@ export default { /** * Saves the status and closes the * - * @returns {Promise} + * @return {Promise} */ async saveStatus() { if (this.isSavingStatus) { @@ -216,7 +216,7 @@ export default { }, /** * - * @returns {Promise} + * @return {Promise} */ async clearStatus() { try { diff --git a/apps/user_status/src/filters/clearAtFilter.js b/apps/user_status/src/filters/clearAtFilter.js index c7140c00976df..89604fe9f3a5e 100644 --- a/apps/user_status/src/filters/clearAtFilter.js +++ b/apps/user_status/src/filters/clearAtFilter.js @@ -27,8 +27,8 @@ import { dateFactory } from '../services/dateService' /** * Formats a clearAt object to be human readable * - * @param {Object} clearAt The clearAt object - * @returns {string|null} + * @param {object} clearAt The clearAt object + * @return {string|null} */ const clearAtFilter = (clearAt) => { if (clearAt === null) { diff --git a/apps/user_status/src/mixins/OnlineStatusMixin.js b/apps/user_status/src/mixins/OnlineStatusMixin.js index 06a3d058a9b7b..f56723f9b5ce7 100644 --- a/apps/user_status/src/mixins/OnlineStatusMixin.js +++ b/apps/user_status/src/mixins/OnlineStatusMixin.js @@ -35,7 +35,7 @@ export default { /** * The message displayed in the top right corner * - * @returns {String} + * @return {string} */ visibleMessage() { if (this.customIcon && this.customMessage) { @@ -71,7 +71,7 @@ export default { /** * The status indicator icon * - * @returns {String|null} + * @return {string | null} */ statusIcon() { switch (this.statusType) { @@ -97,7 +97,7 @@ export default { /** * Changes the user-status * - * @param {String} statusType (online / away / dnd / invisible) + * @param {string} statusType (online / away / dnd / invisible) */ async changeStatus(statusType) { try { diff --git a/apps/user_status/src/services/clearAtOptionsService.js b/apps/user_status/src/services/clearAtOptionsService.js index 926f21d8b6e9a..c6091aa10de5c 100644 --- a/apps/user_status/src/services/clearAtOptionsService.js +++ b/apps/user_status/src/services/clearAtOptionsService.js @@ -25,7 +25,7 @@ import { translate as t } from '@nextcloud/l10n' /** * Returns an array * - * @returns {Object[]} + * @return {object[]} */ const getAllClearAtOptions = () => { return [{ diff --git a/apps/user_status/src/services/clearAtService.js b/apps/user_status/src/services/clearAtService.js index bc01ff6c0cdf2..38ff342be202c 100644 --- a/apps/user_status/src/services/clearAtService.js +++ b/apps/user_status/src/services/clearAtService.js @@ -28,8 +28,8 @@ import moment from '@nextcloud/moment' /** * Calculates the actual clearAt timestamp * - * @param {Object|null} clearAt The clear-at config - * @returns {Number|null} + * @param {object | null} clearAt The clear-at config + * @return {number | null} */ const getTimestampForClearAt = (clearAt) => { if (clearAt === null) { diff --git a/apps/user_status/src/services/heartbeatService.js b/apps/user_status/src/services/heartbeatService.js index 4a789a8a01275..a981a0dc246fd 100644 --- a/apps/user_status/src/services/heartbeatService.js +++ b/apps/user_status/src/services/heartbeatService.js @@ -26,10 +26,10 @@ import { generateUrl } from '@nextcloud/router' /** * Sends a heartbeat * - * @param {Boolean} isAway Whether or not the user is active - * @returns {Promise} + * @param {boolean} isAway Whether or not the user is active + * @return {Promise} */ -const sendHeartbeat = async(isAway) => { +const sendHeartbeat = async (isAway) => { const url = generateUrl('/apps/user_status/heartbeat') const response = await HttpClient.put(url, { status: isAway ? 'away' : 'online', diff --git a/apps/user_status/src/services/predefinedStatusService.js b/apps/user_status/src/services/predefinedStatusService.js index b4c9ed4a96ad3..18887efb8b517 100644 --- a/apps/user_status/src/services/predefinedStatusService.js +++ b/apps/user_status/src/services/predefinedStatusService.js @@ -26,9 +26,9 @@ import { generateOcsUrl } from '@nextcloud/router' /** * Fetches all predefined statuses from the server * - * @returns {Promise} + * @return {Promise} */ -const fetchAllPredefinedStatuses = async() => { +const fetchAllPredefinedStatuses = async () => { const url = generateOcsUrl('apps/user_status/api/v1/predefined_statuses?format=json') const response = await HttpClient.get(url) diff --git a/apps/user_status/src/services/statusOptionsService.js b/apps/user_status/src/services/statusOptionsService.js index 15da11fd5d25d..31f65d92e4476 100644 --- a/apps/user_status/src/services/statusOptionsService.js +++ b/apps/user_status/src/services/statusOptionsService.js @@ -26,7 +26,7 @@ import { translate as t } from '@nextcloud/l10n' /** * Returns a list of all user-definable statuses * - * @returns {Object[]} + * @return {object[]} */ const getAllStatusOptions = () => { return [{ diff --git a/apps/user_status/src/services/statusService.js b/apps/user_status/src/services/statusService.js index caaea503b8ecb..d14e45b4183f8 100644 --- a/apps/user_status/src/services/statusService.js +++ b/apps/user_status/src/services/statusService.js @@ -26,9 +26,9 @@ import { generateOcsUrl } from '@nextcloud/router' /** * Fetches the current user-status * - * @returns {Promise} + * @return {Promise} */ -const fetchCurrentStatus = async() => { +const fetchCurrentStatus = async () => { const url = generateOcsUrl('apps/user_status/api/v1/user_status') const response = await HttpClient.get(url) @@ -38,10 +38,10 @@ const fetchCurrentStatus = async() => { /** * Sets the status * - * @param {String} statusType The status (online / away / dnd / invisible) - * @returns {Promise} + * @param {string} statusType The status (online / away / dnd / invisible) + * @return {Promise} */ -const setStatus = async(statusType) => { +const setStatus = async (statusType) => { const url = generateOcsUrl('apps/user_status/api/v1/user_status/status') await HttpClient.put(url, { statusType, @@ -51,11 +51,11 @@ const setStatus = async(statusType) => { /** * Sets a message based on our predefined statuses * - * @param {String} messageId The id of the message, taken from predefined status service - * @param {Number|null} clearAt When to automatically clean the status - * @returns {Promise} + * @param {string} messageId The id of the message, taken from predefined status service + * @param {number | null} clearAt When to automatically clean the status + * @return {Promise} */ -const setPredefinedMessage = async(messageId, clearAt = null) => { +const setPredefinedMessage = async (messageId, clearAt = null) => { const url = generateOcsUrl('apps/user_status/api/v1/user_status/message/predefined?format=json') await HttpClient.put(url, { messageId, @@ -66,12 +66,12 @@ const setPredefinedMessage = async(messageId, clearAt = null) => { /** * Sets a custom message * - * @param {String} message The user-defined message - * @param {String|null} statusIcon The user-defined icon - * @param {Number|null} clearAt When to automatically clean the status - * @returns {Promise} + * @param {string} message The user-defined message + * @param {string | null} statusIcon The user-defined icon + * @param {number | null} clearAt When to automatically clean the status + * @return {Promise} */ -const setCustomMessage = async(message, statusIcon = null, clearAt = null) => { +const setCustomMessage = async (message, statusIcon = null, clearAt = null) => { const url = generateOcsUrl('apps/user_status/api/v1/user_status/message/custom?format=json') await HttpClient.put(url, { message, @@ -83,9 +83,9 @@ const setCustomMessage = async(message, statusIcon = null, clearAt = null) => { /** * Clears the current status of the user * - * @returns {Promise} + * @return {Promise} */ -const clearMessage = async() => { +const clearMessage = async () => { const url = generateOcsUrl('apps/user_status/api/v1/user_status/message?format=json') await HttpClient.delete(url) } diff --git a/apps/user_status/src/store/predefinedStatuses.js b/apps/user_status/src/store/predefinedStatuses.js index 219fccd9b8509..aa05f8e54af00 100644 --- a/apps/user_status/src/store/predefinedStatuses.js +++ b/apps/user_status/src/store/predefinedStatuses.js @@ -31,8 +31,8 @@ const mutations = { /** * Adds a predefined status to the state * - * @param {Object} state The Vuex state - * @param {Object} status The status to add + * @param {object} state The Vuex state + * @param {object} status The status to add */ addPredefinedStatus(state, status) { state.predefinedStatuses.push(status) @@ -46,8 +46,9 @@ const actions = { /** * Loads all predefined statuses from the server * - * @param {Object} vuex The Vuex components + * @param {object} vuex The Vuex components * @param {Function} vuex.commit The Vuex commit function + * @param vuex.state */ async loadAllPredefinedStatuses({ state, commit }) { if (state.predefinedStatuses.length > 0) { diff --git a/apps/user_status/src/store/userStatus.js b/apps/user_status/src/store/userStatus.js index 99761da126532..84434895e185f 100644 --- a/apps/user_status/src/store/userStatus.js +++ b/apps/user_status/src/store/userStatus.js @@ -55,9 +55,9 @@ const mutations = { /** * Sets a new status * - * @param {Object} state The Vuex state - * @param {Object} data The destructuring object - * @param {String} data.statusType The new status type + * @param {object} state The Vuex state + * @param {object} data The destructuring object + * @param {string} data.statusType The new status type */ setStatus(state, { statusType }) { state.status = statusType @@ -67,12 +67,12 @@ const mutations = { /** * Sets a message using a predefined message * - * @param {Object} state The Vuex state - * @param {Object} data The destructuring object - * @param {String} data.messageId The messageId - * @param {Number|null} data.clearAt When to automatically clear the status - * @param {String} data.message The message - * @param {String} data.icon The icon + * @param {object} state The Vuex state + * @param {object} data The destructuring object + * @param {string} data.messageId The messageId + * @param {number | null} data.clearAt When to automatically clear the status + * @param {string} data.message The message + * @param {string} data.icon The icon */ setPredefinedMessage(state, { messageId, clearAt, message, icon }) { state.messageId = messageId @@ -86,11 +86,11 @@ const mutations = { /** * Sets a custom message * - * @param {Object} state The Vuex state - * @param {Object} data The destructuring object - * @param {String} data.message The message - * @param {String} data.icon The icon - * @param {Number} data.clearAt When to automatically clear the status + * @param {object} state The Vuex state + * @param {object} data The destructuring object + * @param {string} data.message The message + * @param {string} data.icon The icon + * @param {number} data.clearAt When to automatically clear the status */ setCustomMessage(state, { message, icon, clearAt }) { state.messageId = null @@ -104,7 +104,7 @@ const mutations = { /** * Clears the status * - * @param {Object} state The Vuex state + * @param {object} state The Vuex state */ clearMessage(state) { state.messageId = null @@ -118,14 +118,14 @@ const mutations = { /** * Loads the status from initial state * - * @param {Object} state The Vuex state - * @param {Object} data The destructuring object - * @param {String} data.status The status type - * @param {Boolean} data.statusIsUserDefined Whether or not this status is user-defined - * @param {String} data.message The message - * @param {String} data.icon The icon - * @param {Number} data.clearAt When to automatically clear the status - * @param {Boolean} data.messageIsPredefined Whether or not the message is predefined + * @param {object} state The Vuex state + * @param {object} data The destructuring object + * @param {string} data.status The status type + * @param {boolean} data.statusIsUserDefined Whether or not this status is user-defined + * @param {string} data.message The message + * @param {string} data.icon The icon + * @param {number} data.clearAt When to automatically clear the status + * @param {boolean} data.messageIsPredefined Whether or not the message is predefined * @param {string} data.messageId The id of the predefined message */ loadStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) { @@ -146,12 +146,12 @@ const actions = { /** * Sets a new status * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} vuex.state The Vuex state object - * @param {Object} data The data destructuring object - * @param {String} data.statusType The new status type - * @returns {Promise} + * @param {object} vuex.state The Vuex state object + * @param {object} data The data destructuring object + * @param {string} data.statusType The new status type + * @return {Promise} */ async setStatus({ commit, state }, { statusType }) { await setStatus(statusType) @@ -170,11 +170,11 @@ const actions = { * This doesn't trigger another 'user_status:status.updated' * event. * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} vuex.state The Vuex state object - * @param {String} status The new status - * @returns {Promise} + * @param {object} vuex.state The Vuex state object + * @param {string} status The new status + * @return {Promise} */ async setStatusFromObject({ commit, state }, status) { commit('loadStatusFromServer', status) @@ -183,14 +183,14 @@ const actions = { /** * Sets a message using a predefined message * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} vuex.state The Vuex state object - * @param {Object} vuex.rootState The Vuex root state - * @param {Object} data The data destructuring object - * @param {String} data.messageId The messageId - * @param {Object|null} data.clearAt When to automatically clear the status - * @returns {Promise} + * @param {object} vuex.state The Vuex state object + * @param {object} vuex.rootState The Vuex root state + * @param {object} data The data destructuring object + * @param {string} data.messageId The messageId + * @param {object | null} data.clearAt When to automatically clear the status + * @return {Promise} */ async setPredefinedMessage({ commit, rootState, state }, { messageId, clearAt }) { const resolvedClearAt = getTimestampForClearAt(clearAt) @@ -212,14 +212,14 @@ const actions = { /** * Sets a custom message * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} vuex.state The Vuex state object - * @param {Object} data The data destructuring object - * @param {String} data.message The message - * @param {String} data.icon The icon - * @param {Object|null} data.clearAt When to automatically clear the status - * @returns {Promise} + * @param {object} vuex.state The Vuex state object + * @param {object} data The data destructuring object + * @param {string} data.message The message + * @param {string} data.icon The icon + * @param {object | null} data.clearAt When to automatically clear the status + * @return {Promise} */ async setCustomMessage({ commit, state }, { message, icon, clearAt }) { const resolvedClearAt = getTimestampForClearAt(clearAt) @@ -238,10 +238,10 @@ const actions = { /** * Clears the status * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} vuex.state The Vuex state object - * @returns {Promise} + * @param {object} vuex.state The Vuex state object + * @return {Promise} */ async clearMessage({ commit, state }) { await clearMessage() @@ -258,9 +258,9 @@ const actions = { /** * Re-fetches the status from the server * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @returns {Promise} + * @return {Promise} */ async reFetchStatusFromServer({ commit }) { const status = await fetchCurrentStatus() @@ -270,17 +270,17 @@ const actions = { /** * Stores the status we got in the reply of the heartbeat * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function - * @param {Object} status The data destructuring object - * @param {String} status.status The status type - * @param {Boolean} status.statusIsUserDefined Whether or not this status is user-defined - * @param {String} status.message The message - * @param {String} status.icon The icon - * @param {Number} status.clearAt When to automatically clear the status - * @param {Boolean} status.messageIsPredefined Whether or not the message is predefined - * @param {String} status.messageId The id of the predefined message - * @returns {Promise} + * @param {object} status The data destructuring object + * @param {string} status.status The status type + * @param {boolean} status.statusIsUserDefined Whether or not this status is user-defined + * @param {string} status.message The message + * @param {string} status.icon The icon + * @param {number} status.clearAt When to automatically clear the status + * @param {boolean} status.messageIsPredefined Whether or not the message is predefined + * @param {string} status.messageId The id of the predefined message + * @return {Promise} */ async setStatusFromHeartbeat({ commit }, status) { commit('loadStatusFromServer', status) @@ -289,7 +289,7 @@ const actions = { /** * Loads the server from the initial state * - * @param {Object} vuex The Vuex destructuring object + * @param {object} vuex The Vuex destructuring object * @param {Function} vuex.commit The Vuex commit function */ loadStatusFromInitialState({ commit }) { diff --git a/apps/weather_status/src/App.vue b/apps/weather_status/src/App.vue index 6fcc764ac9784..549351db68e66 100644 --- a/apps/weather_status/src/App.vue +++ b/apps/weather_status/src/App.vue @@ -216,7 +216,7 @@ export default { /** * The message displayed in the top right corner * - * @returns {String} + * @return {string} */ visibleMessage() { if (this.loading) { diff --git a/apps/weather_status/src/services/weatherStatusService.js b/apps/weather_status/src/services/weatherStatusService.js index 7f4fc35316c27..bf9cc43b090fc 100644 --- a/apps/weather_status/src/services/weatherStatusService.js +++ b/apps/weather_status/src/services/weatherStatusService.js @@ -26,11 +26,11 @@ import { generateOcsUrl } from '@nextcloud/router' /** * * - * @param {String} lat the latitude - * @param {String} lon the longitude - * @returns {Promise} + * @param {string} lat the latitude + * @param {string} lon the longitude + * @return {Promise} */ -const setLocation = async(lat, lon) => { +const setLocation = async (lat, lon) => { const url = generateOcsUrl('apps/weather_status/api/v1/location') const response = await HttpClient.put(url, { address: '', @@ -43,10 +43,10 @@ const setLocation = async(lat, lon) => { /** * - * @param {String} address The location - * @returns {Promise} + * @param {string} address The location + * @return {Promise} */ -const setAddress = async(address) => { +const setAddress = async (address) => { const url = generateOcsUrl('apps/weather_status/api/v1/location') const response = await HttpClient.put(url, { address, @@ -59,10 +59,10 @@ const setAddress = async(address) => { /** * - * @param {String} mode can be 1 browser or 2 custom - * @returns {Promise} + * @param {string} mode can be 1 browser or 2 custom + * @return {Promise} */ -const setMode = async(mode) => { +const setMode = async (mode) => { const url = generateOcsUrl('apps/weather_status/api/v1/mode') const response = await HttpClient.put(url, { mode, @@ -73,9 +73,9 @@ const setMode = async(mode) => { /** * - * @returns {Promise} + * @return {Promise} */ -const usePersonalAddress = async() => { +const usePersonalAddress = async () => { const url = generateOcsUrl('apps/weather_status/api/v1/use-personal') const response = await HttpClient.put(url) @@ -85,9 +85,9 @@ const usePersonalAddress = async() => { /** * Fetches the location information for current user * - * @returns {Promise} + * @return {Promise} */ -const getLocation = async() => { +const getLocation = async () => { const url = generateOcsUrl('apps/weather_status/api/v1/location') const response = await HttpClient.get(url) @@ -97,10 +97,10 @@ const getLocation = async() => { /** * Fetches the weather forecast * - * @param {String} address The location - * @returns {Promise} + * @param {string} address The location + * @return {Promise} */ -const fetchForecast = async() => { +const fetchForecast = async () => { const url = generateOcsUrl('apps/weather_status/api/v1/forecast') const response = await HttpClient.get(url) @@ -110,10 +110,10 @@ const fetchForecast = async() => { /** * Fetches the location favorites * - * @param {String} address The location - * @returns {Promise} + * @param {string} address The location + * @return {Promise} */ -const getFavorites = async() => { +const getFavorites = async () => { const url = generateOcsUrl('apps/weather_status/api/v1/favorites') const response = await HttpClient.get(url) @@ -123,9 +123,9 @@ const getFavorites = async() => { /** * * @param {Array} favorites List of favorite addresses - * @returns {Promise} + * @return {Promise} */ -const saveFavorites = async(favorites) => { +const saveFavorites = async (favorites) => { const url = generateOcsUrl('apps/weather_status/api/v1/favorites') const response = await HttpClient.put(url, { favorites, diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js index 9cb314707c85a..81735a4363807 100644 --- a/apps/workflowengine/src/store.js +++ b/apps/workflowengine/src/store.js @@ -159,9 +159,10 @@ const store = new Vuex.Store({ /** * Return all available checker plugins for a given entity class - * @param {Object} state the store state - * @param {Object} entity the entity class - * @returns {Array} the available plugins + * + * @param {object} state the store state + * @param {object} entity the entity class + * @return {Array} the available plugins */ getChecksForEntity(state) { return (entity) => { diff --git a/apps/workflowengine/src/workflowengine.js b/apps/workflowengine/src/workflowengine.js index 00ca352d9afa5..a3e92c2a99757 100644 --- a/apps/workflowengine/src/workflowengine.js +++ b/apps/workflowengine/src/workflowengine.js @@ -30,7 +30,7 @@ import ShippedChecks from './components/Checks' /** * A plugin for displaying a custom value field for checks * - * @typedef {Object} CheckPlugin + * @typedef {object} CheckPlugin * @property {string} class - The PHP class name of the check * @property {Comparison[]} operators - A list of possible comparison operations running on the check * @property {Vue} component - A vue component to handle the rendering of options @@ -39,12 +39,12 @@ import ShippedChecks from './components/Checks' * event once the data has changed * @property {callable} placeholder - Return a placeholder of no custom component is used * @property {callable} validate - validate a check if no custom component is used - **/ + */ /** * A plugin for extending the admin page repesentation of a operator * - * @typedef {Object} OperatorPlugin + * @typedef {object} OperatorPlugin * @property {string} id - The PHP class name of the check * @property {string} operation - Default value for the operation field * @property {string} color - Custom color code to be applied for the operator selector @@ -55,10 +55,10 @@ import ShippedChecks from './components/Checks' */ /** - * @typedef {Object} Comparison + * @typedef {object} Comparison * @property {string} operator - value the comparison should have, e.g. !less, greater * @property {string} name - Translated readable text, e.g. less or equals - **/ + */ /** * Public javascript api for apps to register custom plugins diff --git a/core/src/OC/admin.js b/core/src/OC/admin.js index bb947573490a8..96ad6cd4048f9 100644 --- a/core/src/OC/admin.js +++ b/core/src/OC/admin.js @@ -26,7 +26,7 @@ const isAdmin = !!window._oc_isadmin /** * Returns whether the current user is an administrator * - * @returns {bool} true if the user is an admin, false otherwise + * @return {bool} true if the user is an admin, false otherwise * @since 9.0.0 */ export const isUserAdmin = () => isAdmin diff --git a/core/src/OC/apps.js b/core/src/OC/apps.js index d504a99eaac93..89b7b10247e8a 100644 --- a/core/src/OC/apps.js +++ b/core/src/OC/apps.js @@ -34,7 +34,7 @@ const Apps = { /** * Shows the #app-sidebar and add .with-app-sidebar to subsequent siblings * - * @param {Object} [$el] sidebar element to show, defaults to $('#app-sidebar') + * @param {object} [$el] sidebar element to show, defaults to $('#app-sidebar') */ Apps.showAppSidebar = function($el) { const $appSidebar = $el || $('#app-sidebar') @@ -46,7 +46,7 @@ Apps.showAppSidebar = function($el) { * Shows the #app-sidebar and removes .with-app-sidebar from subsequent * siblings * - * @param {Object} [$el] sidebar element to hide, defaults to $('#app-sidebar') + * @param {object} [$el] sidebar element to hide, defaults to $('#app-sidebar') */ Apps.hideAppSidebar = function($el) { const $appSidebar = $el || $('#app-sidebar') @@ -81,6 +81,9 @@ export const registerAppsSlideToggle = () => { const areaSelector = $(button).data('apps-slide-toggle') const area = $(areaSelector) + /** + * + */ function hideArea() { area.slideUp(OC.menuSpeed * 4, function() { area.trigger(new $.Event('hide')) @@ -89,6 +92,9 @@ export const registerAppsSlideToggle = () => { $(button).removeClass('opened') } + /** + * + */ function showArea() { area.slideDown(OC.menuSpeed * 4, function() { area.trigger(new $.Event('show')) diff --git a/core/src/OC/capabilities.js b/core/src/OC/capabilities.js index 50b919d0ea335..01405ec9b2968 100644 --- a/core/src/OC/capabilities.js +++ b/core/src/OC/capabilities.js @@ -27,7 +27,7 @@ import { getCapabilities as realGetCapabilities } from '@nextcloud/capabilities' /** * Returns the capabilities * - * @returns {Array} capabilities + * @return {Array} capabilities * * @since 14.0 */ diff --git a/core/src/OC/get_set.js b/core/src/OC/get_set.js index e5d5bd5c5fdee..082cef67ca8c2 100644 --- a/core/src/OC/get_set.js +++ b/core/src/OC/get_set.js @@ -36,8 +36,9 @@ export const get = context => name => { /** * Set a variable by name + * * @param {string} context context - * @returns {Function} setter + * @return {Function} setter * @deprecated 19.0.0 use https://lodash.com/docs#set */ export const set = context => (name, value) => { diff --git a/core/src/OC/host.js b/core/src/OC/host.js index 44623b27399cd..d525818a6cab1 100644 --- a/core/src/OC/host.js +++ b/core/src/OC/host.js @@ -32,7 +32,7 @@ export const getProtocol = () => window.location.protocol.split(':')[0] * https://example.com => example.com * http://example.com:8080 => example.com:8080 * - * @returns {string} host + * @return {string} host * * @since 8.2 * @deprecated 17.0.0 use window.location.host directly @@ -43,7 +43,7 @@ export const getHost = () => window.location.host * Returns the hostname used to access this Nextcloud instance * The hostname is always stripped of the port * - * @returns {string} hostname + * @return {string} hostname * @since 9.0 * @deprecated 17.0.0 use window.location.hostname directly */ @@ -52,7 +52,7 @@ export const getHostName = () => window.location.hostname /** * Returns the port number used to access this Nextcloud instance * - * @returns {int} port number + * @return {int} port number * * @since 8.2 * @deprecated 17.0.0 use window.location.port directly diff --git a/core/src/OC/index.js b/core/src/OC/index.js index ebf9171bada5e..7f811c51a56f5 100644 --- a/core/src/OC/index.js +++ b/core/src/OC/index.js @@ -133,8 +133,9 @@ export default { */ /** * Check if a user file is allowed to be handled. + * * @param {string} file to check - * @returns {Boolean} + * @return {boolean} * @deprecated 17.0.0 */ fileIsBlacklisted: file => !!(file.match(Config.blacklist_files_regex)), @@ -171,6 +172,7 @@ export default { /** * Ajax error handlers + * * @todo remove from here and keep internally -> requires new tests */ _ajaxConnectionLostHandler: ajaxConnectionLostHandler, @@ -234,7 +236,7 @@ export default { /** * Loads translations for the given app asynchronously. * - * @param {String} app app name + * @param {string} app app name * @param {Function} callback callback to call after loading * @return {Promise} * @deprecated 17.0.0 use OC.L10N.load instead @@ -286,9 +288,9 @@ export default { */ linkTo, /** - * @param {String} service service name - * @param {Number} version OCS API version - * @returns {String} OCS API base path + * @param {string} service service name + * @param {number} version OCS API version + * @return {string} OCS API base path * @deprecated 19.0.0 use `generateOcsUrl` from https://www.npmjs.com/package/@nextcloud/router */ linkToOCS: (service, version) => { diff --git a/core/src/OC/l10n-registry.js b/core/src/OC/l10n-registry.js index 5ed463275a9dc..b2579fd67cf4e 100644 --- a/core/src/OC/l10n-registry.js +++ b/core/src/OC/l10n-registry.js @@ -26,8 +26,8 @@ window._oc_l10n_registry_translations = window._oc_l10n_registry_translations || window._oc_l10n_registry_plural_functions = window._oc_l10n_registry_plural_functions || {} /** - * @param {String} appId the app id - * @param {Object} translations the translations list + * @param {string} appId the app id + * @param {object} translations the translations list * @param {Function} pluralFunction the translations list */ const register = (appId, translations, pluralFunction) => { @@ -36,8 +36,8 @@ const register = (appId, translations, pluralFunction) => { } /** - * @param {String} appId the app id - * @param {Object} translations the translations list + * @param {string} appId the app id + * @param {object} translations the translations list * @param {Function} pluralFunction the translations list */ const extend = (appId, translations, pluralFunction) => { @@ -49,8 +49,8 @@ const extend = (appId, translations, pluralFunction) => { } /** - * @param {String} appId the app id - * @param {Object} translations the translations list + * @param {string} appId the app id + * @param {object} translations the translations list * @param {Function} pluralFunction the translations list */ export const registerAppTranslations = (appId, translations, pluralFunction) => { @@ -62,7 +62,7 @@ export const registerAppTranslations = (appId, translations, pluralFunction) => } /** - * @param {String} appId the app id + * @param {string} appId the app id */ export const unregisterAppTranslations = appId => { delete window._oc_l10n_registry_translations[appId] @@ -70,8 +70,8 @@ export const unregisterAppTranslations = appId => { } /** - * @param {String} appId the app id - * @returns {Boolean} + * @param {string} appId the app id + * @return {boolean} */ export const hasAppTranslations = appId => { return window._oc_l10n_registry_translations[appId] !== undefined @@ -79,8 +79,8 @@ export const hasAppTranslations = appId => { } /** - * @param {String} appId the app id - * @returns {Object} + * @param {string} appId the app id + * @return {object} */ export const getAppTranslations = appId => { return { diff --git a/core/src/OC/l10n.js b/core/src/OC/l10n.js index 0704269ce4b3c..48dfe6c1785c0 100644 --- a/core/src/OC/l10n.js +++ b/core/src/OC/l10n.js @@ -1,7 +1,7 @@ /** * Copyright (c) 2014 Vincent Petry - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * * @author Christoph Wurst * @author Daniel Kesselberg @@ -54,10 +54,10 @@ const L10n = { /** * Load an app's translation bundle if not loaded already. * - * @param {String} appName name of the app + * @param {string} appName name of the app * @param {Function} callback callback to be called when * the translations are loaded - * @returns {Promise} promise + * @return {Promise} promise */ load(appName, callback) { // already available ? @@ -86,28 +86,29 @@ const L10n = { /** * Register an app's translation bundle. * - * @param {String} appName name of the app - * @param {Object} bundle bundle + * @param {string} appName name of the app + * @param {object} bundle bundle */ register(appName, bundle) { registerAppTranslations(appName, bundle, this._getPlural) }, /** - * @private do not use this + * @private */ _unregister: unregisterAppTranslations, /** * Translate a string + * * @param {string} app the id of the app for which to translate the string * @param {string} text the string to translate - * @param {Object} [vars] map of placeholder key to value + * @param {object} [vars] map of placeholder key to value * @param {number} [count] number to replace %n with - * @param {array} [options] options array + * @param {Array} [options] options array * @param {bool} [options.escape=true] enable/disable auto escape of placeholders (by default enabled) * @param {bool} [options.sanitize=true] enable/disable sanitization (by default enabled) - * @returns {string} + * @return {string} */ translate(app, text, vars, count, options) { const defaultOptions = { @@ -151,14 +152,15 @@ const L10n = { /** * Translate a plural string + * * @param {string} app the id of the app for which to translate the string * @param {string} textSingular the string to translate for exactly one object * @param {string} textPlural the string to translate for n objects * @param {number} count number to determine whether to use singular or plural - * @param {Object} [vars] map of placeholder key to value - * @param {array} [options] options array + * @param {object} [vars] map of placeholder key to value + * @param {Array} [options] options array * @param {bool} [options.escape=true] enable/disable auto escape of placeholders (by default enabled) - * @returns {string} Translated string + * @return {string} Translated string */ translatePlural(app, textSingular, textPlural, count, vars, options) { const identifier = '_' + textSingular + '_::_' + textPlural + '_' @@ -183,7 +185,7 @@ const L10n = { * The plural function taken from symfony * * @param {number} number the number of elements - * @returns {number} + * @return {number} * @private */ _getPlural(number) { @@ -346,14 +348,14 @@ export default L10n /** * Returns the user's locale * - * @returns {String} locale string + * @return {string} locale string */ export const getLocale = () => $('html').data('locale') ?? 'en' /** * Returns the user's language * - * @returns {String} language string + * @return {string} language string */ export const getLanguage = () => $('html').prop('lang') diff --git a/core/src/OC/legacy-loader.js b/core/src/OC/legacy-loader.js index 3fedc07a081aa..07efbef0fc61f 100644 --- a/core/src/OC/legacy-loader.js +++ b/core/src/OC/legacy-loader.js @@ -31,10 +31,11 @@ const loadedStyles = [] /** * Load a script for the server and load it. If the script is already loaded, * the event handler will be called directly + * * @param {string} app the app id to which the script belongs * @param {string} script the filename of the script * @param {Function} ready event handler to be called when the script is loaded - * @returns {jQuery.Deferred} + * @return {jQuery.Deferred} * @deprecated 16.0.0 Use OCP.Loader.loadScript */ export const addScript = (app, script, ready) => { @@ -56,6 +57,7 @@ export const addScript = (app, script, ready) => { /** * Loads a CSS file + * * @param {string} app the app id to which the css style belongs * @param {string} style the filename of the css file * @deprecated 16.0.0 Use OCP.Loader.loadStylesheet diff --git a/core/src/OC/menu.js b/core/src/OC/menu.js index 26d139b5f08d4..669b1f1566b82 100644 --- a/core/src/OC/menu.js +++ b/core/src/OC/menu.js @@ -35,9 +35,9 @@ export let currentMenuToggle = null * * @param {jQuery} $toggle the toggle element * @param {jQuery} $menuEl the menu container element - * @param {function|undefined} toggle callback invoked everytime the menu is opened + * @param {Function | undefined} toggle callback invoked everytime the menu is opened * @param {boolean} headerMenu is this a top right header menu? - * @returns {undefined} + * @return {undefined} */ export const registerMenu = function($toggle, $menuEl, toggle, headerMenu) { $menuEl.addClass('menu') @@ -119,8 +119,8 @@ export const hideMenus = function(complete) { /** * Shows a given element as menu * - * @param {Object} [$toggle=null] menu toggle - * @param {Object} $menuEl menu element + * @param {object} [$toggle=null] menu toggle + * @param {object} $menuEl menu element * @param {Function} complete callback when the showing animation is done */ export const showMenu = ($toggle, $menuEl, complete) => { diff --git a/core/src/OC/msg.js b/core/src/OC/msg.js index bb28d873c9815..861fe2b90868a 100644 --- a/core/src/OC/msg.js +++ b/core/src/OC/msg.js @@ -35,7 +35,7 @@ export default { /** * Displayes a "Saving..." message in the given message placeholder * - * @param {Object} selector Placeholder to display the message in + * @param {object} selector Placeholder to display the message in */ startSaving(selector) { this.startAction(selector, t('core', 'Saving …')) @@ -44,7 +44,7 @@ export default { /** * Displayes a custom message in the given message placeholder * - * @param {Object} selector Placeholder to display the message in + * @param {object} selector Placeholder to display the message in * @param {string} message Plain text message to display (no HTML allowed) */ startAction(selector, message) { @@ -58,9 +58,9 @@ export default { /** * Displayes an success/error message in the given selector * - * @param {Object} selector Placeholder to display the message in - * @param {Object} response Response of the server - * @param {Object} response.data Data of the servers response + * @param {object} selector Placeholder to display the message in + * @param {object} response Response of the server + * @param {object} response.data Data of the servers response * @param {string} response.data.message Plain text message to display (no HTML allowed) * @param {string} response.status is being used to decide whether the message * is displayed as an error/success @@ -72,9 +72,9 @@ export default { /** * Displayes an success/error message in the given selector * - * @param {Object} selector Placeholder to display the message in - * @param {Object} response Response of the server - * @param {Object} response.data Data of the servers response + * @param {object} selector Placeholder to display the message in + * @param {object} response Response of the server + * @param {object} response.data Data of the servers response * @param {string} response.data.message Plain text message to display (no HTML allowed) * @param {string} response.status is being used to decide whether the message * is displayed as an error/success @@ -90,7 +90,7 @@ export default { /** * Displayes an success message in the given selector * - * @param {Object} selector Placeholder to display the message in + * @param {object} selector Placeholder to display the message in * @param {string} message Plain text success message to display (no HTML allowed) */ finishedSuccess(selector, message) { @@ -106,7 +106,7 @@ export default { /** * Displayes an error message in the given selector * - * @param {Object} selector Placeholder to display the message in + * @param {object} selector Placeholder to display the message in * @param {string} message Plain text error message to display (no HTML allowed) */ finishedError(selector, message) { diff --git a/core/src/OC/navigation.js b/core/src/OC/navigation.js index a4ccb9ced51e7..4c72e9e71db32 100644 --- a/core/src/OC/navigation.js +++ b/core/src/OC/navigation.js @@ -25,6 +25,7 @@ export const redirect = targetURL => { window.location = targetURL } /** * Reloads the current page + * * @deprecated 17.0.0 use window.location.reload directly */ export const reload = () => { window.location.reload() } diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js index a0b289b6a87cf..02383af81dfc8 100644 --- a/core/src/OC/notification.js +++ b/core/src/OC/notification.js @@ -95,10 +95,10 @@ export default { * Consider using show() instead of showHTML() * * @param {string} html Message to display - * @param {Object} [options] options + * @param {object} [options] options * @param {string} [options.type] notification type * @param {int} [options.timeout=0] timeout value, defaults to 0 (permanent) - * @returns {jQuery} jQuery element for notification row + * @return {jQuery} jQuery element for notification row * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ showHtml(html, options) { @@ -114,10 +114,10 @@ export default { * Shows a sanitized notification * * @param {string} text Message to display - * @param {Object} [options] options + * @param {object} [options] options * @param {string} [options.type] notification type * @param {int} [options.timeout=0] timeout value, defaults to 0 (permanent) - * @returns {jQuery} jQuery element for notification row + * @return {jQuery} jQuery element for notification row * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ show(text, options) { @@ -141,7 +141,7 @@ export default { * Updates (replaces) a sanitized notification. * * @param {string} text Message to display - * @returns {jQuery} JQuery element for notificaiton row + * @return {jQuery} JQuery element for notificaiton row * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ showUpdate(text) { @@ -158,11 +158,11 @@ export default { * 7 seconds * * @param {string} text Message to show - * @param {array} [options] options array + * @param {Array} [options] options array * @param {int} [options.timeout=7] timeout in seconds, if this is 0 it will show the message permanently * @param {boolean} [options.isHTML=false] an indicator for HTML notifications (true) or text (false) * @param {string} [options.type] notification type - * @returns {JQuery} the toast element + * @return {JQuery} the toast element * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ showTemporary(text, options) { @@ -175,7 +175,8 @@ export default { /** * Returns whether a notification is hidden. - * @returns {boolean} + * + * @return {boolean} * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ isHidden() { diff --git a/core/src/OC/password-confirmation.js b/core/src/OC/password-confirmation.js index ec70720b4d27c..e387de74ae3d7 100644 --- a/core/src/OC/password-confirmation.js +++ b/core/src/OC/password-confirmation.js @@ -52,7 +52,7 @@ export default { /** * @param {Function} callback success callback function - * @param {Object} options options + * @param {object} options options * @param {Function} rejectCallback error callback function */ requirePasswordConfirmation(callback, options, rejectCallback) { diff --git a/core/src/OC/plugins.js b/core/src/OC/plugins.js index dab74db11e99e..6be76a2d5a4bd 100644 --- a/core/src/OC/plugins.js +++ b/core/src/OC/plugins.js @@ -31,7 +31,7 @@ export default { /** * Register plugin * - * @param {String} targetName app name / class name to hook into + * @param {string} targetName app name / class name to hook into * @param {OC.Plugin} plugin plugin */ register(targetName, plugin) { @@ -46,8 +46,8 @@ export default { * Returns all plugin registered to the given target * name / app name / class name. * - * @param {String} targetName app name / class name to hook into - * @returns {Array.} array of plugins + * @param {string} targetName app name / class name to hook into + * @return {Array.} array of plugins */ getPlugins(targetName) { return this._plugins[targetName] || [] @@ -56,9 +56,9 @@ export default { /** * Call attach() on all plugins registered to the given target name. * - * @param {String} targetName app name / class name - * @param {Object} targetObject to be extended - * @param {Object} [options] options + * @param {string} targetName app name / class name + * @param {object} targetObject to be extended + * @param {object} [options] options */ attach(targetName, targetObject, options) { const plugins = this.getPlugins(targetName) @@ -72,9 +72,9 @@ export default { /** * Call detach() on all plugins registered to the given target name. * - * @param {String} targetName app name / class name - * @param {Object} targetObject to be extended - * @param {Object} [options] options + * @param {string} targetName app name / class name + * @param {object} targetObject to be extended + * @param {object} [options] options */ detach(targetName, targetObject, options) { const plugins = this.getPlugins(targetName) diff --git a/core/src/OC/query-string.js b/core/src/OC/query-string.js index 3b71ebb5a8d6d..b61f84c7a6b0c 100644 --- a/core/src/OC/query-string.js +++ b/core/src/OC/query-string.js @@ -26,8 +26,9 @@ import $ from 'jquery' /** * Parses a URL query string into a JS map + * * @param {string} queryString query string in the format param1=1234¶m2=abcde¶m3=xyz - * @returns {Object.} map containing key/values matching the URL parameters + * @return {object.} map containing key/values matching the URL parameters */ export const parse = queryString => { let pos @@ -75,8 +76,9 @@ export const parse = queryString => { /** * Builds a URL query from a JS map. - * @param {Object.} params map containing key/values matching the URL parameters - * @returns {string} String containing a URL query (without question) mark + * + * @param {object.} params map containing key/values matching the URL parameters + * @return {string} String containing a URL query (without question) mark */ export const build = params => { if (!params) { diff --git a/core/src/OC/requesttoken.js b/core/src/OC/requesttoken.js index 06ccdffd00d3e..f532b6f19d61c 100644 --- a/core/src/OC/requesttoken.js +++ b/core/src/OC/requesttoken.js @@ -27,7 +27,7 @@ import { emit } from '@nextcloud/event-bus' * @private * @param {Document} global the document to read the initial value from * @param {Function} emit the function to invoke for every new token - * @returns {Object} + * @return {object} */ export const manageToken = (global, emit) => { let token = global.getElementsByTagName('head')[0].getAttribute('data-requesttoken') @@ -47,11 +47,11 @@ export const manageToken = (global, emit) => { const manageFromDocument = manageToken(document, emit) /** - * @returns {string} + * @return {string} */ export const getToken = manageFromDocument.getToken /** - * @param {String} newToken new token + * @param {string} newToken new token */ export const setToken = manageFromDocument.setToken diff --git a/core/src/OC/routing.js b/core/src/OC/routing.js index 0531a6776a4e7..b978d92c50065 100644 --- a/core/src/OC/routing.js +++ b/core/src/OC/routing.js @@ -28,8 +28,9 @@ import { /** * Creates a relative url for remote use + * * @param {string} service id - * @returns {string} the url + * @return {string} the url */ export const linkToRemoteBase = service => { return realGetRootUrl() + '/remote.php/' + service diff --git a/core/src/OC/util-history.js b/core/src/OC/util-history.js index de40a9c4eed8e..64d15997ecc58 100644 --- a/core/src/OC/util-history.js +++ b/core/src/OC/util-history.js @@ -41,7 +41,7 @@ export default { * Note: this includes a workaround for IE8/IE9 that uses * the hash part instead of the search part. * - * @param {Object|string} params to append to the URL, can be either a string + * @param {object | string} params to append to the URL, can be either a string * or a map * @param {string} [url] URL to be used, otherwise the current URL will be used, * using the params as query string @@ -92,7 +92,7 @@ export default { * Note: this includes a workaround for IE8/IE9 that uses * the hash part instead of the search part. * - * @param {Object|string} params to append to the URL, can be either a string or a map + * @param {object | string} params to append to the URL, can be either a string or a map * @param {string} [url] URL to be used, otherwise the current URL will be used, using the params as query string */ pushState(params, url) { @@ -105,7 +105,7 @@ export default { * Note: this includes a workaround for IE8/IE9 that uses * the hash part instead of the search part. * - * @param {Object|string} params to append to the URL, can be either a string + * @param {object | string} params to append to the URL, can be either a string * or a map * @param {string} [url] URL to be used, otherwise the current URL will be used, * using the params as query string @@ -126,7 +126,8 @@ export default { /** * Parse a query string from the hash part of the URL. * (workaround for IE8 / IE9) - * @returns {string} + * + * @return {string} */ _parseHashQuery() { const hash = window.location.hash @@ -149,7 +150,7 @@ export default { * Parse the query/search part of the URL. * Also try and parse it from the URL hash (for IE8) * - * @returns {Object} map of parameters + * @return {object} map of parameters */ parseUrlQuery() { const query = this._parseHashQuery() diff --git a/core/src/OC/util.js b/core/src/OC/util.js index cd7d7c42a3b60..e3e3e2a3171d8 100644 --- a/core/src/OC/util.js +++ b/core/src/OC/util.js @@ -27,6 +27,9 @@ import History from './util-history' import OC from './index' import { formatFileSize as humanFileSize } from '@nextcloud/files' +/** + * @param t + */ function chunkify(t) { // Adapted from http://my.opera.com/GreyWyvern/blog/show.dml/1671288 const tz = [] @@ -53,6 +56,7 @@ function chunkify(t) { /** * Utility functions + * * @namespace OC.Util */ export default { @@ -68,8 +72,9 @@ export default { * Returns a file size in bytes from a humanly readable string * Makes 2kB to 2048. * Inspired by computerFileSize in helper.php + * * @param {string} string file size in human readable format - * @returns {number} or null if string could not be parsed + * @return {number} or null if string could not be parsed * * */ @@ -115,7 +120,7 @@ export default { /** * @param {string|number} timestamp timestamp * @param {string} format date format, see momentjs docs - * @returns {string} timestamp formatted as requested + * @return {string} timestamp formatted as requested */ formatDate(timestamp, format) { if (window.TESTING === undefined) { @@ -127,7 +132,7 @@ export default { /** * @param {string|number} timestamp timestamp - * @returns {string} human readable difference from now + * @return {string} human readable difference from now */ relativeModifiedDate(timestamp) { if (window.TESTING === undefined) { @@ -143,7 +148,7 @@ export default { /** * Returns the width of a generic browser scrollbar * - * @returns {int} width of scrollbar + * @return {int} width of scrollbar */ getScrollBarWidth() { if (this._scrollBarWidth) { @@ -183,7 +188,7 @@ export default { * Remove the time component from a given date * * @param {Date} date date - * @returns {Date} date with stripped time + * @return {Date} date with stripped time */ stripTime(date) { // FIXME: likely to break when crossing DST @@ -193,9 +198,10 @@ export default { /** * Compare two strings to provide a natural sort + * * @param {string} a first string to compare * @param {string} b second string to compare - * @returns {number} -1 if b comes before a, 1 if a comes before b + * @return {number} -1 if b comes before a, 1 if a comes before b * or 0 if the strings are identical */ naturalSortCompare(a, b) { @@ -222,7 +228,8 @@ export default { /** * Calls the callback in a given interval until it returns true - * @param {function} callback function to call on success + * + * @param {Function} callback function to call on success * @param {integer} interval in milliseconds */ waitFor(callback, interval) { @@ -237,9 +244,10 @@ export default { /** * Checks if a cookie with the given name is present and is set to the provided value. + * * @param {string} name name of the cookie * @param {string} value value of the cookie - * @returns {boolean} true if the cookie with the given name has the given value + * @return {boolean} true if the cookie with the given name has the given value */ isCookieSetToValue(name, value) { const cookies = document.cookie.split(';') diff --git a/core/src/OC/xhr-error.js b/core/src/OC/xhr-error.js index 660651dd0d9e7..3bf31e649e802 100644 --- a/core/src/OC/xhr-error.js +++ b/core/src/OC/xhr-error.js @@ -41,6 +41,7 @@ export const ajaxConnectionLostHandler = _.throttle(() => { /** * Process ajax error, redirects to main page * if an error/auth error status was returned. + * * @param {XMLHttpRequest} xhr xhr request */ export const processAjaxError = xhr => { diff --git a/core/src/OCA/index.js b/core/src/OCA/index.js index 2f92eff367b53..1db47ba0d31c0 100644 --- a/core/src/OCA/index.js +++ b/core/src/OCA/index.js @@ -24,6 +24,7 @@ import Search from './search' /** * Namespace for apps + * * @namespace OCA */ export default { diff --git a/core/src/OCP/appconfig.js b/core/src/OCP/appconfig.js index d8c8c152a376a..b4062bdf85083 100644 --- a/core/src/OCP/appconfig.js +++ b/core/src/OCP/appconfig.js @@ -29,10 +29,10 @@ import OC from '../OC/index' /** * @param {string} method 'post' or 'delete' * @param {string} endpoint endpoint - * @param {Object} [options] destructuring object - * @param {Object} [options.data] option data - * @param {function} [options.success] success callback - * @param {function} [options.error] error callback + * @param {object} [options] destructuring object + * @param {object} [options.data] option data + * @param {Function} [options.success] success callback + * @param {Function} [options.error] error callback * @internal */ function call(method, endpoint, options) { @@ -52,8 +52,8 @@ function call(method, endpoint, options) { } /** - * @param {Object} [options] destructuring object - * @param {function} [options.success] success callback + * @param {object} [options] destructuring object + * @param {Function} [options.success] success callback * @since 11.0.0 */ export function getApps(options) { @@ -62,9 +62,9 @@ export function getApps(options) { /** * @param {string} app app id - * @param {Object} [options] destructuring object - * @param {function} [options.success] success callback - * @param {function} [options.error] error callback + * @param {object} [options] destructuring object + * @param {Function} [options.success] success callback + * @param {Function} [options.error] error callback * @since 11.0.0 */ export function getKeys(app, options) { @@ -74,10 +74,10 @@ export function getKeys(app, options) { /** * @param {string} app app id * @param {string} key key - * @param {string|function} defaultValue default value - * @param {Object} [options] destructuring object - * @param {function} [options.success] success callback - * @param {function} [options.error] error callback + * @param {string | Function} defaultValue default value + * @param {object} [options] destructuring object + * @param {Function} [options.success] success callback + * @param {Function} [options.error] error callback * @since 11.0.0 */ export function getValue(app, key, defaultValue, options) { @@ -93,9 +93,9 @@ export function getValue(app, key, defaultValue, options) { * @param {string} app app id * @param {string} key key * @param {string} value value - * @param {Object} [options] destructuring object - * @param {function} [options.success] success callback - * @param {function} [options.error] error callback + * @param {object} [options] destructuring object + * @param {Function} [options.success] success callback + * @param {Function} [options.error] error callback * @since 11.0.0 */ export function setValue(app, key, value, options) { @@ -110,9 +110,9 @@ export function setValue(app, key, value, options) { /** * @param {string} app app id * @param {string} key key - * @param {Object} [options] destructuring object - * @param {function} [options.success] success callback - * @param {function} [options.error] error callback + * @param {object} [options] destructuring object + * @param {Function} [options.success] success callback + * @param {Function} [options.error] error callback * @since 11.0.0 */ export function deleteKey(app, key, options) { diff --git a/core/src/OCP/collaboration.js b/core/src/OCP/collaboration.js index 06ff7b6b57044..129440033e31f 100644 --- a/core/src/OCP/collaboration.js +++ b/core/src/OCP/collaboration.js @@ -25,20 +25,21 @@ import escapeHTML from 'escape-html' /** * @typedef TypeDefinition - * @method {callback} action This action is executed to let the user select a resource + * @function {callback} action This action is executed to let the user select a resource * @param {string} icon Contains the icon css class for the type - * @constructor + * @function Object() { [native code] } */ /** * @type {TypeDefinition[]} - **/ + */ const types = {} /** * Those translations will be used by the vue component but they should be shipped with the server * FIXME: Those translations should be added to the library - * @returns {Array} + * + * @return {Array} */ export const l10nProjects = () => { return [ diff --git a/core/src/OCP/comments.js b/core/src/OCP/comments.js index 5d346a80ba03b..9f30557d231ef 100644 --- a/core/src/OCP/comments.js +++ b/core/src/OCP/comments.js @@ -34,14 +34,23 @@ import $ from 'jquery' */ const urlRegex = /(\s|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig +/** + * @param content + */ export function plainToRich(content) { return this.formatLinksRich(content) } +/** + * @param content + */ export function richToPlain(content) { return this.formatLinksPlain(content) } +/** + * @param content + */ export function formatLinksRich(content) { return content.replace(urlRegex, function(_, leadingSpace, protocol, url, trailingSpace) { let linkText = url @@ -55,6 +64,9 @@ export function formatLinksRich(content) { }) } +/** + * @param content + */ export function formatLinksPlain(content) { const $content = $('
').html(content) $content.find('a').each(function() { diff --git a/core/src/OCP/loader.js b/core/src/OCP/loader.js index 9a41fa7910f2b..354475b7fc126 100644 --- a/core/src/OCP/loader.js +++ b/core/src/OCP/loader.js @@ -35,7 +35,7 @@ export default { * * @param {string} app the app name * @param {string} file the script file name - * @returns {Promise} + * @return {Promise} */ loadScript(app, file) { const key = app + file @@ -59,7 +59,7 @@ export default { * * @param {string} app the app name * @param {string} file the script file name - * @returns {Promise} + * @return {Promise} */ loadStylesheet(app, file) { const key = app + file diff --git a/core/src/OCP/toast.js b/core/src/OCP/toast.js index 9fde3884987bd..ad1c572e0a1fc 100644 --- a/core/src/OCP/toast.js +++ b/core/src/OCP/toast.js @@ -34,7 +34,7 @@ export default { * * @param {string} text the toast text * @param {object} options options - * @returns {Toast} + * @return {Toast} */ success(text, options) { return showSuccess(text, options) @@ -44,7 +44,7 @@ export default { * * @param {string} text the toast text * @param {object} options options - * @returns {Toast} + * @return {Toast} */ warning(text, options) { return showWarning(text, options) @@ -54,7 +54,7 @@ export default { * * @param {string} text the toast text * @param {object} options options - * @returns {Toast} + * @return {Toast} */ error(text, options) { return showError(text, options) @@ -64,7 +64,7 @@ export default { * * @param {string} text the toast text * @param {object} options options - * @returns {Toast} + * @return {Toast} */ info(text, options) { return showInfo(text, options) @@ -74,7 +74,7 @@ export default { * * @param {string} text the toast text * @param {object} options options - * @returns {Toast} + * @return {Toast} */ message(text, options) { return showMessage(text, options) diff --git a/core/src/OCP/whatsnew.js b/core/src/OCP/whatsnew.js index ac455ffc08b06..d125f85e11a10 100644 --- a/core/src/OCP/whatsnew.js +++ b/core/src/OCP/whatsnew.js @@ -25,6 +25,9 @@ import _ from 'underscore' import $ from 'jquery' import { generateOcsUrl } from '@nextcloud/router' +/** + * @param options + */ export function query(options) { options = options || {} const dismissOptions = options.dismiss || {} @@ -38,6 +41,10 @@ export function query(options) { }) } +/** + * @param version + * @param options + */ export function dismiss(version, options) { options = options || {} $.ajax({ @@ -51,6 +58,12 @@ export function dismiss(version, options) { $('.whatsNewPopover').remove() } +/** + * @param data + * @param statusText + * @param xhr + * @param dismissOptions + */ function onQuerySuccess(data, statusText, xhr, dismissOptions) { console.debug('querying Whats New data was successful: ' + statusText) console.debug(data) @@ -131,15 +144,26 @@ function onQuerySuccess(data, statusText, xhr, dismissOptions) { document.body.appendChild(div) } +/** + * @param x + * @param t + * @param e + */ function onQueryError(x, t, e) { console.debug('querying Whats New Data resulted in an error: ' + t + e) console.debug(x) } +/** + * @param data + */ function onDismissSuccess(data) { // noop } +/** + * @param data + */ function onDismissError(data) { console.debug('dismissing Whats New data resulted in an error: ' + data) } diff --git a/core/src/Util/get-url-parameter.js b/core/src/Util/get-url-parameter.js index 1bde89ed7b1e1..32214d6bfe374 100644 --- a/core/src/Util/get-url-parameter.js +++ b/core/src/Util/get-url-parameter.js @@ -21,6 +21,9 @@ * */ +/** + * @param name + */ export default function getURLParameter(name) { return decodeURIComponent( // eslint-disable-next-line no-sparse-arrays diff --git a/core/src/components/setup/RecommendedApps.vue b/core/src/components/setup/RecommendedApps.vue index 719828b59a5ce..9ec5b9ceba7f0 100644 --- a/core/src/components/setup/RecommendedApps.vue +++ b/core/src/components/setup/RecommendedApps.vue @@ -81,15 +81,15 @@ const recommended = { }, spreed: { description: t('core', 'Chatting, video calls, screensharing, online meetings and web conferencing – in your browser and with mobile apps.'), - icon: imagePath('core', 'apps/spreed.svg') + icon: imagePath('core', 'apps/spreed.svg'), }, richdocuments: { description: t('core', 'Collaboratively edit office documents.'), - icon: imagePath('core', 'apps/richdocuments.svg') + icon: imagePath('core', 'apps/richdocuments.svg'), }, richdocumentscode: { description: t('core', 'Local document editing back-end used by the Collabora Online app.'), - icon: imagePath('core', 'apps/richdocumentscode.svg') + icon: imagePath('core', 'apps/richdocumentscode.svg'), }, } const recommendedIds = Object.keys(recommended) diff --git a/core/src/globals.js b/core/src/globals.js index 32a14fa12f40b..45a2fba3dd44e 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -68,9 +68,9 @@ const warnIfNotTesting = function() { * warn if used! * * @param {Function} func the library to deprecate - * @param {String} funcName the name of the library + * @param {string} funcName the name of the library * @param {Int} version the version this gets removed - * @returns {function} + * @return {Function} */ const deprecate = (func, funcName, version) => { const oldFunc = func @@ -128,6 +128,7 @@ $.fn.select2 = deprecate($.fn.select2, 'select2', 19) /** * translate a string + * * @param {string} app the id of the app for which to translate the string * @param {string} text the string to translate * @param [vars] map of placeholder key to value @@ -138,6 +139,7 @@ window.t = _.bind(OC.L10N.translate, OC.L10N) /** * translate a string + * * @param {string} app the id of the app for which to translate the string * @param {string} text_singular the string to translate for exactly one object * @param {string} text_plural the string to translate for n objects diff --git a/core/src/jquery/exists.js b/core/src/jquery/exists.js index 22fed55badb7a..4006982a8b6ec 100644 --- a/core/src/jquery/exists.js +++ b/core/src/jquery/exists.js @@ -26,8 +26,9 @@ import $ from 'jquery' /** * check if an element exists. * allows you to write if ($('#myid').exists()) to increase readability + * * @link http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery - * @returns {boolean} + * @return {boolean} */ $.fn.exists = function() { return this.length > 0 diff --git a/core/src/jquery/filterattr.js b/core/src/jquery/filterattr.js index 2bd4af417ac95..fb8d45c4dd3d9 100644 --- a/core/src/jquery/filterattr.js +++ b/core/src/jquery/filterattr.js @@ -28,7 +28,7 @@ import $ from 'jquery' * * @param {string} attrName attribute name * @param {string} attrValue attribute value - * @returns {Void} + * @return {Void} */ $.fn.filterAttr = function(attrName, attrValue) { return this.filter(function() { diff --git a/core/src/jquery/selectrange.js b/core/src/jquery/selectrange.js index 914832d45381b..b8f0d3dc122e6 100644 --- a/core/src/jquery/selectrange.js +++ b/core/src/jquery/selectrange.js @@ -25,10 +25,11 @@ import $ from 'jquery' /** * select a range in an input field + * * @link http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area * @param {int} start start selection from * @param {int} end number of char from start - * @returns {Void} + * @return {Void} */ $.fn.selectRange = function(start, end) { return this.each(function() { diff --git a/core/src/services/UnifiedSearchService.js b/core/src/services/UnifiedSearchService.js index a838d61bfd66d..1c2b5d617c895 100644 --- a/core/src/services/UnifiedSearchService.js +++ b/core/src/services/UnifiedSearchService.js @@ -34,14 +34,15 @@ export const regexFilterNot = /-in:([a-z_-]+)/ig /** * Create a cancel token - * @returns {CancelTokenSource} + * + * @return {CancelTokenSource} */ const createCancelToken = () => axios.CancelToken.source() /** * Get the list of available search providers * - * @returns {Array} + * @return {Array} */ export async function getTypes() { try { @@ -64,11 +65,11 @@ export async function getTypes() { /** * Get the list of available search providers * - * @param {Object} options destructuring object + * @param {object} options destructuring object * @param {string} options.type the type to search * @param {string} options.query the search * @param {int|string|undefined} options.cursor the offset for paginated searches - * @returns {Object} {request: Promise, cancel: Promise} + * @return {object} {request: Promise, cancel: Promise} */ export function search({ type, query, cursor }) { /** @@ -76,7 +77,7 @@ export function search({ type, query, cursor }) { */ const cancelToken = createCancelToken() - const request = async() => axios.get(generateOcsUrl('search/providers/{type}/search', { type }), { + const request = async () => axios.get(generateOcsUrl('search/providers/{type}/search', { type }), { cancelToken: cancelToken.token, params: { term: query, diff --git a/core/src/services/WebAuthnAuthenticationService.js b/core/src/services/WebAuthnAuthenticationService.js index db05e7ca3fe44..1e33dc78b3b04 100644 --- a/core/src/services/WebAuthnAuthenticationService.js +++ b/core/src/services/WebAuthnAuthenticationService.js @@ -23,6 +23,9 @@ import Axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' +/** + * @param loginName + */ export function startAuthentication(loginName) { const url = generateUrl('/login/webauthn/start') @@ -30,6 +33,9 @@ export function startAuthentication(loginName) { .then(resp => resp.data) } +/** + * @param data + */ export function finishAuthentication(data) { const url = generateUrl('/login/webauthn/finish') diff --git a/core/src/session-heartbeat.js b/core/src/session-heartbeat.js index 828896f9fae85..3dc6792f5222f 100644 --- a/core/src/session-heartbeat.js +++ b/core/src/session-heartbeat.js @@ -48,7 +48,8 @@ const loadConfig = () => { /** * session heartbeat (defaults to enabled) - * @returns {boolean} + * + * @return {boolean} */ const keepSessionAlive = () => { return config.session_keepalive === undefined @@ -57,7 +58,8 @@ const keepSessionAlive = () => { /** * get interval in seconds - * @returns {Number} + * + * @return {number} */ const getInterval = () => { let interval = NaN @@ -75,7 +77,7 @@ const getInterval = () => { ) } -const getToken = async() => { +const getToken = async () => { const url = generateUrl('/csrftoken') // Not using Axios here as Axios is not stubbable with the sinon fake server @@ -86,7 +88,7 @@ const getToken = async() => { return resp.token } -const poll = async() => { +const poll = async () => { try { const token = await getToken() setRequestToken(token) @@ -151,7 +153,7 @@ export const initSessionHeartBeat = () => { } let interval = startPolling() - window.addEventListener('online', async() => { + window.addEventListener('online', async () => { console.info('browser is online again, resuming heartbeat') interval = startPolling() try { diff --git a/core/src/systemtags/systemtagsmappingcollection.js b/core/src/systemtags/systemtagsmappingcollection.js index 6c6b657860833..f47b6a81ec2ed 100644 --- a/core/src/systemtags/systemtagsmappingcollection.js +++ b/core/src/systemtags/systemtagsmappingcollection.js @@ -38,22 +38,22 @@ import { generateRemoteUrl } from '@nextcloud/router' sync: OC.Backbone.davSync, /** - * Use PUT instead of PROPPATCH - */ + * Use PUT instead of PROPPATCH + */ usePUT: true, /** - * Id of the file for which to filter activities by - * - * @var int - */ + * Id of the file for which to filter activities by + * + * @member int + */ _objectId: null, /** - * Type of the object to filter by - * - * @var string - */ + * Type of the object to filter by + * + * @member string + */ _objectType: 'files', model: OC.SystemTags.SystemTagModel, @@ -63,19 +63,19 @@ import { generateRemoteUrl } from '@nextcloud/router' }, /** - * Sets the object id to filter by or null for all. - * - * @param {int} objectId file id or null - */ + * Sets the object id to filter by or null for all. + * + * @param {int} objectId file id or null + */ setObjectId(objectId) { this._objectId = objectId }, /** - * Sets the object type to filter by or null for all. - * - * @param {int} objectType file id or null - */ + * Sets the object type to filter by or null for all. + * + * @param {int} objectType file id or null + */ setObjectType(objectType) { this._objectType = objectType }, diff --git a/core/src/views/UnifiedSearch.vue b/core/src/views/UnifiedSearch.vue index bcb9f03be8a4c..6f5745125a85e 100644 --- a/core/src/views/UnifiedSearch.vue +++ b/core/src/views/UnifiedSearch.vue @@ -203,7 +203,8 @@ export default { /** * Is there any result to display - * @returns {boolean} + * + * @return {boolean} */ hasResults() { return Object.keys(this.results).length !== 0 @@ -211,7 +212,8 @@ export default { /** * Return ordered results - * @returns {Array} + * + * @return {Array} */ orderedResults() { return this.typesIDs @@ -225,7 +227,8 @@ export default { /** * Available filters * We only show filters that are available on the results - * @returns {string[]} + * + * @return {string[]} */ availableFilters() { return Object.keys(this.results) @@ -233,7 +236,8 @@ export default { /** * Applied filters - * @returns {string[]} + * + * @return {string[]} */ usedFiltersIn() { let match @@ -246,7 +250,8 @@ export default { /** * Applied anti filters - * @returns {string[]} + * + * @return {string[]} */ usedFiltersNot() { let match @@ -259,7 +264,8 @@ export default { /** * Is the current search too short - * @returns {boolean} + * + * @return {boolean} */ isShortQuery() { return this.query && this.query.trim().length < minSearchLength @@ -267,7 +273,8 @@ export default { /** * Is the current search valid - * @returns {boolean} + * + * @return {boolean} */ isValidQuery() { return this.query && this.query.trim() !== '' && !this.isShortQuery @@ -275,7 +282,8 @@ export default { /** * Have we reached the end of all types searches - * @returns {boolean} + * + * @return {boolean} */ isDoneSearching() { return Object.values(this.reached).every(state => state === false) @@ -283,7 +291,8 @@ export default { /** * Is there any search in progress - * @returns {boolean} + * + * @return {boolean} */ isLoading() { return Object.values(this.loading).some(state => state === true) @@ -478,7 +487,8 @@ export default { /** * Load more results for the provided type - * @param {String} type type + * + * @param {string} type type */ async loadMore(type) { // If already loading, ignore @@ -535,7 +545,7 @@ export default { * * @param {Array} list the results * @param {string} type the type - * @returns {Array} + * @return {Array} */ limitIfAny(list, type) { if (type in this.limits) { @@ -550,6 +560,7 @@ export default { /** * Focus the first result if any + * * @param {Event} event the keydown event */ focusFirst(event) { @@ -565,6 +576,7 @@ export default { /** * Focus the next result if any + * * @param {Event} event the keydown event */ focusNext(event) { @@ -584,6 +596,7 @@ export default { /** * Focus the previous result if any + * * @param {Event} event the keydown event */ focusPrev(event) { @@ -604,6 +617,7 @@ export default { /** * Focus the specified result index if it exists + * * @param {number} index the result index */ focusIndex(index) { @@ -615,6 +629,7 @@ export default { /** * Set the current focused element based on the target + * * @param {Event} event the focus event */ setFocusedIndex(event) { diff --git a/dist/core-main.js b/dist/core-main.js index a6af677c61068..13e4d2cc01ccc 100644 --- a/dist/core-main.js +++ b/dist/core-main.js @@ -1,3 +1,3 @@ /*! For license information please see core-main.js.LICENSE.txt */ -(()=>{var e,o={6772:()=>{Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){let t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})},97782:()=>{if("undefined"==typeof console||void 0===console.log){window.console||(window.console={});const e=()=>{},t=["log","debug","warn","info","error","assert","time","timeEnd"];for(let n=0;n{var o,i=n(19755);i.prototype.tooltip=(o=i.prototype.tooltip,function(e){try{return o.call(this,e)}catch(t){if(t instanceof TypeError&&"destroy"===e)return void 0===window.TESTING&&console.error("Deprecated call $.tooltip('destroy') has been deprecated and should be removed"),o.call(this,"dispose");if(t instanceof TypeError&&"fixTitle"===e)return void 0===window.TESTING&&console.error("Deprecated call $.tooltip('fixTitle') has been deprecated and should be removed"),o.call(this,"_fixTitle")}})},76389:()=>{if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){const e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}},4818:(e,o,i)=>{"use strict";var a={};i.r(a),i.d(a,{deleteKey:()=>P,getApps:()=>y,getKeys:()=>k,getValue:()=>x,setValue:()=>E});var s={};i.r(s),i.d(s,{formatLinksPlain:()=>at,formatLinksRich:()=>it,plainToRich:()=>nt,richToPlain:()=>ot});var r={};i.r(r),i.d(r,{dismiss:()=>rt,query:()=>st});var l=i(19755),c=i.n(l),d=(i(28594),i(35666),i(97782),i(6772),i(76389),i(74854)),u=i(79753);const p={},h=[];var g=i(64492),f=i(26932);const A={updatableNotification:null,getDefaultNotificationFunction:null,setDefault(e){this.getDefaultNotificationFunction=e},hide(e,t){g.default.isFunction(e)&&(t=e,e=void 0),e?(e.each((function(){c()(this)[0].toastify?c()(this)[0].toastify.hideToast():console.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),t&&t.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):console.error("Missing argument $row in OC.Notification.hide() call, caller needs to be adjusted to only dismiss its own notification")},showHtml(e,t){(t=t||{}).isHTML=!0,t.timeout=t.timeout?t.timeout:f.Rl;const n=(0,f.PV)(e,t);return n.toastElement.toastify=n,c()(n.toastElement)},show(e,t){(t=t||{}).timeout=t.timeout?t.timeout:f.Rl;const n=(0,f.PV)(function(e){return e.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(e),t);return n.toastElement.toastify=n,c()(n.toastElement)},showUpdate(e){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,f.PV)(e,{timeout:f.Rl}),this.updatableNotification.toastElement.toastify=this.updatableNotification,c()(this.updatableNotification.toastElement)},showTemporary(e,t){(t=t||{}).timeout=t.timeout||f.TN;const n=(0,f.PV)(e,t);return n.toastElement.toastify=n,c()(n.toastElement)},isHidden:()=>!c()("#content").find(".toastify").length},m=g.default.throttle((()=>{A.showTemporary(t("core","Connection to server lost"))}),7e3,{trailing:!1});let v=!1;const w={enableDynamicSlideToggle(){v=!0},showAppSidebar:function(e){(e||c()("#app-sidebar")).removeClass("disappear").show(),c()("#app-content").trigger(new(c().Event)("appresized"))},hideAppSidebar:function(e){(e||c()("#app-sidebar")).hide().addClass("disappear"),c()("#app-content").trigger(new(c().Event)("appresized"))}};var C=i(64492);function b(e,t,n){"post"!==e&&"delete"!==e||!Se.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},c().ajax({type:e.toUpperCase(),url:(0,u.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps")+t,data:n.data||{},success:n.success,error:n.error})):Se.PasswordConfirmation.requirePasswordConfirmation(C.bind(b,this,e,t,n))}function y(e){b("get","",e)}function k(e,t){b("get","/"+e,t)}function x(e,t,n,o){(o=o||{}).data={defaultValue:n},b("get","/"+e+"/"+t,o)}function E(e,t,n,o){(o=o||{}).data={value:n},b("post","/"+e+"/"+t,o)}function P(e,t,n){b("delete","/"+e+"/"+t,n)}const B=window.oc_appconfig||{},O={getValue:function(e,t,n,o){x(e,t,n,{success:o})},setValue:function(e,t,n){E(e,t,n)},getApps:function(e){y({success:e})},getKeys:function(e,t){k(e,{success:t})},deleteKey:function(e,t){P(e,t)}},T=void 0!==window._oc_appswebroots&&window._oc_appswebroots;var j=i(72316),D=i.n(j),I=i(87240);const _={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function z(e,t){if(g.default.isArray(e))return g.default.map(e,(function(e){return z(e,t)}));var n={href:e.href};return g.default.each(e.propStat,(function(e){if("HTTP/1.1 200 OK"===e.status)for(var o in e.properties){var i=o;o in t&&(i=t[o]),n[i]=e.properties[o]}})),n.id||(n.id=N(n.href)),n}function N(e){var t=e.indexOf("?");t>0&&(e=e.substr(0,t));var n,o=e.split("/");do{n=o[o.length-1],o.pop()}while(!n&&o.length>0);return n}function M(e){return e>=200&&e<=299}function S(e,t,n,o){return e.propPatch(t.url,function(e,t){var n,o={};for(n in e){var i=t[n],a=e[n];i||(console.warn('No matching DAV property for property "'+n),i=n),(g.default.isBoolean(a)||g.default.isNumber(a))&&(a=""+a),o[i]=a}return o}(n.changed,t.davProperties),o).then((function(e){M(e.status)?g.default.isFunction(t.success)&&t.success(n.toJSON()):g.default.isFunction(t.error)&&t.error(e)}))}const L=D().noConflict();Object.assign(L,{davCall:(e,t)=>{var n=new I.dav.Client({baseUrl:e.url,xmlNamespaces:g.default.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},e.xmlNamespaces||{})});n.resolveUrl=function(){return e.url};var o=g.default.extend({"X-Requested-With":"XMLHttpRequest",requesttoken:OC.requestToken},e.headers);return"PROPFIND"===e.type?function(e,t,n,o){return e.propFind(t.url,g.default.values(t.davProperties)||[],t.depth,o).then((function(e){if(M(e.status)){if(g.default.isFunction(t.success)){var n=g.default.invert(t.davProperties),o=z(e.body,n);t.depth>0&&o.shift(),t.success(o)}}else g.default.isFunction(t.error)&&t.error(e)}))}(n,e,0,o):"PROPPATCH"===e.type?S(n,e,t,o):"MKCOL"===e.type?function(e,t,n,o){return e.request(t.type,t.url,o,null).then((function(i){M(i.status)?S(e,t,n,o):g.default.isFunction(t.error)&&t.error(i)}))}(n,e,t,o):function(e,t,n,o){return o["Content-Type"]="application/json",e.request(t.type,t.url,o,t.data).then((function(e){if(M(e.status)){if(g.default.isFunction(t.success)){if("PUT"===t.type||"POST"===t.type||"MKCOL"===t.type){var o=e.body||n.toJSON(),i=e.xhr.getResponseHeader("Content-Location");return"POST"===t.type&&i&&(o.id=N(i)),void t.success(o)}if(207===e.status){var a=g.default.invert(t.davProperties);t.success(z(e.body,a))}else t.success(e.body)}}else g.default.isFunction(t.error)&&t.error(e)}))}(n,e,t,o)},davSync:(e=>(t,n,o)=>{var i={type:_[t]||t},a=n instanceof e.Collection;if("update"===t&&(n.hasInnerCollection?i.type="MKCOL":(n.usePUT||n.collection&&n.collection.usePUT)&&(i.type="PUT")),o.url||(i.url=g.default.result(n,"url")||function(){throw new Error('A "url" property or function must be specified')}()),null!=o.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(i.data=JSON.stringify(o.attrs||n.toJSON(o))),"PROPFIND"!==i.type&&(i.processData=!1),"PROPFIND"===i.type||"PROPPATCH"===i.type){var s=n.davProperties;!s&&n.model&&(s=n.model.prototype.davProperties),s&&(g.default.isFunction(s)?i.davProperties=s.call(n):i.davProperties=s),i.davProperties=g.default.extend(i.davProperties||{},o.davProperties),g.default.isUndefined(o.depth)&&(o.depth=a?1:0)}var r=o.error;o.error=function(e,t,n){o.textStatus=t,o.errorThrown=n,r&&r.call(o.context,e,t,n)};var l=o.xhr=e.davCall(g.default.extend(i,o),n);return n.trigger("request",n,l,o),l})(L)});const U=L;var F=i(76632);const R=window._oc_config||{};var Q=i(64492);const G=j.Model.extend({defaults:{fullName:"",lastMessage:"",actions:[],hasOneAction:!1,hasTwoActions:!1,hasManyActions:!1},initialize:function(){0===this.get("actions").length?this.set("hasOneAction",!0):1===this.get("actions").length?(this.set("hasTwoActions",!0),this.set("secondAction",this.get("actions")[0])):this.set("hasManyActions",!0)}}),H=j.Collection.extend({model:G}),K=j.View.extend({_collection:void 0,_subViews:[],initialize:function(e){this._collection=e.collection},render:function(){var e=this;return e.$el.html(""),e._subViews=[],e._collection.forEach((function(t){var n=new Y({model:t});n.render(),e.$el.append(n.$el),n.on("toggle:actionmenu",e._onChildActionMenuToggle,e),e._subViews.push(n)})),e},_onChildActionMenuToggle:function(e){this._subViews.forEach((function(t){t.trigger("parent:toggle:actionmenu",e)}))}}),Y=j.View.extend({className:"contact",_template:void 0,_model:void 0,_actionMenuShown:!1,events:{"click .icon-more":"_onToggleActionsMenu"},contactTemplate:i(10944),template:function(e){return this.contactTemplate(e)},initialize:function(e){this._model=e.model,this.on("parent:toggle:actionmenu",this._onOtherActionMenuOpened,this)},render:function(){return this.$el.html(this.template({contact:this._model.toJSON()})),this.delegateEvents(),this.$("div.avatar").imageplaceholder(this._model.get("fullName")),this.$(".top-action").tooltip({placement:"left"}),this.$(".second-action").tooltip({placement:"left"}),this},_onToggleActionsMenu:function(){this._actionMenuShown=!this._actionMenuShown,this._actionMenuShown?this.$(".menu").show():this.$(".menu").hide(),this.trigger("toggle:actionmenu",this.$el)},_onOtherActionMenuOpened:function(e){this.$el.is(e)||(this._actionMenuShown=!1,this.$(".menu").hide())}}),q=j.View.extend({_loadingTemplate:void 0,_errorTemplate:void 0,_contentTemplate:void 0,_contactsTemplate:void 0,_contacts:void 0,_searchTerm:"",events:{"input #contactsmenu-search":"_onSearch"},templates:{loading:i(95386),error:i(20421),menu:i(66115),list:i(34083)},_onSearch:Q.debounce((function(e){var t=this.$("#contactsmenu-search").val();t!==this._searchTerm&&(this.trigger("search",this.$("#contactsmenu-search").val()),this._searchTerm=t)}),700),loadingTemplate:function(e){return this.templates.loading(e)},errorTemplate:function(e){return this.templates.error(Q.extend({couldNotLoadText:t("core","Could not load your contacts")},e))},contentTemplate:function(e){return this.templates.menu(Q.extend({searchContactsText:t("core","Search contacts …")},e))},contactsTemplate:function(e){return this.templates.list(Q.extend({noContactsFoundText:t("core","No contacts found"),showAllContactsText:t("core","Show all contacts …"),contactsAppMgmtText:t("core","Install the Contacts app")},e))},initialize:function(e){this.options=e},showLoading:function(e){this.render(),this._contacts=void 0,this.$(".content").html(this.loadingTemplate({loadingText:e}))},showError:function(){this.render(),this._contacts=void 0,this.$(".content").html(this.errorTemplate())},showContacts:function(e,t){this._contacts=e.contacts,this.render({contacts:e.contacts});var n=new K({collection:e.contacts});n.render(),this.$(".content").html(this.contactsTemplate({contacts:e.contacts,searchTerm:t,contactsAppEnabled:e.contactsAppEnabled,contactsAppURL:Se.generateUrl("/apps/contacts"),canInstallApp:Se.isUserAdmin(),contactsAppMgmtURL:Se.generateUrl("/settings/apps/social/contacts")})),this.$("#contactsmenu-contacts").html(n.$el)},render:function(e){var t=this.$("#contactsmenu-search").val();return this.$el.html(this.contentTemplate(e)),this.$("#contactsmenu-search").val(t),this.$("#contactsmenu-search").focus(),this}}),J=function(e){this.initialize(e)};J.prototype={$el:void 0,_$trigger:void 0,_view:void 0,_contactsPromise:void 0,initialize:function(e){this.$el=e.el,this._$trigger=e.trigger,this._view=new q({el:this.$el}),this._view.on("search",(function(e){this._loadContacts(e)}),this),Se.registerMenu(this._$trigger,this.$el,function(){this._toggleVisibility(!0)}.bind(this),!0),this.$el.on("beforeHide",function(){this._toggleVisibility(!1)}.bind(this))},_toggleVisibility:function(e){return e?this._loadContacts():(this.$el.html(""),Promise.resolve())},_getContacts:function(e){var t=Se.generateUrl("/contactsmenu/contacts");return Promise.resolve(c().ajax(t,{method:"POST",data:{filter:e}}))},_loadContacts:function(e){var n=this;return n._contactsPromise||(n._contactsPromise=n._getContacts(e)),Q.isUndefined(e)||""===e?n._view.showLoading(t("core","Loading your contacts …")):n._view.showLoading(t("core","Looking for {term} …",{term:e})),n._contactsPromise.then((function(t){t.contacts=new H(t.contacts),n._view.showContacts(t,e)}),(function(e){n._view.showError(),console.error("There was an error loading your contacts",e)})).then((function(){delete n._contactsPromise})).catch(console.error.bind(this))}};const W=J,V=document.getElementsByTagName("head")[0].getAttribute("data-user"),Z=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),X=void 0!==V&&V,$={Search:class{constructor(){console.warn("OCA.Search is deprecated. Please use the unified search API instead")}}},ee={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,dialogsCounter:0,alert:function(e,t,n,o){this.message(e,t,"alert",ee.OK_BUTTON,n,o)},info:function(e,t,n,o){this.message(e,t,"info",ee.OK_BUTTON,n,o)},confirm:function(e,t,n,o){return this.message(e,t,"notice",ee.YES_NO_BUTTONS,n,o)},confirmDestructive:function(e,t,n,o,i){return this.message(e,t,"none",n,o,void 0===i||i)},confirmHtml:function(e,t,n,o){return this.message(e,t,"notice",ee.YES_NO_BUTTONS,n,o,!0)},prompt:function(e,n,o,i,a,s){return c().when(this._getMessageTemplate()).then((function(r){var l="oc-dialog-"+ee.dialogsCounter+"-content",d="#"+l,u=r.octemplate({dialog_name:l,title:n,message:e,type:"notice"}),p=c()("");p.attr("type",s?"password":"text").attr("id",l+"-input").attr("placeholder",a);var h=c()("