From 5c3814957ddf4f35c8583e3d72543130d970f7f3 Mon Sep 17 00:00:00 2001 From: "lauren.mieczkowski" Date: Wed, 17 Jan 2024 09:11:48 -0700 Subject: [PATCH] updated read.me --- .env.development | 1 - .env.production | 5 ++--- .env.staging | 1 - README.md | 19 ++++++++++++------- src/connect/hooks/useRegisterDevice.ts | 24 ------------------------ src/connect/pages/DeviceRegistration.tsx | 3 --- src/mocks/server.ts | 14 ++++++-------- 7 files changed, 20 insertions(+), 47 deletions(-) delete mode 100644 src/connect/hooks/useRegisterDevice.ts diff --git a/.env.development b/.env.development index 01f9d215..1458bf29 100644 --- a/.env.development +++ b/.env.development @@ -4,4 +4,3 @@ REACT_APP_SOURCE_LINK=https://github.com/DISHDevEx/findr-orchestrator REACT_APP_SUPPORT_LINK=https://github.com/DISHDevEx/findr REACT_APP_GA_TRACKING_ID= REACT_APP_SENTRY_DSN= -# REACT_APP_ORACLE_URL= \ No newline at end of file diff --git a/.env.production b/.env.production index 31546df8..ea1eae55 100644 --- a/.env.production +++ b/.env.production @@ -1,7 +1,6 @@ REACT_APP_NAME=FINDR (Prod) -REACT_APP_CONTACT_MAIL=m6v3l9@gmail.com +REACT_APP_CONTACT_MAIL=mss@gmail.com REACT_APP_SOURCE_LINK=https://github.com/DISHDevEx/findr-orchestrator REACT_APP_SUPPORT_LINK=https://github.com/DISHDevEx/findr REACT_APP_GA_TRACKING_ID= -REACT_APP_SENTRY_DSN= -REACT_APP_ORACLE_URL="http://a52c356e9b4b540c59d2c7db947ace25-1368697784.us-east-1.elb.amazonaws.com:9000" \ No newline at end of file +REACT_APP_SENTRY_DSN= \ No newline at end of file diff --git a/.env.staging b/.env.staging index 5f1d2f26..22604291 100644 --- a/.env.staging +++ b/.env.staging @@ -4,4 +4,3 @@ REACT_APP_SOURCE_LINK=https://github.com/DISHDevEx/findr-orchestrator REACT_APP_SUPPORT_LINK=https://github.com/DISHDevEx/findr REACT_APP_GA_TRACKING_ID= REACT_APP_SENTRY_DSN= -REACT_APP_ORACLE_URL="http://a52c356e9b4b540c59d2c7db947ace25-1368697784.us-east-1.elb.amazonaws.com:9000" \ No newline at end of file diff --git a/README.md b/README.md index 863c36e3..bffa7fe0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Based on React Material Admin which is a free and open-source admin application ## Getting Started ``` -#Clone repo, navigate to root and run: +#To develop and interact with locally: +1. Clone repo, navigate to root and run: rm -rf node_modules rm -rf package-lock.json yarn config set "strict-ssl" false -g @@ -19,7 +20,13 @@ yarn run start ``` -This will automatically open [http://localhost:3000](http://localhost:3000). +This will automatically open [http://localhost:7001](http://localhost:7001). + +``` +If the UI has been deployed with terraform on an EKS cluster, you may access the UI by using the node IP provided to you +OR you can port-forward the UI by using the command: +kubectl port-forward -n ui 7001:7001 +``` ## Features @@ -27,8 +34,11 @@ This will automatically open [http://localhost:3000](http://localhost:3000). - Admin - Home - Dashboard + - Connect + - Manage - FAQ - Help Center + - Documentation - Profile Activity - Profile Information - Profile Password @@ -42,7 +52,6 @@ This will automatically open [http://localhost:3000](http://localhost:3000). - Not Found - Under Construction - Landing -- User Management ``` ## Technologies @@ -68,7 +77,3 @@ This will automatically open [http://localhost:3000](http://localhost:3000). | Validation | Yup | [Docs](https://github.com/jquense/yup) | -## License - -This project is licensed under the terms of the -[MIT license](/LICENSE). diff --git a/src/connect/hooks/useRegisterDevice.ts b/src/connect/hooks/useRegisterDevice.ts deleted file mode 100644 index 6012e1fc..00000000 --- a/src/connect/hooks/useRegisterDevice.ts +++ /dev/null @@ -1,24 +0,0 @@ -import axios from "axios"; -import { useMutation, useQueryClient } from "react-query"; -import { addOne } from "../../core/utils/crudUtilsDevice"; -import { Device } from "../types/device"; -import { mock } from "../../mocks/server"; - -const registerDevice = async (device: Device): Promise => { - mock.restore(); - const { data } = await axios.post("http://a52c356e9b4b540c59d2c7db947ace25-1368697784.us-east-1.elb.amazonaws.com/oracle", device); - return data; -}; - -export function useRegisterDevice() { - const queryClient = useQueryClient(); - const { isLoading, mutateAsync } = useMutation(registerDevice, { - onSuccess: (device: Device) => { - queryClient.setQueryData(["devices"], (oldDevices) => - addOne(oldDevices, device) - ); - }, - }); - - return { isAdding: isLoading, registerDevice: mutateAsync }; -} diff --git a/src/connect/pages/DeviceRegistration.tsx b/src/connect/pages/DeviceRegistration.tsx index 6a20c7ae..d41bb49d 100644 --- a/src/connect/pages/DeviceRegistration.tsx +++ b/src/connect/pages/DeviceRegistration.tsx @@ -7,9 +7,6 @@ import { NavLink, Outlet } from "react-router-dom"; import { useAuth } from "../../auth/contexts/AuthProvider"; import QueryWrapper from "../../core/components/QueryWrapper"; import { useSnackbar } from "../../core/contexts/SnackbarProvider"; -import SvgContainer from "../../core/components/SvgContainer"; -import { ReactComponent as S3Svg } from "../assets/amazon-s3.svg"; -import { ReactComponent as DynamoSvg } from "../assets/aws-dynamodb.svg"; import { useAddDevice } from "../hooks/useAddDevice"; import { useDeleteDevices } from "../hooks/useDeleteDevices"; import { useUpdateDevice } from "../hooks/useUpdateDevice"; diff --git a/src/mocks/server.ts b/src/mocks/server.ts index c0c6755f..4303954f 100644 --- a/src/mocks/server.ts +++ b/src/mocks/server.ts @@ -13,13 +13,11 @@ function generateId() { return (Math.floor(Math.random() * 10000) + 1).toString(); } -// const axiosMockInstance = axios.create(); - // This sets the mock adapter on the default instance export const mock = new MockAdapter(axios, { delayResponse: 10, onNoMatch: "throwException" }); // Activity -// mock.restore(); +// mock.restore(); this will remove mocking behavior mock.onGet("/api/activity-logs").reply(200, activityLogs); // Auth @@ -59,8 +57,8 @@ mock .reply(({ data }) => [201, { ...JSON.parse(data), id: generateId() }]); mock.onPut("/api/devices").reply(({ data }) => [200, data]); -// Oracle -mock - .onPost("http://3.95.191.132:30806/oracle") - .reply(({ data }) => [201, { ...JSON.parse(data), id: generateId() }]); -mock.onPost("/oracle").reply(200); +// // If wanting to use axios, instead of fetch. Set up mock for oracle endpoint +// mock +// .onPost("http://3.95.191.132:30806/oracle") +// .reply(({ data }) => [201, { ...JSON.parse(data), id: generateId() }]); +// mock.onPost("/oracle").reply(200);