Use new JSX transformation for React (#3033)

This commit is contained in:
Jon Koops 2022-08-03 14:12:07 +02:00 committed by GitHub
parent 533c954f4c
commit a6fd2cabfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
342 changed files with 329 additions and 399 deletions

View file

@ -13,6 +13,7 @@ module.exports = {
extends: [ extends: [
"eslint:recommended", "eslint:recommended",
"plugin:react/recommended", "plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/base", "plugin:@typescript-eslint/base",
"plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended", "plugin:prettier/recommended",
@ -44,6 +45,18 @@ module.exports = {
endOfLine: "auto", endOfLine: "auto",
}, },
], ],
// Prevent default imports from React, named imports should be used instead.
"no-restricted-imports": [
"error",
{
paths: [
{
name: "react",
importNames: ["default"],
},
],
},
],
}, },
overrides: [ overrides: [
{ {

View file

@ -40,7 +40,7 @@ A good tutorial on this approach is found in [Kent Dodds blog](https://kentcd
This project uses function components and hooks over class components. When coding function components in typescript, a developer should include any specific props that they need. This project uses function components and hooks over class components. When coding function components in typescript, a developer should include any specific props that they need.
```javascript ```javascript
import React, { FunctionComponent } from "react"; import { FunctionComponent } from "react";
... ...
@ -55,7 +55,7 @@ export const ExampleComponent: FunctionComponent<ExampleComponentProps> = ({ mes
For components that do not have any additional props an empty object should be used instead: For components that do not have any additional props an empty object should be used instead:
```javascript ```javascript
import React, { FunctionComponent } from "react"; import { FunctionComponent } from "react";
... ...

View file

@ -1,4 +1,4 @@
import React, { FunctionComponent, Suspense } from "react"; import { FunctionComponent, Suspense } from "react";
import { Page } from "@patternfly/react-core"; import { Page } from "@patternfly/react-core";
import { HashRouter as Router, Route, Switch } from "react-router-dom"; import { HashRouter as Router, Route, Switch } from "react-router-dom";
import { ErrorBoundary } from "react-error-boundary"; import { ErrorBoundary } from "react-error-boundary";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { PageSection } from "@patternfly/react-core"; import { PageSection } from "@patternfly/react-core";

View file

@ -12,7 +12,7 @@ import {
PageHeaderToolsItem, PageHeaderToolsItem,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import { HelpIcon } from "@patternfly/react-icons"; import { HelpIcon } from "@patternfly/react-icons";
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { HelpHeader, useHelp } from "./components/help-enabler/HelpHeader"; import { HelpHeader, useHelp } from "./components/help-enabler/HelpHeader";

View file

@ -1,4 +1,4 @@
import React from "react"; import { FormEvent, FunctionComponent } from "react";
import { NavLink, useHistory, useRouteMatch } from "react-router-dom"; import { NavLink, useHistory, useRouteMatch } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
@ -16,7 +16,7 @@ import { useAccess } from "./context/access/Access";
import { routes } from "./route-config"; import { routes } from "./route-config";
import { AddRealmRoute } from "./realm/routes/AddRealm"; import { AddRealmRoute } from "./realm/routes/AddRealm";
export const PageNav: React.FunctionComponent = () => { export const PageNav: FunctionComponent = () => {
const { t } = useTranslation("common"); const { t } = useTranslation("common");
const { hasAccess, hasSomeAccess } = useAccess(); const { hasAccess, hasSomeAccess } = useAccess();
const { realm } = useRealm(); const { realm } = useRealm();
@ -27,7 +27,7 @@ export const PageNav: React.FunctionComponent = () => {
groupId: number | string; groupId: number | string;
itemId: number | string; itemId: number | string;
to: string; to: string;
event: React.FormEvent<HTMLInputElement>; event: FormEvent<HTMLInputElement>;
}; };
const onSelect = (item: SelectedItem) => { const onSelect = (item: SelectedItem) => {

View file

@ -1,5 +1,3 @@
import React from "react";
export const PageNotFoundSection = () => { export const PageNotFoundSection = () => {
return <>Page Not Found</>; return <>Page Not Found</>;
}; };

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { sortBy } from "lodash-es"; import { sortBy } from "lodash-es";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Button, Button,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useHistory, useParams } from "react-router-dom"; import { useHistory, useParams } from "react-router-dom";
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { AlertVariant, Switch } from "@patternfly/react-core"; import { AlertVariant, Switch } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Dropdown, Dropdown,

View file

@ -1,4 +1,10 @@
import React, { ReactNode, useMemo, useRef, useState } from "react"; import {
DragEvent as ReactDragEvent,
ReactNode,
useMemo,
useRef,
useState,
} from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { get } from "lodash-es"; import { get } from "lodash-es";
import { import {
@ -53,7 +59,7 @@ export function DraggableTable<T>({
[data] [data]
); );
const onDragStart = (evt: React.DragEvent) => { const onDragStart = (evt: ReactDragEvent) => {
evt.dataTransfer.effectAllowed = "move"; evt.dataTransfer.effectAllowed = "move";
evt.dataTransfer.setData("text/plain", evt.currentTarget.id); evt.dataTransfer.setData("text/plain", evt.currentTarget.id);
const draggedItemId = evt.currentTarget.id; const draggedItemId = evt.currentTarget.id;
@ -103,14 +109,14 @@ export function DraggableTable<T>({
}); });
}; };
const onDragLeave = (evt: React.DragEvent) => { const onDragLeave = (evt: ReactDragEvent) => {
if (!isValidDrop(evt)) { if (!isValidDrop(evt)) {
move(itemOrder); move(itemOrder);
setState({ ...state, draggingToItemIndex: -1 }); setState({ ...state, draggingToItemIndex: -1 });
} }
}; };
const isValidDrop = (evt: React.DragEvent) => { const isValidDrop = (evt: ReactDragEvent) => {
const ulRect = bodyRef.current!.getBoundingClientRect(); const ulRect = bodyRef.current!.getBoundingClientRect();
return ( return (
evt.clientX > ulRect.x && evt.clientX > ulRect.x &&
@ -120,7 +126,7 @@ export function DraggableTable<T>({
); );
}; };
const onDrop = (evt: React.DragEvent) => { const onDrop = (evt: ReactDragEvent) => {
if (isValidDrop(evt)) { if (isValidDrop(evt)) {
onDragFinish(state.draggedItemId, state.tempItemOrder); onDragFinish(state.draggedItemId, state.tempItemOrder);
} else { } else {
@ -128,7 +134,7 @@ export function DraggableTable<T>({
} }
}; };
const onDragOver = (evt: React.DragEvent) => { const onDragOver = (evt: ReactDragEvent) => {
evt.preventDefault(); evt.preventDefault();
const td = evt.target as HTMLTableCellElement; const td = evt.target as HTMLTableCellElement;
@ -161,7 +167,7 @@ export function DraggableTable<T>({
} }
}; };
const onDragEnd = (evt: React.DragEvent) => { const onDragEnd = (evt: ReactDragEvent) => {
const tr = evt.target as HTMLTableRowElement; const tr = evt.target as HTMLTableRowElement;
tr.classList.remove(styles.modifiers.ghostRow); tr.classList.remove(styles.modifiers.ghostRow);
tr.setAttribute("aria-pressed", "false"); tr.setAttribute("aria-pressed", "false");

View file

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState, MouseEvent } from "react"; import { useState, MouseEvent as ReactMouseEvent } from "react";
import { import {
Drawer, Drawer,
DrawerActions, DrawerActions,
@ -41,7 +41,7 @@ const createEdge = (fromNode: string, toNode: string) => ({
target: toNode, target: toNode,
data: { data: {
onEdgeClick: ( onEdgeClick: (
evt: React.MouseEvent<HTMLButtonElement, MouseEvent>, evt: ReactMouseEvent<HTMLButtonElement, MouseEvent>,
id: string id: string
) => { ) => {
evt.stopPropagation(); evt.stopPropagation();
@ -217,7 +217,7 @@ export const FlowDiagram = ({
); );
const [expandDrawer, setExpandDrawer] = useState(false); const [expandDrawer, setExpandDrawer] = useState(false);
const onElementClick = (_event: MouseEvent, element: Node | Edge) => { const onElementClick = (_event: ReactMouseEvent, element: Node | Edge) => {
if (isNode(element)) setExpandDrawer(!expandDrawer); if (isNode(element)) setExpandDrawer(!expandDrawer);
}; };

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
DataListItem, DataListItem,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Select, SelectOption, SelectVariant } from "@patternfly/react-core"; import { Select, SelectOption, SelectVariant } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
DataListItemRow, DataListItemRow,

View file

@ -1,4 +1,3 @@
import React from "react";
import { Card, CardBody } from "@patternfly/react-core"; import { Card, CardBody } from "@patternfly/react-core";
import "./flow-title.css"; import "./flow-title.css";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Button, Button,

View file

@ -1,4 +1,4 @@
import React, { CSSProperties } from "react"; import { CSSProperties, MouseEvent as ReactMouseEvent } from "react";
import { PlusIcon } from "@patternfly/react-icons"; import { PlusIcon } from "@patternfly/react-icons";
import { import {
ArrowHeadType, ArrowHeadType,
@ -22,7 +22,7 @@ type ButtonEdgeProps = {
selected: boolean; selected: boolean;
data: { data: {
onEdgeClick: ( onEdgeClick: (
evt: React.MouseEvent<HTMLButtonElement, MouseEvent>, evt: ReactMouseEvent<HTMLButtonElement, MouseEvent>,
id: string id: string
) => void; ) => void;
}; };

View file

@ -1,4 +1,4 @@
import React, { memo } from "react"; import { memo } from "react";
import { Handle, Position } from "react-flow-renderer"; import { Handle, Position } from "react-flow-renderer";
type ConditionalNodeProps = { type ConditionalNodeProps = {

View file

@ -1,4 +1,4 @@
import React, { memo } from "react"; import { memo } from "react";
import { Handle, Position } from "react-flow-renderer"; import { Handle, Position } from "react-flow-renderer";
type NodeProps = { type NodeProps = {

View file

@ -1,4 +1,4 @@
import React, { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Button, Button,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { useFormContext } from "react-hook-form";
import { FormGroup, ValidatedOptions } from "@patternfly/react-core"; import { FormGroup, ValidatedOptions } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useForm, useWatch } from "react-hook-form"; import { Controller, useForm, useWatch } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Tab, Tabs, TabTitleText } from "@patternfly/react-core"; import { Tab, Tabs, TabTitleText } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { import {
Controller, Controller,
FormProvider, FormProvider,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { AlertVariant, Select } from "@patternfly/react-core"; import { AlertVariant, Select } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Button, Button,

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { LocationDescriptorObject } from "history"; import type { LocationDescriptorObject } from "history";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory, useParams, useRouteMatch } from "react-router-dom"; import { Link, useHistory, useParams, useRouteMatch } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Link, useParams } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useForm, useWatch } from "react-hook-form"; import { Controller, useForm, useWatch } from "react-hook-form";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Dropdown, Dropdown,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useHistory, useParams } from "react-router-dom"; import { useHistory, useParams } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { useFormContext } from "react-hook-form";
import { AlertVariant, PageSection, Text } from "@patternfly/react-core"; import { AlertVariant, PageSection, Text } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { FormGroup, Switch, ValidatedOptions } from "@patternfly/react-core"; import { FormGroup, Switch, ValidatedOptions } from "@patternfly/react-core";

View file

@ -13,7 +13,7 @@ import {
import { InfoCircleIcon } from "@patternfly/react-icons"; import { InfoCircleIcon } from "@patternfly/react-icons";
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import { cloneDeep, sortBy } from "lodash-es"; import { cloneDeep, sortBy } from "lodash-es";
import React, { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { Controller, FormProvider, useForm, useWatch } from "react-hook-form"; import { Controller, FormProvider, useForm, useWatch } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useHistory, useParams } from "react-router-dom"; import { useHistory, useParams } from "react-router-dom";

View file

@ -1,7 +1,7 @@
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import type UserSessionRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation"; import type UserSessionRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation";
import { PageSection } from "@patternfly/react-core"; import { PageSection } from "@patternfly/react-core";
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { LoaderFunction } from "../components/table-toolbar/KeycloakDataTable"; import type { LoaderFunction } from "../components/table-toolbar/KeycloakDataTable";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { useFormContext } from "react-hook-form";
import { Form } from "@patternfly/react-core"; import { Form } from "@patternfly/react-core";

View file

@ -11,7 +11,7 @@ import {
import { cellWidth, IRowData, TableText } from "@patternfly/react-table"; import { cellWidth, IRowData, TableText } from "@patternfly/react-table";
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import type { ClientQuery } from "@keycloak/keycloak-admin-client/lib/resources/clients"; import type { ClientQuery } from "@keycloak/keycloak-admin-client/lib/resources/clients";
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { useAlerts } from "../components/alert/Alerts"; import { useAlerts } from "../components/alert/Alerts";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { useFormContext } from "react-hook-form";
import { FormGroup } from "@patternfly/react-core"; import { FormGroup } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { import {
FormGroup, FormGroup,
Select, Select,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { FormGroup, Switch, ValidatedOptions } from "@patternfly/react-core"; import { FormGroup, Switch, ValidatedOptions } from "@patternfly/react-core";

View file

@ -7,7 +7,7 @@ import {
WizardFooter, WizardFooter,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
import React, { useState } from "react"; import { useState } from "react";
import { FormProvider, useForm } from "react-hook-form"; import { FormProvider, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Control, Controller } from "react-hook-form"; import { Control, Controller } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Control, Controller } from "react-hook-form"; import { Control, Controller } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { sortBy } from "lodash-es"; import { sortBy } from "lodash-es";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import type { Control } from "react-hook-form"; import type { Control } from "react-hook-form";
import { ActionGroup, Button, FormGroup } from "@patternfly/react-core"; import { ActionGroup, Button, FormGroup } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Control, Controller } from "react-hook-form"; import { Control, Controller } from "react-hook-form";
import { ActionGroup, Button, FormGroup, Switch } from "@patternfly/react-core"; import { ActionGroup, Button, FormGroup, Switch } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { useFormContext } from "react-hook-form";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { ActionGroup, ActionGroupProps, Button } from "@patternfly/react-core"; import { ActionGroup, ActionGroupProps, Button } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Control, Controller, FieldValues } from "react-hook-form"; import { Control, Controller, FieldValues } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Button, Button,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, FormProvider, useForm } from "react-hook-form"; import { Controller, FormProvider, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { import {
ExpandableRowContent, ExpandableRowContent,
TableComposable, TableComposable,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { import {
DescriptionList, DescriptionList,
TextContent, TextContent,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
FormGroup, FormGroup,

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { FormGroup, Radio } from "@patternfly/react-core"; import { FormGroup, Radio } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Alert, AlertVariant } from "@patternfly/react-core"; import { Alert, AlertVariant } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { DescriptionList } from "@patternfly/react-core"; import { DescriptionList } from "@patternfly/react-core";
import type ResourceServerRepresentation from "@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation"; import type ResourceServerRepresentation from "@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation";

View file

@ -1,4 +1,3 @@
import React from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import type { LocationDescriptor } from "history"; import type { LocationDescriptor } from "history";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { Fragment, useState } from "react"; import { Fragment, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Alert, Alert,

View file

@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFieldArray, useFormContext } from "react-hook-form"; import { Controller, useFieldArray, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Label } from "@patternfly/react-core"; import { Label } from "@patternfly/react-core";

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {
Modal, Modal,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory, useParams } from "react-router-dom"; import { Link, useHistory, useParams } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, FormProvider, useForm, useWatch } from "react-hook-form"; import { Controller, FormProvider, useForm, useWatch } from "react-hook-form";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory, useParams } from "react-router-dom"; import { Link, useHistory, useParams } from "react-router-dom";
import { Controller, FormProvider, useForm } from "react-hook-form"; import { Controller, FormProvider, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { Select, SelectOption, SelectVariant } from "@patternfly/react-core"; import { Select, SelectOption, SelectVariant } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory, useParams } from "react-router-dom"; import { Link, useHistory, useParams } from "react-router-dom";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useRef, useState } from "react"; import { useRef, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { Select, SelectOption, SelectVariant } from "@patternfly/react-core"; import { Select, SelectOption, SelectVariant } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Controller, FormProvider, useForm } from "react-hook-form"; import { Controller, FormProvider, useForm } from "react-hook-form";
import { import {

View file

@ -1,4 +1,4 @@
import React, { KeyboardEvent, useMemo, useState } from "react"; import { KeyboardEvent, useMemo, useState } from "react";
import { import {
Select, Select,
SelectVariant, SelectVariant,

View file

@ -1,4 +1,3 @@
import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { FormGroup } from "@patternfly/react-core"; import { FormGroup } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { Controller, useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { import {
SelectOption, SelectOption,

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext, Controller } from "react-hook-form"; import { useFormContext, Controller } from "react-hook-form";
import { FormGroup, Button, Checkbox } from "@patternfly/react-core"; import { FormGroup, Button, Checkbox } from "@patternfly/react-core";

View file

@ -1,4 +1,4 @@
import React, { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext, Controller } from "react-hook-form"; import { useFormContext, Controller } from "react-hook-form";
import { MinusCircleIcon } from "@patternfly/react-icons"; import { MinusCircleIcon } from "@patternfly/react-icons";

Some files were not shown because too many files have changed in this diff Show more