-
Notifications
You must be signed in to change notification settings - Fork 35
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
Update with new superdesk content profile API #2089
Conversation
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.
Go over the checklist and mark the ones that apply. It might not be possible to implement some, in that case leave unchecked.
@@ -20,6 +21,24 @@ const DEFAULT_PLANNING_SCHEMA = { | |||
}; | |||
|
|||
export class AddToPlanningController { | |||
$scope: any; | |||
notify: typeof superdeskApi['ui']['notify']; |
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.
It's not correct to specify this type. You should not make assumptions on what superdesk API is using under the hood as implementation. It should be possible to easily change it without breaking anything.
Regarding checklist, if it doesn't apply to the PR (i.e. no lodash usages), mark as done. I'd like to quickly see whether there are any guidelines that do apply, but were not implemented. |
.then((newsItem: IArticle) => { | ||
const contentProfile = superdeskApi.entities.contentProfile.get(newsItem.profile); | ||
|
||
return Promise.resolve({ |
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.
no need for Promise.resolve
here. You should return the object directly. Since it's inside a .then
it's a promise already
SDCP-838
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
)