From dba8fb56498f01e3a610aef2d4c560e23cf56c6e Mon Sep 17 00:00:00 2001 From: Birdmachine Date: Wed, 22 Jan 2025 13:43:24 -0500 Subject: [PATCH 1/2] Fix for rendering results of submission --- src/src/components/ingest/dataset_edit.jsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/src/components/ingest/dataset_edit.jsx b/src/src/components/ingest/dataset_edit.jsx index 68583511..94d7d712 100644 --- a/src/src/components/ingest/dataset_edit.jsx +++ b/src/src/components/ingest/dataset_edit.jsx @@ -1240,9 +1240,21 @@ class DatasetEdit extends Component { ingest_api_pipeline_test_submit(JSON.parse(localStorage.getItem("info")).groups_token, {"uuid":this.props.editingDataset.uuid}) .then((response) => { console.debug('%c◉ SUBMITTED', 'color:#00ff7b', response); + let results = ""; + let title = ""; + if(response.status === 200){ + title = "Submitted for Testing"; + results = "Dataset submitted for test processing"; + }else if(response.status === 500){ + title = "Error"; + results = "Unexpected error occurred, please ask an admin to check the ingest-api logs."; + }else{ + title = "Submission Response: "+response.status; + results = response.results; + } this.toggleFeedbackDialog( - "Testing Submitted", - response.results, + title, + results, [{label:"Close", action:()=>{this.clearFeedbackDialog()}}]); }) .catch((error) => { From 4c4a64cec23b165503bc7daa2760ad2feb6f304e Mon Sep 17 00:00:00 2001 From: Birdmachine Date: Wed, 22 Jan 2025 14:24:35 -0500 Subject: [PATCH 2/2] Render Submit for Testing button for *all* statuses --- src/src/components/ingest/dataset_edit.jsx | 45 ++++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/src/components/ingest/dataset_edit.jsx b/src/src/components/ingest/dataset_edit.jsx index 94d7d712..447ee31f 100644 --- a/src/src/components/ingest/dataset_edit.jsx +++ b/src/src/components/ingest/dataset_edit.jsx @@ -1477,6 +1477,19 @@ class DatasetEdit extends Component { } } + renderSubmitForTestingButton(){ + return ( + + ) + } + renderManualStatusControl=()=>{ return( @@ -1576,10 +1589,13 @@ class DatasetEdit extends Component { // console.debug("CheckTwo",this.state.writeable === false && this.state.has_version_priv === false); if (this.state.writeable === false ){ return ( -
- {this.cancelButton()} -
- ) +
+ {(this.state.has_pipeline_testing_priv || this.state.has_admin_priv) && this.state.is_primary === true &&( +
{this.renderSubmitForTestingButton()}
+ )} + {this.cancelButton()} +
+ ) } else { if (["NEW", "INVALID", "REOPENED", "ERROR", "SUBMITTED"].includes( this.state.status.toUpperCase())) { @@ -1600,33 +1616,30 @@ class DatasetEdit extends Component { )} { (this.state.has_pipeline_testing_priv || this.state.has_admin_priv) && this.state.is_primary === true &&( -
- -
+
{this.renderSubmitForTestingButton()}
)} + {this.cancelButton()} ) - } - if (this.state.status.toUpperCase() === 'PUBLISHED' ) { + }else if (this.state.status.toUpperCase() === 'PUBLISHED' ) { return (
{/* {this.renderNewVersionButtons()} */} {this.aButton("reopened", "Reopen")} {this.aButton("unpublished", "UnPublish")} + {(this.state.has_pipeline_testing_priv || this.state.has_admin_priv) && this.state.is_primary === true &&( +
{this.renderSubmitForTestingButton()}
+ )} {this.cancelButton()}
) }else{ return(
+ {(this.state.has_pipeline_testing_priv || this.state.has_admin_priv) && this.state.is_primary === true &&( +
{this.renderSubmitForTestingButton()}
+ )} {this.cancelButton()}
)