Skip to content

Commit

Permalink
Hide the text 'Agenda:No Agenda Assigned.' in the list view of the pl…
Browse files Browse the repository at this point in the history
…anning items (and anywhere else) if the Agenda field was not selected in the Planning tem profile [SDESK-7136]
  • Loading branch information
devketanpro committed Dec 20, 2023
1 parent 3844f37 commit 65cb100
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client/components/Main/ListGroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {PlanningItem} from '../Planning';

import {ITEM_TYPE, EVENTS, PLANNING, MAIN, CLICK_DELAY} from '../../constants';
import {getItemType, eventUtils} from '../../utils';
import {planningApi} from '../../superdeskApi';

interface IProps extends Omit<
IEventListItemProps & IPlanningListItemProps,
Expand Down Expand Up @@ -198,6 +199,7 @@ export class ListGroupItem extends React.Component<IProps, IState> {
agendas: agendas,
date: date,
filterLanguage: searchParams?.language || searchFilterParams?.language,
isAgendaEnabled: planningApi.planning.getEditorProfile().editor.agendas.enabled,
onAddCoverageClick: onAddCoverageClick,
multiSelected: indexOf(selectedPlanningIds, item._id) !== -1,
showAddCoverage: showAddCoverage,
Expand Down
10 changes: 7 additions & 3 deletions client/components/Planning/PlanningItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class PlanningItemComponent extends React.Component<IProps, IState> {
planningUtils.getAgendaNames(nextProps.item, nextProps.agendas)
) ||
this.props.minTimeWidth !== nextProps.minTimeWidth ||
this.props.filterLanguage !== nextProps.filterLanguage;
this.props.filterLanguage !== nextProps.filterLanguage ||
this.props.isAgendaEnabled !== nextProps.isAgendaEnabled;
}

onItemHoverOn() {
Expand Down Expand Up @@ -186,7 +187,8 @@ class PlanningItemComponent extends React.Component<IProps, IState> {
agendas,
contacts,
listViewType,
filterLanguage
filterLanguage,
isAgendaEnabled,
} = this.props;

if (!item) {
Expand All @@ -198,7 +200,9 @@ class PlanningItemComponent extends React.Component<IProps, IState> {
const event = get(item, 'event');
const borderState = isItemLocked ? 'locked' : false;
const isExpired = isItemExpired(item);
const secondaryFields = get(listFields, 'planning.secondary_fields', PLANNING.LIST.SECONDARY_FIELDS);
const secondaryFields = get(listFields, 'planning.secondary_fields', PLANNING.LIST.SECONDARY_FIELDS)
.filter((fields) => isAgendaEnabled ? true : fields !== 'agendas');

const {querySelectorParent} = superdeskApi.utilities;
const language = filterLanguage || item.language || getUserInterfaceLanguageFromCV();

Expand Down
1 change: 1 addition & 0 deletions client/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ export interface IPlanningListItemProps extends IBaseListItemProps<IPlanningItem
users: Array<IUser>;
desks: Array<IDesk>;
filterLanguage?: string;
isAgendaEnabled?:boolean;
// showUnlock?: boolean; // Is this used anymore?
hideItemActions: boolean;
showAddCoverage: boolean;
Expand Down

0 comments on commit 65cb100

Please sign in to comment.