From 0314eb972dd4abac34e4a54f65627f0c8f991306 Mon Sep 17 00:00:00 2001 From: Ann Catton Date: Thu, 15 Oct 2020 15:08:22 -0400 Subject: [PATCH 1/5] Add custom api fetcher for Arranger, arranger_api config value --- .env.schema | 3 ++- components/pages/repository/index.tsx | 6 +++++- components/utils/ajax.ts | 25 +++++++++++++++++++++++++ components/utils/arrangerFetcher.ts | 27 +++++++++++++++++++++++++++ global/config.ts | 2 ++ package-lock.json | 13 +++++++++++++ package.json | 1 + 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 components/utils/ajax.ts create mode 100644 components/utils/arrangerFetcher.ts diff --git a/.env.schema b/.env.schema index 7e4fe201..6b101f80 100644 --- a/.env.schema +++ b/.env.schema @@ -7,4 +7,5 @@ NEXT_PUBLIC_EGO_CLIENT_ID=dms-ui-dev ######### Arranger NEXT_PUBLIC_ARRANGER_PROJECT_ID= NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD= -NEXT_PUBLIC_ARRANGER_INDEX= \ No newline at end of file +NEXT_PUBLIC_ARRANGER_INDEX= +NEXT_PUBLIC_ARRANGER_API= \ No newline at end of file diff --git a/components/pages/repository/index.tsx b/components/pages/repository/index.tsx index cd9b0209..5cf7cded 100644 --- a/components/pages/repository/index.tsx +++ b/components/pages/repository/index.tsx @@ -6,6 +6,7 @@ import PageLayout from '../../PageLayout'; import { RepoFiltersType } from './sqonTypes'; import { getConfig } from '../../../global/config'; import { css } from '@emotion/core'; +import createArrangerFetcher from '../../utils/arrangerFetcher'; const Arranger = dynamic( () => import('@arranger/components/dist/Arranger').then((comp) => comp.Arranger), @@ -33,6 +34,8 @@ export interface PageContentProps { fetchData?: (projectId: string) => Promise; } +const arrangerFetcher = createArrangerFetcher({}); + const RepositoryPage = () => { const { ARRANGER_PROJECT_ID, ARRANGER_GRAPHQL_FIELD, ARRANGER_INDEX } = getConfig(); @@ -56,7 +59,7 @@ const RepositoryPage = () => { ` } > - Arranger is missing configuration values. Please check your ".env.local" file. + Arranger is missing configuration values. Please check your ".env" file.