interface Props {
allowResizing?: boolean;
children:
- | ((renderProps: RenderProps) => JSX.Element)
+ | ((renderProps: Readonly<RenderProps>) => JSX.Element)
| React.ReactElement<{ onClick: OnClickCallback }>;
className?: string;
closeOnClick?: boolean;
open: boolean;
}
-export class Dropdown extends React.PureComponent<Props, State> {
+export class Dropdown extends React.PureComponent<Readonly<Props>, State> {
state: State = { open: false };
- componentDidUpdate(props: Props, prevState: State) {
+ componentDidUpdate(props: Readonly<Props>, prevState: State) {
if (!prevState.open && this.state.open && this.props.onOpen) {
this.props.onOpen();
}
toggleClassName?: string;
}
-export function ActionsDropdown(props: ActionsDropdownProps) {
+export function ActionsDropdown(props: Readonly<ActionsDropdownProps>) {
const { children, buttonSize, ariaLabel, toggleClassName, ...dropdownProps } = props;
const intl = useIntl();
projectBindingErrors?: ProjectAlmBindingConfigurationErrors;
}
-function ComponentNav(props: ComponentNavProps) {
+function ComponentNav(props: Readonly<ComponentNavProps>) {
const {
branchLike,
component,
snippets: Snippet[];
}
-export default class ComponentSourceSnippetGroupViewer extends React.PureComponent<Props, State> {
+export default class ComponentSourceSnippetGroupViewer extends React.PureComponent<
+ Readonly<Props>,
+ State
+> {
mounted = false;
- constructor(props: Props) {
+ constructor(props: Readonly<Props>) {
super(props);
this.state = {
additionalLines: {},
snippets.length === 1 &&
snippetGroup.component.measures &&
snippets[0].end - snippets[0].start ===
- parseInt(snippetGroup.component.measures.lines || '', 10);
+ parseInt(snippetGroup.component.measures.lines ?? '', 10);
return !fullyShown && isFile(snippetGroup.component.q);
}
return { label: b.name, value: b.name, isMain: b.isMain };
}
-export default function ProjectNewCodeDefinitionSelector(props: ProjectBaselineSelectorProps) {
+export default function ProjectNewCodeDefinitionSelector(
+ props: Readonly<ProjectBaselineSelectorProps>,
+) {
const {
analysis,
branch,
total: number | null;
}
-export default class ProfileRules extends React.PureComponent<Props, State> {
+export default class ProfileRules extends React.PureComponent<Readonly<Props>, State> {
mounted = false;
state: State = {
activatedTotal: activatedRules.paging.total,
allByType: keyBy<ByType>(this.takeFacet(allRules, 'types'), 'val'),
activatedByType: keyBy<ByType>(this.takeFacet(activatedRules, 'types'), 'val'),
- compareToSonarWay: showProfile && showProfile.compareToSonarWay,
+ compareToSonarWay: showProfile?.compareToSonarWay,
total: allRules.paging.total,
});
}
);
}
- getRulesCountForType(type: string) {
- return this.state.activatedByType && this.state.activatedByType[type]
- ? this.state.activatedByType[type].count
- : null;
- }
-
- getRulesTotalForType(type: string) {
- return this.state.allByType && this.state.allByType[type]
- ? this.state.allByType[type].count
- : null;
- }
-
takeFacet(response: SearchRulesResponse, property: string) {
const facet = response.facets?.find((f) => f.property === property);
return facet ? facet.values : [];
type?: string;
}
-export default function ProfileRulesRowOfType(props: Props) {
+export default function ProfileRulesRowOfType(props: Readonly<Props>) {
const activeRulesUrl = getRulesUrl({
qprofile: props.qprofile,
activation: 'true',
validationError?: string;
}
-export default class AlmBindingDefinitionFormRenderer extends React.PureComponent<Props> {
+export default class AlmBindingDefinitionFormRenderer extends React.PureComponent<Readonly<Props>> {
renderForm = () => {
const { alm, formData, isUpdate, bitbucketVariant } = this.props;
onVariantChange: (variant: AlmKeys.BitbucketServer | AlmKeys.BitbucketCloud) => void;
}
-export default function BitbucketForm(props: BitbucketFormProps) {
+export default function BitbucketForm(props: Readonly<BitbucketFormProps>) {
const { isUpdate, formData, variant } = props;
return (
Option = LabelValueSelectOption,
IsMulti extends boolean = boolean,
Group extends GroupBase<Option> = GroupBase<Option>,
->(props: NamedProps<Option, IsMulti, Group> & StyleExtensionProps) {
+>(props: NamedProps<Option, IsMulti, Group> & Readonly<StyleExtensionProps>) {
return (
<ReactSelect<Option, IsMulti, Group>
{...omit(props, 'className', 'large')}
>(
props: NamedProps<Option, IsMulti, Group> &
AsyncProps<Option, IsMulti, Group> &
- StyleExtensionProps,
+ Readonly<StyleExtensionProps>,
) {
return (
<AsyncReactSelect<Option, IsMulti, Group>
>(
props?: NamedProps<Option, IsMulti, Group> &
AsyncProps<Option, IsMulti, Group> &
- StyleExtensionProps,
+ Readonly<StyleExtensionProps>,
): StylesConfig<Option, IsMulti, Group> {
return {
container: () => ({
component?: Component;
}
-function NCDAutoUpdateMessage(props: NCDAutoUpdateMessageProps) {
+function NCDAutoUpdateMessage(props: Readonly<NCDAutoUpdateMessageProps>) {
const { branchName, component, currentUser } = props;
const isGlobalBanner = component === undefined;
const intl = useIntl();
title: ReactNode;
}
-export function AdminPageHeader({ children, className, description, title }: Props) {
+export function AdminPageHeader({ children, className, description, title }: Readonly<Props>) {
return (
<div className={classNames('sw-flex sw-justify-between', className)}>
<header className="sw-flex-1">