diff --git a/react/relay.config.js b/react/relay.config.js index 50c326486..50bf4ed0d 100644 --- a/react/relay.config.js +++ b/react/relay.config.js @@ -1,19 +1,19 @@ // relay.config.js -// const fs = require('fs'); -// const path = require('path'); +const fs = require('fs'); +const path = require('path'); -// // function to merge schema.graphql and client-directives.graphql and write to merged_schema.graphql -// const schemaFiles = [ -// path.join(__dirname, './data/schema.graphql'), -// path.join(__dirname, './data/client-directives.graphql'), -// ]; -// const mergedSchema = schemaFiles -// .map((file) => fs.readFileSync(file, 'utf8')) -// .join('\n'); -// fs.writeFileSync( -// path.join(__dirname, './data/merged_schema.graphql'), -// mergedSchema, -// ); +// function to merge schema.graphql and client-directives.graphql and write to merged_schema.graphql +const schemaFiles = [ + path.join(__dirname, './data/schema.graphql'), + path.join(__dirname, './data/client-directives.graphql'), +]; +const mergedSchema = schemaFiles + .map((file) => fs.readFileSync(file, 'utf8')) + .join('\n'); +fs.writeFileSync( + path.join(__dirname, './data/merged_schema.graphql'), + mergedSchema, +); module.exports = { // ... diff --git a/react/src/components/AvailableResourcesCard.tsx b/react/src/components/AvailableResourcesCard.tsx index 13c5c2745..69fe66c6c 100644 --- a/react/src/components/AvailableResourcesCard.tsx +++ b/react/src/components/AvailableResourcesCard.tsx @@ -3,7 +3,6 @@ import { useCurrentProjectValue } from '../hooks/useCurrentProject'; import { useResourceLimitAndRemaining } from '../hooks/useResourceLimitAndRemaining'; import BAIProgressWithLabel from './BAIProgressWithLabel'; import Flex from './Flex'; -import ResourceGroupSelect from './ResourceGroupSelect'; import ResourceGroupSelectForCurrentProject from './ResourceGroupSelectForCurrentProject'; import { QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons'; import { Button, Card, Tooltip } from 'antd'; diff --git a/react/src/components/ResourceGroupSelect.tsx b/react/src/components/ResourceGroupSelect.tsx index 8e82d949a..4eb905b6e 100644 --- a/react/src/components/ResourceGroupSelect.tsx +++ b/react/src/components/ResourceGroupSelect.tsx @@ -2,11 +2,10 @@ import { useBaiSignedRequestWithPromise } from '../helper'; import { useUpdatableState } from '../hooks'; import { useSuspenseTanQuery } from '../hooks/reactQueryAlias'; import useControllableState from '../hooks/useControllableState'; -import { useCurrentProjectValue } from '../hooks/useCurrentProject'; import TextHighlighter from './TextHighlighter'; import { Select, SelectProps } from 'antd'; import _ from 'lodash'; -import React, { useEffect, useTransition } from 'react'; +import React, { useEffect } from 'react'; interface ResourceGroupSelectProps extends SelectProps { projectName: string; @@ -24,7 +23,7 @@ const ResourceGroupSelect: React.FC = ({ ...selectProps }) => { const baiRequestWithPromise = useBaiSignedRequestWithPromise(); - const [fetchKey, updateFetchKey] = useUpdatableState('first'); + const [fetchKey] = useUpdatableState('first'); const [controllableSearchValue, setControllableSearchValue] = useControllableState({ value: searchValue, @@ -34,7 +33,6 @@ const ResourceGroupSelect: React.FC = ({ const [controllableValue, setControllableValue] = useControllableState(selectProps); - const [isPendingLoading, startLoadingTransition] = useTransition(); const { data: resourceGroupSelectQueryResult } = useSuspenseTanQuery< [ { @@ -147,7 +145,7 @@ const ResourceGroupSelect: React.FC = ({ // }); // } }} - loading={isPendingLoading || loading} + loading={loading} options={_.map(resourceGroups, (resourceGroup) => { return { value: resourceGroup.name, label: resourceGroup.name }; })}