-
Notifications
You must be signed in to change notification settings - Fork 34
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
Adding related items to plannings and events #2110
base: feature/multiple-events-in-planning
Are you sure you want to change the base?
Adding related items to plannings and events #2110
Conversation
support removing items from "related plannings" field.
before it was expanding an associated event which should not happen
…nning' into dragging-events-and-planning-items-by-tomas
@MarkLark86 If an existing planning item gets drag and dropped as related to an event, I'm adding it using the secondary link. Should it be possible to add coverages to planning items linked using the secondary link type? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, mostly just suggestion about implementing logic around the link config in the front-end
I might need a little more context here, as I'm not sure I understand the scenario entirely. When adding a Coverage to a Planning item, there is no logic involved around any linked Events that alllows or denies adding these Coverages. Am I missing something here, could you maybe explain more please |
…nning' into adding-related-items-to-plannings-and-events
61bceb8
to
d64ce28
Compare
FYI I've force-pushed to revert a bad merge. I had by mistake merged develop to this branch, instead of |
That's what I wanted to know in the end - whether coverages have some relation to the planning item and its link type. Because in the UI they look attached to planning items. Since you say they're not connected - all good then - I don't have to do anything special to address it. |
const ageSeconds = (now.getTime() - createdAt.getTime()) / 1000; | ||
const tooRecent = ageSeconds > 30; | ||
|
||
if (tooRecent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarkLark86 any idea how to avoid this hack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing that comes to mind is if you also pass in the original associatedPlanning IDs. Check non-temp IDs (aka not "fake ID") that are in original that are not in updates are to be unlinked.
…d-items-to-plannings-and-events
…d-items-to-plannings-and-events
actions.planning.api was evaluating to undefined
@MarkLark86 besides the hack, anything else you'd like me to address here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomaskikutis Looks good to me.
client/actions/events/api.ts
Outdated
return Promise.resolve([updatedEvent]); | ||
} | ||
|
||
// return Promise.resolve([updatedEvent]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
|
||
// KEEP IN SYNC WITH client/planning-extension/src/globals.d.ts | ||
declare module 'superdesk-api' { | ||
interface ISuperdeskGlobalConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 👍 Removes the need for the hack const appConfig = config.appConfig as IPlanningConfig;
.
Though, where is it getting the references to types from client/interfaces.ts (such as IPlanningItem)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I forgot to import it so it wasn't getting references and evaluating to any
server/planning/__init__.py
Outdated
@@ -242,6 +242,9 @@ def init_app(app): | |||
"default_create_planning_series_with_event_series" | |||
] = get_config_default_create_planning_series_with_event_series(app) | |||
|
|||
# TODO: use get_planning_event_link_method | |||
app.client_config["planning_event_link_method"] = "one_primary_many_secondary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO action needs to be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petrjasek can you fix this one for me?
STT-67
STT-8
Front-end checklist
memo
orPureComponent
to define new React components (and updates existing usages in modified code segments)lodash.get
with optional chaining and nullish coalescing for modified code segmentssuperdeskApi
)superdesk-ui-framework
andsuperdeskApi
when possible instead of using ones defined in this repository.planningApi
where it is possible to usesuperdeskApi
planningApi
)