back-testing-react 2.1.9 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/back-testing-sidebar/back-testing-sidebar.tsx +14 -3
- package/src/components/back-testing-stepper/inputs/number-input/number-input.tsx +1 -1
- package/src/components/back-testing-stepper/inputs/number-input/number-input.types.ts +1 -1
- package/src/components/back-testing-stepper/steps/input-anemometer/input-anemometer.tsx +1 -1
- package/src/components/back-testing-stepper/steps/input-cias/input-cias.tsx +14 -10
- package/src/components/back-testing-stepper/steps/input-location/input-location.tsx +4 -3
- package/src/components/back-testing-stepper/steps/input-pga/input-pga.tsx +17 -13
- package/src/components/back-testing-stepper/steps/input-pga/input-pga.types.ts +1 -1
- package/src/components/back-testing-stepper/steps/input-proxy/input-proxy.tsx +11 -7
- package/src/lib/features/back-testing/backTestingSlice.ts +7 -1
- package/src/lib/features/wizard/wizardSlice.ts +4 -6
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@ import React, { useEffect } from "react";
|
|
|
8
8
|
import * as XLSX from 'xlsx';
|
|
9
9
|
import { PayoutWizardStepType } from "../back-testing-stepper/steps/step.types";
|
|
10
10
|
import { useAppDispatch, useAppSelector } from "../../lib/hooks";
|
|
11
|
-
import { isEarthquakeEnabled, isFireEnabled, isFloodEnabled, isSnowstormEnabled, isWindstormEnabled, selectProxyPayoutOptions, selectWeatherEvent, selectWizardStep, setWeatherEvent } from "../../lib/features/wizard/wizardSlice";
|
|
12
|
-
import { isAppLoading, selectPDFOutput, selectWSPayoutRequest, selectWSPayoutResponse } from "../../lib/features/back-testing/backTestingSlice";
|
|
11
|
+
import { isEarthquakeEnabled, isFireEnabled, isFloodEnabled, isSnowstormEnabled, isWindstormEnabled, selectProxyPayoutOptions, selectWeatherEvent, selectWizardStep, setWeatherEvent, updateWeatherEvent } from "../../lib/features/wizard/wizardSlice";
|
|
12
|
+
import { isAppLoading, resetPayouts, selectPDFOutput, selectWSPayoutRequest, selectWSPayoutResponse, setEQPayoutResponse, setPDFOutput } from "../../lib/features/back-testing/backTestingSlice";
|
|
13
13
|
|
|
14
14
|
const BackTestingSidebar = (props:BackTestingSidebarProps) => {
|
|
15
15
|
|
|
@@ -48,12 +48,23 @@ const BackTestingSidebar = (props:BackTestingSidebarProps) => {
|
|
|
48
48
|
setAppActions(actions);
|
|
49
49
|
},[pdfOutput,selectedWeatherEventOption])
|
|
50
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
switch(selectedWeatherEventOption){
|
|
53
|
+
case WeatherEventOption.WINDSTORM:
|
|
54
|
+
dispatch(setEQPayoutResponse(undefined))
|
|
55
|
+
dispatch(setPDFOutput())
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
|
|
51
59
|
function isWeatherEventOptionSelected(option: WeatherOption) : boolean {
|
|
52
60
|
return selectedWeatherEventOption == (option.action);
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
const selectWeatherEventOption = (option: WeatherOption) => {
|
|
56
|
-
|
|
64
|
+
if(option.action != selectedWeatherEventOption){
|
|
65
|
+
dispatch(updateWeatherEvent(option.action));
|
|
66
|
+
dispatch(resetPayouts())
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
@@ -9,7 +9,7 @@ export interface NumberInputProps{
|
|
|
9
9
|
step?: number,
|
|
10
10
|
value?: number | string,
|
|
11
11
|
readOnly?: boolean,
|
|
12
|
-
onChange?: (e: number) => void
|
|
12
|
+
onChange?: (e: number|undefined) => void
|
|
13
13
|
placeholder?: string
|
|
14
14
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
15
15
|
className?: string
|
|
@@ -187,13 +187,13 @@ const InputAnemometerStep = forwardRef<WizardStep, InputAnemometerStepProps>((pr
|
|
|
187
187
|
const anemometer = cloneDeep(wizardAnemometers[i]);
|
|
188
188
|
let isAnemometerChoiceError = (anemometer.anemometerChoice == RadioChoice.CUSTOM && anemometer.customPayouts == undefined)
|
|
189
189
|
if(isAnemometerChoiceError){
|
|
190
|
-
fileError = true;
|
|
191
190
|
anemometer.fileError = true
|
|
192
191
|
anemometer.fileErrorMsg = FILE_ERROR;
|
|
193
192
|
if(!fileError){
|
|
194
193
|
setExpanded('panel'+(anemometer.refId));
|
|
195
194
|
setSelectedAnemometer(anemometer);
|
|
196
195
|
}
|
|
196
|
+
fileError = true;
|
|
197
197
|
} else{
|
|
198
198
|
anemometer.fileError = false
|
|
199
199
|
anemometer.fileErrorMsg = "";
|
|
@@ -206,7 +206,11 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
206
206
|
let location = locations.find((location) => location.refId == id)
|
|
207
207
|
if(location){
|
|
208
208
|
clonedCircle.latitude = location.latitude;
|
|
209
|
+
clonedCircle.latError = false;
|
|
210
|
+
clonedCircle.latErrorMsg = "";
|
|
209
211
|
clonedCircle.longitude = location.longitude;
|
|
212
|
+
clonedCircle.lngError = false;
|
|
213
|
+
clonedCircle.lngErrorMsg = "";
|
|
210
214
|
}
|
|
211
215
|
clonedCIAS.circle = clonedCircle;
|
|
212
216
|
updateCIAS(clonedCIAS,onLoad);
|
|
@@ -252,14 +256,14 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
252
256
|
updateShape(clonedCIAS,clonedPolygon);
|
|
253
257
|
}
|
|
254
258
|
|
|
255
|
-
function updatePolygonCoordinateLat(cias: CIAS, polygon:CATPolygon,index:number,value:number){
|
|
259
|
+
function updatePolygonCoordinateLat(cias: CIAS, polygon:CATPolygon,index:number,value:number|undefined){
|
|
256
260
|
let clonedCIAS = cloneDeep(cias);
|
|
257
261
|
let clonedPolygon = cloneDeep(polygon);
|
|
258
262
|
clonedPolygon.coords[index].latitude = value;
|
|
259
263
|
updateShape(clonedCIAS,clonedPolygon);
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
function updatePolygonCoordinateLng(cias: CIAS, polygon:CATPolygon,index:number,value:number){
|
|
266
|
+
function updatePolygonCoordinateLng(cias: CIAS, polygon:CATPolygon,index:number,value:number|undefined){
|
|
263
267
|
let clonedCIAS = cloneDeep(cias);
|
|
264
268
|
let clonedPolygon = cloneDeep(polygon);
|
|
265
269
|
clonedPolygon.coords[index].longitude = value;
|
|
@@ -308,13 +312,13 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
308
312
|
let circle = cias.circle;
|
|
309
313
|
let latError = circle.latitude == undefined || Number.isNaN(circle.latitude) || circle.latitude < -90;
|
|
310
314
|
if(latError){
|
|
311
|
-
latitudeError = true;
|
|
312
315
|
circle.latError = true
|
|
313
316
|
circle.latErrorMsg = LAT_ERROR;
|
|
314
317
|
if(!fileError && !latitudeError && !longitudeError){
|
|
315
318
|
setExpanded('panel'+(cias.refId));
|
|
316
319
|
setSelectedCIAS(cias);
|
|
317
320
|
}
|
|
321
|
+
latitudeError = true;
|
|
318
322
|
} else{
|
|
319
323
|
circle.latError = false
|
|
320
324
|
circle.latErrorMsg = "";
|
|
@@ -325,18 +329,18 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
325
329
|
|
|
326
330
|
// perform circle longitude validations
|
|
327
331
|
for(var i = 0; i < ciasList.length; i++){
|
|
328
|
-
const cias =
|
|
332
|
+
const cias = ciasList[i];
|
|
329
333
|
if(cias.shapeType == CATShapeType.CIRCLE){
|
|
330
334
|
let circle = cias.circle;
|
|
331
335
|
let lngError = circle.longitude == undefined || Number.isNaN(circle.longitude) || circle.longitude < -180;
|
|
332
336
|
if(lngError){
|
|
333
|
-
longitudeError = true;
|
|
334
337
|
circle.lngError = true
|
|
335
338
|
circle.lngErrorMsg = LNG_ERROR;
|
|
336
339
|
if(!fileError && !latitudeError && !longitudeError){
|
|
337
340
|
setExpanded('panel'+(cias.refId));
|
|
338
341
|
setSelectedCIAS(cias);
|
|
339
342
|
}
|
|
343
|
+
longitudeError = true;
|
|
340
344
|
} else{
|
|
341
345
|
circle.lngError = false
|
|
342
346
|
circle.lngErrorMsg = "";
|
|
@@ -346,18 +350,18 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
346
350
|
|
|
347
351
|
// perform circle longitude validations
|
|
348
352
|
for(var i = 0; i < ciasList.length; i++){
|
|
349
|
-
const cias =
|
|
353
|
+
const cias = ciasList[i];
|
|
350
354
|
if(cias.shapeType == CATShapeType.CIRCLE){
|
|
351
355
|
let circle = cias.circle;
|
|
352
356
|
let lngError = circle.longitude == undefined || Number.isNaN(circle.longitude) || circle.longitude < -180;
|
|
353
357
|
if(lngError){
|
|
354
|
-
longitudeError = true;
|
|
355
358
|
circle.lngError = true
|
|
356
359
|
circle.lngErrorMsg = LNG_ERROR;
|
|
357
360
|
if(!fileError && !latitudeError && !longitudeError){
|
|
358
361
|
setExpanded('panel'+(cias.refId));
|
|
359
362
|
setSelectedCIAS(cias);
|
|
360
363
|
}
|
|
364
|
+
longitudeError = true;
|
|
361
365
|
} else{
|
|
362
366
|
circle.lngError = false
|
|
363
367
|
circle.lngErrorMsg = "";
|
|
@@ -367,18 +371,18 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
367
371
|
|
|
368
372
|
// perform payout file validations
|
|
369
373
|
for(var i = 0; i < ciasList.length; i++){
|
|
370
|
-
const cias =
|
|
374
|
+
const cias = ciasList[i];
|
|
371
375
|
if(cias.shapeType == CATShapeType.CIRCLE){
|
|
372
376
|
let circle = cias.circle;
|
|
373
377
|
let isCIACChoiceError = (circle.ciasChoice == RadioChoice.CUSTOM && circle.customPayouts == undefined)
|
|
374
378
|
if(isCIACChoiceError){
|
|
375
|
-
fileError = true;
|
|
376
379
|
circle.fileError = true
|
|
377
380
|
circle.fileErrorMsg = FILE_ERROR;
|
|
378
381
|
if(!fileError && !latitudeError && !longitudeError){
|
|
379
382
|
setExpanded('panel'+(cias.refId));
|
|
380
383
|
setSelectedCIAS(cias);
|
|
381
384
|
}
|
|
385
|
+
fileError = true;
|
|
382
386
|
} else {
|
|
383
387
|
circle.fileError = false
|
|
384
388
|
circle.fileErrorMsg = "";
|
|
@@ -387,13 +391,13 @@ const InputCIASStep = forwardRef<WizardStep, InputCIASStepProps>((props,ref) =>
|
|
|
387
391
|
let polygon = cias.polygon;
|
|
388
392
|
let isCIACChoiceError = (polygon.ciasChoice == RadioChoice.CUSTOM && polygon.customPayouts == undefined)
|
|
389
393
|
if(isCIACChoiceError){
|
|
390
|
-
fileError = true;
|
|
391
394
|
polygon.fileError = true
|
|
392
395
|
polygon.fileErrorMsg = FILE_ERROR;
|
|
393
396
|
if(!fileError && !latitudeError && !longitudeError){
|
|
394
397
|
setExpanded('panel'+(cias.refId));
|
|
395
398
|
setSelectedCIAS(cias);
|
|
396
399
|
}
|
|
400
|
+
fileError = true;
|
|
397
401
|
} else {
|
|
398
402
|
polygon.fileError = false
|
|
399
403
|
polygon.fileErrorMsg = "";
|
|
@@ -212,13 +212,14 @@ const InputLocationStep = forwardRef<WizardStep, InputLocationStepProps>((props,
|
|
|
212
212
|
let location = cloneDeep(wizardLocations[i]);
|
|
213
213
|
let latError = location.latitude == undefined || Number.isNaN(location.latitude) || location.latitude < -90;
|
|
214
214
|
if(latError){
|
|
215
|
-
latitudeError = true;
|
|
216
215
|
location.latError = true
|
|
217
216
|
location.latErrorMsg = LAT_ERROR;
|
|
218
217
|
if(!latitudeError && !longitudeError){
|
|
219
218
|
setExpanded('panel'+(location.refId));
|
|
220
219
|
setSelectedLocation(location);
|
|
221
220
|
}
|
|
221
|
+
latitudeError = true;
|
|
222
|
+
|
|
222
223
|
} else{
|
|
223
224
|
location.latError = false
|
|
224
225
|
location.latErrorMsg = "";
|
|
@@ -227,16 +228,16 @@ const InputLocationStep = forwardRef<WizardStep, InputLocationStepProps>((props,
|
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
for(var i = 0; i < locationsList.length; i++){
|
|
230
|
-
let location =
|
|
231
|
+
let location = locationsList[i];
|
|
231
232
|
let lngError = location.longitude == undefined || Number.isNaN(location.longitude) || location.longitude < -180;
|
|
232
233
|
if(lngError){
|
|
233
|
-
longitudeError = true;
|
|
234
234
|
location.lngError = true
|
|
235
235
|
location.lngErrorMsg = LNG_ERROR;
|
|
236
236
|
if(!latitudeError && !longitudeError){
|
|
237
237
|
setExpanded('panel'+(location.refId));
|
|
238
238
|
setSelectedLocation(location);
|
|
239
239
|
}
|
|
240
|
+
longitudeError = true;
|
|
240
241
|
} else{
|
|
241
242
|
location.lngError = false
|
|
242
243
|
location.lngErrorMsg = "";
|
|
@@ -269,7 +269,11 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
269
269
|
let location = locations.find((location) => location.refId == id)
|
|
270
270
|
if(location){
|
|
271
271
|
clonedCircle.latitude = location.latitude;
|
|
272
|
+
clonedCircle.latError = false;
|
|
273
|
+
clonedCircle.latErrorMsg = "";
|
|
272
274
|
clonedCircle.longitude = location.longitude;
|
|
275
|
+
clonedCircle.lngError = false;
|
|
276
|
+
clonedCircle.lngErrorMsg = "";
|
|
273
277
|
}
|
|
274
278
|
clonedPGA.circle = clonedCircle;
|
|
275
279
|
updatePGA(clonedPGA,onLoad);
|
|
@@ -311,13 +315,13 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
311
315
|
updateShape(pga,clonedPolygon);
|
|
312
316
|
}
|
|
313
317
|
|
|
314
|
-
function updatePolygonCoordinateLat(pga: PGA, polygon:CATPolygon,index:number,value:number){
|
|
318
|
+
function updatePolygonCoordinateLat(pga: PGA, polygon:CATPolygon,index:number,value:number|undefined){
|
|
315
319
|
const clonedPolygon = cloneDeep(polygon);
|
|
316
320
|
clonedPolygon.coords[index].latitude = value;
|
|
317
321
|
updateShape(pga,clonedPolygon);
|
|
318
322
|
}
|
|
319
323
|
|
|
320
|
-
function updatePolygonCoordinateLng(pga: PGA, polygon:CATPolygon,index:number,value:number){
|
|
324
|
+
function updatePolygonCoordinateLng(pga: PGA, polygon:CATPolygon,index:number,value:number|undefined){
|
|
321
325
|
const clonedPolygon = cloneDeep(polygon);
|
|
322
326
|
clonedPolygon.coords[index].longitude = value;
|
|
323
327
|
updateShape(pga,clonedPolygon);
|
|
@@ -404,13 +408,13 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
404
408
|
let county = pga.county;
|
|
405
409
|
let countyError = county.countyFIPSCode == undefined || county.geometry == undefined;
|
|
406
410
|
if(countyError){
|
|
407
|
-
usCountyError = true;
|
|
408
411
|
county.countyError = true
|
|
409
412
|
county.countyErrorMsg = COUNTY_ERROR;
|
|
410
413
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
411
414
|
setExpanded('panel'+(pga.refId));
|
|
412
415
|
setSelectedPGA(pga);
|
|
413
416
|
}
|
|
417
|
+
usCountyError = true;
|
|
414
418
|
} else{
|
|
415
419
|
county.countyError = false
|
|
416
420
|
county.countyErrorMsg = "";
|
|
@@ -422,18 +426,18 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
422
426
|
|
|
423
427
|
// perform circle latitude validations
|
|
424
428
|
for(var i = 0; i < pgaList.length; i++){
|
|
425
|
-
const pga =
|
|
429
|
+
const pga = pgaList[i];
|
|
426
430
|
if(pga.shapeType == CATShapeType.CIRCLE){
|
|
427
431
|
let circle = pga.circle;
|
|
428
432
|
let latError = circle.latitude == undefined || Number.isNaN(circle.latitude) || circle.latitude < -90;
|
|
429
433
|
if(latError){
|
|
430
|
-
latitudeError = true;
|
|
431
434
|
circle.latError = true
|
|
432
435
|
circle.latErrorMsg = LAT_ERROR;
|
|
433
436
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
434
437
|
setExpanded('panel'+(pga.refId));
|
|
435
438
|
setSelectedPGA(pga);
|
|
436
439
|
}
|
|
440
|
+
latitudeError = true;
|
|
437
441
|
} else{
|
|
438
442
|
circle.latError = false
|
|
439
443
|
circle.latErrorMsg = "";
|
|
@@ -443,18 +447,18 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
443
447
|
|
|
444
448
|
// perform circle longitude validations
|
|
445
449
|
for(var i = 0; i < pgaList.length; i++){
|
|
446
|
-
const pga =
|
|
450
|
+
const pga = pgaList[i];
|
|
447
451
|
if(pga.shapeType == CATShapeType.CIRCLE){
|
|
448
452
|
let circle = pga.circle;
|
|
449
453
|
let lngError = circle.longitude == undefined || Number.isNaN(circle.longitude) || circle.longitude < -180;
|
|
450
454
|
if(lngError){
|
|
451
|
-
longitudeError = true;
|
|
452
455
|
circle.lngError = true
|
|
453
456
|
circle.lngErrorMsg = LNG_ERROR;
|
|
454
457
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
455
458
|
setExpanded('panel'+(pga.refId));
|
|
456
459
|
setSelectedPGA(pga);
|
|
457
460
|
}
|
|
461
|
+
longitudeError = true;
|
|
458
462
|
} else{
|
|
459
463
|
circle.lngError = false
|
|
460
464
|
circle.lngErrorMsg = "";
|
|
@@ -464,18 +468,18 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
464
468
|
|
|
465
469
|
// perform circle longitude validations
|
|
466
470
|
for(var i = 0; i < pgaList.length; i++){
|
|
467
|
-
const pga =
|
|
471
|
+
const pga = pgaList[i];
|
|
468
472
|
if(pga.shapeType == CATShapeType.CIRCLE){
|
|
469
473
|
let circle = pga.circle;
|
|
470
474
|
let lngError = circle.longitude == undefined || Number.isNaN(circle.longitude) || circle.longitude < -180;
|
|
471
475
|
if(lngError){
|
|
472
|
-
longitudeError = true;
|
|
473
476
|
circle.lngError = true
|
|
474
477
|
circle.lngErrorMsg = LNG_ERROR;
|
|
475
478
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
476
479
|
setExpanded('panel'+(pga.refId));
|
|
477
480
|
setSelectedPGA(pga);
|
|
478
481
|
}
|
|
482
|
+
longitudeError = true;
|
|
479
483
|
} else{
|
|
480
484
|
circle.lngError = false
|
|
481
485
|
circle.lngErrorMsg = "";
|
|
@@ -486,18 +490,18 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
486
490
|
|
|
487
491
|
// perform payout file validations
|
|
488
492
|
for(var i = 0; i < pgaList.length; i++){
|
|
489
|
-
const pga =
|
|
493
|
+
const pga = pgaList[i];
|
|
490
494
|
if(pga.shapeType == CATShapeType.CIRCLE){
|
|
491
495
|
let circle = pga.circle;
|
|
492
496
|
let isCIACChoiceError = (circle.ciasChoice == RadioChoice.CUSTOM && circle.customPayouts == undefined)
|
|
493
497
|
if(isCIACChoiceError){
|
|
494
|
-
fileError = true;
|
|
495
498
|
circle.fileError = true
|
|
496
499
|
circle.fileErrorMsg = FILE_ERROR;
|
|
497
500
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
498
501
|
setExpanded('panel'+(pga.refId));
|
|
499
502
|
setSelectedPGA(pga);
|
|
500
503
|
}
|
|
504
|
+
fileError = true;
|
|
501
505
|
} else {
|
|
502
506
|
circle.fileError = false
|
|
503
507
|
circle.fileErrorMsg = "";
|
|
@@ -506,13 +510,13 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
506
510
|
let polygon = pga.polygon;
|
|
507
511
|
let isCIACChoiceError = (polygon.ciasChoice == RadioChoice.CUSTOM && polygon.customPayouts == undefined)
|
|
508
512
|
if(isCIACChoiceError){
|
|
509
|
-
fileError = true;
|
|
510
513
|
polygon.fileError = true
|
|
511
514
|
polygon.fileErrorMsg = FILE_ERROR;
|
|
512
515
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
513
516
|
setExpanded('panel'+(pga.refId));
|
|
514
517
|
setSelectedPGA(pga);
|
|
515
518
|
}
|
|
519
|
+
fileError = true;
|
|
516
520
|
} else {
|
|
517
521
|
polygon.fileError = false
|
|
518
522
|
polygon.fileErrorMsg = "";
|
|
@@ -521,13 +525,13 @@ const InputPGAStep = forwardRef<WizardStep, InputPGAStepProps>((props,ref) => {
|
|
|
521
525
|
let county = pga.county;
|
|
522
526
|
let isCIACChoiceError = (county.ciasChoice == RadioChoice.CUSTOM && county.customPayouts == undefined)
|
|
523
527
|
if(isCIACChoiceError){
|
|
524
|
-
fileError = true;
|
|
525
528
|
county.fileError = true
|
|
526
529
|
county.fileErrorMsg = FILE_ERROR;
|
|
527
530
|
if(!fileError && !latitudeError && !longitudeError && !usCountyError){
|
|
528
531
|
setExpanded('panel'+(pga.refId));
|
|
529
532
|
setSelectedPGA(pga);
|
|
530
533
|
}
|
|
534
|
+
fileError = true;
|
|
531
535
|
} else {
|
|
532
536
|
county.fileError = false
|
|
533
537
|
county.fileErrorMsg = "";
|
|
@@ -15,7 +15,7 @@ export interface PGA {
|
|
|
15
15
|
export function generateNewPGA(shapeType:CATShapeType|undefined, latitude: number|undefined, longitude: number|undefined, radius:number|undefined, coords: Coordinate[]|undefined, fipsCode:string|undefined, payoutOption:string | undefined) : PGA {
|
|
16
16
|
const pga : PGA = {
|
|
17
17
|
refId: uuidv4(),
|
|
18
|
-
shapeType: shapeType || CATShapeType.
|
|
18
|
+
shapeType: shapeType || CATShapeType.COUNTY,
|
|
19
19
|
circle: generateNewCATCircle(latitude,longitude,radius,payoutOption),
|
|
20
20
|
polygon: generateNewCATPolygon(coords,payoutOption),
|
|
21
21
|
county: generateNewCATCounty(fipsCode,payoutOption)
|
|
@@ -159,8 +159,12 @@ const InputProxyStep = forwardRef<WizardStep, InputProxyStepProps>((props,ref) =
|
|
|
159
159
|
clonedProxy.locationRefId = id;
|
|
160
160
|
let location = locations.find((location) => location.refId == id)
|
|
161
161
|
if(location){
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
clonedProxy.latitude = location.latitude;
|
|
163
|
+
clonedProxy.latError = false;
|
|
164
|
+
clonedProxy.latErrorMsg = "";
|
|
165
|
+
clonedProxy.longitude = location.longitude;
|
|
166
|
+
clonedProxy.lngError = false;
|
|
167
|
+
clonedProxy.lngErrorMsg = "";
|
|
164
168
|
}
|
|
165
169
|
updateProxy(clonedProxy);
|
|
166
170
|
}
|
|
@@ -236,13 +240,13 @@ const InputProxyStep = forwardRef<WizardStep, InputProxyStepProps>((props,ref) =
|
|
|
236
240
|
const proxy = cloneDeep(wizardProxies[i]);
|
|
237
241
|
let latError = proxy.latitude == undefined || Number.isNaN(proxy.latitude) || proxy.latitude < -90;
|
|
238
242
|
if(latError){
|
|
239
|
-
latitudeError = true;
|
|
240
243
|
proxy.latError = true
|
|
241
244
|
proxy.latErrorMsg = LAT_ERROR;
|
|
242
245
|
if(!fileError && !latitudeError && !longitudeError){
|
|
243
246
|
setExpanded('panel'+(proxy.refId));
|
|
244
247
|
setSelectedProxy(proxy);
|
|
245
248
|
}
|
|
249
|
+
latitudeError = true;
|
|
246
250
|
} else{
|
|
247
251
|
proxy.latError = false
|
|
248
252
|
proxy.latErrorMsg = "";
|
|
@@ -252,16 +256,16 @@ const InputProxyStep = forwardRef<WizardStep, InputProxyStepProps>((props,ref) =
|
|
|
252
256
|
|
|
253
257
|
// perform proxy longitude validations
|
|
254
258
|
for(var i = 0; i < proxyList.length; i++){
|
|
255
|
-
const proxy =
|
|
259
|
+
const proxy = proxyList[i];
|
|
256
260
|
let lngError = proxy.longitude == undefined || Number.isNaN(proxy.longitude) || proxy.longitude < -180;
|
|
257
261
|
if(lngError){
|
|
258
|
-
longitudeError = true;
|
|
259
262
|
proxy.lngError = true
|
|
260
263
|
proxy.lngErrorMsg = LNG_ERROR;
|
|
261
264
|
if(!fileError && !latitudeError && !longitudeError){
|
|
262
265
|
setExpanded('panel'+(proxy.refId));
|
|
263
266
|
setSelectedProxy(proxy);
|
|
264
267
|
}
|
|
268
|
+
longitudeError = true;
|
|
265
269
|
} else{
|
|
266
270
|
proxy.lngError = false
|
|
267
271
|
proxy.lngErrorMsg = "";
|
|
@@ -270,16 +274,16 @@ const InputProxyStep = forwardRef<WizardStep, InputProxyStepProps>((props,ref) =
|
|
|
270
274
|
|
|
271
275
|
// perform payout file validations
|
|
272
276
|
for(var i = 0; i < proxyList.length; i++){
|
|
273
|
-
const proxy =
|
|
277
|
+
const proxy = proxyList[i];
|
|
274
278
|
let isProxyChoiceError = (proxy.proxyChoice == RadioChoice.CUSTOM && proxy.customPayouts == undefined)
|
|
275
279
|
if(isProxyChoiceError){
|
|
276
|
-
fileError = true;
|
|
277
280
|
proxy.fileError = true
|
|
278
281
|
proxy.fileErrorMsg = FILE_ERROR;
|
|
279
282
|
if(!fileError && !latitudeError && !longitudeError){
|
|
280
283
|
setExpanded('panel'+(proxy.refId));
|
|
281
284
|
setSelectedProxy(proxy);
|
|
282
285
|
}
|
|
286
|
+
fileError = true;
|
|
283
287
|
} else{
|
|
284
288
|
proxy.fileError = false
|
|
285
289
|
proxy.fileErrorMsg = "";
|
|
@@ -43,6 +43,11 @@ export const backTestingSlice = createAppSlice({
|
|
|
43
43
|
state.loading = initialState.loading,
|
|
44
44
|
state.success = initialState.success
|
|
45
45
|
}),
|
|
46
|
+
resetPayouts: create.reducer((state) => {
|
|
47
|
+
state.wsPayoutResponse = undefined
|
|
48
|
+
state.eqPayoutResponse = undefined
|
|
49
|
+
state.pdfOutput = undefined
|
|
50
|
+
}),
|
|
46
51
|
setAPIAccessToken: create.reducer((state, action: PayloadAction<string|undefined>) => {
|
|
47
52
|
state.apiAccessToken = action.payload
|
|
48
53
|
}),
|
|
@@ -172,7 +177,8 @@ export const {
|
|
|
172
177
|
setEQPayoutResponse,
|
|
173
178
|
setPDFOutput,
|
|
174
179
|
setAppLoading,
|
|
175
|
-
setAutoCalculatePayoutsEnabled
|
|
180
|
+
setAutoCalculatePayoutsEnabled,
|
|
181
|
+
resetPayouts
|
|
176
182
|
} = backTestingSlice.actions;
|
|
177
183
|
|
|
178
184
|
export const {
|
|
@@ -184,8 +184,8 @@ export const wizardSlice = createAppSlice({
|
|
|
184
184
|
setMapAccessToken: create.reducer((state, action: PayloadAction<string|undefined>) => {
|
|
185
185
|
state.mapAccessToken = action.payload
|
|
186
186
|
}),
|
|
187
|
-
|
|
188
|
-
state.weatherEvent =
|
|
187
|
+
updateWeatherEvent: create.reducer((state, action: PayloadAction<WeatherEventOption>) => {
|
|
188
|
+
state.weatherEvent = action.payload
|
|
189
189
|
state.step = PayoutWizardStepType.INPUT_LOCATION_DETAILS
|
|
190
190
|
state.activeStep = 0
|
|
191
191
|
state.limit = 0
|
|
@@ -193,10 +193,7 @@ export const wizardSlice = createAppSlice({
|
|
|
193
193
|
state.proxies = []
|
|
194
194
|
state.anemometers = []
|
|
195
195
|
state.pgas = []
|
|
196
|
-
state.ciass = []
|
|
197
|
-
}),
|
|
198
|
-
changeToEarthquakeEvents: create.reducer((state) => {
|
|
199
|
-
state.weatherEvent = WeatherEventOption.EARTHQUAKE
|
|
196
|
+
state.ciass = []
|
|
200
197
|
}),
|
|
201
198
|
setWeatherEvent: create.reducer((state, action: PayloadAction<WeatherEventOption>) => {
|
|
202
199
|
state.weatherEvent = action.payload
|
|
@@ -391,6 +388,7 @@ export const {
|
|
|
391
388
|
setInitialProxyEnabled,
|
|
392
389
|
setPGAEnabled,
|
|
393
390
|
setProxyEnabled,
|
|
391
|
+
updateWeatherEvent,
|
|
394
392
|
} = wizardSlice.actions;
|
|
395
393
|
|
|
396
394
|
export const {
|