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

TGR-50: Remediation update #2155

Merged
merged 40 commits into from
Nov 7, 2024
Merged

Conversation

EdwinGuzman
Copy link
Member

@EdwinGuzman EdwinGuzman commented Jul 29, 2024

NOTE: Tests currently DO NOT run. This might be the tradeoff we deal with now or spend a week or so updating tests to jest/rtl for Hold and SHEP pages (since those are/will be left in the app until the refactor project is complete).

This is still a WIP because we are waiting on tech stacks but please test locally. Make sure you have AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set in .env for the Docker image to build correctly.

1.9.0

Remediation Project Update

Adds

  • Adds AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as example env vars needed in .env-sample. They are required for building Docker images.
  • Adds Dockerfile and instructions on how to use it locally.
  • Adds the following npm packages:
    sass, webpack-dev-middleware

Updates

  • Updates .nvmrc to use Node 20.
  • Updates the logger file.
  • Updates npm scripts to be more conventional with build and dev.
  • Updates how the webpack dev server is implemented.
  • Updates how the react-number-format package is used in the FieldsetDate component.
  • Updates implementation of the focus-trap-react package.
  • Updates node's Buffer implementation for KMS package usage.
  • Updates the following npm packages:
    @babel/preset-env, @babel/preset-react, @babel/preset-register, @nypl/nypl-core-objects, @nypl/nypl-data-api-client, @typescript-eslint/eslint-plugin, axios, babel-plugin-module-resolver, body-parser, chai, clean-webpack-plugin, compression, cookie-parser, cross-env, css-loader, doctoc, dotenv, ejs, enzyme-adapter-react-16, eslint, eslint-config-airbnb, eslint-config-prettier, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-prettier, eslint-plugin-react, eslint-plugin-react-hooks, express, file-loader, focus-trap-react, jsonwebtoken, mini-css-extract-plugin, mocha, mock-local-storage, nock, react, react-autosuggest, react-dom, react-number-format, react-redux, redux, redux-thunk, prettier, sass-loader, sinon, sinon-chai, style-loader, supertest, typescript, webpack, webpack-cli, winston, underscore, url-parse, validator

Removals

  • Removes the .ebextensions folder since this repos should no longer deploy to ElasticBeanstalk.
  • Removes the .travis.yml file to not use Travis CI.
  • Removes the Procfile since this we don't use Heroku.
  • Removes the following npm packages:
    @babel/core, @babel/polyfill, @nypl/dgx-header-component, @nypl/dgx-react-footer, @typescript-eslint/parser, node-sass, node-sass-glob-importer, react-router-scroll, webpack-bundle-analyzer, webpack-dev-server, webpack-merge

@EdwinGuzman EdwinGuzman changed the title Tgr 50/remediation update TGR-50: Remediation update Aug 12, 2024
@EdwinGuzman EdwinGuzman marked this pull request as ready for review August 12, 2024 21:00
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@danamansana danamansana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine but I think there is some commented code that I've marked to remove (unless there is some reason to keep it).

logger.js Outdated
// Supress error handling
winston.emitErrs = false;
// winston.emitErrs = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

logger.js Outdated
Comment on lines 54 to 55
// const logLevel = (process.env.NODE_ENV === 'production') ? 'info' : 'debug';
const timestamp = () => new Date().toISOString();
const formatter = (options) => {
// const timestamp = () => new Date().toISOString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Button, Checkbox, Icon } from '@nypl/design-system-react-components';
import FocusTrap from 'focus-trap-react';
// import FocusTrap from 'focus-trap-react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

Comment on lines 125 to 135
// <FocusTrap
// focusTrapOptions={{
// clickOutsideDeactivates: true,
// onDeactivate: () => {
// if (!mobile) manageFilterDisplay('none');
// },
// returnFocusOnDeactivate: false,
// }}
// active={isOpen}
// className="item-filter"
// >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

Comment on lines 19 to 27
// <FocusTrap
// focusTrapOptions={{
// onDeactivate: () => {
// if (focus) {
// focus();
// }
// },
// }}
// >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

@@ -45,7 +45,7 @@ const LoadingLayer = ({ loading, title, focus }) => {
</div>
</div>
</div>
</FocusTrap>
// {/* </FocusTrap> */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

@@ -8,7 +8,7 @@ import ReactDOM from 'react-dom';
import { Router, browserHistory, applyRouterMiddleware } from 'react-router';
import a11y from 'react-a11y';
import { Provider } from 'react-redux';
import useScroll from 'react-router-scroll/lib/useScroll';
// import useScroll from 'react-router-scroll/lib/useScroll';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code?

@EdwinGuzman
Copy link
Member Author

Good point, thanks, I'll remove the commented code.

@charmingduchess
Copy link
Contributor

@EdwinGuzman are there specs for this work? the ticket seems to be more documentation of the work itself than a directive describing what needs to happen.

@@ -1,5 +1,36 @@
## CHANGE LOG

### 1.9.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this warrant a new major version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating that. I don't think so since the update is for the codebase and not any features. Do you think it should be a major bump?

active={isOpen}
className="item-filter"
>
<div className="item-filter">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this have any accessibility implications? ie is focus going to be affected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but this page will soon be replaced so I'm not too concerned.

const path = require('path');
const webpack = require('webpack');

// Sets appEnv so the the header component will point to the search app on either Dev or Prod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the search app?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm just copy/paste issue.

@charmingduchess
Copy link
Contributor

per our discussion, please update the readme to indicate the --force flag for npm i invocation

@EdwinGuzman
Copy link
Member Author

This update is on the QA, Train, and Production live envs. Merging into development with the known issue of tests failing.

@EdwinGuzman EdwinGuzman merged commit d30b284 into development Nov 7, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants