Move contexts under a single directory. (#145)

This commit is contained in:
Stan Silvert 2020-10-06 04:25:38 -04:00 committed by GitHub
parent 932906a103
commit bfe6e2c236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 40 additions and 40 deletions

View file

@ -6,8 +6,8 @@ import { Header } from "./PageHeader";
import { PageNav } from "./PageNav";
import { Help } from "./components/help-enabler/HelpHeader";
import { RealmContextProvider } from "./components/realm-context/RealmContext";
import { WhoAmIContextProvider } from "./whoami/WhoAmI";
import { RealmContextProvider } from "./context/realm-context/RealmContext";
import { WhoAmIContextProvider } from "./context/whoami/WhoAmI";
import { routes } from "./route-config";
import { PageBreadCrumbs } from "./components/bread-crumb/PageBreadCrumbs";

View file

@ -14,8 +14,8 @@ import {
PageHeaderToolsGroup,
} from "@patternfly/react-core";
import { HelpIcon } from "@patternfly/react-icons";
import { KeycloakContext } from "./auth/KeycloakContext";
import { WhoAmIContext } from "./whoami/WhoAmI";
import { KeycloakContext } from "./context/auth/KeycloakContext";
import { WhoAmIContext } from "./context/whoami/WhoAmI";
import { HelpHeader } from "./components/help-enabler/HelpHeader";
import { Link } from "react-router-dom";

View file

@ -10,7 +10,7 @@ import {
} from "@patternfly/react-core";
import { RealmSelector } from "./components/realm-selector/RealmSelector";
import { DataLoader } from "./components/data-loader/DataLoader";
import { HttpClientContext } from "./http-service/HttpClientContext";
import { HttpClientContext } from "./context/http-service/HttpClientContext";
import { RealmRepresentation } from "./realm/models/Realm";
export const PageNav: React.FunctionComponent = () => {

View file

@ -3,8 +3,8 @@ import { Button, PageSection } from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";
import { RealmContext } from "../components/realm-context/RealmContext";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { RealmContext } from "../context/realm-context/RealmContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { ClientRepresentation } from "../realm/models/Realm";
import { DataLoader } from "../components/data-loader/DataLoader";
import { TableToolbar } from "../components/table-toolbar/TableToolbar";

View file

@ -16,8 +16,8 @@ import { Controller, useForm } from "react-hook-form";
import { ClientScopeRepresentation } from "../models/client-scope";
import { HelpItem } from "../../components/help-enabler/HelpItem";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { RealmContext } from "../../components/realm-context/RealmContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { RealmContext } from "../../context/realm-context/RealmContext";
import { useAlerts } from "../../components/alert/Alerts";
export const NewClientScopeForm = () => {

View file

@ -12,10 +12,10 @@ import {
import { Badge, AlertVariant } from "@patternfly/react-core";
import { ExternalLink } from "../components/external-link/ExternalLink";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { useAlerts } from "../components/alert/Alerts";
import { ClientRepresentation } from "./models/client-model";
import { RealmContext } from "../components/realm-context/RealmContext";
import { RealmContext } from "../context/realm-context/RealmContext";
import { exportClient } from "../util";
type ClientListProps = {

View file

@ -19,8 +19,8 @@ import { Controller, useForm } from "react-hook-form";
import { ScrollForm } from "../components/scroll-form/ScrollForm";
import { ClientDescription } from "./ClientDescription";
import { CapabilityConfig } from "./add/CapabilityConfig";
import { RealmContext } from "../components/realm-context/RealmContext";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { RealmContext } from "../context/realm-context/RealmContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { ClientRepresentation } from "../realm/models/Realm";
import {
convertToMultiline,

View file

@ -5,10 +5,10 @@ import { Button, PageSection, Spinner } from "@patternfly/react-core";
import { TableToolbar } from "../components/table-toolbar/TableToolbar";
import { ClientList } from "./ClientList";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { KeycloakContext } from "../auth/KeycloakContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { KeycloakContext } from "../context/auth/KeycloakContext";
import { ClientRepresentation } from "./models/client-model";
import { RealmContext } from "../components/realm-context/RealmContext";
import { RealmContext } from "../context/realm-context/RealmContext";
import { ViewHeader } from "../components/view-header/ViewHeader";
export const ClientsSection = () => {

View file

@ -9,7 +9,7 @@ import {
import { useTranslation } from "react-i18next";
import { Controller, UseFormMethods } from "react-hook-form";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { sortProvider } from "../../util";
import { ServerInfoRepresentation } from "../models/server-info";
import { ClientDescription } from "../ClientDescription";

View file

@ -11,12 +11,12 @@ import {
import { useTranslation } from "react-i18next";
import { useForm } from "react-hook-form";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { GeneralSettings } from "./GeneralSettings";
import { CapabilityConfig } from "./CapabilityConfig";
import { ClientRepresentation } from "../models/client-model";
import { useAlerts } from "../../components/alert/Alerts";
import { RealmContext } from "../../components/realm-context/RealmContext";
import { RealmContext } from "../../context/realm-context/RealmContext";
import { ViewHeader } from "../../components/view-header/ViewHeader";
export const NewClientForm = () => {

View file

@ -13,10 +13,10 @@ import { useTranslation } from "react-i18next";
import { ClientRepresentation } from "../models/client-model";
import { ClientDescription } from "../ClientDescription";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { JsonFileUpload } from "../../components/json-file-upload/JsonFileUpload";
import { useAlerts } from "../../components/alert/Alerts";
import { RealmContext } from "../../components/realm-context/RealmContext";
import { RealmContext } from "../../context/realm-context/RealmContext";
import { ViewHeader } from "../../components/view-header/ViewHeader";
export const ImportForm = () => {

View file

@ -15,8 +15,8 @@ import {
import { CheckIcon } from "@patternfly/react-icons";
import { RealmRepresentation } from "../../realm/models/Realm";
import { RealmContext } from "../realm-context/RealmContext";
import { WhoAmIContext } from "../../whoami/WhoAmI";
import { RealmContext } from "../../context/realm-context/RealmContext";
import { WhoAmIContext } from "../../context/whoami/WhoAmI";
import "./realm-selector.css";

View file

@ -3,7 +3,7 @@ import { mount } from "enzyme";
import { act } from "@testing-library/react";
import { RealmSelector } from "../RealmSelector";
import { RealmContextProvider } from "../../realm-context/RealmContext";
import { RealmContextProvider } from "../../../context/realm-context/RealmContext";
it("renders realm selector", async () => {
const wrapper = mount(

View file

@ -1,5 +1,5 @@
import React, { useState, useContext } from "react";
import { WhoAmIContext } from "../../whoami/WhoAmI";
import { WhoAmIContext } from "../../context/whoami/WhoAmI";
export const RealmContext = React.createContext({
realm: "",

View file

@ -1,11 +1,11 @@
import React, { useContext } from "react";
import i18n from "../i18n";
import i18n from "../../i18n";
import WhoAmIRepresentation from "./who-am-i-model";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { KeycloakContext } from "../auth/KeycloakContext";
import { DataLoader } from "../components/data-loader/DataLoader";
import { DataLoader } from "../../components/data-loader/DataLoader";
export class WhoAmI {
constructor(

View file

@ -9,7 +9,7 @@ import { Button } from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { GroupRepresentation } from "./models/groups";
import { UsersIcon } from "@patternfly/react-icons";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
type GroupsListProps = {
list?: GroupRepresentation[];

View file

@ -1,6 +1,6 @@
import React, { useContext, useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { GroupsList } from "./GroupsList";
import { GroupRepresentation } from "./models/groups";
import {

View file

@ -3,11 +3,11 @@ import ReactDom from "react-dom";
import i18n from "./i18n";
import { App } from "./App";
import init from "./auth/keycloak";
import { KeycloakContext } from "./auth/KeycloakContext";
import { KeycloakService } from "./auth/keycloak.service";
import { HttpClientContext } from "./http-service/HttpClientContext";
import { HttpClient } from "./http-service/http-client";
import init from "./context/auth/keycloak";
import { KeycloakContext } from "./context/auth/KeycloakContext";
import { KeycloakService } from "./context/auth/keycloak.service";
import { HttpClientContext } from "./context/http-service/HttpClientContext";
import { HttpClient } from "./context/http-service/http-client";
console.info("supported languages", ...i18n.languages);
init().then((keycloak) => {

View file

@ -14,10 +14,10 @@ import {
import { DataLoader } from "../components/data-loader/DataLoader";
import { TableToolbar } from "../components/table-toolbar/TableToolbar";
import { HttpClientContext } from "../http-service/HttpClientContext";
import { HttpClientContext } from "../context/http-service/HttpClientContext";
import { RoleRepresentation } from "../model/role-model";
import { RolesList } from "./RoleList";
import { RealmContext } from "../components/realm-context/RealmContext";
import { RealmContext } from "../context/realm-context/RealmContext";
export const RealmRolesSection = () => {
const { t } = useTranslation("roles");

View file

@ -16,10 +16,10 @@ import {
} from "@patternfly/react-core";
import { RoleRepresentation } from "../../model/role-model";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { useAlerts } from "../../components/alert/Alerts";
import { Controller, useForm } from "react-hook-form";
import { RealmContext } from "../../components/realm-context/RealmContext";
import { RealmContext } from "../../context/realm-context/RealmContext";
export const NewRoleForm = () => {
const { t } = useTranslation("roles");

View file

@ -13,7 +13,7 @@ import {
import { JsonFileUpload } from "../../components/json-file-upload/JsonFileUpload";
import { RealmRepresentation } from "../models/Realm";
import { HttpClientContext } from "../../http-service/HttpClientContext";
import { HttpClientContext } from "../../context/http-service/HttpClientContext";
import { useAlerts } from "../../components/alert/Alerts";
import { useForm, Controller } from "react-hook-form";
import { ViewHeader } from "../../components/view-header/ViewHeader";

View file

@ -9,7 +9,7 @@ import {
import { Meta } from "@storybook/react";
import { RealmSelector } from "../components/realm-selector/RealmSelector";
import { RealmContextProvider } from "../components/realm-context/RealmContext";
import { RealmContextProvider } from "../context/realm-context/RealmContext";
export default {
title: "Header",