forked from superdesk/superdesk-planning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
121 lines (117 loc) · 4.66 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// styles
import './client/styles/index.scss';
// scripts
import planningModule from './client';
import * as ctrl from './client/controllers';
configurePlanning.$inject = ['superdeskProvider', '$injector'];
function configurePlanning(superdesk, $injector) {
superdesk
.activity('/planning', {
label: gettext('Planning'),
description: gettext('Planning'),
adminTools: false,
template: require('./client/views/planning.html'),
sideTemplateUrl: 'scripts/apps/workspace/views/workspace-sidenav.html',
privileges: {planning: 1},
})
.activity('/workspace/assignments', {
label: gettext('Assignments'),
priority: 100,
template: require('./client/views/assignment.html'),
topTemplateUrl: 'scripts/apps/dashboard/views/workspace-topnav.html',
sideTemplateUrl: 'scripts/apps/workspace/views/workspace-sidenav.html',
})
.activity('/locations', {
label: gettext('Manage Locations'),
description: gettext('Manage Locations'),
priority: 200,
category: superdesk.MENU_MAIN,
adminTools: true,
templateUrl: 'locations.html',
sideTemplateUrl: 'scripts/apps/workspace/views/workspace-sidenav.html',
privileges: {
planning_locations_management: 1,
},
})
.activity('planning.addto', {
label: gettext('Add to Planning'),
modal: true,
icon: 'calendar-list',
priority: 3000,
controller: ctrl.AddToPlanningController,
filters: [
{
action: 'list',
type: 'archive',
},
{
action: 'external-app',
type: 'addto-planning',
},
],
group: 'Planning',
privileges: {
planning_planning_management: 1,
archive: 1,
},
additionalCondition: ['lock', 'archiveService', 'item', 'authoring',
function(lock, archiveService, item, authoring) {
return !item.assignment_id &&
(!lock.isLocked(item) || lock.isLockedInCurrentSession(item)) &&
!archiveService.isPersonal(item) && (authoring.itemActions(item).edit ||
authoring.itemActions(item).correct || authoring.itemActions(item).deschedule);
}],
})
.activity('planning.fulfil', {
label: gettext('Fulfil Assignment'),
icon: 'calendar-list',
modal: true,
priority: 2000,
controller: ctrl.FulFilAssignmentController,
filters: [
{
action: 'list',
type: 'archive',
},
{
action: 'external-app',
type: 'fulfill-assignment',
},
],
group: 'Planning',
privileges: {archive: 1},
additionalCondition: ['lock', 'archiveService', 'item', 'authoring',
function(lock, archiveService, item, authoring) {
return !item.assignment_id &&
(!lock.isLocked(item) || lock.isLockedInCurrentSession(item)) &&
!archiveService.isPersonal(item) && !['killed', 'recalled',
'unpublished', 'spiked'].includes(item.state);
}],
})
.activity('planning.unlink', {
label: gettext('Unlink as Coverage'),
icon: 'cut',
priority: 1000,
controller: ctrl.UnlinkAssignmentController,
filters: [
{
action: 'list',
type: 'archive',
},
{
action: 'external-app',
type: 'unlink-assignment',
},
],
group: 'Planning',
privileges: {archive: 1},
additionalCondition: ['lock', 'archiveService', 'item', 'authoring',
function(lock, archiveService, item, authoring) {
return item.assignment_id && (!lock.isLocked(item) || lock.isLockedInCurrentSession(item)) &&
!archiveService.isPersonal(item) && (authoring.itemActions(item).edit ||
authoring.itemActions(item).correct || authoring.itemActions(item).deschedule);
}],
});
}
export default planningModule
.config(configurePlanning);