Skip to content

Commit

Permalink
web: Check types for ProposalSettingsSection
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Apr 8, 2024
1 parent 0a4cdeb commit 6dd7cf6
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions web/src/components/storage/ProposalSettingsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* find current contact information at www.suse.com.
*/

// @ts-check

import React, { useEffect, useState } from "react";
import { Button, Checkbox, Form, Skeleton, Switch, Tooltip } from "@patternfly/react-core";

Expand All @@ -31,9 +33,11 @@ import { noop } from "~/utils";
import { hasFS, deviceLabel, SPACE_POLICIES } from "~/components/storage/utils";

/**
* @typedef {import ("~/client/storage").ProposalManager.ProposalSettings} ProposalSettings
* @typedef {import ("~/client/storage").DevicesManager.StorageDevice} StorageDevice
* @typedef {import ("~/client/storage").ProposalManager.Volume} Volume
* @typedef {import ("~/client/storage").ProposalSettings} ProposalSettings
* @typedef {import ("~/client/storage").SpaceAction} SpaceAction
* @typedef {import ("~/components/storage/utils").SpacePolicy} SpacePolicy
* @typedef {import ("~/client/storage").StorageDevice} StorageDevice
* @typedef {import ("~/client/storage").Volume} Volume
*/

/**
Expand Down Expand Up @@ -116,10 +120,11 @@ const EncryptionSettingsForm = ({
*
* @param {object} props
* @param {ProposalSettings} props.settings - Settings used for calculating a proposal.
* @param {onChangeFn} [props.onChange=noop] - On change callback
* @param {(config: SnapshotsConfig) => void} [props.onChange=noop] - On change callback
*
* @callback onChangeFn
* @param {object} settings
* @typedef {object} SnapshotsConfig
* @property {boolean} active
* @property {ProposalSettings} settings
*/
const SnapshotsField = ({
settings,
Expand Down Expand Up @@ -406,10 +411,9 @@ const SpacePolicyField = ({
* @param {ProposalSettings} props.settings
* @param {StorageDevice[]} [props.availableDevices=[]]
* @param {String[]} [props.encryptionMethods=[]]
* @param {onChangeFn} [props.onChange=noop]
*
* @callback onChangeFn
* @param {object} settings
* @param {Volume[]} [props.volumeTemplates=[]]
* @param {boolean} [props.isLoading=false]
* @param {(settings: object) => void} [props.onChange=noop]
*/
export default function ProposalSettingsSection({
settings,
Expand Down

0 comments on commit 6dd7cf6

Please sign in to comment.