Skip to content

Commit

Permalink
Merge pull request #922 from digitalfabrik/sort-imports
Browse files Browse the repository at this point in the history
Sort imports in administration
  • Loading branch information
sarahsporck authored Apr 11, 2023
2 parents 85f0120 + 80fb402 commit 4abfc48
Show file tree
Hide file tree
Showing 91 changed files with 481 additions and 303 deletions.
5 changes: 4 additions & 1 deletion administration/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"printWidth": 120,
"bracketSameLine": true,
"jsxSingleQuote": true,
"endOfLine": "auto"
"endOfLine": "auto",
"importOrderSeparation": true,
"importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderSortSpecifiers": true
}
210 changes: 160 additions & 50 deletions administration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@graphql-codegen/typescript": "^3.0.1",
"@graphql-codegen/typescript-operations": "^3.0.1",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/apollo-upload-client": "^17.0.2",
"@types/blob-stream": "^0.1.30",
"@types/jasmine": "^4.3.1",
Expand Down
7 changes: 4 additions & 3 deletions administration/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react'
import AuthProvider from './AuthProvider'
import { ProjectConfigProvider } from './project-configs/ProjectConfigContext'
import { AppToasterProvider } from './bp-modules/AppToaster'

import AppApolloProvider from './AppApolloProvider'
import AuthProvider from './AuthProvider'
import Router from './Router'
import { AppToasterProvider } from './bp-modules/AppToaster'
import useMetaTags from './hooks/useMetaTags'
import { ProjectConfigProvider } from './project-configs/ProjectConfigContext'

if (!process.env.REACT_APP_API_BASE_URL) {
throw new Error('REACT_APP_API_BASE_URL is not set!')
Expand Down
5 changes: 3 additions & 2 deletions administration/src/AppApolloProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { ReactElement, useContext } from 'react'
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client'
import { setContext } from '@apollo/client/link/context'
import { AuthContext } from './AuthProvider'
import { createUploadLink } from 'apollo-upload-client'
import React, { ReactElement, useContext } from 'react'

import { AuthContext } from './AuthProvider'
import getApiBaseUrl from './util/getApiBaseUrl'

const httpLink = createUploadLink({ uri: getApiBaseUrl() })
Expand Down
3 changes: 2 additions & 1 deletion administration/src/AuthProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createContext, ReactNode, useMemo, useState } from 'react'
import { ReactNode, createContext, useMemo, useState } from 'react'

import { SignInPayload } from './generated/graphql'

export interface TokenPayload {
Expand Down
7 changes: 4 additions & 3 deletions administration/src/KeepAliveToken.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Button, Classes, Dialog } from '@blueprintjs/core'
import React, { ReactNode, useContext, useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'

import { TokenPayload } from './AuthProvider'
import { WhoAmIContext } from './WhoAmIProvider'
import { useAppToaster } from './bp-modules/AppToaster'
import { SignInPayload, useSignInMutation } from './generated/graphql'
import PasswordInput from './bp-modules/PasswordInput'
import { SignInPayload, useSignInMutation } from './generated/graphql'
import { ProjectConfigContext } from './project-configs/ProjectConfigContext'
import { WhoAmIContext } from './WhoAmIProvider'
import { useNavigate } from 'react-router-dom'

interface Props {
authData: TokenPayload
Expand Down
19 changes: 10 additions & 9 deletions administration/src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import React, { useContext, useMemo } from 'react'
import Navigation from './bp-modules/NavigationBar'
import { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom'
import CreateCardsController from './bp-modules/cards/CreateCardsController'
import { Outlet, RouteObject, RouterProvider, createBrowserRouter } from 'react-router-dom'
import styled from 'styled-components'
import WhoAmIProvider from './WhoAmIProvider'

import { AuthContext } from './AuthProvider'
import Login from './bp-modules/auth/Login'
import KeepAliveToken from './KeepAliveToken'
import WhoAmIProvider from './WhoAmIProvider'
import Navigation from './bp-modules/NavigationBar'
import ApplicationsController from './bp-modules/applications/ApplicationsController'
import { ProjectConfigContext } from './project-configs/ProjectConfigContext'
import ForgotPasswordController from './bp-modules/auth/ForgotPasswordController'
import Login from './bp-modules/auth/Login'
import ResetPasswordController from './bp-modules/auth/ResetPasswordController'
import CreateCardsController from './bp-modules/cards/CreateCardsController'
import HomeController from './bp-modules/home/HomeController'
import DataPrivacyPolicy from './bp-modules/regions/DataPrivacyPolicy'
import RegionsController from './bp-modules/regions/RegionController'
import UserSettingsController from './bp-modules/user-settings/UserSettingsController'
import ResetPasswordController from './bp-modules/auth/ResetPasswordController'
import ForgotPasswordController from './bp-modules/auth/ForgotPasswordController'
import ManageUsersController from './bp-modules/users/ManageUsersController'
import DataPrivacyPolicy from './bp-modules/regions/DataPrivacyPolicy'
import ApplicationApplicantController from './mui-modules/application-verification/ApplicationApplicantController'
import ApplicationVerificationController from './mui-modules/application-verification/ApplicationVerificationController'
import ApplyController from './mui-modules/application/ApplyController'
import { ProjectConfigContext } from './project-configs/ProjectConfigContext'

const Main = styled.div`
flex-grow: 1;
Expand Down
9 changes: 5 additions & 4 deletions administration/src/WhoAmIProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Button, Spinner } from '@blueprintjs/core'
import { createContext, ReactNode, useContext } from 'react'
import { useWhoAmIQuery, WhoAmIQuery } from './generated/graphql'
import { ProjectConfigContext } from './project-configs/ProjectConfigContext'
import StandaloneCenter from './bp-modules/StandaloneCenter'
import { ReactNode, createContext, useContext } from 'react'

import { AuthContext } from './AuthProvider'
import StandaloneCenter from './bp-modules/StandaloneCenter'
import { WhoAmIQuery, useWhoAmIQuery } from './generated/graphql'
import { ProjectConfigContext } from './project-configs/ProjectConfigContext'

export const WhoAmIContext = createContext<{
me: WhoAmIQuery['me'] | null
Expand Down
Loading

0 comments on commit 4abfc48

Please sign in to comment.