From 3628ded6ad537c01ce51ee9a7ffb008bd1b0e228 Mon Sep 17 00:00:00 2001 From: 9308233900 Date: Fri, 9 Apr 2021 14:06:10 -0700 Subject: server up --- frontend/src/App.css | 0 frontend/src/App.js | 18 ++++++++++++++++ frontend/src/App.test.js | 8 +++++++ frontend/src/SECAPIData.js | 47 +++++++++++++++++++++++++++++++++++++++++ frontend/src/index.js | 16 ++++++++++++++ frontend/src/reportWebVitals.js | 13 ++++++++++++ frontend/src/setupTests.js | 5 +++++ 7 files changed, 107 insertions(+) create mode 100644 frontend/src/App.css create mode 100644 frontend/src/App.js create mode 100644 frontend/src/App.test.js create mode 100644 frontend/src/SECAPIData.js create mode 100644 frontend/src/index.js create mode 100644 frontend/src/reportWebVitals.js create mode 100644 frontend/src/setupTests.js (limited to 'frontend/src') diff --git a/frontend/src/App.css b/frontend/src/App.css new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/App.js b/frontend/src/App.js new file mode 100644 index 0000000..73ec59e --- /dev/null +++ b/frontend/src/App.js @@ -0,0 +1,18 @@ +import './App.css'; +import SECAPIData from "./SECAPIData"; + +/* +App is the main react component that contains all the other maps components +*/ + +function App() { + + return ( +
+ +
+ ); +} + +export default App; + diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js new file mode 100644 index 0000000..1f03afe --- /dev/null +++ b/frontend/src/App.test.js @@ -0,0 +1,8 @@ +import { render, screen } from '@testing-library/react'; +import App from './App'; + +test('renders learn react link', () => { + render(); + const linkElement = screen.getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/frontend/src/SECAPIData.js b/frontend/src/SECAPIData.js new file mode 100644 index 0000000..daa653a --- /dev/null +++ b/frontend/src/SECAPIData.js @@ -0,0 +1,47 @@ +import React, {useState, useRef} from 'react'; + + +function SECAPIData() { + + const [filedAt, setFiledAt] = useState(""); + const [xml, setXML] = useState(""); + + const requestData = () => { + + const toSend = { + filedAt : filedAt, + xml : xml, + }; + + let axiosConfig = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + "Access-Control-Allow-Origin": "*", + } + }; + + axios({ + method: 'post', + url: 'http://localhost:4567/', + headers: axiosConfig, + data: toSend + }) + + .then(response => { + + }) + .catch(function (error) { + console.log(error); + }); + } + + return ( +
+

SECAPIData

+ +
+ ); +} + +export default SECAPIData; + \ No newline at end of file diff --git a/frontend/src/index.js b/frontend/src/index.js new file mode 100644 index 0000000..7998135 --- /dev/null +++ b/frontend/src/index.js @@ -0,0 +1,16 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; +import reportWebVitals from './reportWebVitals'; + +ReactDOM.render( + + + , + document.getElementById('root') +); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); diff --git a/frontend/src/reportWebVitals.js b/frontend/src/reportWebVitals.js new file mode 100644 index 0000000..5253d3a --- /dev/null +++ b/frontend/src/reportWebVitals.js @@ -0,0 +1,13 @@ +const reportWebVitals = onPerfEntry => { + if (onPerfEntry && onPerfEntry instanceof Function) { + import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + }); + } +}; + +export default reportWebVitals; diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js new file mode 100644 index 0000000..8f2609b --- /dev/null +++ b/frontend/src/setupTests.js @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom'; -- cgit v1.2.3-70-g09d2