From 0b5f89bb5a2c8b81462b8cfab873ca903cc621a6 Mon Sep 17 00:00:00 2001 From: Ketan <73937490+devketanpro@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:23:33 +0530 Subject: [PATCH] Hide the text 'Agenda:No Agenda Assigned.' in the related planning section [SDESK-7136] (#1900) --- .../RelatedPlanningListItem.tsx | 20 ++++++++++++------- .../EventRelatedPlannings.tsx | 4 +++- .../RelatedPlanningItem.tsx | 4 +++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/client/components/RelatedPlannings/PlanningMetaData/RelatedPlanningListItem.tsx b/client/components/RelatedPlannings/PlanningMetaData/RelatedPlanningListItem.tsx index 9a33e0a33..8a8fd19d4 100644 --- a/client/components/RelatedPlannings/PlanningMetaData/RelatedPlanningListItem.tsx +++ b/client/components/RelatedPlannings/PlanningMetaData/RelatedPlanningListItem.tsx @@ -30,6 +30,7 @@ interface IProps { desks: Array; contentTypes: Array; lockedItems: ILockedItems; + isAgendaEnabled: boolean; } const mapStateToProps = (state) => ({ @@ -75,14 +76,19 @@ class RelatedPlanningListItemComponent extends React.PureComponent { {this.props.item.slugline} - - - {gettext('Agenda:')} - - + {this.props.isAgendaEnabled && ( + + + {gettext('Agenda:')} + + + - - + + )} diff --git a/client/components/fields/editor/EventRelatedPlannings/EventRelatedPlannings.tsx b/client/components/fields/editor/EventRelatedPlannings/EventRelatedPlannings.tsx index 51aa728e8..e6a6a5174 100644 --- a/client/components/fields/editor/EventRelatedPlannings/EventRelatedPlannings.tsx +++ b/client/components/fields/editor/EventRelatedPlannings/EventRelatedPlannings.tsx @@ -8,7 +8,7 @@ import { IProfileSchemaTypeList, ISearchProfile } from '../../../../interfaces'; -import {superdeskApi} from '../../../../superdeskApi'; +import {planningApi, superdeskApi} from '../../../../superdeskApi'; import {ButtonGroup, Button} from 'superdesk-ui-framework/react'; import {Row} from '../../../UI/Form'; @@ -32,6 +32,7 @@ interface IProps extends IEditorFieldProps { export class EditorFieldEventRelatedPlannings extends React.PureComponent { render() { const {gettext} = superdeskApi.localization; + const isAgendaEnabled = planningApi.planning.getEditorProfile().editor.agendas.enabled; const disabled = this.props.disabled || this.props.schema?.read_only; return ( @@ -88,6 +89,7 @@ export class EditorFieldEventRelatedPlannings extends React.PureComponent )) )} diff --git a/client/components/fields/editor/EventRelatedPlannings/RelatedPlanningItem.tsx b/client/components/fields/editor/EventRelatedPlannings/RelatedPlanningItem.tsx index cff0adbf4..15f83a21d 100644 --- a/client/components/fields/editor/EventRelatedPlannings/RelatedPlanningItem.tsx +++ b/client/components/fields/editor/EventRelatedPlannings/RelatedPlanningItem.tsx @@ -36,6 +36,7 @@ interface IProps { scrollOnChange: boolean ): void; addCoverageToWorkflow(original: IPlanningItem, coverage: IPlanningCoverageItem, index: number): void; + isAgendaEnabled: boolean; } export class RelatedPlanningItem extends React.PureComponent { @@ -104,7 +105,7 @@ export class RelatedPlanningItem extends React.PureComponent { render() { const {gettext} = superdeskApi.localization; - const {item} = this.props; + const {item, isAgendaEnabled} = this.props; const hideRemoveIcon = !this.props.item._id.startsWith(TEMP_ID_PREFIX) || this.props.disabled; return ( @@ -118,6 +119,7 @@ export class RelatedPlanningItem extends React.PureComponent {