From dc1a9450680ba9d61a20db9b4b6a31880e19adf7 Mon Sep 17 00:00:00 2001 From: karolina-siemieniuk-morawska <55505399+karolina-siemieniuk-morawska@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:18:22 +0200 Subject: [PATCH] ui: display error link in new holdingpen * ref: cern-sis/issues-inspire#520 --- ui/public/config.js | 1 + .../AuthorDetailPageContainer.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ui/public/config.js b/ui/public/config.js index 5d251335a2..1fa9f1fe10 100644 --- a/ui/public/config.js +++ b/ui/public/config.js @@ -11,6 +11,7 @@ ASSIGN_NO_PROFILE_UI_FEATURE_FLAG: true, ASSIGN_NOT_LOGGED_IN_FEATURE_FLAG: true, SELF_CURATION_BUTTON: true, + INSPIRE_WORKFLOWS_DAGS_URL: null, /* Example: BANNERS: [ { diff --git a/ui/src/holdingpen-new/containers/DetailPageContainer/AuthorDetailPageContainer.tsx b/ui/src/holdingpen-new/containers/DetailPageContainer/AuthorDetailPageContainer.tsx index 9cd5a6936f..321a5a64f5 100644 --- a/ui/src/holdingpen-new/containers/DetailPageContainer/AuthorDetailPageContainer.tsx +++ b/ui/src/holdingpen-new/containers/DetailPageContainer/AuthorDetailPageContainer.tsx @@ -25,6 +25,7 @@ import { columnsSubject, columnsAdvisors, } from './columnData'; +import { getConfigFor } from '../../../common/config'; interface AuthorDetailPageContainerProps { dispatch: ActionCreator; @@ -47,13 +48,14 @@ const AuthorDetailPageContainer: React.FC = ({ const data = author?.get('data') as Map; const tickets = author?.get('tickets') as Map; + const ERRORS_URL = getConfigFor('INSPIRE_WORKFLOWS_DAGS_URL'); const OPEN_SECTIONS = [ data?.get('positions') && 'institutions', data?.get('project_membership') && 'projects', (data?.get('urls') || data?.get('ids')) && 'links', (data?.get('arxiv_categories') || data?.get('.advisors')) && 'other', - author?.get('_error_msg') && 'errors', + author?.get('status') === 'error' && 'errors', 'delete', ].filter(Boolean); @@ -177,11 +179,15 @@ const AuthorDetailPageContainer: React.FC = ({ - {author?.get('_error_msg') && ( + {author?.get('status') === 'error' && ( -
- {author?.get('_error_msg')} -
+

+ See error details here:{' '} + {`${ERRORS_URL}/${id}`} +

)}