Skip to content

Commit

Permalink
add proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasmatus committed Aug 24, 2023
1 parent 9851e29 commit 7d1520d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/deploymentModals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import React, { useState } from 'react';
import PropTypes from "prop-types";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import PropTypes.

import cockpit from 'cockpit';

Expand Down
12 changes: 12 additions & 0 deletions src/ostree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ const OStreeStatus = ({ ostreeState, versions }) => {
);
};

OStreeStatus.propTypes = {
ostreeState: PropTypes.object.isRequired,
versions: PropTypes.array.isRequired,
};

const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRemoteOrigin }) => {
const Dialogs = useDialogs();
const [isKebabOpen, setKebabOpen] = useState(false);
Expand Down Expand Up @@ -576,6 +581,13 @@ const OStreeSource = ({ ostreeState, refreshRemotes, onChangeBranch, onChangeRem
);
};

OStreeSource.propTypes = {
ostreeState: PropTypes.object.isRequired,
refreshRemotes: PropTypes.func.isRequired,
onChangeBranch: PropTypes.func.isRequired,
onChangeRemoteOrigin: PropTypes.func.isRequired,
};

/**
* Main application
*/
Expand Down
25 changes: 25 additions & 0 deletions src/repositoryModals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import React, { useEffect, useState } from 'react';
import PropTypes from "prop-types";

import cockpit from 'cockpit';

Expand Down Expand Up @@ -105,6 +106,12 @@ export const RemoveRepositoryModal = ({ origin, availableRemotes, refreshRemotes
);
};

RemoveRepositoryModal.propTypes = {
origin: PropTypes.object.isRequired,
availableRemotes: PropTypes.array.isRequired,
refreshRemotes: PropTypes.func.isRequired,
};

export const AddRepositoryModal = ({ refreshRemotes }) => {
const Dialogs = useDialogs();
const [newRepoName, setNewRepoName] = useState("");
Expand Down Expand Up @@ -191,6 +198,10 @@ export const AddRepositoryModal = ({ refreshRemotes }) => {
);
};

AddRepositoryModal.propTypes = {
refreshRemotes: PropTypes.func.isRequired,
};

export const EditRepositoryModal = ({ remote, availableRemotes }) => {
const Dialogs = useDialogs();
const [addAnotherKey, setAddAnotherKey] = useState(false);
Expand Down Expand Up @@ -290,6 +301,11 @@ export const EditRepositoryModal = ({ remote, availableRemotes }) => {
);
};

EditRepositoryModal.propTypes = {
remote: PropTypes.string.isRequired,
availableRemotes: PropTypes.array.isRequired,
};

export const RebaseRepositoryModal = ({ origin, availableRemotes, currentOriginBranches, currentBranchLoadError, onChangeBranch, onChangeRemoteOrigin }) => {
const Dialogs = useDialogs();
const [isSelectRemoteExpanded, setSelectRemoteExpanded] = useState(false);
Expand Down Expand Up @@ -409,3 +425,12 @@ export const RebaseRepositoryModal = ({ origin, availableRemotes, currentOriginB
</Modal>
);
};

RebaseRepositoryModal.propTypes = {
origin: PropTypes.object.isRequired,
availableRemotes: PropTypes.array.isRequired,
currentOriginBranches: PropTypes.array,
currentBranchLoadError: PropTypes.string,
onChangeBranch: PropTypes.func.isRequired,
onChangeRemoteOrigin: PropTypes.func.isRequired,
};

0 comments on commit 7d1520d

Please sign in to comment.