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

Authoring react post broadcasting #1904

Merged
merged 30 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
998cff9
adjust API
tomaskikutis Apr 20, 2023
209db09
update gettext usage
tomaskikutis Apr 20, 2023
def1a61
Fix event template (#1812)
thecalcc Jun 14, 2023
629c2e8
Fix show modal (#1814)
thecalcc Jun 14, 2023
46387f7
UIF version update (#1818)
thecalcc Jun 28, 2023
a9fe557
[email protected]
tomaskikutis Jul 27, 2023
6ee85a5
Merge remote-tracking branch 'origin/develop' into authoring-react-po…
petrjasek Oct 31, 2023
400ef62
fix lint
petrjasek Oct 31, 2023
9a8ec9e
fix e2e client build
petrjasek Oct 31, 2023
d4f1176
version of ui-framework (#1875)
dzonidoo Nov 8, 2023
8d6204a
added zIndex on treeSelect (#1878)
dzonidoo Nov 21, 2023
2fa76c2
When navigating away from planning the selected drop down filter is n…
dzonidoo Nov 22, 2023
947931c
fix typo (#1881) (#1882)
devketanpro Nov 23, 2023
24c6003
Fix start working on assignment action (#1885)
thecalcc Dec 4, 2023
cc6ef7a
fix creation of planning items via ingest (#1889)
petrjasek Dec 18, 2023
b548e0a
Merge branch 'develop' into authoring-react-post-broadcasting
thecalcc Jan 17, 2024
393bae8
[STTNHUB-312] Add planning_ingested signal (#1899)
MarkLark86 Jan 18, 2024
df4a01d
update client core to develop
petrjasek Jan 19, 2024
1655909
[SDESK-7166] fix: Use `ingest_id` for coverage content when its auto …
MarkLark86 Jan 24, 2024
0efc58f
fix unit test notifies the user if the item is already linked to an a…
tomaskikutis Jan 28, 2024
7eebef9
update superdesk-core to latest
tomaskikutis Jan 29, 2024
c4fa3cd
fix e2e test event_template.cy.ts
tomaskikutis Jan 29, 2024
fb2956f
add assigned user/desk info to planning json (#1888)
petrjasek Dec 19, 2023
367d470
[SDBELGA-759] Feature: Sync Event metadata to Planning & Coverages (#…
MarkLark86 Jan 8, 2024
1a8d7bc
fix unit tests
MarkLark86 Jan 30, 2024
582acf7
update cores to use release/2.7 branches
MarkLark86 Jan 30, 2024
de8905c
Merge remote-tracking branch 'origin/release/2.7' into develop
petrjasek Feb 1, 2024
b75701f
Merge branch 'develop' into authoring-react-post-broadcasting
petrjasek Feb 1, 2024
0d84d9b
update package-lock
petrjasek Feb 6, 2024
390b852
fix flaky test
petrjasek Feb 6, 2024
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
10 changes: 4 additions & 6 deletions client/actions/assignments/ui.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {get, cloneDeep, forEach} from 'lodash';
import moment from 'moment';

import {planningApi} from '../../superdeskApi';
import {planningApi, superdeskApi} from '../../superdeskApi';
import {IAssignmentItem} from '../../interfaces';

import {showModal} from '../index';
Expand Down Expand Up @@ -628,12 +628,10 @@ function startWorking(assignment: IAssignmentItem) {
promise.then(() =>
(planningApi.locks.lockItem(assignment, 'start_working')
.then((lockedAssignment) => {
const currentDesk = assignmentUtils.getCurrentSelectedDesk(desks, getState());
const defaultTemplateId = get(currentDesk, 'default_content_template') || null;
const defaultTemplateId = assignmentUtils
.getCurrentSelectedDesk(desks, getState())?.default_content_template ?? null;

return templates.fetchTemplatesByUserDesk(
session.identity._id,
get(currentDesk, '_id') || null,
return superdeskApi.entities.templates.getUserTemplates(
1,
200,
'create'
Expand Down
15 changes: 4 additions & 11 deletions client/actions/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,22 +823,15 @@ function _filter(filterType: PLANNING_VIEW, params: ICombinedEventOrPlanningSear
if (currentFilterId != undefined || filterType === PLANNING_VIEW.COMBINED) {
promise = planningApi.ui.list.changeFilterId(currentFilterId, params);
} else if (filterType === PLANNING_VIEW.EVENTS) {
const calendar = urlParams.getString('calendar') ||
lastParams?.calendars?.[0] ||
(lastParams?.noCalendarAssigned ?
EVENTS.FILTER.NO_CALENDAR_ASSIGNED :
EVENTS.FILTER.ALL_CALENDARS
);

const calender = $location.search().calendar ||
const calendar = $location.search().calendar ||
get(lastParams, 'calendars[0]', null) ||
(get(lastParams, 'noCalendarAssigned', false) ?
EVENTS.FILTER.NO_CALENDAR_ASSIGNED :
EVENTS.FILTER.ALL_CALENDARS
{qcode: EVENTS.FILTER.NO_CALENDAR_ASSIGNED} :
{qcode: EVENTS.FILTER.ALL_CALENDARS}
);

promise = planningApi.ui.list.changeCalendarId(
calender,
calendar.qcode,
params
);
} else if (filterType === PLANNING_VIEW.PLANNING) {
Expand Down
93 changes: 44 additions & 49 deletions client/components/Events/ManageEventTemplatesModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable react/no-multi-comp */

import {IFormGroup, IBaseRestApiResponse, IGenericListPageComponent} from 'superdesk-api';
import {superdeskApi} from '../../superdeskApi';

import React from 'react';
import PropTypes from 'prop-types';
import {IFormGroup, IBaseRestApiResponse, IPropsGenericFormItemComponent, IFormField} from 'superdesk-api';
import {superdeskApi} from '../../superdeskApi';
import {Modal} from '../index';
import {planningEventTemplateEvents} from '../../actions/events/notifications';

Expand All @@ -16,67 +14,68 @@ interface IEventTemplate extends IBaseRestApiResponse {
template_name: string;
}

const getItemComponent = (nameField: IFormField) =>
class ItemComponent extends React.PureComponent<IPropsGenericFormItemComponent<any>> {
render(): React.ReactNode {
const {item, page} = this.props;

const {ListItem, ListItemColumn} = superdeskApi.components;
const {getFormFieldPreviewComponent} = superdeskApi.forms;

return (
<ListItem>
<ListItemColumn ellipsisAndGrow noBorder>
{getFormFieldPreviewComponent(item, nameField)}
</ListItemColumn>
<ListItemColumn noBorder>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<button onClick={() => page.startEditing(item._id)}>
<i className="icon-pencil" />
</button>
<button onClick={() => page.deleteItem(item)}>
<i className="icon-trash" />
</button>
</div>
</ListItemColumn>
</ListItem>
);
}
};

export class ManageEventTemplatesModal extends React.PureComponent<IProps> {
static propTypes: any;

render() {
const {handleHide} = this.props;

const {getGenericHttpEntityListPageComponent, ListItemColumn, ListItem} = superdeskApi.components;
const {getFormFieldPreviewComponent, FormFieldType} = superdeskApi.forms;

const {gettext} = superdeskApi.localization;
const {getGenericHttpEntityListPageComponent} = superdeskApi.components;
const {FormFieldType} = superdeskApi.forms;

const nameField = {
const nameField: IFormField = {
label: gettext('Template name'),
type: FormFieldType.textSingleLine,
type: FormFieldType.plainText,
field: 'template_name',
required: true,
};

const formConfig: IFormGroup = {
direction: 'vertical',
type: 'inline',
form: [
nameField,
],
form: [nameField],
};

const EventTemplatesComponent = getGenericHttpEntityListPageComponent<IEventTemplate>(
const EventTemplatesComponent = getGenericHttpEntityListPageComponent<IEventTemplate, unknown>(
'events_template',
formConfig
);

const renderRow = (
key: string,
item: IEventTemplate,
page: IGenericListPageComponent<IEventTemplate>
) => (
<ListItem
key={key}
>
<ListItemColumn ellipsisAndGrow noBorder>
{getFormFieldPreviewComponent(item, nameField)}
</ListItemColumn>
<ListItemColumn noBorder>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<button onClick={() => page.startEditing(item._id)}>
<i className="icon-pencil" />
</button>
<button onClick={() => page.deleteItem(item)}>
<i className="icon-trash" />
</button>
</div>
</ListItemColumn>
</ListItem>
);

return (
<Modal xLarge={true} show={true} onHide={handleHide}>
<Modal.Header>
Expand All @@ -87,8 +86,8 @@ export class ManageEventTemplatesModal extends React.PureComponent<IProps> {
</Modal.Header>
<Modal.Body noPadding={true}>
<EventTemplatesComponent
renderRow={renderRow}
formConfig={formConfig}
ItemComponent={getItemComponent(nameField)}
getFormConfig={() => formConfig}
defaultSortOption={{field: nameField.field, direction: 'ascending'}}
fieldForSearch={nameField}
refreshOnEvents={Object.keys(planningEventTemplateEvents)}
Expand All @@ -104,7 +103,3 @@ export class ManageEventTemplatesModal extends React.PureComponent<IProps> {
);
}
}

ManageEventTemplatesModal.propTypes = {
handleHide: PropTypes.func,
};
1 change: 1 addition & 0 deletions client/components/fields/editor/base/numberSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class EditorFieldNumberSelect extends React.PureComponent<IProps> {
value={values}
onChange={this.onChangeMultiple}
allowMultiple={true}
zIndex={1051}
/>
);
}
Expand Down
3 changes: 1 addition & 2 deletions client/controllers/AddToPlanningController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {planning} from '../actions';
import {get, isEmpty, isNumber} from 'lodash';
import {registerNotifications, getErrorMessage, isExistingItem} from '../utils';
import {WORKSPACE, MODALS, MAIN} from '../constants';
import {GET_LABEL_MAP, DEFAULT_SCHEMA} from 'superdesk-core/scripts/apps/workspace/content/constants';
import {GET_LABEL_MAP} from 'superdesk-core/scripts/apps/workspace/content/constants';
import {planningApi} from '../superdeskApi';

const DEFAULT_PLANNING_SCHEMA = {
Expand Down Expand Up @@ -207,7 +207,6 @@ export class AddToPlanningController {
}

Object.keys(schema)
.filter((field) => DEFAULT_SCHEMA.hasOwnProperty(field)) // filter out planning only fields
.filter((field) => get(schema[field], 'required') &&
isEmpty(get(newsItem, field)) &&
!isNumber(get(newsItem, field)))
Expand Down
Loading
Loading