From e267aefe01b53e88e91b98eb3fc218fa824099af Mon Sep 17 00:00:00 2001 From: "tdring@ford.com" Date: Mon, 18 Dec 2023 13:16:48 -0500 Subject: [PATCH] Mark the props of the component as read-only. (non-standard props) --- .../ArchivedBoardColumn/ArchivedBoardColumn.tsx | 6 ++++-- .../FeedbackForm/FeedbackStars/FeedbackStars.tsx | 2 +- .../AddActionItem/AddActionItem.tsx | 2 +- .../AccountTab/AddBoardOwnersForm/AddBoardOwnersForm.tsx | 2 +- ui/src/Assets/CheckedCheckboxIcon.tsx | 2 +- ui/src/Common/AuthTemplate/Form/Form.tsx | 2 +- ui/src/Common/ColumnHeader/ColumnHeader.tsx | 2 +- .../Common/ColumnItem/DeleteColumnItem/DeleteColumnItem.tsx | 2 +- ui/src/Common/CountSeparator/CountSeparator.tsx | 2 +- ui/src/Common/DateCreated/DateCreated.tsx | 2 +- .../HorizontalRuleWithText/HorizontalRuleWithText.tsx | 4 +++- ui/src/Common/UpvoteCount/UpvoteCount.tsx | 2 +- 12 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ui/src/App/Team/Archives/ThoughtArchives/ArchivedBoard/ArchivedBoardColumn/ArchivedBoardColumn.tsx b/ui/src/App/Team/Archives/ThoughtArchives/ArchivedBoard/ArchivedBoardColumn/ArchivedBoardColumn.tsx index ad2386125..1945b6c4a 100644 --- a/ui/src/App/Team/Archives/ThoughtArchives/ArchivedBoard/ArchivedBoardColumn/ArchivedBoardColumn.tsx +++ b/ui/src/App/Team/Archives/ThoughtArchives/ArchivedBoard/ArchivedBoardColumn/ArchivedBoardColumn.tsx @@ -34,7 +34,9 @@ interface ThoughtProps { thought: Thought; } -function ArchivedBoardThought({ thought }: ThoughtProps): React.ReactElement { +function ArchivedBoardThought({ + thought, +}: Readonly): React.ReactElement { return (
  • {thought.message}

    @@ -51,7 +53,7 @@ function ArchivedBoardThought({ thought }: ThoughtProps): React.ReactElement { function ArchivedBoardColumn({ column, thoughts, -}: ColumnProps): React.ReactElement { +}: Readonly): React.ReactElement { return (
    diff --git a/ui/src/App/Team/Retro/RetroSubheader/FeedbackForm/FeedbackStars/FeedbackStars.tsx b/ui/src/App/Team/Retro/RetroSubheader/FeedbackForm/FeedbackStars/FeedbackStars.tsx index 685b48491..7afb94704 100644 --- a/ui/src/App/Team/Retro/RetroSubheader/FeedbackForm/FeedbackStars/FeedbackStars.tsx +++ b/ui/src/App/Team/Retro/RetroSubheader/FeedbackForm/FeedbackStars/FeedbackStars.tsx @@ -25,7 +25,7 @@ type FeedbackStarsProps = { onChange: (stars: number) => void; }; -function FeedbackStars(props: FeedbackStarsProps) { +function FeedbackStars(props: Readonly) { const { value, onChange } = props; const [hoveredStarValue, setHoveredStarValue] = useState(-1); diff --git a/ui/src/App/Team/Retro/ThoughtsColumn/ThoughtItemWithAddAction/AddActionItem/AddActionItem.tsx b/ui/src/App/Team/Retro/ThoughtsColumn/ThoughtItemWithAddAction/AddActionItem/AddActionItem.tsx index e4bbfa1c9..2bf4d5e01 100644 --- a/ui/src/App/Team/Retro/ThoughtsColumn/ThoughtItemWithAddAction/AddActionItem/AddActionItem.tsx +++ b/ui/src/App/Team/Retro/ThoughtsColumn/ThoughtItemWithAddAction/AddActionItem/AddActionItem.tsx @@ -39,7 +39,7 @@ type AddActionItemProps = { hideComponentCallback: () => void; }; -function AddActionItem(props: AddActionItemProps) { +function AddActionItem(props: Readonly) { const { hideComponentCallback, thoughtId } = props; const team = useRecoilValue(TeamState); diff --git a/ui/src/App/Team/TeamHeader/Settings/AccountTab/AddBoardOwnersForm/AddBoardOwnersForm.tsx b/ui/src/App/Team/TeamHeader/Settings/AccountTab/AddBoardOwnersForm/AddBoardOwnersForm.tsx index 2127b7751..a6d133401 100644 --- a/ui/src/App/Team/TeamHeader/Settings/AccountTab/AddBoardOwnersForm/AddBoardOwnersForm.tsx +++ b/ui/src/App/Team/TeamHeader/Settings/AccountTab/AddBoardOwnersForm/AddBoardOwnersForm.tsx @@ -37,7 +37,7 @@ export interface AddBoardOwnersFormProps { email2?: string; } -function AddBoardOwnersForm(props: AddBoardOwnersFormProps) { +function AddBoardOwnersForm(props: Readonly) { const { email1 = '', email2 = '' } = props; const setModalContents = useSetRecoilState(ModalContentsState); diff --git a/ui/src/Assets/CheckedCheckboxIcon.tsx b/ui/src/Assets/CheckedCheckboxIcon.tsx index 26764e09b..3c337f67c 100644 --- a/ui/src/Assets/CheckedCheckboxIcon.tsx +++ b/ui/src/Assets/CheckedCheckboxIcon.tsx @@ -20,7 +20,7 @@ interface Props { className?: string; } -function CheckedCheckboxIcon({ color, className }: Props) { +function CheckedCheckboxIcon({ color, className }: Readonly) { return ( { disableSubmitBtn?: boolean; } -function Form(props: FormProps): React.ReactElement { +function Form(props: Readonly): React.ReactElement { const { onSubmit, errorMessages = [], diff --git a/ui/src/Common/ColumnHeader/ColumnHeader.tsx b/ui/src/Common/ColumnHeader/ColumnHeader.tsx index 76d070162..8eb0f6d89 100644 --- a/ui/src/Common/ColumnHeader/ColumnHeader.tsx +++ b/ui/src/Common/ColumnHeader/ColumnHeader.tsx @@ -33,7 +33,7 @@ interface ColumnHeaderProps extends HTMLAttributes { onTitleChange?(title: string): void; } -function ColumnHeader(props: ColumnHeaderProps): React.ReactElement { +function ColumnHeader(props: Readonly): React.ReactElement { const { initialTitle = '', type = '', diff --git a/ui/src/Common/ColumnItem/DeleteColumnItem/DeleteColumnItem.tsx b/ui/src/Common/ColumnItem/DeleteColumnItem/DeleteColumnItem.tsx index 103fc49c0..e8ef2233c 100644 --- a/ui/src/Common/ColumnItem/DeleteColumnItem/DeleteColumnItem.tsx +++ b/ui/src/Common/ColumnItem/DeleteColumnItem/DeleteColumnItem.tsx @@ -34,7 +34,7 @@ interface DeletionOverlayProps { className?: string; } -function DeleteColumnItem(props: DeletionOverlayProps) { +function DeleteColumnItem(props: Readonly) { const { onConfirm, onCancel, children, height, className } = props; const cancelButtonRef = useRef(null); diff --git a/ui/src/Common/CountSeparator/CountSeparator.tsx b/ui/src/Common/CountSeparator/CountSeparator.tsx index e6eb1eebe..a84e70efa 100644 --- a/ui/src/Common/CountSeparator/CountSeparator.tsx +++ b/ui/src/Common/CountSeparator/CountSeparator.tsx @@ -23,7 +23,7 @@ interface SeparatorProps extends HTMLAttributes { count: number; } -function CountSeparator(props: SeparatorProps): ReactElement { +function CountSeparator(props: Readonly): ReactElement { const { count, ...divProps } = props; return (
    diff --git a/ui/src/Common/DateCreated/DateCreated.tsx b/ui/src/Common/DateCreated/DateCreated.tsx index 36a48fb72..706382210 100644 --- a/ui/src/Common/DateCreated/DateCreated.tsx +++ b/ui/src/Common/DateCreated/DateCreated.tsx @@ -28,7 +28,7 @@ type DateCreatedProps = { className?: string; }; -export function DateCreated(props: DateCreatedProps) { +export function DateCreated(props: Readonly) { const { date, className, disabled = false, readOnly = false } = props; return ( diff --git a/ui/src/Common/HorizontalRuleWithText/HorizontalRuleWithText.tsx b/ui/src/Common/HorizontalRuleWithText/HorizontalRuleWithText.tsx index 18e717fbd..357d652b7 100644 --- a/ui/src/Common/HorizontalRuleWithText/HorizontalRuleWithText.tsx +++ b/ui/src/Common/HorizontalRuleWithText/HorizontalRuleWithText.tsx @@ -23,7 +23,9 @@ interface RuleProps { text: string; } -function HorizontalRuleWithText(props: RuleProps): React.ReactElement { +function HorizontalRuleWithText( + props: Readonly +): React.ReactElement { const { text } = props; return (
    diff --git a/ui/src/Common/UpvoteCount/UpvoteCount.tsx b/ui/src/Common/UpvoteCount/UpvoteCount.tsx index 5de84e99f..4077094d8 100644 --- a/ui/src/Common/UpvoteCount/UpvoteCount.tsx +++ b/ui/src/Common/UpvoteCount/UpvoteCount.tsx @@ -23,7 +23,7 @@ interface Props { votes: number; } -function UpvoteCount({ votes }: Props): React.ReactElement { +function UpvoteCount({ votes }: Readonly): React.ReactElement { return (