Skip to content

Commit

Permalink
Revert "Support Node 18, 20, 21 (#2182)"
Browse files Browse the repository at this point in the history
This reverts commit 5aa7157.
  • Loading branch information
jschwarz2030 authored Dec 2, 2023
1 parent df6df06 commit 37031d3
Show file tree
Hide file tree
Showing 46 changed files with 7,984 additions and 5,705 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "@babel/eslint-parser",
"parser": "babel-eslint",
"plugins": ["react", "react-hooks", "jest"],
"rules": {
"no-unused-vars": "warn",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 20, 21]
node-version: [16]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -40,3 +40,4 @@ jobs:
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

4 changes: 3 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ This is the repository that holds the front-end code. The back-end and API are d

### Basic Dependencies:

* [Node 16-21 LTS](https://nodejs.org/)
* [Node 16 LTS](https://nodejs.org/)
* [yarn](https://yarnpkg.com/)
* [jq](https://stedolan.github.io/jq/)
* [curl](https://curl.haxx.se/)

Note: When installing Node LTS, ensure that the version of node installed is <= 17.0.1 & conversely, the version of npm is <= 8.19.3. Otherwise, with higher versions of node, yarn would not be able to recognize Node and run the frontend portion of the codebase.

### Initial Setup

1. Create a `.env.development.local` file and then look through `.env` at the
Expand Down
30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
"@apollo/client": "^3.5.4",
"@formatjs/intl-relativetimeformat": "^6.0.2",
"@mapbox/geo-viewport": "^0.4.0",
"@mapbox/geojsonhint": "^3.0.0",
"@nivo/bar": "^0.79.1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@nivo/radar": "^0.79.1",
"@popperjs/core": "^2.8.4",
"@rjsf/core": "^5.14.2",
"@rjsf/utils": "^5.14.2",
"@rjsf/core": "^2.1.0",
"@turf/bbox": "^6.0.1",
"@turf/bbox-polygon": "^6.0.1",
"@turf/bearing": "^6.0.1",
"@turf/boolean-contains": "^6.0.1",
"@turf/boolean-disjoint": "^6.0.2",
"@turf/boolean-valid": "^6.5.0",
"@turf/center": "^6.0.1",
"@turf/centroid": "^6.0.2",
"@turf/distance": "^6.0.1",
Expand Down Expand Up @@ -46,6 +45,7 @@
"mapillary-js": "^4.1.0",
"normalize.css": "^7.0.0",
"normalizr": "^3.6.0",
"parse-link-header": "^2.0.0",
"piwik-react-router": "^0.12.1",
"prop-types": "^15.6.0",
"query-string": "^6.13.1",
Expand All @@ -63,7 +63,7 @@
"react-elastic-carousel": "^0.9.0",
"react-grid-layout": "^0.18.3",
"react-helmet": "^6.1.0",
"react-intl": "^6.5.5",
"react-intl": "^4.6.9",
"react-intl-formatted-duration": "^4.0.0",
"react-leaflet": "^2.7.0",
"react-leaflet-bing-v2": "^5.0.1",
Expand All @@ -72,10 +72,10 @@
"react-popper": "^2.2.4",
"react-query": "^3.34.2",
"react-redux": "^7.2.6",
"react-responsive": "^9.0.2",
"react-responsive": "^8.1.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-scripts": "^4.0.3",
"react-share": "^4.2.0",
"react-syntax-highlighter": "^15.4.3",
"react-table-6": "^6.11.0",
Expand All @@ -86,7 +86,7 @@
"remark-external-links": "^6.1.0",
"remark-react": "^7.0.1",
"route-matcher": "^0.1.0",
"sass": "^1.69.5",
"sass": "^1.54.2",
"stale-lru-cache": "^5.1.1",
"styled-components": "^5.1.0",
"timezones.json": "^1.5.2",
Expand All @@ -96,17 +96,15 @@
"xmltojson": "^1.3.5"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/eslint-parser": "^7.23.3",
"@babel/helper-get-function-arity": "^7.16.7",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@openstreetmap/id-tagging-schema": "^3.0.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.7",
"eslint": "^8.54.0",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.1",
"extract-react-intl-messages": "^4.1.1",
"jest-environment-jsdom-sixteen": "^1.0.3",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.21",
"postcss-cli": "^9.0.2",
Expand Down Expand Up @@ -136,9 +134,9 @@
"start-js": "react-scripts --max_old_space_size=4096 start",
"start": "npm-run-all -p copy-static update-layers watch-postcss start-js",
"build": "yarn update-static && yarn run build-intl && yarn run update-layers-prod && yarn run build-postcss && react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test --resetMocks=false --detectOpenHandles",
"test:cov": "react-scripts test --coverage --resetMocks=false",
"test:cov-full": "react-scripts test --coverage --watchAll --resetMocks=false",
"test": "react-scripts test --env=jest-environment-jsdom-sixteen --resetMocks=false",
"test:cov": "react-scripts test --coverage --env=jest-environment-jsdom-sixteen --resetMocks=false",
"test:cov-full": "react-scripts test --coverage --watchAll --env=jest-environment-jsdom-sixteen --resetMocks=false",
"eject": "react-scripts eject"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminPane/AdminPane.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.admin {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.calendar-heatmap {
$calendar-bucket-colors: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../mixins.scss';
@import 'mixins.scss';

.admin__manage.challenge-dashboard {
section {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.admin__manage.inspect-task {
.task-pane {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,24 @@ describe("EditChallenges", () => {
);
expect(container.firstChild.classList["0"]).toBe("pane-loading");
});

it("renders project with a challenge button", () => {
const { getByText } = global.withProvider(
<EditChallenges
user={{
isLoggedIn: true,
id: 1,
properties: { mr3Frontend: { settings: { tallied: { 1: [1, 2] } } } }
}}
history={{ location: "", push: () => null }}
project={{ id: 1, name: "project 1" }}
intl={{ formatMessage: () => null }}
challenges={[{ id: 1, name: "challenge 1" }, { id: 2, name: "challenge 2" }]}
/>
);
const challengeOne = getByText("challenge 1");
expect(challengeOne).toBeInTheDocument();
const challengeTwo = getByText("challenge 2");
expect(challengeTwo).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../mixins.scss';
@import 'mixins.scss';

.admin__manage.project-dashboard {
.admin__manage__primary-content {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.admin__manage__managed-item-list.project-list {
font-size: $size-5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.admin__manage.projects-dashboard {
&__dashboard-controls {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ export class ChallengeResultList extends Component {
}

render() {
const search = _get(this.props, 'currentSearch.challenges', {})
const query = search.query ? search.query : this.props.searchFilters.project ? this.props.searchFilters.project : this.props.searchFilters.task

const challengeResultsUnbound = _clone(this.props.pagedChallenges);
const challengeResults = this.props.location?.pathname?.includes("browse/challenges")
&& (this.props.searchSort?.sortBy === "created"
Expand Down Expand Up @@ -130,6 +127,8 @@ export class ChallengeResultList extends Component {
}, []);

const isFetching = _get(this.props, 'fetchingChallenges', []).length > 0

const search = _get(this.props, 'currentSearch.challenges', {})
const searchType = this.props.searchFilters.searchType
const bounds = _get(search, 'mapBounds.bounds')
const locationFilter = _get(search, 'filters.location')
Expand All @@ -139,6 +138,8 @@ export class ChallengeResultList extends Component {
_isEmpty(otherFilters) &&
(_isEmpty(locationFilter) || !bounds || !boundsWithinAllowedMaxDegrees(bounds))

const query = search.query ? search.query : this.props.searchFilters.project ? this.props.searchFilters.project : this.props.searchFilters.task

let matchedId = []
if(!isNaN(query) && query && !this.props.history.location.pathname.includes('browse/projects/')) {
if(this.props.searchFilters.searchType == "projects"){
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmAction/ConfirmAction.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.confirm-action {
display: inline-flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/CongratulateModal/CongratulateModal.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.congratulate-modal {
.modal-content {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CountrySelector/CountrySelector.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../theme.scss';
@import 'theme.scss';

.country-selector {
margin: 2px 20px 0px -60px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../theme.scss';
@import 'theme.scss';

.form {
.array-item-remove::after {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables.scss';
@import 'variables.scss';

.fit-bounds-control {
svg {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnhancedMap/MapPane/MapPane.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../mixins.scss';
@import 'mixins.scss';

.map-pane {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.inspect-task-controls {
&__control-block {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../mixins.scss';
@import 'mixins.scss';

.keyword-autosuggest-input {
@include basic-form-element-styling();
Expand Down
2 changes: 1 addition & 1 deletion src/components/LoadMoreButton/LoadMoreButton.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../mixins.scss';
@import 'mixins.scss';

button.load-more-button {
@include invert-on-hover($green, $white);
Expand Down
2 changes: 1 addition & 1 deletion src/components/MobileNotSupported/MobileNotSupported.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.mobile-not-supported {
padding: 30px 20px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.navbar.top-nav {
height: $navbar-height;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../theme.scss';
@import 'theme.scss';

.past-duration-selector {
.dropdown-trigger {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PublicWidgetGrid/PublicWidgetGrid.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.widget-grid {
&__controls {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewTaskControls/ReviewTaskControls.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.review-task-controls {
&__control-block {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewTaskPane/ReviewTaskPane.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.task-pane {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShareLink/ShareLink.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../mixins.scss';
@import 'mixins.scss';

.share-link.dropdown {
position: static; // allow content to float above sidebar
Expand Down
2 changes: 1 addition & 1 deletion src/components/TaskAnalysisTable/TaskAnalysisTable.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../theme.scss';
@import 'theme.scss';

.task-analysis-table {
.status-icon {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TaskClusterMap/TaskClusterMap.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

/**
* Mixin to set the colors for map clusters. Three colors are required: the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.active-task-controls {
&__control-block {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../../variables.scss';
@import 'variables.scss';

.active-task-controls button.button.cancel-control {
margin-top: 15px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../variables.scss';
@import 'variables.scss';

.keyboard-shortcut-list {
display: grid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../mixins.scss';
@import 'mixins.scss';

.mobile-task-details {
$inactive-icon-color: $grey-darkest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables.scss';
@import 'variables.scss';

.task-location-map {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../variables.scss';
@import 'variables.scss';

.task-randomness-control {
margin: 15px 0px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.active-task-details .task-status {
margin: 25px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/WidgetGrid/WidgetGrid.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.widget-grid {
&__controls {
Expand Down
2 changes: 1 addition & 1 deletion src/components/WidgetWorkspace/WidgetWorkspace.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../variables.scss';
@import 'variables.scss';

.widget-workspace {
position: relative;
Expand Down
Loading

0 comments on commit 37031d3

Please sign in to comment.