Skip to content

Commit

Permalink
Hide the text 'Agenda:No Agenda Assigned.' in the related planning se…
Browse files Browse the repository at this point in the history
…ction [SDESK-7136] (#1900)
  • Loading branch information
devketanpro authored Feb 12, 2024
1 parent 6905c95 commit 0b5f89b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface IProps {
desks: Array<IDesk>;
contentTypes: Array<IG2ContentType>;
lockedItems: ILockedItems;
isAgendaEnabled: boolean;
}

const mapStateToProps = (state) => ({
Expand Down Expand Up @@ -75,14 +76,19 @@ class RelatedPlanningListItemComponent extends React.PureComponent<IProps> {
<span className="sd-list-item__text-strong">{this.props.item.slugline}</span>
</span>
</List.Row>
<List.Row>
<span className="no-padding">
<span className="sd-list-item__text-label">{gettext('Agenda:')}</span>
<span className="sd-overflow-ellipsis sd-list-item__text-strong sd-list-item--element-grow">
<AgendaNameList agendas={this.props.item._agendas} />
{this.props.isAgendaEnabled && (
<List.Row>
<span className="no-padding">
<span className="sd-list-item__text-label">{gettext('Agenda:')}</span>
<span
className="sd-overflow-ellipsis
sd-list-item__text-strong sd-list-item--element-grow"
>
<AgendaNameList agendas={this.props.item._agendas} />
</span>
</span>
</span>
</List.Row>
</List.Row>
)}
</List.Column>
<List.Column>
<List.Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -32,6 +32,7 @@ interface IProps extends IEditorFieldProps {
export class EditorFieldEventRelatedPlannings extends React.PureComponent<IProps> {
render() {
const {gettext} = superdeskApi.localization;
const isAgendaEnabled = planningApi.planning.getEditorProfile().editor.agendas.enabled;
const disabled = this.props.disabled || this.props.schema?.read_only;

return (
Expand Down Expand Up @@ -88,6 +89,7 @@ export class EditorFieldEventRelatedPlannings extends React.PureComponent<IProps
editorType={this.props.editorType}
profile={this.props.profile}
coverageProfile={this.props.coverageProfile}
isAgendaEnabled={isAgendaEnabled}
/>
))
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<IProps> {
Expand Down Expand Up @@ -104,7 +105,7 @@ export class RelatedPlanningItem extends React.PureComponent<IProps> {

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 (
Expand All @@ -118,6 +119,7 @@ export class RelatedPlanningItem extends React.PureComponent<IProps> {
<Row noPadding={true}>
<RelatedPlanningListItem
item={item}
isAgendaEnabled={isAgendaEnabled}
showIcon={true}
shadow={1}
editPlanningComponent={hideRemoveIcon ? null : (
Expand Down

0 comments on commit 0b5f89b

Please sign in to comment.