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

Debug intermittent rendering issue #340

Merged
merged 7 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ parameters:
default: "main"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "kw-fix-region-order"
default: "kw-test"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ function App() {
<>
<Helmet titleTemplate="%s - TTA Smart Hub" defaultTitle="TTA Smart Hub">
<meta charSet="utf-8" />
<script src="https://touchpoints.app.cloud.gov/touchpoints/7d519b5e.js" async />
</Helmet>
<BrowserRouter>
{authenticated && (
Expand Down
29 changes: 6 additions & 23 deletions frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
import React, { useState, useEffect } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { NavLink as Link, withRouter } from 'react-router-dom';
import { NavLink as Link } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChartBar } from '@fortawesome/free-solid-svg-icons';

Expand Down Expand Up @@ -33,7 +33,6 @@ const SiteNav = ({
authenticated,
logout,
user,
location,
}) => {
const navItems = [
<button type="button" onClick={() => logout(false)} className={`usa-button--unstyled width-full ${navLinkClasses}`}>
Expand All @@ -47,25 +46,11 @@ const SiteNav = ({
</NavLink>,
];

const [showActivityReportSurveyButton, setShowActivityReportSurveyButton] = useState(false);

useEffect(() => {
if (location.pathname === '/activity-reports') {
setShowActivityReportSurveyButton(true);
} else {
setShowActivityReportSurveyButton(false);
}
}, [location.pathname]);

const items = admin ? navItems.concat(adminNavItem) : navItems;

return (
<div>
<div className="position-relative z-top">
<button id="tp-ar-landing-survey" className={`usa-button position-fixed bottom-2 right-1 display-${showActivityReportSurveyButton ? 'block' : 'none'}`} aria-label="Please leave feedback" type="button">Please leave feedback</button>
</div>
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<>
<div className="width-full smart-hub-sitenav-separator--after">
<div role="complementary" className="padding-2 smart-hub-sitenav-word-wrap--break">
Expand Down Expand Up @@ -95,8 +80,7 @@ const SiteNav = ({
</div>
</nav>
</>
)}
</div>
)}
</div>
);
};
Expand All @@ -107,7 +91,6 @@ SiteNav.propTypes = {
authenticated: PropTypes.bool,
logout: PropTypes.func,
user: PropTypes.shape({ name: PropTypes.string, email: PropTypes.string }),
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired,
};

SiteNav.defaultProps = {
Expand All @@ -120,4 +103,4 @@ SiteNav.defaultProps = {
},
};

export default withRouter(SiteNav);
export default SiteNav;
4 changes: 0 additions & 4 deletions frontend/src/pages/Landing/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
font-family: 'Merriweather', serif;
}

.fba-modal .fba-modal-dialog {
margin-top: 120px;
}

.pagination {
float: right;
white-space: nowrap;
Expand Down
5 changes: 1 addition & 4 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ app.use(express.urlencoded({ extended: true }));
app.use(helmet({
contentSecurityPolicy: {
directives: {
...omit(helmet.contentSecurityPolicy.getDefaultDirectives(), 'upgrade-insecure-requests', 'block-all-mixed-content', 'script-src', 'img-src', 'default-src'),
...omit(helmet.contentSecurityPolicy.getDefaultDirectives(), 'upgrade-insecure-requests', 'block-all-mixed-content'),
'form-action': ["'self'"],
scriptSrc: ["'self'", 'https://touchpoints.app.cloud.gov/touchpoints/7d519b5e.js'],
imgSrc: ["'self'", 'data:', 'https://touchpoints.app.cloud.gov'],
defaultSrc: ["'self'", 'https://touchpoints.app.cloud.gov/touchpoints/7d519b5e/submissions.json'],
},
},
}));
Expand Down