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 list view of the planning items (and anywhere else) if the Agenda field was not selected in the Planning profile [SDESK-7136] #1890

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading