Skip to content

Commit 5951cc1

Browse files
committed
Changing source of "aboutPagesContent.yaml" file.
Old Method: aboutController.js was used to pull data from GitHub's URL. New Method: aboutController.js will now use static file from code base. There are few folders under content directory which will be not needed with this change as code is reading data from local. We might need to clean up those directories and have single sources. Current code will be reading YAML file from "dev" directory.
1 parent 616de71 commit 5951cc1

File tree

4 files changed

+1
-7
lines changed

4 files changed

+1
-7
lines changed

conf/inject.template.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ window.injectedEnv = {
33
REACT_APP_LOGIN_URL: '${REACT_APP_LOGIN_URL}',
44
REACT_APP_USER_LOGOUT_URL: '${REACT_APP_USER_LOGOUT_URL}',
55
REACT_APP_BACKEND_API: '${REACT_APP_BACKEND_API}',
6-
REACT_APP_ABOUT_CONTENT_URL: '${REACT_APP_ABOUT_CONTENT_URL}',
76
REACT_APP_BE_VERSION: '${REACT_APP_BE_VERSION}',
87
REACT_APP_FE_VERSION: '${REACT_APP_FE_VERSION}',
98
REACT_APP_APPLICATION_VERSION: '${REACT_APP_APPLICATION_VERSION}',

packages/bento-frontend/public/injectEnv.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
window.injectedEnv = {
44

55
REACT_APP_APPLICATION_VERSION: 'YYYY_MM_DD/HH:MM',
6-
REACT_APP_ABOUT_CONTENT_URL: 'https://raw.githubusercontent.com/CBIIT/bento-frontend/master/src/content/dev/aboutPagesContent.yaml',
76

87
// Services API End Points:
98
REACT_APP_BACKEND_API: 'http://localhost:3000/v1/graphql/',

packages/bento-frontend/src/pages/about/aboutController.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import React, { useState, useEffect } from 'react';
22
import yaml from 'js-yaml';
33
import axios from 'axios';
44
import YAMLData from '../../content/prod/aboutPagesContent.yaml';
5-
import env from '../../utils/env';
65
import AboutView from './aboutView';
76

8-
const ABOUT_CONTENT_URL = env.REACT_APP_ABOUT_CONTENT_URL;
9-
107
const About = ({ match }) => {
118
const [data, setData] = useState([]);
129

@@ -15,7 +12,7 @@ const About = ({ match }) => {
1512
let resultData = [];
1613
let result = [];
1714
try {
18-
result = await axios.get(ABOUT_CONTENT_URL);
15+
result = await axios.get(YAMLData);
1916
resultData = yaml.safeLoad(result.data);
2017
} catch (error) {
2118
result = await axios.get(YAMLData);

packages/bento-frontend/src/pages/sysInfo/view.js

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ function SysInfoView() {
107107
createRow('Backend API Endpoint', env.REACT_APP_BACKEND_API),
108108
createRow('File Service API Endpoint', env.REACT_APP_FILE_SERVICE_API),
109109
createRow('Auth Service API Endpoint', env.REACT_APP_AUTH_SERVICE_API),
110-
createRow('REACT_APP_ABOUT_CONTENT_URL', env.REACT_APP_ABOUT_CONTENT_URL),
111110
];
112111

113112
const dependenciesData = [

0 commit comments

Comments
 (0)