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

Display user role in list and detail view based on new Config [CPCN-690] #977

Merged
merged 2 commits into from
Jun 27, 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
1 change: 1 addition & 0 deletions assets/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface IClientConfig {
display_all_versions_toggle: boolean;
display_credits: boolean;
display_news_only: boolean;
display_user_role: boolean;
filter_panel_defaults: {
tab: {
wire: string;
Expand Down
1 change: 1 addition & 0 deletions assets/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ window.newsroom = {
display_all_versions_toggle: false,
display_credits: false,
display_news_only: true,
display_user_role: true,
devketanpro marked this conversation as resolved.
Show resolved Hide resolved
filter_panel_defaults: {
tab: {
wire: 'nav',
Expand Down
1 change: 1 addition & 0 deletions assets/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const DAY_IN_MINUTES = 24 * 60 - 1;
export const LIST_ANIMATIONS = getConfig('list_animations', true);
export const DISPLAY_NEWS_ONLY = getConfig('display_news_only', true);
export const AGENDA_SORT_EVENTS_WITH_COVERAGE_ON_TOP = getConfig('agenda_sort_events_with_coverage_on_top', false);
export const DISPLAY_USER_ROLE = getConfig('display_user_role', true);
export const DISPLAY_AGENDA_FEATURED_STORIES_ONLY = getConfig('display_agenda_featured_stories_only', true);
export const DISPLAY_ALL_VERSIONS_TOGGLE = getConfig('display_all_versions_toggle', true);
export const DEFAULT_TIMEZONE = getConfig('default_timezone', 'Australia/Sydney');
Expand Down
4 changes: 2 additions & 2 deletions assets/wire/components/fields/Authors.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';

import {gettext} from 'utils';
import {gettext, DISPLAY_USER_ROLE} from 'utils';

import InfoBox from '../InfoBox';

Expand All @@ -14,7 +14,7 @@ export function Authors({item}: any) {
<InfoBox label={gettext('Authors')}>
{item.authors.map((author: any) => (
<div key={author.code + '/' + author.role} className="wire-column__preview__item__author">
<h5>{author.role}</h5>
{DISPLAY_USER_ROLE ? <h5>{author.role}</h5> : null}
<h6>{author.name}</h6>
{(!author.biography || !author.biography.length) ? null : (
<p>{author.biography.split('\n').map((item: any, key: any) => (
Expand Down
1 change: 1 addition & 0 deletions newsroom/web/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
"item_actions": {},
"display_abstract": DISPLAY_ABSTRACT,
"display_credits": False,
"display_user_role": True,
"filter_panel_defaults": {
"tab": {
"wire": "nav", # Options are 'nav', 'topics', 'filters'
Expand Down
Loading