back-testing-react 2.1.9 → 2.1.11

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.
@@ -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
- clonedProxy.latitude = location.latitude;
163
- clonedProxy.longitude = location.longitude;
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 = cloneDeep(proxyList[i]);
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 = cloneDeep(proxyList[i]);
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
- changeToWindstormEvents: create.reducer((state) => {
188
- state.weatherEvent = WeatherEventOption.WINDSTORM
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 {