Skip to content

Commit

Permalink
119602: Update doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AAwouters committed Nov 25, 2024
1 parent deb4a63 commit c38352e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/accessibility/accessibility-settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,22 @@ export const ACCESSIBILITY_SETTINGS_METADATA_KEY = 'dspace.accessibility.setting

/**
* Enum containing all possible accessibility settings.
* When adding new settings, the {@link AccessibilitySettingsService#getInputType} method and the i18n keys for the
* accessibility settings page should be updated.
* When adding new settings, make sure to add the new setting to the accessibility-settings component.
* The converter methods to convert from stored format to form format (and vice-versa) need to be updated as well.
*/
export enum AccessibilitySetting {
NotificationTimeOut = 'notificationTimeOut',
LiveRegionTimeOut = 'liveRegionTimeOut',
}

/**
* Type representing an object that contains accessibility settings values.
*/
export type AccessibilitySettings = { [key in AccessibilitySetting]?: string };

/**
* The accessibility settings object format used by the accessibility-settings component form.
*/
export interface AccessibilitySettingsFormValues {
disableNotificationTimeOut: boolean,
notificationTimeOut: string,
Expand Down Expand Up @@ -226,6 +232,10 @@ export class AccessibilitySettingsService {
return this.setSettingsInAuthenticatedUserMetadata({});
}

/**
* Retrieve the placeholder to be used for the provided AccessibilitySetting.
* Returns an empty string when no placeholder is specified for the provided setting.
*/
getPlaceholder(setting: AccessibilitySetting): string {
switch (setting) {
case AccessibilitySetting.NotificationTimeOut:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { take } from 'rxjs';
import { NotificationsService } from '../../shared/notifications/notifications.service';
import { TranslateService } from '@ngx-translate/core';

/**
* Component providing the form where users can update accessibility settings.
*/
@Component({
selector: 'ds-accessibility-settings',
templateUrl: './accessibility-settings.component.html'
Expand Down

0 comments on commit c38352e

Please sign in to comment.