Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the text 'Agenda:No Agenda Assigned.' in the related planning section [SDESK-7136] #1900

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading