From 053c7551a3e2ee784bb6cf96560f0fba64390c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=B6hme?= Date: Tue, 3 Sep 2024 13:33:06 +0200 Subject: [PATCH] fix: Fix various titles and filters (#1133) * fix: Fix various titles and filters * only show questionnaire editor when in all projects * remove console logs --- frontend/src/components/ActionTable/ActionTable.tsx | 7 +++++-- .../src/views/Project/Admin/Components/CategoryHeader.tsx | 8 ++++---- frontend/src/views/Project/Dashboard/DashboardView.tsx | 5 +++-- frontend/src/views/Project/ProjectTabs.tsx | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/ActionTable/ActionTable.tsx b/frontend/src/components/ActionTable/ActionTable.tsx index af405c75..71174648 100644 --- a/frontend/src/components/ActionTable/ActionTable.tsx +++ b/frontend/src/components/ActionTable/ActionTable.tsx @@ -12,6 +12,7 @@ import { barrierToString, organizationToString } from '../../utils/EnumToString' import { getFusionProjectName } from '../../utils/helpers' import PriorityIndicator from '../Action/PriorityIndicator' import { PersonDetails } from '@equinor/fusion-react-person' +import { useAppContext } from '../../context/AppContext' const { Row, Cell } = Table @@ -47,10 +48,12 @@ interface Props { } const ActionTable = ({ onClickAction, actionsWithAdditionalInfo, personDetailsList, showEvaluations = false, projects }: Props) => { + const {currentProject} = useAppContext() + const columns = columnOptions.filter( col => (col.name === 'Evaluation' && showEvaluations) || - (col.name === 'Project' && projects) || + (col.name === 'Project' && !currentProject) || (col.name !== 'Evaluation' && col.name !== 'Project') ) @@ -117,7 +120,7 @@ const ActionTable = ({ onClickAction, actionsWithAdditionalInfo, personDetailsLi > {action.title} - {projects && {getFusionProjectName(projects, action.question.evaluation.project.fusionProjectId)}} + {!currentProject && {getFusionProjectName(projects, action.question.evaluation.project.fusionProjectId)}} {showEvaluations && {action.question.evaluation.name}} {barrierToString(barrier)} {organizationToString(organization)} diff --git a/frontend/src/views/Project/Admin/Components/CategoryHeader.tsx b/frontend/src/views/Project/Admin/Components/CategoryHeader.tsx index f5a4d73e..426489ee 100644 --- a/frontend/src/views/Project/Admin/Components/CategoryHeader.tsx +++ b/frontend/src/views/Project/Admin/Components/CategoryHeader.tsx @@ -49,7 +49,7 @@ const CategoryHeader = ({ const projectCategoryOptions = [ { - title: 'All project categories', + title: 'All questionnaire templates', id: 'all', }, ] @@ -87,7 +87,7 @@ const CategoryHeader = ({ option.id === selectedProjectCategory)?.title} onSelect={option => { const selectedOption = (option as any).nativeEvent.detail.selected[0] @@ -105,11 +105,11 @@ const CategoryHeader = ({ - +