Skip to content

Commit

Permalink
changed comment on function level
Browse files Browse the repository at this point in the history
  • Loading branch information
Son authored and Son committed Aug 30, 2023
1 parent 3bec6a4 commit c47e0fd
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ export interface IAccuracyCorrectionAndRetention {
describeRetention: string;
};
}

export interface AccuracyCorrectionAndRetentionProps {
showComments?: boolean;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import MDEditor from '@uiw/react-md-editor';
import { useContext, useEffect, useMemo, useState } from 'react';
import Messages from './helper/messages';
import { IAccuracyCorrectionAndRetention } from './accuracy-retention-interface';
import {
IAccuracyCorrectionAndRetention,
AccuracyCorrectionAndRetentionProps,
} from './accuracy-retention-interface';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
import { deepEqual } from '../../../../utils/object-comparison.util';
Expand All @@ -15,12 +18,8 @@ import ViewComments from '../../../common/ViewComment';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';
import Radio from '../../../common/Radio';

interface AccuracyCorrectionAndRetentionProps {
hideViewComments: boolean;
}

export const AccuracyCorrectionAndRetention = ({
hideViewComments,
showComments = true,
}: AccuracyCorrectionAndRetentionProps) => {
const {
pia,
Expand Down Expand Up @@ -279,7 +278,7 @@ export const AccuracyCorrectionAndRetention = ({
</p>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -498,7 +497,7 @@ export const AccuracyCorrectionAndRetention = ({
</p>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -694,7 +693,7 @@ export const AccuracyCorrectionAndRetention = ({
</div>
) : null
) : null}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ export interface IAdditionRisk extends Record<string, string> {
risk: string;
response: string;
}

export interface PIAAdditionalRisksProps {
showComments?: boolean;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useEffect, useMemo, useState } from 'react';
import Messages from './messages';
import { IAdditionalRisks } from './AdditionalRisks';
import { IAdditionalRisks, PIAAdditionalRisksProps } from './AdditionalRisks';
import { deepEqual } from '../../../../utils/object-comparison.util';
import { setNestedReactState } from '../../../../utils/object-modification.util';
import { Table } from '../../../common/Table';
Expand All @@ -12,11 +12,9 @@ import {
import ViewComments from '../../../common/ViewComment';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';

interface PIAAdditionalRisksProps {
hideViewComments: boolean;
}

const PIAAdditionalRisks = ({ hideViewComments }: PIAAdditionalRisksProps) => {
const PIAAdditionalRisks = ({
showComments = true,
}: PIAAdditionalRisksProps) => {
const {
pia,
commentCount,
Expand Down Expand Up @@ -84,7 +82,7 @@ const PIAAdditionalRisks = ({ hideViewComments }: PIAAdditionalRisksProps) => {
format="row"
readOnly={isReadOnly}
/>
{!hideViewComments && (
{showComments && (
<ViewComments
count={commentCount?.[PiaSections.ADDITIONAL_RISKS_RISKS]}
path={PiaSections.ADDITIONAL_RISKS_RISKS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ export interface IAgreementsAndInformationBanks {
export interface ITextInputProps {
pia: IPiaForm;
}

export interface PIAAgreementsAndInformationBanksProps {
showComments?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { useContext, useEffect, useMemo, useState } from 'react';
import Messages from './messages';
import InputText from '../../../common/InputText/InputText';
import MDEditor from '@uiw/react-md-editor';
import { IAgreementsAndInformationBanks } from './AgreementsAndInformationBanks';
import {
IAgreementsAndInformationBanks,
PIAAgreementsAndInformationBanksProps,
} from './AgreementsAndInformationBanks';
import CustomInputDate from '../../../common/CustomInputDate';
import { dateToString, stringToDate } from '../../../../utils/date';
import { deepEqual } from '../../../../utils/object-comparison.util';
Expand All @@ -18,12 +21,8 @@ import ViewComments from '../../../common/ViewComment';
import Radio from '../../../common/Radio';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';

interface PIAAgreementsAndInformationBanksProps {
hideViewComments: boolean;
}

const PIAAgreementsAndInformationBanks = ({
hideViewComments,
showComments = true,
}: PIAAgreementsAndInformationBanksProps) => {
const {
pia,
Expand Down Expand Up @@ -372,7 +371,7 @@ const PIAAgreementsAndInformationBanks = ({
</div>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -560,7 +559,7 @@ const PIAAgreementsAndInformationBanks = ({
)}
</div>
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ export interface CollectionNoticeInput {
drafterInput?: string;
mpoInput?: string;
}

export interface PIACollectionUseAndDisclosureProps {
showComments?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import Messages from './messages';
import MDEditor from '@uiw/react-md-editor';
import { isMPORole } from '../../../../utils/helper.util';

import { ICollectionUseAndDisclosure } from './CollectionUseAndDisclosure';
import {
ICollectionUseAndDisclosure,
PIACollectionUseAndDisclosureProps,
} from './CollectionUseAndDisclosure';
import { deepEqual } from '../../../../utils/object-comparison.util';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
Expand All @@ -18,13 +21,8 @@ import ViewComments from '../../../common/ViewComment';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';
import { TextInputEnum } from '../../../../constant/constant';

// Define the prop type for hideViewComments
interface PIACollectionUseAndDisclosureProps {
hideViewComments: boolean;
}

const PIACollectionUseAndDisclosure = ({
hideViewComments,
showComments = true,
}: PIACollectionUseAndDisclosureProps) => {
const {
pia,
Expand Down Expand Up @@ -121,7 +119,7 @@ const PIACollectionUseAndDisclosure = ({
addRowBtnLabel="Add more steps"
format="row"
/>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[PiaSections.COLLECTION_USE_AND_DISCLOSURE_STEPS]
Expand Down Expand Up @@ -245,7 +243,7 @@ const PIACollectionUseAndDisclosure = ({
)}
</div>
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import MDEditor from '@uiw/react-md-editor';
import { useContext, useEffect, useMemo, useState } from 'react';
import Messages from './helper/messages';
import { ISecurityPersonalInformation } from './security-personal-info-interface';
import {
ISecurityPersonalInformation,
SecurityPersonalInformationProps,
} from './security-personal-info-interface';
import Checkbox from '../../../common/Checkbox';
import { deepEqual } from '../../../../utils/object-comparison.util';
import { YesNoInput } from '../../../../types/enums/yes-no.enum';
Expand All @@ -16,12 +19,8 @@ import ViewComments from '../../../common/ViewComment';
import Radio from '../../../common/Radio';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';

interface SecurityPersonalInformationProps {
hideViewComments: boolean;
}

export const SecurityPersonalInformation = ({
hideViewComments,
showComments = true,
}: SecurityPersonalInformationProps) => {
const {
pia,
Expand Down Expand Up @@ -337,7 +336,7 @@ export const SecurityPersonalInformation = ({
</p>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -435,7 +434,7 @@ export const SecurityPersonalInformation = ({
)}
</div>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -582,7 +581,7 @@ export const SecurityPersonalInformation = ({
</p>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ export interface ISecurityPersonalInformation {
additionalStrategies: string;
};
}

export interface SecurityPersonalInformationProps {
showComments?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { YesNoInput } from '../../../../types/enums/yes-no.enum';
import { isMPORole } from '../../../../utils/helper.util';
import { deepEqual } from '../../../../utils/object-comparison.util';
import Radio from '../../../common/Radio';
import { IStoringPersonalInformation } from './interfaces';
import {
IStoringPersonalInformation,
StoringPersonalInformationProps,
} from './interfaces';
import Messages from './messages';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
Expand All @@ -19,12 +22,8 @@ import ViewComments from '../../../common/ViewComment';
import { PiaSections } from '../../../../types/enums/pia-sections.enum';
import Callout from '../../../common/Callout';

interface StoringPersonalInformationProps {
hideViewComments: boolean;
}

const StoringPersonalInformation = ({
hideViewComments,
showComments = true,
}: StoringPersonalInformationProps) => {
const {
pia,
Expand Down Expand Up @@ -396,7 +395,7 @@ const StoringPersonalInformation = ({
)}
</div>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -518,7 +517,7 @@ const StoringPersonalInformation = ({
)}
</div>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -766,7 +765,7 @@ const StoringPersonalInformation = ({
</p>
)}
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -859,7 +858,7 @@ const StoringPersonalInformation = ({
<i>Not answered</i>
</p>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -923,7 +922,7 @@ const StoringPersonalInformation = ({
<i>Not answered</i>
</p>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -985,7 +984,7 @@ const StoringPersonalInformation = ({
<i>Not answered</i>
</p>
)}
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down Expand Up @@ -1041,7 +1040,7 @@ const StoringPersonalInformation = ({
readOnly={isReadOnly}
/>
</div>
{!hideViewComments && (
{showComments && (
<ViewComments
count={
commentCount?.[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ export interface IStoringPersonalInformation {
};
};
}

export interface StoringPersonalInformationProps {
showComments?: boolean;
}
Loading

0 comments on commit c47e0fd

Please sign in to comment.