-
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
Unlink as coverage #1847
Unlink as coverage #1847
Changes from all commits
998cff9
209db09
def1a61
629c2e8
46387f7
a9fe557
677f7e5
6ee85a5
400ef62
9a8ec9e
39161ab
22f9466
71f4543
bae43ce
72d9ea9
929832f
6b0b326
0b9d3eb
dfd0245
57670c5
07ab588
b12a71f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import planningModule from './client'; | |
import * as ctrl from './client/controllers'; | ||
import {gettext} from './client/utils/gettext'; | ||
import {isContentLinkToCoverageAllowed} from './client/utils/archive'; | ||
|
||
import ng from 'superdesk-core/scripts/core/services/ng'; | ||
|
||
configurePlanning.$inject = ['superdeskProvider']; | ||
function configurePlanning(superdesk) { | ||
|
@@ -103,6 +103,8 @@ function configurePlanning(superdesk) { | |
!['killed', 'recalled', 'unpublished', 'spiked', 'correction'].includes(item.state); | ||
}], | ||
}) | ||
|
||
// TAG: AUTHORING-ANGULAR | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thecalcc have you looked into this yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm doing so yep, but I plan to address it in a different PR. haven't forgotten about it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In short, looks like this is some filtering based on which we calculate whether to show the action in the three dots menu or not |
||
.activity('planning.unlink', { | ||
label: gettext('Unlink as Coverage'), | ||
icon: 'cut', | ||
|
@@ -120,6 +122,8 @@ function configurePlanning(superdesk) { | |
], | ||
group: gettext('Planning'), | ||
privileges: {archive: 1}, | ||
|
||
// keep in sync with client/planning-extension/src/extension.ts:126 | ||
additionalCondition: ['archiveService', 'item', 'authoring', | ||
function(archiveService, item, authoring) { | ||
return item.assignment_id && | ||
|
@@ -134,5 +138,15 @@ function configurePlanning(superdesk) { | |
}); | ||
} | ||
|
||
window.addEventListener('planning:unlinkfromcoverage', (event: CustomEvent) => { | ||
ctrl.UnlinkAssignmentController( | ||
event.detail, | ||
ng.get('notify'), | ||
ng.get('gettext'), | ||
ng.get('api'), | ||
ng.get('lock'), | ||
); | ||
}); | ||
|
||
export default planningModule | ||
.config(configurePlanning); |
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.
Did you take these conditions from somewhere else? In order not to duplicate it, we should add
canUnlinkAscoverage
function and expose it via extensions bridge.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.
The thing is, we can't add it 1-to-1, because in the angular world permissions work under the hood, so if we do add it it'll still be chopped up. Personally I don't think it's necessary when this is the case, so we can keep it like this
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.
add the comment about keeping it up to date