Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Correct info site routes
Browse files Browse the repository at this point in the history
Adds the info site routes as constants in the constants file,
instead of using their string value directly. This allows us to
update the links in one place in order to keep them consistent and
avoid outdated links around the site.

Updates the info links throughout the site to use the constant values.

Updates the info site routes to use the most current version of the
URLs.
  • Loading branch information
TaiWilkin committed Nov 10, 2021
1 parent 4dfc5bf commit 9df0164
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 88 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Correct info site routes [#1520](https://github.com/open-apparel-registry/open-apparel-registry/pull/1520)

### Security

## [51] 2021-11-04
Expand Down
11 changes: 8 additions & 3 deletions src/app/src/components/Contribute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import AppGrid from './AppGrid';
import AppOverflow from './AppOverflow';
import ContributeForm from './ContributeForm';

import { listsRoute, authLoginFormRoute, InfoLink } from '../util/constants';
import {
listsRoute,
authLoginFormRoute,
InfoLink,
InfoPaths,
} from '../util/constants';

function ContributeList({ userHasSignedIn, fetchingSessionSignIn }) {
if (fetchingSessionSignIn) {
Expand Down Expand Up @@ -51,7 +56,7 @@ function ContributeList({ userHasSignedIn, fetchingSessionSignIn }) {

<p>
<a
href={`${InfoLink}/resources/how-to-contribute-data-to-the-oar`}
href={`${InfoLink}/${InfoPaths.contribute}`}
target="_blank"
rel="noreferrer"
>
Expand Down Expand Up @@ -84,7 +89,7 @@ function ContributeList({ userHasSignedIn, fetchingSessionSignIn }) {
uploaded, you will receive an email letting
you know{' '}
<a
href={`${InfoLink}/how-the-oar-improves-data-quality`}
href={`${InfoLink}/${InfoPaths.dataQuality}`}
target="_blank"
rel="noreferrer"
>
Expand Down
14 changes: 11 additions & 3 deletions src/app/src/components/CookiePreferencesText.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import React from 'react';
import { InfoLink } from '../util/constants';
import { InfoLink, InfoPaths } from '../util/constants';

const CookiePreferencesText = () => (
<div>
The Open Apparel Registry uses cookies to collect and analyze site
performance and usage. By clicking the Accept button, you agree to allow
us to place cookies and share information with Google Analytics. For
more information, please visit our{' '}
<a href={`${InfoLink}/terms-of-use`} target="_blank" rel="noreferrer">
<a
href={`${InfoLink}/${InfoPaths.termsOfUse}`}
target="_blank"
rel="noreferrer"
>
Terms of Use
</a>{' '}
and{' '}
<a href={`${InfoLink}/privacy-policy`} target="_blank" rel="noreferrer">
<a
href={`${InfoLink}/${InfoPaths.privacyPolicy}`}
target="_blank"
rel="noreferrer"
>
Privacy Policy
</a>
.
Expand Down
7 changes: 2 additions & 5 deletions src/app/src/components/EmbeddedFooter.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React from 'react';
import logo from '../styles/images/OAR_PoweredBy_white.svg';
import { InfoLink } from '../util/constants';

const EmbeddedFooter = () => (
<footer className="footerContainerEmbedded results-height-subtract" xs={12}>
<a
href="https://info.openapparel.org/"
target="_blank"
rel="noopener noreferrer"
>
<a href={`${InfoLink}`} target="_blank" rel="noopener noreferrer">
<img
className="footer-image"
src={logo}
Expand Down
7 changes: 6 additions & 1 deletion src/app/src/components/EmbeddedMapConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ function EmbeddedMapConfig({
</Typography>
<Typography paragraph style={{ width: '100%' }}>
<strong>Have questions?</strong> Check out the FAQs on our{' '}
<a href={EmbeddedMapInfoLink} className="inline-link">
<a
href={EmbeddedMapInfoLink}
className="inline-link"
target="_blank"
rel="noreferrer"
>
Embedded Map info page
</a>{' '}
or email{' '}
Expand Down
6 changes: 4 additions & 2 deletions src/app/src/components/EmbeddedMapUnauthorized.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ function EmbeddedMapUnauthorized({ isSettings, error = [] }) {
</Typography>
<Typography paragraph>
To activate this paid-for feature, check out the{' '}
<a href={EmbeddedMapInfoLink}>OAR Embedded Map</a> page on our
website for packages and pricing options.
<a href={EmbeddedMapInfoLink} target="_blank" rel="noreferrer">
OAR Embedded Map
</a>{' '}
page on our website for packages and pricing options.
</Typography>
{isSettings && (
<Typography paragraph>
Expand Down
3 changes: 2 additions & 1 deletion src/app/src/components/FacilityListItems.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
authLoginFormRoute,
dashboardListsRoute,
InfoLink,
InfoPaths,
} from '../util/constants';

import { facilityListPropType } from '../util/propTypes';
Expand Down Expand Up @@ -209,7 +210,7 @@ class FacilityListItems extends Component {
<div style={facilityListItemsStyles.subheadStyles}>
Read about how your facility data is{' '}
<a
href={`${InfoLink}/how-the-oar-improves-data-quality`}
href={`${InfoLink}/${InfoPaths.dataQuality}`}
target="_blank"
rel="noreferrer"
>
Expand Down
6 changes: 3 additions & 3 deletions src/app/src/components/FilterSidebarGuideTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Link } from 'react-router-dom';

import { filterSidebarStyles } from '../util/styles';
import { authRegisterFormRoute } from '../util/constants';
import { authRegisterFormRoute, InfoLink, InfoPaths } from '../util/constants';

export default function FilterSidebarGuideTab({ vectorTile }) {
if (!vectorTile) {
Expand Down Expand Up @@ -36,7 +36,7 @@ export default function FilterSidebarGuideTab({ vectorTile }) {
are able to search the site without creating an account.
</p>
<a
href="http://info.openapparel.org/about"
href={`${InfoLink}/${InfoPaths.aboutUs}`}
target="_blank"
rel="noopener noreferrer"
className="link-underline"
Expand Down Expand Up @@ -120,7 +120,7 @@ export default function FilterSidebarGuideTab({ vectorTile }) {
the OAR map.
</p>
<a
href="http://info.openapparel.org/about"
href={`${InfoLink}/${InfoPaths.aboutUs}`}
target="_blank"
rel="noopener noreferrer"
className="link-underline"
Expand Down
48 changes: 2 additions & 46 deletions src/app/src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import logo from '../styles/images/Creative-Commons-Attribution-ShareAlike-40-International-Public.png';

import { setGDPROpen } from '../actions/ui';
import { InfoLink } from '../util/constants';
import { FooterLinks } from '../util/constants';

const linkButtonStyle = {
minHeight: 'auto',
Expand All @@ -17,54 +17,10 @@ const linkButtonStyle = {
fontWeight: 700,
};

const links = [
{
href: 'https://www.azavea.com/',
prefix: 'Built by ',
text: 'Azavea',
external: true,
newTab: true,
},
{
text: 'Cookie Preferences',
button: true,
},
{
href: `${InfoLink}/contact`,
text: 'Contact us',
external: true,
newTab: true,
},
{
href: `${InfoLink}/work-with-us`,
text: 'Work with us',
external: true,
newTab: true,
},
{
href: `${InfoLink}/faqs`,
text: 'FAQs',
external: true,
newTab: true,
},
{
href: `${InfoLink}/privacy-policy`,
text: 'Privacy policy',
external: true,
newTab: true,
},
{
href: `${InfoLink}/terms-of-use`,
text: 'Terms of use',
external: true,
newTab: true,
},
];

const Footer = ({ openGDPR }) => (
<footer className="results-height-subtract" xs={12}>
<div className="simple-footer">
{links.map(l => {
{FooterLinks.map(l => {
if (l.external && 'prefix' in l) {
return (
<span
Expand Down
4 changes: 2 additions & 2 deletions src/app/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MainMobileNav from './Navbar/MainMobileNav';

import '../styles/css/header.css';

import { InfoLink } from '../util/constants';
import { InfoLink, InfoPaths } from '../util/constants';

function Navbar() {
const [activeSubmenu, setActiveSubmenu] = useState(null);
Expand All @@ -37,7 +37,7 @@ function Navbar() {
/>
<a
className="nav__link nav__link--level-1"
href={`${InfoLink}/resources`}
href={`${InfoLink}/${InfoPaths.storiesResources}`}
target="_blank"
rel="noreferrer"
>
Expand Down
8 changes: 6 additions & 2 deletions src/app/src/components/Navbar/MainMobileNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import MobileNavParent from './MobileNavParent';
import BurgerButton from './BurgerButton';
import MobileContributeButton from './MobileContributeButton';

import { MOBILE_HEADER_HEIGHT, InfoLink } from '../../util/constants';
import {
MOBILE_HEADER_HEIGHT,
InfoLink,
InfoPaths,
} from '../../util/constants';

const styles = {
mobileNavActive: {
Expand Down Expand Up @@ -53,7 +57,7 @@ function MainMobileNav({
<div className="mobile-nav__item">
<a
className="mobile-nav__link"
href={`${InfoLink}/resources`}
href={`${InfoLink}/${InfoPaths.storiesResources}`}
target="_blank"
rel="noreferrer"
onClick={handleClose}
Expand Down

0 comments on commit 9df0164

Please sign in to comment.