From ba5fa30cbdd462d8d4dc3286439e19c383a403c9 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 14 Mar 2023 14:13:56 +0100 Subject: [PATCH] fix import and jsdoc lint rules, update caniuse Signed-off-by: Maksim Sukharev --- .eslintrc.js | 1 + package-lock.json | 12 ++-- .../BreakoutRoomsParticipantsEditor.vue | 2 +- src/main.js | 2 +- src/mainFilesSidebar.js | 2 +- src/mainPublicShareAuthSidebar.js | 2 +- src/mainPublicShareSidebar.js | 2 +- src/mainRecording.js | 2 +- src/services/breakoutRoomsService.js | 56 +++++++++---------- src/store/breakoutRoomsStore.js | 12 ++-- src/store/pollStore.js | 12 ++-- src/utils/webrtc/index.js | 8 +-- 12 files changed, 56 insertions(+), 57 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cbbf4a6d28..7064426a2d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,6 +4,7 @@ module.exports = { ], rules: { 'import/newline-after-import': 1, + 'import/no-named-as-default-member': 0, 'import/order': [ 'warn', { diff --git a/package-lock.json b/package-lock.json index 400589e1c3..ab8e91754b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5576,9 +5576,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001397", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001397.tgz", - "integrity": "sha512-SW9N2TbCdLf0eiNDRrrQXx2sOkaakNZbCjgNpPyMJJbiOrU5QzMIrXOVMRM1myBXTD5iTkdrtU/EguCrBocHlA==", + "version": "1.0.30001466", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001466.tgz", + "integrity": "sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w==", "funding": [ { "type": "opencollective", @@ -24938,9 +24938,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001397", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001397.tgz", - "integrity": "sha512-SW9N2TbCdLf0eiNDRrrQXx2sOkaakNZbCjgNpPyMJJbiOrU5QzMIrXOVMRM1myBXTD5iTkdrtU/EguCrBocHlA==" + "version": "1.0.30001466", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001466.tgz", + "integrity": "sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w==" }, "chalk": { "version": "2.4.2", diff --git a/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue b/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue index 21431ef1e9..b08f485f4a 100644 --- a/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue +++ b/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue @@ -220,7 +220,7 @@ export default { /** * Initialise the assignments array. * - * @param forceReset {boolean} If true, the assignments array will be reset if the breakoutRooms prop is populated. + * @param {boolean} forceReset If true, the assignments array will be reset if the breakoutRooms prop is populated. */ initialiseAssignments(forceReset) { if (this.isReorganizingAttendees && !forceReset) { diff --git a/src/main.js b/src/main.js index 372fce1df6..b6f84c4fd1 100644 --- a/src/main.js +++ b/src/main.js @@ -45,9 +45,9 @@ import router from './router/router.js' import store from './store/index.js' import '@nextcloud/dialogs/dist/index.css' -import 'leaflet/dist/leaflet.css' // Leaflet icon patch import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css' // Re-uses images from ~leaflet package +import 'leaflet/dist/leaflet.css' // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' diff --git a/src/mainFilesSidebar.js b/src/mainFilesSidebar.js index e5966ac59f..fef66ddbbf 100644 --- a/src/mainFilesSidebar.js +++ b/src/mainFilesSidebar.js @@ -41,9 +41,9 @@ import './init.js' import store from './store/index.js' import '@nextcloud/dialogs/dist/index.css' -import 'leaflet/dist/leaflet.css' // Leaflet icon patch import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css' // Re-uses images from ~leaflet package +import 'leaflet/dist/leaflet.css' // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' diff --git a/src/mainPublicShareAuthSidebar.js b/src/mainPublicShareAuthSidebar.js index 30e6b5ce1a..6c8d032f45 100644 --- a/src/mainPublicShareAuthSidebar.js +++ b/src/mainPublicShareAuthSidebar.js @@ -35,9 +35,9 @@ import './init.js' import store from './store/index.js' import '@nextcloud/dialogs/dist/index.css' -import 'leaflet/dist/leaflet.css' // Leaflet icon patch import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css' // Re-uses images from ~leaflet package +import 'leaflet/dist/leaflet.css' // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' diff --git a/src/mainPublicShareSidebar.js b/src/mainPublicShareSidebar.js index b9d608fb0d..86ae5b061d 100644 --- a/src/mainPublicShareSidebar.js +++ b/src/mainPublicShareSidebar.js @@ -35,9 +35,9 @@ import './init.js' import store from './store/index.js' import '@nextcloud/dialogs/dist/index.css' -import 'leaflet/dist/leaflet.css' // Leaflet icon patch import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css' // Re-uses images from ~leaflet package +import 'leaflet/dist/leaflet.css' // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' diff --git a/src/mainRecording.js b/src/mainRecording.js index c8fde06934..5a323a9177 100644 --- a/src/mainRecording.js +++ b/src/mainRecording.js @@ -49,9 +49,9 @@ import { } from './utils/webrtc/index.js' import '@nextcloud/dialogs/dist/index.css' -import 'leaflet/dist/leaflet.css' // Leaflet icon patch import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css' // Re-uses images from ~leaflet package +import 'leaflet/dist/leaflet.css' // eslint-disable-next-line import 'leaflet-defaulticon-compatibility' diff --git a/src/services/breakoutRoomsService.js b/src/services/breakoutRoomsService.js index 9fa38dfd1f..5ff420572a 100644 --- a/src/services/breakoutRoomsService.js +++ b/src/services/breakoutRoomsService.js @@ -25,12 +25,12 @@ import { generateOcsUrl } from '@nextcloud/router' /** * Create breakout rooms for a given conversation * - * @param token The conversation token - * @param mode Either manual, auto, or free, see constants file - * @param amount The amount of breakout rooms to be created - * @param attendeeMap A json encoded Map of attendeeId => room number (0 based) + * @param {string} token The conversation token + * @param {string} mode Either manual, auto, or free, see constants file + * @param {number} amount The amount of breakout rooms to be created + * @param {string} attendeeMap A json encoded Map of attendeeId => room number (0 based) * (Only considered when the mode is "manual") - * @return {Promise>} + * @return {Promise>} */ const configureBreakoutRooms = async function(token, mode, amount, attendeeMap) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}', { token }), { @@ -43,9 +43,9 @@ const configureBreakoutRooms = async function(token, mode, amount, attendeeMap) /** * Resets the request assistance * - * @param token the breakout room token - * @param attendeeMap A json encoded Map of attendeeId => room number (0 based) - * @return {Promise>} The array of conversations + * @param {string} token the breakout room token + * @param {string} attendeeMap A json encoded Map of attendeeId => room number (0 based) + * @return {Promise>} The array of conversations */ const reorganizeAttendees = async function(token, attendeeMap) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/attendees', { @@ -59,8 +59,8 @@ const reorganizeAttendees = async function(token, attendeeMap) { /** * Deletes all breakout rooms for a given conversation * - * @param token - * @return {Promise>} + * @param {string} token The conversation token + * @return {Promise>} */ const deleteBreakoutRooms = async function(token) { return await axios.delete(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}', { token })) @@ -69,8 +69,8 @@ const deleteBreakoutRooms = async function(token) { /** * Fetches the breakout rooms for given conversation * - * @param token The conversation token - * @return {Promise>} The array of conversations + * @param {string} token The conversation token + * @return {Promise>} The array of conversations */ const getBreakoutRooms = async function(token) { return await axios.get(generateOcsUrl('/apps/spreed/api/v4/room/{token}/breakout-rooms', { token })) @@ -78,8 +78,8 @@ const getBreakoutRooms = async function(token) { /** * - * @param token The conversation token - * @return {Promise>} The array of conversations + * @param {string} token The conversation token + * @return {Promise>} The array of conversations */ const startBreakoutRooms = async function(token) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/rooms', { token })) @@ -88,8 +88,8 @@ const startBreakoutRooms = async function(token) { /** * Stops the breakout rooms * - * @param token The conversation token - * @return {Promise>} The array of conversations + * @param {string} token The conversation token + * @return {Promise>} The array of conversations */ const stopBreakoutRooms = async function(token) { return await axios.delete(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/rooms', { token })) @@ -97,9 +97,9 @@ const stopBreakoutRooms = async function(token) { /** * - * @param token the conversation token - * @param message The message to be posted - * @return {Promise>} The array of conversations + * @param {string} message The message to be posted + * @param {string} token the conversation token + * @return {Promise>} The array of conversations */ const broadcastMessageToBreakoutRooms = async function(message, token) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/broadcast', { @@ -112,8 +112,8 @@ const broadcastMessageToBreakoutRooms = async function(message, token) { /** * - * @param token the conversation token - * @return {Promise>} The array of conversations + * @param {string} token the conversation token + * @return {Promise>} The array of conversations */ const getBreakoutRoomsParticipants = async function(token) { return await axios.get(generateOcsUrl('/apps/spreed/api/v4/room/{token}/breakout-rooms/participants', { @@ -124,8 +124,8 @@ const getBreakoutRoomsParticipants = async function(token) { /** * Requests assistance from a moderator * - * @param token the breakout room token - * @return {Promise>} The array of conversations + * @param {string} token the breakout room token + * @return {Promise>} The array of conversations */ const requestAssistance = async function(token) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/request-assistance', { @@ -137,8 +137,8 @@ const requestAssistance = async function(token) { /** * Resets the request assistance * - * @param token the breakout room token - * @return {Promise>} The array of conversations + * @param {string} token the breakout room token + * @return {Promise>} The array of conversations */ const resetRequestAssistance = async function(token) { return await axios.delete(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/request-assistance', { @@ -151,9 +151,9 @@ const resetRequestAssistance = async function(token) { * This endpoint allows participants to switch between breakout rooms when they are allowed to choose the breakout room * and not are automatically or manually assigned by the moderator. * - * @param token Conversation token of the parent room hosting the breakout rooms - * @param target Conversation token of the target breakout room - * @return {Promise>} The target breakout room + * @param {string} token Conversation token of the parent room hosting the breakout rooms + * @param {string} target Conversation token of the target breakout room + * @return {Promise>} The target breakout room */ const switchToBreakoutRoom = async function(token, target) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/switch', { diff --git a/src/store/breakoutRoomsStore.js b/src/store/breakoutRoomsStore.js index 5ab250d48e..1258cf9a50 100644 --- a/src/store/breakoutRoomsStore.js +++ b/src/store/breakoutRoomsStore.js @@ -66,10 +66,8 @@ const mutations = { * * @param {object} state current store state; * @param {object} conversation the conversation; - * @param conversation.parentRoomToken - * @param parentRoomToken the parent room token; - * @param breakoutRoom - * @param conversation.breakoutRoom + * @param {string} conversation.parentRoomToken the parent room token; + * @param {object} conversation.breakoutRoom the breakout room; */ addBreakoutRoom(state, { parentRoomToken, breakoutRoom }) { if (!state.breakoutRooms[parentRoomToken]) { @@ -90,9 +88,9 @@ const mutations = { * The breakout rooms api return an array with mixed breakout rooms and "parent" conversations, we want to add the * breakout rooms to this store and update the parent conversations in the conversations store. * - * @param conversationsList the array of mixed breakout rooms and "parent" conversation - * @param parentRoomToken - * @param context the context object + * @param {Array} conversationsList the array of mixed breakout rooms and "parent" conversation + * @param {string }parentRoomToken the parent room token; + * @param {object} context the context object */ const processConversations = (conversationsList, parentRoomToken, context) => { diff --git a/src/store/pollStore.js b/src/store/pollStore.js index 82153631e9..674d68003e 100644 --- a/src/store/pollStore.js +++ b/src/store/pollStore.js @@ -20,7 +20,7 @@ * */ import debounce from 'debounce' -import { set } from 'vue' +import Vue from 'vue' import { showError } from '@nextcloud/dialogs' @@ -39,20 +39,20 @@ const getters = { const mutations = { addPoll(state, { token, poll }) { if (!state.polls[token]) { - set(state.polls, token, {}) + Vue.set(state.polls, token, {}) } - set(state.polls[token], poll.id, poll) + Vue.set(state.polls[token], poll.id, poll) }, // Add debounce function for getting the poll data addDebounceGetPollDataFunction(state, { token, pollId, debounceGetPollDataFunction }) { if (!state.polls?.pollDebounceFunctions) { - set(state.polls, 'pollDebounceFunctions', {}) + Vue.set(state.polls, 'pollDebounceFunctions', {}) } if (!state.polls.pollDebounceFunctions?.[token]) { - set(state.polls.pollDebounceFunctions, [token], {}) + Vue.set(state.polls.pollDebounceFunctions, [token], {}) } - set(state.polls.pollDebounceFunctions[token], pollId, debounceGetPollDataFunction) + Vue.set(state.polls.pollDebounceFunctions[token], pollId, debounceGetPollDataFunction) }, } diff --git a/src/utils/webrtc/index.js b/src/utils/webrtc/index.js index 64494886c0..dc3d019619 100644 --- a/src/utils/webrtc/index.js +++ b/src/utils/webrtc/index.js @@ -21,6 +21,10 @@ import Axios from '@nextcloud/axios' +import { PARTICIPANT } from '../../constants.js' +import { fetchSignalingSettings } from '../../services/signalingService.js' +import CancelableRequest from '../cancelableRequest.js' +import Signaling from '../signaling.js' import CallAnalyzer from './analyzers/CallAnalyzer.js' import MediaDevicesManager from './MediaDevicesManager.js' import CallParticipantCollection from './models/CallParticipantCollection.js' @@ -30,10 +34,6 @@ import SentVideoQualityThrottler from './SentVideoQualityThrottler.js' import './shims/MediaStream.js' import './shims/MediaStreamTrack.js' import initWebRtc from './webrtc.js' -import { PARTICIPANT } from '../../constants.js' -import { fetchSignalingSettings } from '../../services/signalingService.js' -import CancelableRequest from '../cancelableRequest.js' -import Signaling from '../signaling.js' let webRtc = null const callParticipantCollection = new CallParticipantCollection()