Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 16 #2

Merged
merged 66 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
334ab92
feat(bach-ui): hide unnecessary screens. updated search page size for…
chrisjrd Mar 11, 2022
a13a772
feat(bach-ui): replaced hardcoded horizontal space with flex behavior…
chrisjrd Mar 11, 2022
694630b
feat(bach-ui): remove remaining margin from Data Summary layout.
chrisjrd Mar 11, 2022
75b5e6b
feat(bach-ui): synced layouts between Bach sections. Temporary fix fo…
chrisjrd Mar 12, 2022
03e33c6
feat(bach-ui): fixing "fixed" AppBar interactions with Drawer and mai…
chrisjrd Mar 12, 2022
a3e5f82
feat(bach-ui): removing commented out code.
chrisjrd Mar 14, 2022
93d59c6
feat(bach-ui): using header color compatible with react version.
chrisjrd Mar 14, 2022
7c85a96
feat(bach-ui): changed app header to be relative positioning for simp…
chrisjrd Mar 14, 2022
51e5701
feat(bach-ui): simplified table styles. adjusted column default width…
chrisjrd Mar 14, 2022
0e9fd58
feat(bach-ui): use standard MIME type.
chrisjrd Mar 14, 2022
3254cb3
feat(bach-ui): organize imports
chrisjrd Mar 14, 2022
62daaa4
feat(bach-ui): fixed prop-type typo
chrisjrd Mar 14, 2022
2b52af5
feat(bach-ui): replaced most relative paths from imports with aliases…
chrisjrd Mar 14, 2022
e87201a
feat(bach-ui): fixed non-javascript imports in Jest. removed addition…
chrisjrd Mar 14, 2022
8d386e2
feat(bach-ui): replaced NEN references with SDP
chrisjrd Mar 14, 2022
ed7b4b3
feat(bach-ui): adjust minimum width due to longer L3 filenames.
chrisjrd Mar 14, 2022
3c7e74f
feat(bach-ui): I before E, except after C.
chrisjrd Mar 15, 2022
3143b45
feat(bach-ui): update report type from nen to sdp.
chrisjrd Mar 15, 2022
be56579
feat(bach-ui): replace GDS references with "ancillary".
chrisjrd Mar 15, 2022
e908ebc
feat(bach-ui): simplified summary table. removed visible CRID. synced…
chrisjrd Mar 15, 2022
6187942
feat(bach-ui): replace hardcoded styles with theme references.
chrisjrd Mar 15, 2022
ac1e297
feat(bach-ui): removed unused style classes.
chrisjrd Mar 15, 2022
69f3caf
feat(bach-ui): minimized styling on FilterTableGrid
chrisjrd Mar 15, 2022
faf913e
feat(bach-ui): replaced remaining hardcoded "NASA blue" references wi…
chrisjrd Mar 15, 2022
92175c4
feat(bach-ui): replaced remaining hardcoded "NASA blue" references wi…
chrisjrd Mar 15, 2022
78149fe
feat(bach-ui): simplified button styles using theme.
chrisjrd Mar 15, 2022
7dbbbfe
feat(bach-ui): simplified table styles using theme.
chrisjrd Mar 15, 2022
0166b8c
feat(bach-ui): simplified filter menu styles.
chrisjrd Mar 15, 2022
0d8f81a
feat(bach-ui): removed hardcoded background colors and dimensions fro…
chrisjrd Mar 15, 2022
9970401
feat(bach-ui): removed dead code from styles.
chrisjrd Mar 15, 2022
ddc953b
feat(bach-ui): changed primary color to complement the OPERA logo.
chrisjrd Mar 15, 2022
7ad7370
feat(bach-ui): changed transfer state labels. adjusted link appearanc…
chrisjrd Mar 15, 2022
ad96488
feat(bach-ui): added some padding to Grid. Removed color constant. Im…
chrisjrd Mar 16, 2022
c21f0a0
feat(bach-ui): removed invalid theme constant. fixed transfer state t…
chrisjrd Mar 16, 2022
2b83d00
feat(bach-ui): fixed transfer status filters.
chrisjrd Mar 16, 2022
c72fda9
feat(bach-ui): fixed transfer status filters.
chrisjrd Mar 16, 2022
1bc9ee9
feat(bach-ui): added user-friendly Volume display
chrisjrd Mar 16, 2022
3002264
feat(bach-ui): new page title context to share page title with header…
chrisjrd Mar 17, 2022
a37f1e8
feat(bach-ui): replaced use of Ancillary API with Data API. Added que…
chrisjrd Mar 17, 2022
3f6d23c
feat(bach-ui): fix mime param for generated products tab.
chrisjrd Mar 17, 2022
048c1aa
feat(bach-ui): update import alias.
chrisjrd Mar 17, 2022
86a9878
feat(bach-ui): removed crid references.
chrisjrd Mar 17, 2022
a08ae71
feat(bach-ui): moved Volume unit display string util function to sepa…
chrisjrd Mar 17, 2022
a127040
feat(bach-ui): use the same endpoint as the other tabs for consistenc…
chrisjrd Mar 17, 2022
7c278f1
feat(bach-ui): UI fixes. See detailed commit message.
chrisjrd Mar 18, 2022
22f661b
feat(bach-ui): added tile ID filter. fixed form input field name conf…
chrisjrd Mar 22, 2022
c0bd619
feat(bach-ui): fixed tile ID filter
chrisjrd Mar 22, 2022
d8bdb33
feat(bach-ui): update page sizes.
chrisjrd Mar 22, 2022
2e253bd
feat(bach-ui): user-friendly datetime render.
chrisjrd Mar 22, 2022
f13ec63
feat(bach-ui): added a modal dialog to Data Summary > All Data when a…
chrisjrd Mar 23, 2022
b7b4313
feat(bach-ui): added modal dialog to all subpages of Data Summary.
chrisjrd Mar 23, 2022
0b70603
feat(bach-ui): fixing param for hover text on CNM-R success.
chrisjrd Mar 23, 2022
59f95d3
feat(bach-ui): eslint fixes. no open on `npm start`.
chrisjrd Mar 24, 2022
3caf03a
feat(bach-ui): update grid breakpoints. removed some unnecessary depe…
chrisjrd Mar 25, 2022
3f278af
feat(bach-ui): misc refactor
chrisjrd Mar 25, 2022
9e25b1b
feat(bach-ui): added sensor filter. changed Product Accountability cl…
chrisjrd Mar 25, 2022
aa7a9cc
feat(bach-ui): removed data take and track frame references.
chrisjrd Mar 25, 2022
a407cfb
feat(bach-ui): Tab renames. added missing viewport meta tag for respo…
chrisjrd Mar 25, 2022
4d0c76d
feat(bach-ui): importing Roboto font as in MUI guide.
chrisjrd Mar 26, 2022
53ba8a7
feat(bach-ui): fix venue
chrisjrd Apr 1, 2022
dc3712f
feat(bach-ui): handle not_applicable vs unknown transfer status
chrisjrd Apr 1, 2022
2f2e3b4
feat(bach-ui): fixed unit tests and package.json
chrisjrd Apr 1, 2022
befead2
feat(bach-ui): fixed unit test
chrisjrd Apr 1, 2022
dd096c3
feat(bach-ui): added unit tests for DataUtils. simplified render call…
chrisjrd Apr 4, 2022
3869f96
feat(bach-ui): removed additional relative imports from tests
chrisjrd Apr 4, 2022
8efa26d
feat(bach-ui): simplifying tests
chrisjrd Apr 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ module.exports = {
react: {
version: "detect",
},
"import/resolver": {
"eslint-import-resolver-custom-alias": {
alias: {
"@bach": "./src",
},
extensions: [".js", ".jsx"],
},
},
},
rules: {
"prettier/prettier": ["error", { singleQuote: false, parser: "flow" }],
Expand Down
11,945 changes: 5,383 additions & 6,562 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 20 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"jest": {
"transform": {
"^.+\\.svg$": "jest-svg-transformer",
"^.+\\.(js|jsx)$": "babel-jest"
"^.+\\.(js|jsx)$": "babel-jest",
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
},
"moduleNameMapper": {
"@bach/test-utils": "<rootDir>/src/test_utils.jsx",
"@bach/(.*)": "<rootDir>/src/$1",
"^.+.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
}
},
"scripts": {
Expand All @@ -27,72 +33,62 @@
"dependencies": {
"@babel/core": "^7.17.5",
"@date-io/moment": "^2.13.1",
"@fontsource/roboto": "^4.5.5",
"@material-ui/core": "^4.12.3",
"@material-ui/data-grid": "^4.0.0-alpha.37",
"@material-ui/icons": "^4.11.2",
"@material-ui/pickers": "^3.3.10",
"@material-ui/x-grid": "^4.0.0-alpha.37",
"@testing-library/react": "^11.2.7",
"ansi-regex": ">=5.0.1",
"axios": "^0.21.4",
"babel-eslint": "^10.1.0",
"babel-polyfill": "^6.0.16",
"babel-preset-es2015": "^6.0.15",
"babel-preset-stage-0": "^6.0.15",
"babel-runtime": "^6.26.0",
"clsx": "^1.1.1",
"css-loader": "^6.5.1",
"file-loader": "3.0.1",
"html-loader": "0.5.5",
"material-ui": "^0.20.2",
"eslint-import-resolver-custom-alias": "^1.3.0",
"file-loader": "^6.2.0",
"moment": "^2.29.1",
"node-fetch": ">=2.6.7",
"node-forge": ">=1.0.0",
"postcss": ">=8.2.13",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-json-view": "^1.21.3",
"react-router": "^5.2.1",
"react-router-dom": "^5.3.0",
"source-map": "^0.7.3",
"style-loader": "0.23.1",
"url-loader": "1.1.2",
"webpack": "4.41.0",
"url-loader": "^4.1.1",
"webpack": "^4.46.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4",
"ws": ">=6.2.2"
"webpack-dev-server": "^4.7.4"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^13.5.0",
"ansi-regex": ">=5.0.1",
"babel-core": "^6.26.3",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.3",
"babel-loader": "^8.2.4",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"css-loader": "^5.2.7",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^1.7.0",
"eslint-plugin-react-hooks": "^4.3.0",
"html-webpack-plugin": "3.2.0",
"jest": "^26.6.3",
"jest-svg-transformer": "^1.0.0",
"node-fetch": ">=2.6.7",
"node-forge": ">=1.0.0",
"postcss": ">=8.2.13",
"jest-transform-stub": "^2.0.0",
"prettier": "2.2.1",
"prettier-eslint": "^12.0.0",
"react-test-renderer": "^17.0.2",
"ws": ">=6.2.2"
"react-test-renderer": "^17.0.2"
}
}
14 changes: 6 additions & 8 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ import React from "react";

import MomentUtils from "@date-io/moment";
import { MuiPickersUtilsProvider } from "@material-ui/pickers";
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
import { createTheme, ThemeProvider } from "@material-ui/core/styles";

import Routes from "./pages/Routes";
import Routes from "@bach/pages/Routes";

import Contexts from "./contexts";
import Contexts from "@bach/contexts";

const defaultTheme = createMuiTheme({
const defaultTheme = createTheme({
palette: {
primary: {
main: "#007DFF",
main: "#10B0AB",
dark: "#069995",
},
secondary: {
main: "#EEEEEE",
},
background: {
main: "#FFFFFF",
},
},
});

Expand Down
22 changes: 9 additions & 13 deletions src/api/DataUtils/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import axios from "axios";
import { DEFAULT_HOST, SUFFIX } from "../../config";
import mozartConfig from "../../config/mozartConfig.json";
import { DEFAULT_HOST, SUFFIX } from "@bach/config";
import mozartConfig from "@bach/config/mozartConfig.json";

import { buildAPIUrl } from "../utils";

import { URL_TO_VALUES_DICT, VALUES_TO_URL_DICT } from "../../constants";
import { URL_TO_VALUES_DICT, VALUES_TO_URL_DICT } from "@bach/constants";
import { buildAPIUrl } from "@bach/api/utils";

export async function makeAPIGet(paths, params, data) {
const url = buildAPIUrl(paths, `${DEFAULT_HOST}${SUFFIX}`);
try {
const config = { method: "GET", url };
if (data !== null) config.data = data;
const response = await axios.get(url, { params });
return response;
} catch (err) {
console.error(err);
return {};
const config = { method: "GET", url };
if (data !== null) {
config.data = data;
}
const response = await axios.get(url, { params });
return response;
}

export function getVenue() {
Expand Down
42 changes: 42 additions & 0 deletions src/api/DataUtils/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from "react"
import { render } from "@bach/test-utils";
import { Router } from 'react-router-dom'
import {createMemoryHistory} from 'history'
import { getUrlParams, pushUrlParams } from "@bach/api/DataUtils"

describe("DataUtils test", () => {
it("should parse query params", () => {
// ARRANGE
const history = createMemoryHistory()
render(<Router history={history}><></></Router>)
history.push("/dummyPath?param1&param2=value2")

// ACT
const params = getUrlParams(history);

// ASSERT
expect(params).toEqual({
"param1": undefined,
"param2": "value2"
});
});

it("should push query params", () => {
// ARRANGE
const history = createMemoryHistory()
render(<Router history={history}><></></Router>)

// ACT
const params = pushUrlParams(
{
"param1": undefined,
"param2": "value2",
"startDate": true // needs to be truthy
},
history
);

// ASSERT
expect(history.location.search).toEqual("?start_date=true");
});
});
6 changes: 3 additions & 3 deletions src/components/FilterController/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from "react";
import PropTypes from "prop-types";

import clsx from "clsx";

import { Typography, Button, Paper } from "@material-ui/core";

import useStyles from "./style";
Expand All @@ -17,7 +15,9 @@ export default function FilterController(props) {
<Paper
position="fixed"
elevation={0}
className={clsx(classes.filterControlPaper)}
classes={{
root: classes.filterControlPaper,
}}
>
<Button
variant="outlined"
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterController/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, fireEvent } from "@testing-library/react";

import "@testing-library/jest-dom";

import FilterController from "./index";
import FilterController from "@bach/components/FilterController"

describe("Filter Controller", () => {
const defaultProps = {
Expand Down
20 changes: 4 additions & 16 deletions src/components/FilterController/style.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
import { makeStyles } from "@material-ui/core/styles";

export default makeStyles(() => ({
export default makeStyles((theme) => ({
filterControlPaper: {
backgroundColor: "inherit",
display: "flex",
flexDirection: "row",
alignItems: "center",
padding: "17px",
},
visibilityBtn: {
flex: "none",
order: 0,
flexGrow: 0,
margin: "0px 0px",
height: "32px",
left: 0,
top: 0,
borderRadius: 4,
color: "#007DFF",
borderColor: "#007DFF",
fontFamily: "Roboto",
fontStyle: "normal",
fontWeight: 500,
fontSize: 14,
lineHeight: 24,
color: theme.palette.primary.main,
borderColor: theme.palette.primary.main,
},
}));
109 changes: 56 additions & 53 deletions src/components/FilterMenu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,60 +26,63 @@ export default function FilterMenu(props) {

const onSearchClick = () => search();

const GlobalCss = withStyles({
"@global": {
".MuiCardHeader-title": {
fontSize: "1.2em",
alignSelf: "center",
position: "relative",
const GlobalCss = withStyles((theme) => {
return {
"@global": {
".MuiCardHeader-title": {
fontSize: "1.2em",
alignSelf: "center",
position: "relative",
},
".MuiCardContent-root": {
padding: "0px",
display: "flow-root",
},
".MuiCardHeader-root": {
background: theme.palette.secondary.main,
color: theme.palette.secondary.contrastText,
boxShadow: "inset 0px -1px 0px #E0E0E0",
/* Inside Auto Layout */
flex: "none",
order: 0,
alignSelf: "normal",
flexGrow: 0,
margin: "0px 0px",
},
"MuiFormControl-root": {
display: "flex",
},
".MuiCardActions-root": {
/* Sidebar / Footer */

/* Auto Layout */

display: "flex",
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
padding: "12px",

position: "static",
width: "-webkit-fill-available",
height: "56px",
left: "0px",
top: "312px",
background: theme.palette.secondary.main,
border: "1px solid #E0E0E0",
boxSizing: "border-box",
borderRadius: "0px 0px 4px 4px",
verticalAlign: "baseline",
/* Inside Auto Layout */

flex: "none",
order: 2,
alignSelf: "flex-start",
flexGrow: 0,
margin: "0px 0px",
},
},
".MuiCardContent-root": {
padding: "0px",
display: "flow-root",
},
".MuiCardHeader-root": {
background: "#EEEEEE",
boxShadow: "inset 0px -1px 0px #E0E0E0",
/* Inside Auto Layout */
flex: "none",
order: 0,
alignSelf: "normal",
flexGrow: 0,
margin: "0px 0px",
},
"MuiFormControl-root": {
display: "flex",
},
".MuiCardActions-root": {
/* Sidebar / Footer */

/* Auto Layout */

display: "flex",
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
padding: "12px",

position: "static",
width: "-webkit-fill-available",
height: "56px",
left: "0px",
top: "312px",
background: "#EEEEEE",
border: "1px solid #E0E0E0",
boxSizing: "border-box",
borderRadius: "0px 0px 4px 4px",
verticalAlign: "baseline",
/* Inside Auto Layout */

flex: "none",
order: 2,
alignSelf: "flex-start",
flexGrow: 0,
margin: "0px 0px",
},
},
};
})(() => null);

return (
Expand Down
Loading