chore: fix jsdoc ESLint rules

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2026-01-25 23:47:11 +01:00
parent 59b68e1248
commit 790a1bfca8
No known key found for this signature in database
GPG key ID: 7E849AE05218500F
8 changed files with 61 additions and 53 deletions

View file

@ -132,7 +132,7 @@ async function processSharesToConfirm() {
* @param {string} share.name name of the shared folder
* @param {string} share.token authentication token
* @param {boolean} passwordProtected true if the share is password protected
* @param {Function} callback the callback
* @param {(status: boolean, share: Record<string, unknown> & { password?: string }) => void} callback the callback
*/
function showAddExternalDialog(share, passwordProtected, callback) {
const owner = share.ownerDisplayName || share.owner

View file

@ -23,8 +23,7 @@ function getFirstWorkdayOfWeek() {
}
/**
*
* @param date
* @param date - The date to get the week number for
*/
function getWeek(date: Date) {
const dateClone = new Date(date)
@ -35,9 +34,8 @@ function getWeek(date: Date) {
}
/**
*
* @param a
* @param b
* @param a - First date
* @param b - Second date
*/
function isSameWeek(a: Date, b: Date) {
return getWeek(a) === getWeek(b)
@ -45,9 +43,8 @@ function isSameWeek(a: Date, b: Date) {
}
/**
*
* @param a
* @param b
* @param a - First date
* @param b - Second date
*/
function isSameDate(a: Date, b: Date) {
return a.getDate() === b.getDate()
@ -56,8 +53,7 @@ function isSameDate(a: Date, b: Date) {
}
/**
*
* @param dateTime
* @param dateTime - The preset to get the date for
*/
export function getDateTime(dateTime: DateTimePreset): null | Date {
const matchPreset: Record<DateTimePreset, () => null | Date> = {
@ -126,8 +122,7 @@ export function getInitialCustomDueDate(): Date {
}
/**
*
* @param dueDate
* @param dueDate - The date to format as a string
*/
export function getDateString(dueDate: Date): string {
let formatOptions: Intl.DateTimeFormatOptions = {
@ -166,8 +161,7 @@ export function getDateString(dueDate: Date): string {
}
/**
*
* @param dueDate
* @param dueDate - The date to format as a string
*/
export function getVerboseDateString(dueDate: Date): string {
let formatOptions: Intl.DateTimeFormatOptions = {

View file

@ -102,11 +102,11 @@
v-model="ldapConfigProxy.ldapGroupMemberAssocAttr"
:options="Object.keys(groupMemberAssociation)"
:inputLabel="t('user_ldap', 'Group-Member association')">
<template #option="{ label: configId }">
{{ groupMemberAssociation[configId] }}
<template #option="{ label }">
{{ groupMemberAssociation[label] }}
</template>
<template #selected-option="{ label: configId }">
{{ groupMemberAssociation[configId] }}
<template #selected-option="{ label }">
{{ groupMemberAssociation[label] }}
</template>
</NcSelect>

View file

@ -127,8 +127,9 @@ async function countGroups() {
}
/**
* Toggle filter mode
*
* @param value
* @param value - new value
*/
async function toggleFilterMode(value: boolean) {
if (value) {

View file

@ -73,7 +73,7 @@ import { showError, showSuccess, showWarning } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
import { NcButton, NcCheckboxRadioSwitch, NcSelect, NcTextArea, NcTextField } from '@nextcloud/vue'
import { storeToRefs } from 'pinia'
import { computed, ref } from 'vue'
import { computed, onBeforeMount, ref } from 'vue'
import { callWizard, showEnableAutomaticFilterInfo } from '../../services/ldapConfigService.ts'
import { useLDAPConfigsStore } from '../../store/configs.ts'
@ -99,18 +99,18 @@ const ldapLoginFilterAttributes = computed({
const ldapLoginFilterMode = computed(() => ldapConfigProxy.value.ldapLoginFilterMode === '1')
const filteredLoginFilterOptions = computed(() => loginFilterOptions.value.filter((option) => !ldapLoginFilterAttributes.value.includes(option)))
onBeforeMount(init)
/**
*
* Initialize login filter options
*/
async function init() {
const response = await callWizard('determineAttributes', props.configId)
loginFilterOptions.value = response.options?.ldap_loginfilter_attributes ?? []
}
init()
/**
*
* Get user login filter
*/
async function getUserLoginFilter() {
if (ldapConfigProxy.value.ldapLoginFilterMode === '0') {
@ -121,7 +121,7 @@ async function getUserLoginFilter() {
}
/**
*
* Verify login name
*/
async function verifyLoginName() {
try {
@ -155,8 +155,9 @@ async function verifyLoginName() {
}
/**
* Toggle filter mode
*
* @param value
* @param value - new value
*/
async function toggleFilterMode(value: boolean) {
if (value) {

View file

@ -62,7 +62,7 @@ import { getCapabilities } from '@nextcloud/capabilities'
import { t } from '@nextcloud/l10n'
import { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcSelect, NcTextArea } from '@nextcloud/vue'
import { storeToRefs } from 'pinia'
import { computed, ref } from 'vue'
import { computed, onBeforeMount, ref } from 'vue'
import { callWizard, showEnableAutomaticFilterInfo } from '../../services/ldapConfigService.ts'
import { useLDAPConfigsStore } from '../../store/configs.ts'
@ -92,8 +92,10 @@ const ldapUserFilterGroups = computed({
set(value) { ldapConfigProxy.value.ldapUserFilterGroups = value.join(';') },
})
onBeforeMount(init)
/**
*
* Initialize user filter options
*/
async function init() {
const response1 = await callWizard('determineUserObjectClasses', props.configId)
@ -107,10 +109,8 @@ async function init() {
ldapConfigs.value[props.configId]!.ldapUserFilterGroups = (response2.changes?.ldap_userfilter_groups as string[] | undefined)?.join(';') ?? ''
}
init()
/**
*
* Reload filters
*/
async function reloadFilters() {
if (ldapConfigProxy.value.ldapUserFilterMode === '0') {
@ -125,7 +125,7 @@ async function reloadFilters() {
}
/**
*
* Count users
*/
async function countUsers() {
try {
@ -138,8 +138,9 @@ async function countUsers() {
}
/**
* Toggle filter mode
*
* @param value
* @param value - new value
*/
async function toggleFilterMode(value: boolean) {
if (value) {

View file

@ -34,7 +34,7 @@ export type WizardAction
| 'testLoginName'
/**
*
* Create a new LDAP configuration
*/
export async function createConfig() {
const response = await axios.post(generateOcsUrl('apps/user_ldap/api/v1/config')) as AxiosResponse<OCSResponse<{ configID: string }>>
@ -43,8 +43,9 @@ export async function createConfig() {
}
/**
* Copy an existing LDAP configuration
*
* @param configId
* @param configId - ID of the configuration to copy
*/
export async function copyConfig(configId: string) {
const params = new FormData()
@ -60,8 +61,9 @@ export async function copyConfig(configId: string) {
}
/**
* Get an LDAP configuration
*
* @param configId
* @param configId - ID of the configuration to fetch
*/
export async function getConfig(configId: string): Promise<LDAPConfig> {
const response = await axios.get(generateOcsUrl('apps/user_ldap/api/v1/config/{configId}', { configId })) as AxiosResponse<OCSResponse<LDAPConfig>>
@ -70,9 +72,10 @@ export async function getConfig(configId: string): Promise<LDAPConfig> {
}
/**
* Update an LDAP configuration
*
* @param configId
* @param config
* @param configId - ID of the configuration to update
* @param config - Partial configuration data to update
*/
export async function updateConfig(configId: string, config: Partial<LDAPConfig>): Promise<LDAPConfig> {
const response = await axios.put(
@ -86,8 +89,9 @@ export async function updateConfig(configId: string, config: Partial<LDAPConfig>
}
/**
* Delete an LDAP configuration
*
* @param configId
* @param configId - ID of the configuration to delete
*/
export async function deleteConfig(configId: string): Promise<boolean> {
try {
@ -110,8 +114,9 @@ export async function deleteConfig(configId: string): Promise<boolean> {
}
/**
* Test an LDAP configuration
*
* @param configId
* @param configId - ID of the configuration to test
*/
export async function testConfiguration(configId: string) {
const params = new FormData()
@ -124,8 +129,9 @@ export async function testConfiguration(configId: string) {
}
/**
* Clear LDAP mapping
*
* @param subject
* @param subject - 'user' or 'group'
*/
export async function clearMapping(subject: 'user' | 'group') {
const isConfirmed = await confirmOperation(
@ -152,10 +158,11 @@ export async function clearMapping(subject: 'user' | 'group') {
}
/**
* Call wizard action
*
* @param action
* @param configId
* @param extraParams
* @param action - The wizard action to call
* @param configId - ID of the configuration
* @param extraParams - Additional parameters for the wizard action
*/
export async function callWizard(action: WizardAction, configId: string, extraParams: Record<string, string> = {}) {
const params = new FormData()
@ -189,7 +196,7 @@ export async function callWizard(action: WizardAction, configId: string, extraPa
}
/**
*
* Show info dialog when enabling automatic filter mode
*/
export async function showEnableAutomaticFilterInfo() {
return await confirmOperation(
@ -199,9 +206,10 @@ export async function showEnableAutomaticFilterInfo() {
}
/**
* Show confirmation dialog for dangerous operations
*
* @param name
* @param text
* @param name - Dialog title
* @param text - Dialog text
*/
export async function confirmOperation(name: string, text: string): Promise<boolean> {
let result = false

View file

@ -17,9 +17,10 @@ export const useLDAPConfigsStore = defineStore('ldap-configs', () => {
const updatingConfig = ref(0)
/**
* Get a proxy for the LDAP configuration that automatically updates the backend on property set
*
* @param configId
* @param postSetHooks
* @param configId - ID of the configuration
* @param postSetHooks - Optional hooks to call after a property has been set
*/
function getConfigProxy<J>(configId: string, postSetHooks: Partial<Record<keyof LDAPConfig, (value: J) => void>> = {}) {
if (ldapConfigs.value[configId] === undefined) {
@ -49,7 +50,7 @@ export const useLDAPConfigsStore = defineStore('ldap-configs', () => {
}
/**
*
* Create a new LDAP configuration
*/
async function create() {
const configId = await createConfig()
@ -59,8 +60,9 @@ export const useLDAPConfigsStore = defineStore('ldap-configs', () => {
}
/**
* Copy an existing LDAP configuration
*
* @param fromConfigId
* @param fromConfigId - ID of the configuration to copy
*/
async function _copyConfig(fromConfigId: string) {
if (ldapConfigs.value[fromConfigId] === undefined) {
@ -75,8 +77,9 @@ export const useLDAPConfigsStore = defineStore('ldap-configs', () => {
}
/**
* Delete an LDAP configuration
*
* @param configId
* @param configId - ID of the configuration to delete
*/
async function removeConfig(configId: string) {
const result = await deleteConfig(configId)