Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-12-02 20:32:57 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-01-08 12:14:05 +0300
commit74b980310852a0b406fa9d073870f92c409d5444 (patch)
tree055cbdf57886077bf3a6ea476813deedb54064e0 /apps/user_status
parent85bc8513557f5ff37fc283d53893d4cb77ec7c3b (diff)
Eslint fix
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/src/UserStatus.vue4
-rw-r--r--apps/user_status/src/components/ClearAtSelect.vue6
-rw-r--r--apps/user_status/src/components/PredefinedStatusesList.vue6
-rw-r--r--apps/user_status/src/components/SetStatusModal.vue14
-rw-r--r--apps/user_status/src/filters/clearAtFilter.js4
-rw-r--r--apps/user_status/src/mixins/OnlineStatusMixin.js6
-rw-r--r--apps/user_status/src/services/clearAtOptionsService.js2
-rw-r--r--apps/user_status/src/services/clearAtService.js4
-rw-r--r--apps/user_status/src/services/heartbeatService.js6
-rw-r--r--apps/user_status/src/services/predefinedStatusService.js4
-rw-r--r--apps/user_status/src/services/statusOptionsService.js2
-rw-r--r--apps/user_status/src/services/statusService.js32
-rw-r--r--apps/user_status/src/store/predefinedStatuses.js7
-rw-r--r--apps/user_status/src/store/userStatus.js124
14 files changed, 111 insertions, 110 deletions
diff --git a/apps/user_status/src/UserStatus.vue b/apps/user_status/src/UserStatus.vue
index 608966b9d9a..bac84e86500 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<void>}
+ * @return {Promise<void>}
* @private
*/
async _backgroundHeartbeat() {
diff --git a/apps/user_status/src/components/ClearAtSelect.vue b/apps/user_status/src/components/ClearAtSelect.vue
index 96cc171416c..cd8865edb43 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 844fdbbdfe3..c0b53a6d650 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 95d1aa974d2..704e4ae3788 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<void>}
+ * @return {Promise<void>}
*/
async saveStatus() {
if (this.isSavingStatus) {
@@ -216,7 +216,7 @@ export default {
},
/**
*
- * @returns {Promise<void>}
+ * @return {Promise<void>}
*/
async clearStatus() {
try {
diff --git a/apps/user_status/src/filters/clearAtFilter.js b/apps/user_status/src/filters/clearAtFilter.js
index c7140c00976..89604fe9f3a 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 06a3d058a9b..f56723f9b5c 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 926f21d8b6e..c6091aa10de 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 bc01ff6c0cd..38ff342be20 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 4a789a8a012..a981a0dc246 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<void>}
+ * @param {boolean} isAway Whether or not the user is active
+ * @return {Promise<void>}
*/
-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 b4c9ed4a96a..18887efb8b5 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<void>}
+ * @return {Promise<void>}
*/
-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 15da11fd5d2..31f65d92e44 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 caaea503b8e..d14e45b4183 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<Object>}
+ * @return {Promise<object>}
*/
-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<void>}
+ * @param {string} statusType The status (online / away / dnd / invisible)
+ * @return {Promise<void>}
*/
-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<void>}
+ * @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<void>}
*/
-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<void>}
+ * @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<void>}
*/
-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<void>}
+ * @return {Promise<void>}
*/
-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 219fccd9b85..aa05f8e54af 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 99761da1265..84434895e18 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<void>}
+ * @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<void>}
*/
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<void>}
+ * @param {object} vuex.state The Vuex state object
+ * @param {string} status The new status
+ * @return {Promise<void>}
*/
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<void>}
+ * @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<void>}
*/
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<void>}
+ * @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<void>}
*/
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<void>}
+ * @param {object} vuex.state The Vuex state object
+ * @return {Promise<void>}
*/
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<void>}
+ * @return {Promise<void>}
*/
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<void>}
+ * @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<void>}
*/
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 }) {