Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed May 17, 2022
2 parents 9c127f4 + fa22c05 commit 8ae44bb
Show file tree
Hide file tree
Showing 324 changed files with 12,958 additions and 8,513 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
env
node_modules
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,84 @@
## [1.13.1] 2019-07-18
- [SDAN-532] Fetch card external item details after loading the page (#812)

## [1.15.2] 2019-10-17
### Features
- None

### Improvements
- Add ANA logo (#856)
- [SDCP-25] Allow new users to register their interests (#857)
- [SDAN-596] Pressing back button on a mobile phone when the preview is open should close the preview (#859)
- [SDAN-599] 'Time to be confirmed' feature for Agenda Items (#860)
- [SDAN-588] Use Topic instead of Events in navigation labels (#863)
- [SDAN-599] Display changes to 'Time to be confirmed' label (#864)

### Fixes
- Use default Ubuntu in Travis (#853)
- [SDAN-598] fix: Save button not being enabled when turning off topic notifications (#855)
- [SDAN-595] fix(agenda-emails) Use correct url_for method (#854)
- Updating superdesk-core version for newsroom package (#861)

## [1.15.1] 2019-09-10
### Features
- None

### Improvements
- None

### Fixes
- [SDAN-594] Previewing past or future Agenda item from email displays list not the preview (#848)
- Save Topic and Save Events 'SAVE' button was disabled while saving (#849)

## [1.15] 2019-09-09
### Features
- None

### Improvements
- [SDAN-578][SDAN-579] 'Account Manager' field in Company schema and use that in Company Expiry alerts (#832)
- [SDAN-570] Fixes/Improvements to the 'share' action (#838)
- [SDAN-591] Improve company expiry email layout and text (#841)
- [SDAN-570] Changes to 'share' item template (#842)
- [SDAN-572] Style changes to display 'Event Completed' label (#843)
- [SDAN-568] Improve responsive behaviour for mobile phones (#834)
- [SDAN-568] Further response layout improvements (#844)

### Fixes
- [SDAN-583] Preview for items that aren't wire or agenda in the Subscriber Activity report don't show the body text (#831)
- [SDAN-580] Remove company expiry check from user login and notifications (#833)
- [SDAN-587] Ignore agenda when applying time limit to search (#836)
- [SDAN-590] (fix): Celery beat and queue configs (#840)
- [SDAN-592] Coverages in the Agenda Share/Print Preview are misaligned (#845)
- [SDAN-593] Show all event coverages if no planning item selected (#847)

## [1.14] 2019-08-22
### Features
- [SDAN-538] Add the ability to execute the remove expired command (#817)

### Improvements
- [SDAN-572] Label completed agenda items as 'Completed' (#829)
- [SDAN-572][SDAN-567] UI changes in displaying 'byline', 'located' and 'slugline' (#823)
- [SDAN-565] Reposition the 'show map' text in Agenda Preview (#821)
- [SDAN-566] Add 'preview' and 'open' to 'actions' filter in subscriber activity report (#822)
- [SDAN-524][SDAN-530] Record 'open' and 'preview' actions in history collection (#815)
- [SDAN-519] Toggle map display in Agenda Preview (#811)

### Fixes
- [SDAN-585] (fix): Corrections showing up as 'Updates Coming' (#830)
- [SDAN-569] Market Place Bookmarks were not seen (#828)
- UI fix to add padding after 'published' and remove 'on created_time' in wire ite, detail (#826)
- fix creating new dashboard card when there is single dashboard type (#827)
- [SDAN-576] Prefer description_text over body_text for image captions (#825)
- [SDAN-575] Internal note on coverages is visible for public users in Newsroom (#824)
- [SDAN-548] ednote from wire item was not displayed in Agenda coverage. (#818)
- [SDAN-549] Text from wire items were not updating in Agenda preview (#818)
- [SDAN-531] Push errors when event is created from a planning item (#814)
- [SDAN-516] Show agency logos for AAPX (#816)
- [SDAN-535] Add 'located' attribute as 'Location' when a wire item is copied (#813)

## [1.13.1] 2019-07-18
- [SDAN-532] Fetch card external item details after loading the page (#812)

## [1.13] 2019-07-16
- [SDAN-529] Fix incorrect coverage scheduled date in Agenda notification email
- [SDAN-514] Changes to Watched Agenda Emails (#808)
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions assets/agenda/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
getTimezoneOffset,
errorHandler,
getLocaleDate,
DATE_FORMAT,
TIME_FORMAT,
recordAction
} from 'utils';
import {noNavigationSelected, getNavigationUrlParam} from 'search/utils';
Expand Down Expand Up @@ -272,7 +270,7 @@ function search(state, next) {
fromDateFilter = getMomentDate(get(state, 'agenda.activeDate')).set({
hour: currentMoment.hour(),
minute: currentMoment.minute()
}).format(`${DATE_FORMAT} ${TIME_FORMAT}`);
}).format('DD/MM/YYYY HH:mm'); // Server expects specific date/time format for FeaturedStories param
} else {
const agendaDate = getDateInputDate(get(state, 'agenda.activeDate'));
fromDateFilter = (
Expand Down
29 changes: 8 additions & 21 deletions assets/agenda/components/AgendaApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,6 @@ class AgendaApp extends BaseApp {

const onDetailClose = this.props.detail ? null :
() => this.props.actions.filter(a => a.id === 'open')[0].action(null, this.props.previewGroup, this.props.previewPlan);

const groups = [
{
field: 'service',
label: gettext('Category'),
},
{
field: 'subject',
label: gettext('Subject'),
},
{
field: 'urgency',
label: gettext('News Value'),
},
{
field: 'place',
label: gettext('Place'),
},
];
const eventsOnly = this.props.eventsOnlyView || this.props.eventsOnlyAccess;
const hideFeaturedToggle = !noNavigationSelected(this.props.activeNavigation) ||
this.props.bookmarks ||
Expand Down Expand Up @@ -162,6 +143,7 @@ class AgendaApp extends BaseApp {
coverageActions={this.props.coverageActions}
/>] : [
<section key="contentHeader" className='content-header'>
<h3 className="a11y-only">{gettext('Agenda Content')}</h3>
<SelectedItemsBar
actions={this.props.actions}
/>
Expand All @@ -171,6 +153,7 @@ class AgendaApp extends BaseApp {
className='content-bar__menu content-bar__menu--nav--open'
ref={this.setOpenRef}
title={gettext('Close filter panel')}
aria-label={gettext('Close')}
onClick={this.toggleSidebar}>
<i className='icon--close-thin icon--white' />
</span>
Expand All @@ -181,6 +164,7 @@ class AgendaApp extends BaseApp {
className='content-bar__menu content-bar__menu--nav'
ref={this.setCloseRef}
title={gettext('Open filter panel')}
aria-label={gettext('Open filter panel')}
onClick={this.toggleSidebar}>
<i className='icon--hamburger' />
</span>
Expand Down Expand Up @@ -217,12 +201,12 @@ class AgendaApp extends BaseApp {
<section key="contentMain" className='content-main'>
<div className={`wire-column--3 ${this.state.withSidebar?'nav--open':''}`}>
<div className={`wire-column__nav ${this.state.withSidebar?'wire-column__nav--open':''}`}>
<h3 className="a11y-only">{gettext('Side filter panel')}</h3>
{this.state.withSidebar && (
<SearchSidebar
tabs={this.getTabs()}
props={{
...this.props,
groups,
fetchItems: this.fetchItemsOnNavigation}}
/>
)}
Expand Down Expand Up @@ -286,7 +270,8 @@ class AgendaApp extends BaseApp {
this.props.navigations,
this.props.activeNavigation,
this.props.activeTopic
)
),
this.renderSavedItemsCount(),
])
);
}
Expand Down Expand Up @@ -340,6 +325,7 @@ AgendaApp.propTypes = {
searchParams: PropTypes.object,
showSaveTopic: PropTypes.bool,
previewConfig: PropTypes.object,
groups: PropTypes.array,
};

const mapStateToProps = (state) => ({
Expand Down Expand Up @@ -380,6 +366,7 @@ const mapStateToProps = (state) => ({
searchParams: searchParamsSelector(state),
showSaveTopic: showSaveTopicSelector(state),
previewConfig: previewConfigSelector(state),
groups: get(state, 'groups', []),
});

const mapDispatchToProps = (dispatch) => ({
Expand Down
2 changes: 1 addition & 1 deletion assets/agenda/components/AgendaAttachments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function AgendaAttachments({item}) {
</div>
<div className="coverage-item__column">
<a className="icon-button" href={attachment.href + '?filename=' + attachment.name} aria-label={gettext('Download')}>
<i className="icon--download icon--gray"></i>
<i className="icon--download icon--gray-dark"></i>
</a>
</div>
</div>
Expand Down
25 changes: 19 additions & 6 deletions assets/agenda/components/AgendaCoverages.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import {connect} from 'react-redux';
import PropTypes from 'prop-types';
import classNames from 'classnames';

Expand All @@ -13,9 +14,10 @@ import {
WORKFLOW_STATUS,
formatCoverageDate
} from '../utils';
import {agendaContentLinkTarget} from 'ui/selectors';


export default function AgendaCoverages({item, coverages, wireItems, actions, user, onClick, hideViewContentItems}) {
function AgendaCoveragesComponent({item, coverages, wireItems, actions, user, onClick, hideViewContentItems, contentLinkTarget}) {
if (isEmpty(coverages)) {
return null;
}
Expand All @@ -31,12 +33,12 @@ export default function AgendaCoverages({item, coverages, wireItems, actions, us
{'coverage-item--clickable': onClick})} key={coverage.coverage_id} onClick={onClick}
title={onClick ? gettext('Open Agenda in new tab') : onClick} >
<div className='coverage-item__row'>
<span className='d-flex coverage-item--element-grow'>
<i className={`icon-small--coverage-${getCoverageIcon(coverage.coverage_type)} ${WORKFLOW_COLORS[coverage.workflow_status]} mr-2`}></i>
<span className={classNames('coverage-item__coverage-icon', WORKFLOW_COLORS[coverage.workflow_status])}>
<i className={`icon-small--coverage-${getCoverageIcon(coverage.coverage_type)} mr-2`}></i>
<span>{`${getCoverageDisplayName(coverage.coverage_type)}${getSlugline(coverage)}`}</span>
</span>
{coverage.workflow_status !== WORKFLOW_STATUS.COMPLETED && <span className='d-flex text-nowrap'>
<i className='icon-small--clock icon--gray mr-1'></i>
<i className='icon-small--clock icon--gray-dark mr-1'></i>
<span className='coverage-item__text-label mr-1'>{gettext('expected')}:</span>
<span>{formatCoverageDate(coverage)}</span>
</span>}
Expand All @@ -52,13 +54,24 @@ export default function AgendaCoverages({item, coverages, wireItems, actions, us
actions={actions}
user={user}
coverageData={getDataFromCoverages(item)}
hideViewContentItems={hideViewContentItems} />
hideViewContentItems={hideViewContentItems}
contentLinkTarget={contentLinkTarget}
/>
</div>
));
}

AgendaCoverages.propTypes = {
AgendaCoveragesComponent.propTypes = {
item: PropTypes.object,
coverages: PropTypes.arrayOf(PropTypes.object),
wireItems: PropTypes.array,
contentLinkTarget: PropTypes.string,
};

const mapStateToProps = (state) => ({
contentLinkTarget: agendaContentLinkTarget(state),
});

const AgendaCoverages = connect(mapStateToProps)(AgendaCoveragesComponent);

export default AgendaCoverages;
2 changes: 1 addition & 1 deletion assets/agenda/components/AgendaFilterButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {gettext} from 'utils';
import classNames from 'classnames';

const getActiveFilterLabel = (filter, activeFilter, isActive) => {
return isActive ? activeFilter[filter.field][0] : gettext(filter.label);
return isActive ? gettext(activeFilter[filter.field][0]) : gettext(filter.label);
};

function AgendaFilterButton({filter, activeFilter, autoToggle, onClick}) {
Expand Down
20 changes: 15 additions & 5 deletions assets/agenda/components/AgendaInternalNote.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import {gettext} from 'utils';
import classNames from 'classnames';
import {gettext, getPlainTextMemoized} from 'utils';

export default function AgendaInternalNote({internalNote, onlyIcon, noMargin, mt2, alignCenter, marginRightAuto, borderRight, noPaddingRight}) {
if (!internalNote) {
const note = getPlainTextMemoized(internalNote);

if (!note) {
return null;
}

Expand All @@ -23,7 +25,7 @@ export default function AgendaInternalNote({internalNote, onlyIcon, noMargin, mt
);

return (
<div title={`${labelText}:\n${internalNote}`}
<div title={`${labelText}:\n${note}`}
data-toggle="tooltip"
data-placement="right"
className={className}
Expand All @@ -35,8 +37,16 @@ export default function AgendaInternalNote({internalNote, onlyIcon, noMargin, mt
return (
<div className={classNames('wire-column__preview_article-note', {'m-0': noMargin}, {'mt-2': mt2})}>
<i className="icon--info icon--red icon--info--smaller" title={labelText}/>
<span className='ml-1'>{internalNote.split('\n').map((item, key) =>
<span key={key}>{item}<br/></span>)}</span>
<span className='ml-1'>
{internalNote[0] !== '<' ?
internalNote.split('\n').map((item, key) => (
<p key={key}>{item}</p>
))
: (
<div dangerouslySetInnerHTML={{__html: internalNote}} />
)
}
</span>
</div>
);
}
Expand Down
6 changes: 3 additions & 3 deletions assets/agenda/components/AgendaItemTimeUpdater.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class AgendaItemTimeUpdater extends React.Component {
}

if (timeDiff === 0) {
this.setState({timeText: `${itemState} ${gettext('just now')}`});
this.setState({timeText: itemState + ' ' + gettext('just now')});
} else {
this.setState({timeText: `${itemState} ${timeDiff} ${gettext('minute(s) ago')}`});
this.setState({timeText: itemState + ' ' + timeDiff + ' ' + gettext('minute(s) ago')});
}
}

Expand All @@ -99,7 +99,7 @@ class AgendaItemTimeUpdater extends React.Component {

return(
<div className={className}>
<div className="label label--yellow2">{this.state.timeText}</div>
<div className="label label--blue">{this.state.timeText}</div>
</div>
);
}
Expand Down
12 changes: 9 additions & 3 deletions assets/agenda/components/AgendaList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {get, isEqual, cloneDeep} from 'lodash';
import classNames from 'classnames';
import moment from 'moment';

import {gettext, DATE_FORMAT, isDisplayed} from 'utils';
import {gettext, DATE_FORMAT, isDisplayed, shouldShowListShortcutActionIcons} from 'utils';
import AgendaListItem from './AgendaListItem';
import {setActive, previewItem, toggleSelected, openItem} from '../actions';
import {EXTENDED_VIEW} from 'wire/defaults';
import {getIntVersion} from 'wire/utils';
import {groupItems, getPlanningItemsByGroup, getListItems} from 'agenda/utils';
import {searchNavigationSelector} from 'search/selectors';
import {previewConfigSelector} from 'ui/selectors';
import {previewConfigSelector, listConfigSelector} from 'ui/selectors';


const PREVIEW_TIMEOUT = 500; // time to preview an item after selecting using kb
Expand Down Expand Up @@ -228,6 +228,7 @@ class AgendaList extends React.Component {
onScroll,
} = this.props;
const isExtended = activeView === EXTENDED_VIEW;
const showShortcutActionIcons = shouldShowListShortcutActionIcons(this.props.listConfig, isExtended);
const articleGroups = groupedItems.map((group) =>
[
<div className='wire-articles__header' key={`${group.date}header`}>
Expand Down Expand Up @@ -263,7 +264,9 @@ class AgendaList extends React.Component {
user={this.props.user}
actioningItem={this.state.actioningItem}
planningId={plan.guid}
resetActioningItem={this.resetActioningItem}/>
resetActioningItem={this.resetActioningItem}
showShortcutActionIcons={showShortcutActionIcons}
/>
)
}
</Fragment>);
Expand All @@ -286,6 +289,7 @@ class AgendaList extends React.Component {
user={this.props.user}
actioningItem={this.state.actioningItem}
resetActioningItem={this.resetActioningItem}
showShortcutActionIcons={showShortcutActionIcons}
/>);
}
})}
Expand Down Expand Up @@ -347,6 +351,7 @@ AgendaList.propTypes = {
refNode: PropTypes.func,
previewConfig: PropTypes.object,
featuredOnly: PropTypes.bool,
listConfig: PropTypes.object,
};

const mapStateToProps = (state) => ({
Expand All @@ -369,6 +374,7 @@ const mapStateToProps = (state) => ({
isLoading: state.isLoading,
previewConfig: previewConfigSelector(state),
featuredOnly: get(state, 'agenda.featuredOnly'),
listConfig: listConfigSelector(state),
});

export default connect(mapStateToProps)(AgendaList);
Loading

0 comments on commit 8ae44bb

Please sign in to comment.