Skip to content

Commit

Permalink
Merge branch 'develop' into fulfil-assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Aug 30, 2024
2 parents 7cc6b74 + 9a0e1f2 commit e768699
Show file tree
Hide file tree
Showing 238 changed files with 11,606 additions and 9,079 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Front-end checklist

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [ ] This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
- [ ] This pull request is using TypeScript interfaces instead of prop-types and updates usages where it's quick to do so
- [ ] This pull request is using `memo` or `PureComponent` to define new React components (and updates existing usages in modified code segments)
- [ ] This pull request is replacing `lodash.get` with optional chaining and nullish coalescing for modified code segments
- [ ] This pull request is not importing anything from client-core directly (use `superdeskApi`)
- [ ] This pull request is importing UI components from `superdesk-ui-framework` and `superdeskApi` when possible instead of using ones defined in this repository.
- [ ] This pull request is not using `planningApi` where it is possible to use `superdeskApi`
- [ ] This pull request is not adding redux based modals
- [ ] In this pull request, properties of redux state are not being passed as props to components; instead, we connect it to the component that needs them. Except components where using a react key is required - do not connect those due to performance reasons.
- [ ] This pull request is not adding redux actions that do not modify state (e.g. only calling angular services; those should be moved to `planningApi`)
17 changes: 6 additions & 11 deletions .github/workflows/ci-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ jobs:
strategy:
matrix:
node-version: [14.x]
env:
INSTALL_NODE_MODULES: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup Environment
run: ./scripts/ci-install.sh
- name: Start Services
run: ./scripts/ci-start-services.sh
cache: npm
# avoid file watch limit error
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- run: npm list || true
- name: test
run: npm run test
- run: npm ci
- run: npm run test
- run: npm run lint
55 changes: 0 additions & 55 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

94 changes: 0 additions & 94 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ Below sections include the config options that can be defined in settings.py.
* EVENT_EXPORT_BODY_TEMPLATE:
* default: https://github.com/superdesk/superdesk-planning/blob/develop/server/planning/planning_export_templates.py#L39
* Overrides the default event template used for event exports
* EVENT_RELATED_ITEM_SEARCH_PROVIDER_NAME:
* Default: None
* Required By: Event field ``related_items`` (otherwise this field will be automatically disabled)
* Defines the name of the Search Provider to use for adding related items to an Event

### Planning Config
* LONG_EVENT_DURATION_THRESHOLD:
Expand All @@ -165,6 +169,24 @@ Below sections include the config options that can be defined in settings.py.
* PLANNING_DEFAULT_COVERAGE_STATUS_ON_INGEST:
* Default: 'ncostat:int' - Coverage Planned
* The default CV qcode for populating planning.coverage[x].news_coverage_status on ingest
* DEFAULT_CREATE_PLANNING_SERIES_WITH_EVENT_SERIES
* Default: False
* If true, will default to creating series of Planning items with a recurring series of Events,
* SYNC_EVENT_FIELDS_TO_PLANNING
* Default: ""
* Comma separated list of Planning & Coverage fields to keep in sync with the associated Event
* Supported Fields:
* slugline
* internal_note
* name
* place (list CVs)
* subject (list CVs, exclude items with scheme)
* custom_vocabularies (list CVs, inside subject with scheme)
* anpa_category (list CVs)
* ednote
* language (includes `languages` if multilingual is enabled)
* definition_short (copies to Planning item's `Description Text`)
* priority

### Assignments Config
* SLACK_BOT_TOKEN
Expand All @@ -176,6 +198,9 @@ Below sections include the config options that can be defined in settings.py.
* PLANNING_SEND_NOTIFICATION_FOR_SELF_ASSIGNMENT
* Defaults to false
* If true, sends a notification to a user on creating an assignment that is assigned to themselves
* PLANNING_JSON_ASSIGNED_INFO_EXTENDED
* Defaults to `false`
* If `true`, it will add to planning JSON output additional info for coverages like assigned desk name/email and assigned user name/email.

### Authoring Config
* PLANNING_CHECK_FOR_ASSIGNMENT_ON_PUBLISH
Expand Down
4 changes: 4 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Long term refactoring goals

* Replace current event and planning item editor with react-based authoring component from superdesk (see `getAuthoringComponent` in `superdeskApi`)
* Refactor `EventItem` and `PlanningItem` components so they do not connect to a redux store
37 changes: 31 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 All @@ -24,6 +24,7 @@ const loadAssignments = ({
filterBy = 'Desk',
searchQuery = null,
orderByField = 'Scheduled',
dayField = null,
filterByType = null,
filterByPriority = null,
selectedDeskId = null,
Expand All @@ -34,6 +35,7 @@ const loadAssignments = ({
filterBy,
searchQuery,
orderByField,
dayField,
filterByType,
filterByPriority,
selectedDeskId,
Expand Down Expand Up @@ -304,6 +306,7 @@ const changeListSettings = ({
filterBy = 'Desk',
searchQuery = null,
orderByField = 'Scheduled',
dayField = null,
filterByType = null,
filterByPriority = null,
selectedDeskId = null,
Expand All @@ -314,6 +317,7 @@ const changeListSettings = ({
filterBy,
searchQuery,
orderByField,
dayField,
filterByType,
filterByPriority,
selectedDeskId,
Expand Down Expand Up @@ -628,12 +632,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 Expand Up @@ -807,6 +809,27 @@ const changeSortField = (field, savePreference = true) => (
}
);

/**
* Action dispatcher to set the day field filter for all lists
* @param {String} value - the value to set the field to
*/
const setDayField = (value) => ({
type: ASSIGNMENTS.ACTIONS.SET_DAY_FIELD,
payload: value,
});

const changeDayField = (value, savePreference = true) => (
(dispatch) => {
dispatch(self.setDayField(value));

// if (savePreference) {
// dispatch(actions.users.setAssignmentSortField());
// }

return dispatch(self.reloadAssignments(null, false));
}
);

/**
* Action dispatcher to load the current users' preferred sort field and list orders
* (This assumes the users' preferences have already been loaded into redux)
Expand Down Expand Up @@ -899,6 +922,8 @@ const self = {
setListSortOrder,
changeListSortOrder,
setSortField,
setDayField,
changeDayField,
loadDefaultListSort,
changeSortField,
validateStartWorkingOnScheduledUpdate,
Expand Down
Loading

0 comments on commit e768699

Please sign in to comment.