[Cases] Fix missing displayName for some react components (#123460)

This commit is contained in:
Esteban Beltran 2022-01-20 20:21:08 +01:00 committed by GitHub
parent 855bfd30d1
commit 77d633fd53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 65 additions and 3 deletions

View file

@ -43,6 +43,7 @@ const TestProvidersComponent: React.FC<Props> = ({
</I18nProvider>
);
};
TestProvidersComponent.displayName = 'TestProviders';
export const TestProviders = React.memo(TestProvidersComponent);

View file

@ -456,3 +456,4 @@ export const ExternalServiceColumn: React.FC<Props> = ({ theCase, connectors })
</p>
);
};
ExternalServiceColumn.displayName = 'ExternalServiceColumn';

View file

@ -56,3 +56,4 @@ export const Count: FunctionComponent<CountProps> = ({ refresh }) => {
</EuiFlexGroup>
);
};
Count.displayName = 'Count';

View file

@ -64,3 +64,4 @@ export const CasesTableHeader: FunctionComponent<Props> = ({
</EuiFlexGroup>
</HeaderPage>
);
CasesTableHeader.displayName = 'CasesTableHeader';

View file

@ -33,6 +33,7 @@ export const AllCases: React.FC = () => {
</>
);
};
AllCases.displayName = 'AllCases';
// eslint-disable-next-line import/no-default-export
export { AllCases as default };

View file

@ -64,3 +64,4 @@ export const NavButtons: FunctionComponent<Props> = ({ actionsErrors }) => {
</ButtonFlexGroup>
);
};
NavButtons.displayName = 'NavButtons';

View file

@ -50,5 +50,6 @@ const StatusFilterComponent: React.FC<Props> = ({
/>
);
};
StatusFilterComponent.displayName = 'StatusFilter';
export const StatusFilter = memo(StatusFilterComponent);

View file

@ -164,3 +164,4 @@ export const CasesTable: FunctionComponent<CasesTableProps> = ({
</Div>
);
};
CasesTable.displayName = 'CasesTable';

View file

@ -161,3 +161,4 @@ export const CasesTableUtilityBar: FunctionComponent<Props> = ({
</UtilityBar>
);
};
CasesTableUtilityBar.displayName = 'CasesTableUtilityBar';

View file

@ -98,5 +98,6 @@ const CasesRoutesComponent: React.FC<CasesRoutesProps> = ({
</Switch>
);
};
CasesRoutesComponent.displayName = 'CasesRoutes';
export const CasesRoutes = React.memo(CasesRoutesComponent);

View file

@ -64,5 +64,6 @@ const ActionsComponent: React.FC<CaseViewActions> = ({ caseData, currentExternal
</>
);
};
ActionsComponent.displayName = 'Actions';
export const Actions = React.memo(ActionsComponent);

View file

@ -164,5 +164,6 @@ const CaseActionBarComponent: React.FC<CaseActionBarProps> = ({
</EuiFlexGroup>
);
};
CaseActionBarComponent.displayName = 'CaseActionBar';
export const CaseActionBar = React.memo(CaseActionBarComponent);

View file

@ -69,5 +69,6 @@ const StatusContextMenuComponent: React.FC<Props> = ({
</EuiPopover>
);
};
StatusContextMenuComponent.displayName = 'StatusContextMenu';
export const StatusContextMenu = memo(StatusContextMenuComponent);

View file

@ -61,6 +61,7 @@ export const CasesProvider: React.FC<{ value: CasesContextProps }> = ({
<CasesContext.Provider value={value}>{children}</CasesContext.Provider>
) : null;
};
CasesProvider.displayName = 'CasesProvider';
function isCasesContextValue(value: CasesContextStateValue): value is CasesContextValue {
return value.appId != null && value.appTitle != null && value.userCanCrud != null;

View file

@ -48,5 +48,6 @@ const ClosureOptionsComponent: React.FC<ClosureOptionsProps> = ({
</EuiFormRow>
</EuiDescribedFormGroup>
);
ClosureOptionsComponent.displayName = 'ClosureOptions';
export const ClosureOptions = React.memo(ClosureOptionsComponent);

View file

@ -56,5 +56,6 @@ const ClosureOptionsRadioComponent: React.FC<ClosureOptionsRadioComponentProps>
/>
);
};
ClosureOptionsRadioComponent.displayName = 'ClosureOptionsRadio';
export const ClosureOptionsRadio = React.memo(ClosureOptionsRadioComponent);

View file

@ -131,5 +131,6 @@ const ConnectorsComponent: React.FC<Props> = ({
</>
);
};
ConnectorsComponent.displayName = 'Connectors';
export const Connectors = React.memo(ConnectorsComponent);

View file

@ -139,5 +139,6 @@ const ConnectorsDropdownComponent: React.FC<Props> = ({
/>
);
};
ConnectorsDropdownComponent.displayName = 'ConnectorsDropdown';
export const ConnectorsDropdown = React.memo(ConnectorsDropdownComponent);

View file

@ -62,5 +62,6 @@ const FieldMappingComponent: React.FC<FieldMappingProps> = ({
</EuiFlexGroup>
) : null;
};
FieldMappingComponent.displayName = 'FieldMapping';
export const FieldMapping = React.memo(FieldMappingComponent);

View file

@ -57,5 +57,6 @@ const FieldMappingRowComponent: React.FC<RowProps> = ({
</EuiFlexGroup>
);
};
FieldMappingRowComponent.displayName = 'FieldMappingRow';
export const FieldMappingRowStatic = React.memo(FieldMappingRowComponent);

View file

@ -56,5 +56,6 @@ const MappingComponent: React.FC<MappingProps> = ({ actionTypeName, isLoading, m
</EuiFlexGroup>
);
};
MappingComponent.displayName = 'Mapping';
export const Mapping = React.memo(MappingComponent);

View file

@ -42,5 +42,6 @@ const ConfirmDeleteCaseModalComp: React.FC<ConfirmDeleteCaseModalProps> = ({
</EuiConfirmModal>
);
};
ConfirmDeleteCaseModalComp.displayName = 'ConfirmDeleteCaseModalComp';
export const ConfirmDeleteCaseModal = React.memo(ConfirmDeleteCaseModalComp);

View file

@ -76,3 +76,4 @@ export const ConnectorSelector = ({
</EuiFormRowWrapper>
) : null;
};
ConnectorSelector.displayName = 'ConnectorSelector';

View file

@ -77,5 +77,6 @@ const ConnectorCardDisplay: React.FC<ConnectorCardProps> = ({
</>
);
};
ConnectorCardDisplay.displayName = 'ConnectorCardDisplay';
export const ConnectorCard = memo(ConnectorCardDisplay);

View file

@ -103,6 +103,7 @@ const CaseParamsFields: React.FunctionComponent<ActionParamsProps<CaseActionPara
</Container>
);
};
CaseParamsFields.displayName = 'CaseParamsFields';
// eslint-disable-next-line import/no-default-export
export { CaseParamsFields as default };

View file

@ -69,5 +69,6 @@ const CasesDropdownComponent: React.FC<CaseDropdownProps> = ({
</EuiFormRow>
);
};
CasesDropdownComponent.displayName = 'CasesDropdown';
export const CasesDropdown = memo(CasesDropdownComponent);

View file

@ -77,5 +77,6 @@ const ExistingCaseComponent: React.FC<ExistingCaseProps> = ({ onCaseChanged, sel
</>
);
};
ExistingCaseComponent.displayName = 'ExistingCase';
export const ExistingCase = memo(ExistingCaseComponent);

View file

@ -37,5 +37,6 @@ const DeprecatedCalloutComponent: React.FC<Props> = ({ type = 'warning' }) => (
{DEPRECATED_CONNECTOR_WARNING_DESC}
</EuiCallOut>
);
DeprecatedCalloutComponent.displayName = 'DeprecatedCallout';
export const DeprecatedCallout = React.memo(DeprecatedCalloutComponent);

View file

@ -51,5 +51,6 @@ const ConnectorFieldsFormComponent: React.FC<Props> = ({ connector, isEdit, onCh
</>
);
};
ConnectorFieldsFormComponent.displayName = 'ConnectorFieldsForm';
export const ConnectorFieldsForm = memo(ConnectorFieldsFormComponent);

View file

@ -209,6 +209,7 @@ const JiraFieldsComponent: React.FunctionComponent<ConnectorFieldsProps<JiraFiel
/>
);
};
JiraFieldsComponent.displayName = 'JiraFields';
// eslint-disable-next-line import/no-default-export
export { JiraFieldsComponent as default };

View file

@ -92,5 +92,6 @@ const SearchIssuesComponent: React.FC<Props> = ({ selectedValue, actionConnector
/>
);
};
SearchIssuesComponent.displayName = 'SearchIssues';
export const SearchIssues = memo(SearchIssuesComponent);

View file

@ -43,6 +43,7 @@ const SwimlaneComponent: React.FunctionComponent<ConnectorFieldsProps<SwimlaneFi
</>
);
};
SwimlaneComponent.displayName = 'Swimlane';
// eslint-disable-next-line import/no-default-export
export { SwimlaneComponent as default };

View file

@ -64,6 +64,7 @@ const ConnectorFields = ({
/>
);
};
ConnectorFields.displayName = 'ConnectorFields';
const ConnectorComponent: React.FC<Props> = ({
connectors,

View file

@ -101,6 +101,7 @@ const OwnerSelector = ({
</EuiFormRow>
);
};
OwnerSelector.displayName = 'OwnerSelector';
const CaseOwnerSelector: React.FC<Props> = ({ availableOwners, isLoading }) => {
return (

View file

@ -27,5 +27,6 @@ const SubmitCaseButtonComponent: React.FC = () => {
</EuiButton>
);
};
SubmitCaseButtonComponent.displayName = 'SubmitCaseButton';
export const SubmitCaseButton = memo(SubmitCaseButtonComponent);

View file

@ -142,6 +142,7 @@ export const FormattedRelativePreferenceDate = ({ value }: { value?: string | nu
</LocalizedDateTooltip>
);
};
FormattedRelativePreferenceDate.displayName = 'FormattedRelativePreferenceDate';
/**
* Renders a preceding label according to under/over one hour

View file

@ -9,7 +9,7 @@ exports[`EditableTitle it renders 1`] = `
<EuiFlexItem
grow={false}
>
<Memo(TitleComponent)
<Memo(Title)
title="Test title"
/>
</EuiFlexItem>

View file

@ -8,7 +8,7 @@ exports[`HeaderPage it renders 1`] = `
alignItems="center"
>
<FlexItem>
<Memo(TitleComponent)
<Memo(Title)
badgeOptions={
Object {
"beta": true,

View file

@ -7,7 +7,7 @@ exports[`Title it renders 1`] = `
<h1
data-test-subj="header-page-title"
>
<Memo(TruncatedTextComponent)
<Memo(TruncatedText)
text="Test title"
/>

View file

@ -134,5 +134,6 @@ const EditableTitleComponent: React.FC<EditableTitleProps> = ({
</EuiFlexGroup>
);
};
EditableTitleComponent.displayName = 'EditableTitle';
export const EditableTitle = React.memo(EditableTitleComponent);

View file

@ -127,5 +127,6 @@ const HeaderPageComponent: React.FC<HeaderPageProps> = ({
</Header>
);
};
HeaderPageComponent.displayName = 'HeaderPage';
export const HeaderPage = React.memo(HeaderPageComponent);

View file

@ -52,5 +52,6 @@ const TitleComponent: React.FC<Props> = ({ title, badgeOptions }) => (
</h1>
</EuiTitle>
);
TitleComponent.displayName = 'Title';
export const Title = React.memo(TitleComponent);

View file

@ -31,5 +31,6 @@ const MarkdownLinkComponent: React.FC<MarkdownLinkProps> = ({
</EuiLink>
</EuiToolTip>
);
MarkdownLinkComponent.displayName = 'MarkdownLink';
export const MarkdownLink = memo(MarkdownLinkComponent);

View file

@ -375,6 +375,7 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({
</ModalContainer>
);
};
LensEditorComponent.displayName = 'LensEditor';
export const LensEditor = React.memo(LensEditorComponent);

View file

@ -55,5 +55,6 @@ const LensMarkDownRendererComponent: React.FC<LensMarkDownRendererProps> = ({
</Container>
);
};
LensMarkDownRendererComponent.displayName = 'LensMarkDownRenderer';
export const LensMarkDownRenderer = React.memo(LensMarkDownRendererComponent);

View file

@ -46,5 +46,6 @@ const MarkdownRendererComponent: React.FC<Props> = ({ children, disableLinks })
</EuiMarkdownFormat>
);
};
MarkdownRendererComponent.displayName = 'MarkdownRenderer';
export const MarkdownRenderer = memo(MarkdownRendererComponent);

View file

@ -91,3 +91,4 @@ export const RecentCasesComp = ({ filterOptions, maxCasesToShow }: RecentCasesPr
</>
);
};
RecentCasesComp.displayName = 'RecentCasesComp';

View file

@ -42,4 +42,5 @@ const StatusActionButtonComponent: React.FC<Props> = ({ status, onStatusChanged,
</EuiButton>
);
};
StatusActionButtonComponent.displayName = 'StatusActionButton';
export const StatusActionButton = memo(StatusActionButtonComponent);

View file

@ -46,5 +46,6 @@ const StatusComponent: React.FC<Props> = ({
</EuiBadge>
);
};
StatusComponent.displayName = 'Status';
export const Status = memo(StatusComponent);

View file

@ -30,5 +30,6 @@ const TagsComponent: React.FC<TagsProps> = ({ tags, color = 'default', gutterSiz
)}
</>
);
TagsComponent.displayName = 'Tags';
export const Tags = memo(TagsComponent);

View file

@ -26,5 +26,6 @@ interface Props {
const TruncatedTextComponent: React.FC<Props> = ({ text }) => {
return <Text title={text}>{text}</Text>;
};
TruncatedTextComponent.displayName = 'TruncatedText';
export const TruncatedText = React.memo(TruncatedTextComponent);

View file

@ -40,6 +40,7 @@ const CreateModalComponent: React.FC<CreateCaseModalProps> = ({
</EuiModalBody>
</EuiModal>
) : null;
CreateModalComponent.displayName = 'CreateModal';
export const CreateCaseModal = memo(CreateModalComponent);

View file

@ -68,5 +68,6 @@ const CallOutComponent = ({
</EuiCallOut>
) : null;
};
CallOutComponent.displayName = 'CallOut';
export const CallOut = memo(CallOutComponent);

View file

@ -89,5 +89,6 @@ const CaseCallOutComponent = ({
</>
);
};
CaseCallOutComponent.displayName = 'CaseCallOut';
export const CaseCallOut = memo(CaseCallOutComponent);

View file

@ -20,5 +20,6 @@ const UserActionAvatarComponent = ({ username, fullName, size = 'm' }: UserActio
const avatarName = fullName && fullName.length > 0 ? fullName : username ?? i18n.UNKNOWN;
return <EuiAvatar name={avatarName} data-test-subj={`user-action-avatar`} size={size} />;
};
UserActionAvatarComponent.displayName = 'UserActionAvatar';
export const UserActionAvatar = memo(UserActionAvatarComponent);

View file

@ -34,5 +34,6 @@ const UserActionUsernameWithAvatarComponent = ({
</EuiFlexItem>
</EuiFlexGroup>
);
UserActionUsernameWithAvatarComponent.displayName = 'UserActionUsernameWithAvatar';
export const UserActionUsernameWithAvatar = memo(UserActionUsernameWithAvatarComponent);

View file

@ -63,5 +63,6 @@ const AlertCommentEventComponent: React.FC<Props> = ({
</>
);
};
AlertCommentEventComponent.displayName = 'AlertCommentEvent';
export const AlertCommentEvent = memo(AlertCommentEventComponent);

View file

@ -52,5 +52,6 @@ const HostIsolationCommentEventComponent: React.FC<Props> = ({
</>
);
};
HostIsolationCommentEventComponent.displayName = 'HostIsolationCommentEvent';
export const HostIsolationCommentEvent = memo(HostIsolationCommentEventComponent);

View file

@ -38,5 +38,6 @@ const UserActionShowAlertComponent = ({
</EuiToolTip>
);
};
UserActionShowAlertComponent.displayName = 'UserActionShowAlert';
export const UserActionShowAlert = memo(UserActionShowAlertComponent);

View file

@ -50,5 +50,6 @@ const UserActionContentToolbarComponent = ({
</EuiFlexItem>
</EuiFlexGroup>
);
UserActionContentToolbarComponent.displayName = 'UserActionContentToolbar';
export const UserActionContentToolbar = memo(UserActionContentToolbarComponent);

View file

@ -36,5 +36,6 @@ const UserActionCopyLinkComponent = ({ id: commentId }: UserActionCopyLinkProps)
</EuiToolTip>
);
};
UserActionCopyLinkComponent.displayName = 'UserActionCopyLink';
export const UserActionCopyLink = memo(UserActionCopyLinkComponent);

View file

@ -34,5 +34,6 @@ const UserActionMoveToReferenceComponent = ({
</EuiToolTip>
);
};
UserActionMoveToReferenceComponent.displayName = 'UserActionMoveToReference';
export const UserActionMoveToReference = memo(UserActionMoveToReferenceComponent);

View file

@ -69,5 +69,6 @@ const UserActionPropertyActionsComponent = ({
</>
);
};
UserActionPropertyActionsComponent.displayName = 'UserActionPropertyActions';
export const UserActionPropertyActions = memo(UserActionPropertyActionsComponent);

View file

@ -41,5 +41,6 @@ const UserActionTimestampComponent = ({ createdAt, updatedAt }: UserActionAvatar
)}
</>
);
UserActionTimestampComponent.displayName = 'UserActionTimestamp';
export const UserActionTimestamp = memo(UserActionTimestampComponent);

View file

@ -28,5 +28,6 @@ const UserActionUsernameComponent = ({ username, fullName }: UserActionUsernameP
</EuiToolTip>
);
};
UserActionUsernameComponent.displayName = 'UserActionUsername';
export const UserActionUsername = memo(UserActionUsernameComponent);