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 4, 2024
1 parent 2d20775 commit 613e837
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions web/src/components/storage/ProposalSettingsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@
* 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";

import { sprintf } from "sprintf-js";
import { _ } from "~/i18n";
import { BootSelectionDialog, ProposalVolumes, ProposalSpacePolicyField } from "~/components/storage";
import { _, n_ } from "~/i18n";
import { BootSelectionDialog, ProposalVolumes, SpacePolicyDialog } from "~/components/storage";
import { If, PasswordAndConfirmationInput, Section, Popup } from "~/components/core";
import { Icon } from "~/components/layout";
import { noop } from "~/utils";
import { hasFS, deviceLabel } from "~/components/storage/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 613e837

Please sign in to comment.