From 17267ac107f112b05a42d4681649b7b7997fed8a Mon Sep 17 00:00:00 2001 From: William Horn Date: Thu, 27 Jun 2024 11:22:30 -0800 Subject: [PATCH 1/2] fix: on demand jobs get stuck when loading another page --- .../results-menu/scenes-list/scenes-list.component.ts | 2 +- src/app/store/scenes/scenes.reducer.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/components/results-menu/scenes-list/scenes-list.component.ts b/src/app/components/results-menu/scenes-list/scenes-list.component.ts index 5d65c0665..0c5d6073e 100644 --- a/src/app/components/results-menu/scenes-list/scenes-list.component.ts +++ b/src/app/components/results-menu/scenes-list/scenes-list.component.ts @@ -142,8 +142,8 @@ export class ScenesListComponent implements OnInit, OnDestroy, AfterContentInit scenes => { this.scenes = scenes; - this.removeLoadedScenes(scenes); this.loadDummyProducts(scenes); + this.removeLoadedScenes(scenes); } ) ); diff --git a/src/app/store/scenes/scenes.reducer.ts b/src/app/store/scenes/scenes.reducer.ts index 272656fcb..ac1e387dc 100644 --- a/src/app/store/scenes/scenes.reducer.ts +++ b/src/app/store/scenes/scenes.reducer.ts @@ -90,7 +90,6 @@ export function scenesReducer(state = initState, action: ScenesActions): ScenesS searchResults = searchResults.concat(subproducts) - const products = searchResults .reduce((total, product) => { if (product.isDummyProduct && isAlreadyLoaded(product, state.products[product.id])) { @@ -160,10 +159,13 @@ export function scenesReducer(state = initState, action: ScenesActions): ScenesS const product = cmrData[jobProduct.name]; if(!!product) { + if (!jobProduct.metadata.job) { + return; + } let job = { ...jobProduct.metadata.job, job_parameters: { - ...jobProduct.metadata.job.job_parameters, + ...jobProduct.metadata.job?.job_parameters, } }; const jobFile = !!job.files ? From 2b3de6d5d452688b791f6e807059c9898e63e7a6 Mon Sep 17 00:00:00 2001 From: William Horn Date: Thu, 27 Jun 2024 11:46:51 -0800 Subject: [PATCH 2/2] fix: on demand resubmit errors if no project name is entered --- src/app/services/hyp3.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/services/hyp3.service.ts b/src/app/services/hyp3.service.ts index fc42e756b..b7b659a20 100644 --- a/src/app/services/hyp3.service.ts +++ b/src/app/services/hyp3.service.ts @@ -118,6 +118,10 @@ export class Hyp3Service { jobOptions.name = options.projectName; } + if (!jobOptions.name) { + delete jobOptions.name; + } + return jobOptions; }); }