Skip to content

Commit 2d454a1

Browse files
jacksonjackson
jackson
authored and
jackson
committed
Removing yarn release
1 parent 81da29a commit 2d454a1

File tree

7 files changed

+5596
-5359
lines changed

7 files changed

+5596
-5359
lines changed

react/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

react/.yarnrc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
5+
yarnPath: .yarn/releases/yarn-4.4.1.cjs

react/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@mui/lab": "^5.0.0-alpha.152",
1111
"@mui/material": "^5.14.17",
1212
"@mui/styled-engine": "^5.14.17",
13+
"@mui/system": "^6.0.0",
1314
"@mui/x-data-grid": "^6.18.0",
1415
"@mui/x-date-pickers": "^6.18.0",
1516
"@reduxjs/toolkit": "^1.9.7",
@@ -20,6 +21,8 @@
2021
"@types/react-dom": "^18.2.14",
2122
"@types/sinon": "^17.0.3",
2223
"@types/validator": "^13.11.7",
24+
"@typescript-eslint/eslint-plugin": "^8.3.0",
25+
"@typescript-eslint/parser": "^8.3.0",
2326
"axios": "^0.21.1",
2427
"chart.js": "^4.4.1",
2528
"chartjs-adapter-moment": "^1.0.1",
@@ -130,5 +133,6 @@
130133
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
131134
"react-markdown": "<rootDir>/node_modules/react-markdown/react-markdown.min.js"
132135
}
133-
}
136+
},
137+
"packageManager": "[email protected]"
134138
}

react/src/components/downloadmanager/downloadManagerSagas.ts

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function* handleRequestDownload(action: RequestDownloadActionType) {
7373
yield put(setDownloadLink(response.data.downloadLink))
7474
} catch (e) {
7575
yield put(setStatus('failed'))
76+
console.log(e);
7677
}
7778
}
7879

react/src/components/regionalpressure/RegionalPressureExport.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ const results_to_array = (data: PortsObject, is_hourly: boolean) => {
4444
regionName: portDataPoint.regionName || '',
4545
totalPcpPax: portDataPoint.totalPcpPax || 0,
4646
terminalName: portDataPoint.terminalName || '',
47-
EEA: portDataPoint.queueCounts[0]?.count || 0,
48-
eGates: portDataPoint.queueCounts[1]?.count || 0,
49-
nonEEA: portDataPoint.queueCounts[2]?.count || 0,
47+
EEA: portDataPoint.queueCounts![0]?.count || 0,
48+
eGates: portDataPoint.queueCounts![1]?.count || 0,
49+
nonEEA: portDataPoint.queueCounts![2]?.count || 0,
5050
}
5151
data_rows.push(exportDataPoint)
5252
})

react/src/components/regionalpressure/regionalPressureSagas.ts

+41-9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ export type TerminalDataPoint = {
3535
terminalName?: string,
3636
};
3737

38+
39+
export type ExportableDataPoint = {
40+
date: string,
41+
hour: number,
42+
portCode: string,
43+
regionName: string,
44+
totalPcpPax: number,
45+
terminalName?: string,
46+
EEA?: number,
47+
nonEEA?:number,
48+
eGates?:number,
49+
};
50+
3851
export type PortsObject = {
3952
[key:string] : TerminalDataPoint[]
4053
}
@@ -66,6 +79,24 @@ export function getHistoricDateByDay(date: Moment) : Moment {
6679
.isoWeekday(date.isoWeekday())
6780
}
6881

82+
const createExportableDatapoints = (datapoints: TerminalDataPoint[]) :ExportableDataPoint[] => {
83+
let flattenedCurrent: ExportableDataPoint[] = [];
84+
datapoints!.forEach((datapoint) => {
85+
flattenedCurrent.push({
86+
date: datapoint.date,
87+
hour: datapoint.hour,
88+
portCode: datapoint.portCode,
89+
regionName: datapoint.regionName,
90+
totalPcpPax: datapoint.totalPcpPax,
91+
terminalName: datapoint.terminalName,
92+
EEA: datapoint.queueCounts[0]?.count || 0,
93+
eGates: datapoint.queueCounts[1]?.count || 0,
94+
nonEEA: datapoint.queueCounts[2]?.count || 0,
95+
})
96+
});
97+
return flattenedCurrent
98+
}
99+
69100
export function* handleRequestPaxTotals(action: RequestPaxTotalsType) {
70101
try {
71102
yield(put(setStatus('loading')))
@@ -112,9 +143,10 @@ export function* handleRequestPaxTotals(action: RequestPaxTotalsType) {
112143
}
113144

114145
if (action.isExport) {
115-
116-
const currentCSV = generateCsv({})(current);
117-
const historicCSV = generateCsv({})(historic);
146+
147+
148+
const currentCSV = generateCsv({})(createExportableDatapoints(current));
149+
const historicCSV = generateCsv({})(createExportableDatapoints(historic));
118150
download({})(currentCSV);
119151
download({})(historicCSV);
120152
yield(put(setStatus('done')))
@@ -127,22 +159,22 @@ export function* handleRequestPaxTotals(action: RequestPaxTotalsType) {
127159

128160
current!.forEach((datapoint) => {
129161
const portIndex = datapoint.terminalName ? `${datapoint.portCode}-${datapoint.terminalName}` : datapoint.portCode;
130-
datapoint.queueCounts.forEach(passengerCount => {
162+
datapoint.queueCounts!.forEach(passengerCount => {
131163
portTotals[portIndex] = (portTotals[portIndex] ? portTotals[portIndex] : 0) + passengerCount.count
132164
})
133165
portData[portIndex] ?
134-
portData[portIndex].push(datapoint)
135-
: portData[portIndex] = [datapoint]
166+
portData[portIndex].push(datapoint)
167+
: portData[portIndex] = [datapoint]
136168
})
137169

138170
historic!.forEach((datapoint) => {
139171
const portIndex = datapoint.terminalName ? `${datapoint.portCode}-${datapoint.terminalName}` : datapoint.portCode;
140-
datapoint.queueCounts.forEach(passengerCount => {
172+
datapoint.queueCounts!.forEach(passengerCount => {
141173
historicPortTotals[portIndex] = (historicPortTotals[portIndex] ? historicPortTotals[portIndex] : 0) + passengerCount.count
142174
})
143175
historicPortData[portIndex] ?
144-
historicPortData[portIndex].push(datapoint)
145-
: historicPortData[portIndex] = [datapoint]
176+
historicPortData[portIndex].push(datapoint)
177+
: historicPortData[portIndex] = [datapoint]
146178
})
147179

148180
yield(put(setRegionalDashboardState({

0 commit comments

Comments
 (0)