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

Develop #741

Merged
merged 42 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4baf6db
Feature/203 links and branding (#642)
sudheer-rk Aug 11, 2022
10b2183
Bug/203 links filter and video (#645)
sudheer-rk Aug 15, 2022
b57d5f5
Feature/203 links and branding (#649)
sudheer-rk Aug 16, 2022
75b8973
Feature/204 upgrade disruptions UI in line with tfwm (#650)
sudheer-rk Aug 18, 2022
b0f2793
ncu updates applied to project (#653)
sudheer-rk Aug 25, 2022
21a2cf1
Feature/upgrade node and other dependencies (#656)
sudheer-rk Aug 30, 2022
7ce3cfe
Feature/upgrade node and other dependencies (#657)
sudheer-rk Aug 31, 2022
3a5e67f
Feature/adjust header and footer (#658)
sudheer-rk Aug 31, 2022
58f95c3
merge master into develop
Sep 1, 2022
703e4ff
npm install changes updated after mergt
Sep 1, 2022
71938ce
added new message type NoKnownDisruptionMessage replacing 'good servi…
sudheer-rk Oct 26, 2022
5b23390
Bug/change good service to unknown disruption (#671)
sudheer-rk Oct 27, 2022
d6b1e11
Merge 'master' into develop
Nov 3, 2022
ca412d9
Identify and fix issue with API returning empty array (#679)
sudheer-rk Nov 4, 2022
3243d9a
update staging environment with new api key
Jan 5, 2023
55752c2
rollback dependencies updated previously
Jan 5, 2023
bee26a4
rolled back api key
Jan 5, 2023
7d9b4cc
updated with new api key
Jan 5, 2023
61fa361
rollback package lock file as a test
Jan 5, 2023
bb804bb
remove extra 's' on the end of the api endpoint
Jan 10, 2023
48b1355
added 'show more lines' toggle link to trams (#697)
sudheer-rk Jan 10, 2023
642baba
Bug/amendments to UI displaying incorrect disruptions (#703)
sudheer-rk Jan 11, 2023
f20af1e
implementing disruptions lines display list (#707)
sudheer-rk Jan 12, 2023
7dd4393
Feature/revise text on Disruptions when no known disruption (#677) (#…
sudheer-rk Jan 25, 2023
7030601
testing branch eslint (#721)
sudheer-rk Feb 20, 2023
8428204
bug/send random string with api call (#720)
sudheer-rk Feb 20, 2023
584b5d1
bug/send random string with api call (#722)
sudheer-rk Feb 20, 2023
6ac3c53
Bug/group disruption lines and operators (#728)
sudheer-rk Mar 29, 2023
adf6efa
Merge 'master' into develop & fix Severity level.
Mar 30, 2023
7449ed1
merge master into develop & fix severity
Mar 30, 2023
bc646a3
Merge branch 'master' into develop
May 11, 2023
ee41f16
urgent fix: hard coded industrial action text
May 11, 2023
7dc171d
show disruption descriptions on trains
May 12, 2023
9cdfdfb
fixed case issue
May 12, 2023
252f070
merge branch 'master' into develop
May 12, 2023
8ed33bd
appled paragraph formatting
May 12, 2023
b04487c
fix: node sass (#733)
rolorogan Jul 12, 2023
ad8a26c
fix: rail disruption time (#734)
GeorgeEverett Aug 4, 2023
8d4d714
Merge branch 'master' into develop
rolorogan Aug 4, 2023
bb50a8a
Remove BST temp +1 hour fix (#740)
GeorgeEverett Feb 2, 2024
2e628ac
add local to train times (#744)
rolorogan Mar 18, 2024
26694c0
Merge branch 'master' into develop
rolorogan Mar 18, 2024
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
6 changes: 3 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EXTEND_ESLINT=true # Set linting to true on dev
# developemnt API and keys
REACT_APP_API_HOST='https://wmca-api-portal-staging.azure-api.net'
REACT_APP_API_KEY='222b17e018f94b5ea1c08913db98f298'
# developemnt API and keys https://wmca-api-portal-staging.azure-api.net 222b17e018f94b5ea1c08913db98f298
REACT_APP_API_HOST='https://api.wmnetwork.co.uk'
REACT_APP_API_KEY='514b8bafa009424289cb2d7a12c54f6e'
# feedback link id
REACT_APP_FEEDBACK_LINK_URL='https://forms.office.com/Pages/ResponsePage.aspx'
REACT_APP_FEEDBACK_LINK_ID='RetZCK7xCk6e-ubWa7tnL1voVKMeFXVKvUhU3Uh8aqFUNUNVNFlKOVpLMThNV0g0T1VZWDYyT1FLNCQlQCN0PWcu'
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package = "@sentry/netlify-build-plugin"

# Set env variables for deploy preview on netlify
[context.deploy-preview.environment]
REACT_APP_API_HOST='https://wmca-api-portal-staging.azure-api.net'
REACT_APP_API_KEY='0d4cca4a2c5d40c3bfbbfe45d1bbf294'
REACT_APP_API_HOST='https://api.wmnetwork.co.uk'
REACT_APP_API_KEY='514b8bafa009424289cb2d7a12c54f6e'
REACT_APP_BUS_AUTOCOMPLETE_API='https://rtccdisruptions6zqwajo6s.azurewebsites.net'
REACT_APP_ROADS_AUTOCOMPLETE_KEY='e0c1216f818a41be8d528ac1d4f7ebfd'
REACT_APP_FEEDBACK_LINK_URL='https://forms.office.com/Pages/ResponsePage.aspx'
Expand Down
10,691 changes: 2,619 additions & 8,072 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
"axios": "^0.27.2",
"date-fns": "^2.29.2",
"dompurify": "^2.3.11",
"esri-loader": "3.6.0",
"esri-loader": "^3.6.0",
"fecha": "^4.2.3",
"haversine-distance": "^1.2.1",
"moment": "^2.29.4",
"moment-timezone": "^0.5.45",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-app-polyfill": "^3.0.0",
Expand All @@ -32,29 +33,29 @@
"react-easy-swipe": "0.0.22",
"react-moment": "^1.1.3",
"react-scripts": "5.0.1",
"react-share": "^4.4.0",
"sass": "^1.64.2"
"react-share": "^4.4.1",
"sass": "^1.32.8"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0 || ^8.46.0",
"eslint-config-airbnb": "^18.2.1",
"eslint": "^7.2.0 || ^8.44.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jam3": "^0.2.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
"prettier": "^2.7.1"
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^5.0.0-alpha.2",
"eslint-plugin-react": "^7.30.1",
"prettier": "^3.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint src --ext .js",
"lint:fix": "npm run lint -- --fix"
},
"browserslist": {
"production": [
Expand All @@ -70,4 +71,4 @@
"ie 11"
]
}
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" class="wmnds-html">
<html lang="en-GB" class="wmnds-html">
<head>
<meta charset="utf-8" />

Expand Down
2 changes: 1 addition & 1 deletion src/assets/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// get-color(primary, 50); by default it mixes with white
// If you add dark to the end it will mix black instead of white
// e.g. get-color(primary, 50, dark);
@function get-color($color, $percent: 0, $shade: $white) {
@function get-color($color, $percent: 0%, $shade: $white) {
// If shade is null, then by default set to white else set to shade selected
$shade: if($shade == dark, $black, $white);
$color: map-get($palettes, $color);
Expand Down
4 changes: 2 additions & 2 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import React from 'react';
import ContextProvider from 'globalState/ContextProvider';
import ViewToShow from '../ViewToShow/ViewToShow';

const App = () => {
function App() {
return (
<React.StrictMode>
<ContextProvider>
<ViewToShow />
</ContextProvider>
</React.StrictMode>
);
};
}

export default App;
4 changes: 2 additions & 2 deletions src/components/ViewToShow/ErrorView/ErrorView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';

const ErrorPage = () => {
function ErrorPage() {
const [timeLeft, setTimeLeft] = useState(60); // set timeleft state
useEffect(() => {
// Set an interval to run every one second
Expand Down Expand Up @@ -36,6 +36,6 @@ const ErrorPage = () => {
</div>
</div>
);
};
}

export default ErrorPage;
4 changes: 2 additions & 2 deletions src/components/ViewToShow/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setSearchParam } from 'globalState/helpers/URLSearchParams'; // (used t
// Import styles
import s from './Header.module.scss';

const Header = ({ isFetching, hasError }) => {
function Header({ isFetching, hasError }) {
const [fetchDisruptionState, setFetchDisruptionsState] = useContext(FetchDisruptionsContext);
const { REACT_APP_FEEDBACK_LINK_URL, REACT_APP_FEEDBACK_LINK_ID } = process.env; // Destructure env variables

Expand Down Expand Up @@ -99,7 +99,7 @@ const Header = ({ isFetching, hasError }) => {
</div>
</div>
);
};
}

Header.propTypes = {
hasError: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import DisruptionIndicatorSmall from 'components/shared/DisruptionIndicator/Disr
import DisruptionInfo from 'components/shared/DisruptionInfo/DisruptionInfo';
import useDisruptionAffectedItems from 'customHooks/useDisruptionAffectedItems';

const DisruptionItem = ({ disruption }) => {
function DisruptionItem({ disruption }) {
const [openAccordions, setopenAccordions] = useState({}); // Used to track state of open and closed accordions
const { iconLeft, title, affectedItems } = useDisruptionAffectedItems(disruption); // Get the correct modal icon and affectedItems

Expand Down Expand Up @@ -64,7 +64,7 @@ const DisruptionItem = ({ disruption }) => {
{/* Accordion End */}
</>
);
};
}

// PropTypes
DisruptionItem.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styles from './DisruptionLinesGrouping.module.scss';

const DisruptionLinesGrouping = (disruptionServicesAffected) => {
const servicesAffected = disruptionServicesAffected.disruptionServicesAffected.map(
(affected) => affected
(affected) => affected,
);
let iconRightName;
let disruptedClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useFilterLogic from 'customHooks/useFilterLogic';
import NoKnownDisruptionMessage from 'components/shared/Tray/TrayComponents/SelectedService/NoKnownDisruptionMessage/NoKnownDisruptionMessage';
import DisruptionItem from './DisruptionItem/DisruptionItem';

const DisruptionList = () => {
function DisruptionList() {
const filteredData = useFilterLogic(); // Use filter logic based on tray selections
const disruptionsTotal = filteredData.length;

Expand Down Expand Up @@ -39,6 +39,6 @@ const DisruptionList = () => {
) : (
<NoKnownDisruptionMessage isListView />
);
};
}

export default DisruptionList;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from './DisruptionOperatorsGrouping.module.scss';

const DisruptionOperatorsGrouping = (disruptionServicesAffected) => {
const servicesAffected = disruptionServicesAffected.disruptionServicesAffected.map(
(affected) => affected
(affected) => affected,
);

const servicesAff = Object.values(servicesAffected);
Expand Down
4 changes: 2 additions & 2 deletions src/components/ViewToShow/LoadingView/LoadingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
// Import styling
import s from './LoadingView.module.scss';

const LoadingView = () => {
function LoadingView() {
const loadingText = 'Getting the latest disruptions';

return (
Expand All @@ -15,6 +15,6 @@ const LoadingView = () => {
<h3>{loadingText}</h3>
</div>
);
};
}

export default LoadingView;
4 changes: 2 additions & 2 deletions src/components/ViewToShow/MapView/Map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import useSelectedLocation from './customHooks/useSelectedLocation';
import useIconClustering from './customHooks/useIconClustering';
import './Map.scss';

const WebMapView = () => {
function WebMapView() {
// MAP SETUP
const mapContainerRef = useRef();
const { appHeight } = useWindowHeightWidth();
Expand Down Expand Up @@ -42,6 +42,6 @@ const WebMapView = () => {
style={{ minHeight: appHeight && appHeight / 2 }}
/>
);
};
}

export default WebMapView;
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const useCreateIconLayer = (view) => {
wkid: 4326,
},
},
})
}),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const useDrawPolyline = (view) => {
polylineLayer.add(polyline);
setIsPolylineDrawn(true);
},
[view]
[view],
);

const drawBusPolyline = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const useGoTo = (
isIconLayerCreated,
isFilteringDone,
isPolylineDrawn,
isLocationSelected
isLocationSelected,
) => {
const [autoCompleteState] = useContext(AutoCompleteContext);
const { selectedItem } = autoCompleteState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const useHoverIcon = (view, isIconLayerCreated) => {
if (!queryResult?.features.length) return [];
return queryResult.features;
},
[getDisruptionsFeatureLayer]
[getDisruptionsFeatureLayer],
);

const updateIcons = useCallback(
Expand All @@ -62,7 +62,7 @@ const useHoverIcon = (view, isIconLayerCreated) => {
const featuresToHover = features.filter((feature) => feature.attributes.id === disruptionId);

const featuresToUnhover = features.filter((feature) =>
feature.attributes.mapIcon.includes('hover')
feature.attributes.mapIcon.includes('hover'),
);
const hoveredFeatureIds = featuresToUnhover.map((hovered) => hovered?.attributes?.id);

Expand Down Expand Up @@ -94,7 +94,7 @@ const useHoverIcon = (view, isIconLayerCreated) => {

setShouldUpdateIcons(false);
},
[getDisruptionsFeatureLayer, queryDisruptionsFeatureLayer]
[getDisruptionsFeatureLayer, queryDisruptionsFeatureLayer],
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const usePointerEvents = (view, isIconLayerCreated) => {

return clickedFeature;
},
[view]
[view],
);

const selectDisruption = useCallback(
Expand All @@ -44,7 +44,7 @@ const usePointerEvents = (view, isIconLayerCreated) => {
payload: { id: disruptionId, selectedByMap: true },
});
},
[autoCompleteDispatch, modeState.mode]
[autoCompleteDispatch, modeState.mode],
);

const setSelectedItem = useCallback(
Expand All @@ -57,7 +57,7 @@ const usePointerEvents = (view, isIconLayerCreated) => {
console.log('setSelectedItem error:', error);
}
},
[view, getClickedFeature, selectDisruption]
[view, getClickedFeature, selectDisruption],
);

const usePointerCursor = useCallback(
Expand All @@ -76,7 +76,7 @@ const usePointerEvents = (view, isIconLayerCreated) => {
console.log('usePointerCursor error:', error);
}
},
[view]
[view],
);

const addPointerEvents = useCallback(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ViewToShow/MapView/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Tray from '../../shared/Tray/Tray';
// Import styles
import s from './MapView.module.scss';

const MapView = () => {
function MapView() {
const { appHeight, windowWidth } = useWindowHeightWidth(); // Get window height and width

// Show correct height based on screen size
Expand All @@ -20,6 +20,6 @@ const MapView = () => {
<Tray />
</div>
);
};
}

export default MapView;
4 changes: 2 additions & 2 deletions src/components/ViewToShow/ViewToShow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ListView from 'components/ViewToShow/ListView/ListView';
// Import custom hooks
import useGETDisruptions from './useGETDisruptions';

const ViewToShow = () => {
function ViewToShow() {
const [fetchDisruptionState] = useContext(FetchDisruptionsContext);
const { isFetching, hasError } = useGETDisruptions();

Expand All @@ -37,6 +37,6 @@ const ViewToShow = () => {
{viewToRender}
</>
);
};
}

export default ViewToShow;
6 changes: 3 additions & 3 deletions src/components/shared/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import Icon from '../Icon/Icon';
import './Button.scss'; // Temp styling for displaying button as link

const Button = ({
function Button({
type,
title,
isActive,
Expand All @@ -15,7 +15,7 @@ const Button = ({
iconRight,
disabled,
id,
}) => {
}) {
return (
<button
// eslint-disable-next-line react/button-has-type
Expand All @@ -40,7 +40,7 @@ const Button = ({
) : null}
</button>
);
};
}

// Set props
Button.propTypes = {
Expand Down
Loading
Loading