goblin-desktop 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -9
- package/.eslintrc.js +28 -28
- package/.zou-flow +3 -3
- package/README.md +108 -108
- package/builders/builders.js +3 -3
- package/builders/wizard.js +457 -457
- package/contexts.js +13 -13
- package/desktop-manager.js +10 -10
- package/desktop-window.js +13 -13
- package/desktop.js +13 -13
- package/lib/service.js +137 -137
- package/package.json +36 -36
- package/password-wizard.js +13 -13
- package/quest-run-wizard.js +13 -13
- package/taskbar.js +13 -13
- package/widgets/audio/sfx.js +177 -177
- package/widgets/board/view.js +37 -37
- package/widgets/board/widget.js +65 -65
- package/widgets/contexts/logic-handlers.js +36 -36
- package/widgets/contexts/service.js +40 -40
- package/widgets/contexts/view.js +22 -22
- package/widgets/contexts/widget.js +147 -147
- package/widgets/datagrid/datagrid-entity.js +82 -82
- package/widgets/datagrid/datagrid-headers.js +272 -272
- package/widgets/datagrid/styles.js +13 -13
- package/widgets/datagrid/widget.js +192 -192
- package/widgets/datagrid-cell/styles.js +52 -52
- package/widgets/datagrid-cell/widget.js +41 -41
- package/widgets/datagrid-item/styles.js +15 -15
- package/widgets/datagrid-item/widget.js +74 -74
- package/widgets/default/view.js +142 -142
- package/widgets/desktop/compensator.js +9 -9
- package/widgets/desktop/logic-handlers.js +237 -237
- package/widgets/desktop/reducer.js +35 -35
- package/widgets/desktop/service.js +828 -828
- package/widgets/desktop/styles.js +28 -28
- package/widgets/desktop/widget.js +175 -175
- package/widgets/desktop-clock/styles.js +69 -69
- package/widgets/desktop-clock/widget.js +387 -387
- package/widgets/desktop-clock-clock/styles.js +56 -56
- package/widgets/desktop-clock-clock/widget.js +96 -96
- package/widgets/desktop-clock-menu/styles.js +129 -129
- package/widgets/desktop-clock-menu/widget.js +63 -63
- package/widgets/desktop-connection-status/reducer.js +15 -15
- package/widgets/desktop-connection-status/styles.js +44 -44
- package/widgets/desktop-connection-status/widget.js +129 -129
- package/widgets/desktop-content/widget.js +68 -68
- package/widgets/desktop-footer/reducer.js +31 -31
- package/widgets/desktop-footer/styles.js +36 -36
- package/widgets/desktop-footer/widget.js +52 -52
- package/widgets/desktop-monitors/styles.js +155 -155
- package/widgets/desktop-monitors/widget.js +272 -272
- package/widgets/desktop-notebook/styles.js +155 -155
- package/widgets/desktop-notebook/widget.js +252 -252
- package/widgets/desktop-notifications/styles.js +147 -147
- package/widgets/desktop-notifications/widget.js +231 -231
- package/widgets/desktop-scale/reducer.js +15 -15
- package/widgets/desktop-scale/styles.js +48 -48
- package/widgets/desktop-scale/widget.js +172 -172
- package/widgets/desktop-state-monitor/styles.js +72 -72
- package/widgets/desktop-state-monitor/widget.js +123 -123
- package/widgets/desktop-taskbar/widget.js +57 -57
- package/widgets/desktop-themes-menu/widget.js +121 -121
- package/widgets/desktop-topbar/widget.js +201 -201
- package/widgets/desktop-window/service.js +56 -56
- package/widgets/desktop-window/styles.js +22 -22
- package/widgets/desktop-window/widget.js +70 -70
- package/widgets/detail/compensator.js +17 -17
- package/widgets/detail/view.js +40 -40
- package/widgets/detail/widget.js +125 -125
- package/widgets/editor/widget.js +83 -83
- package/widgets/entity-alerts/styles.js +77 -77
- package/widgets/entity-alerts/widget.js +328 -328
- package/widgets/entity-list/styles.js +66 -66
- package/widgets/entity-list/view.js +36 -36
- package/widgets/entity-list/widget.js +209 -209
- package/widgets/entity-list-item/widget.js +68 -68
- package/widgets/entity-row/styles.js +105 -105
- package/widgets/entity-row/widget.js +524 -524
- package/widgets/entity-row-button/styles.js +46 -46
- package/widgets/entity-row-button/widget.js +57 -57
- package/widgets/entity-view/reducer.js +20 -20
- package/widgets/entity-view/styles.js +90 -90
- package/widgets/entity-view/widget.js +516 -516
- package/widgets/facet-checkbox/styles.js +17 -17
- package/widgets/facet-checkbox/widget.js +43 -43
- package/widgets/facet-filter/widget.js +94 -94
- package/widgets/facet-filter-add/styles.js +30 -30
- package/widgets/facet-filter-add/widget.js +105 -105
- package/widgets/facet-filter-button/styles.js +74 -74
- package/widgets/facet-filter-button/widget.js +214 -214
- package/widgets/facet-filter-list-dialog/styles.js +59 -59
- package/widgets/facet-filter-list-dialog/widget.js +253 -253
- package/widgets/facet-filter-list-dialog-footer/styles.js +22 -22
- package/widgets/facet-filter-list-dialog-footer/widget.js +105 -105
- package/widgets/facet-filter-range-dialog/styles.js +82 -82
- package/widgets/facet-filter-range-dialog/widget.js +399 -399
- package/widgets/facet-filter-range-dialog-footer/styles.js +22 -22
- package/widgets/facet-filter-range-dialog-footer/widget.js +182 -182
- package/widgets/gamepad/widget.js +75 -75
- package/widgets/helpers/facet-helpers.js +105 -105
- package/widgets/hinter/reducer.js +35 -35
- package/widgets/hinter/styles.js +79 -79
- package/widgets/hinter/view.js +31 -31
- package/widgets/hinter/widget.js +291 -291
- package/widgets/junction/styles.js +22 -22
- package/widgets/junction/widget.js +50 -50
- package/widgets/main-tab-menu/styles.js +17 -17
- package/widgets/main-tab-menu/widget.js +136 -136
- package/widgets/map/view.js +49 -49
- package/widgets/map/widget.js +65 -65
- package/widgets/monitor/reducer.js +15 -15
- package/widgets/monitor/widget.js +66 -66
- package/widgets/navigating-layer/widget.js +25 -25
- package/widgets/notifications-button/widget.js +44 -44
- package/widgets/password-wizard/service.js +53 -53
- package/widgets/password-wizard/ui.js +66 -66
- package/widgets/plugin/reducer.js +19 -19
- package/widgets/plugin/styles.js +294 -294
- package/widgets/plugin/widget.js +638 -637
- package/widgets/quest-run-wizard/service.js +49 -49
- package/widgets/quest-run-wizard/ui.js +25 -25
- package/widgets/search/styles.js +80 -80
- package/widgets/search/widget.js +285 -285
- package/widgets/simple/view.js +29 -29
- package/widgets/status-filters/widget.js +121 -121
- package/widgets/tab/styles.js +16 -16
- package/widgets/tab/widget.js +89 -89
- package/widgets/tab-content/widget.js +35 -35
- package/widgets/tabs/widget.js +48 -48
- package/widgets/taskbar/service.js +99 -99
- package/widgets/taskbar/view.js +24 -24
- package/widgets/taskbar/widget.js +167 -167
- package/widgets/widget-doc-caller/reducer.js +15 -15
- package/widgets/widget-doc-caller/styles.js +20 -20
- package/widgets/widget-doc-caller/widget.js +55 -55
- package/widgets/wizard/widget.js +299 -299
- package/widgets/wizard-buttons/widget.js +111 -111
- package/widgets/workitem/styles.js +281 -281
- package/widgets/workitem/view.js +62 -62
- package/widgets/workitem/widget.js +972 -972
- package/widgets/workitem-dialog/widget.js +86 -86
- package/widgets/workitem-fields/widget.js +63 -63
|
@@ -1,237 +1,237 @@
|
|
|
1
|
-
//T:2019-02-27
|
|
2
|
-
module.exports = {
|
|
3
|
-
'create': (state, action) => {
|
|
4
|
-
const id = action.get('id');
|
|
5
|
-
return state.set('', {
|
|
6
|
-
id: id,
|
|
7
|
-
username: action.get('username', 'guest'),
|
|
8
|
-
profileKey: action.get('profileKey'),
|
|
9
|
-
routes: action.get('routes'),
|
|
10
|
-
showNotifications: false,
|
|
11
|
-
dnd: false,
|
|
12
|
-
onlyNews: false,
|
|
13
|
-
notReadCount: 0,
|
|
14
|
-
notifications: {},
|
|
15
|
-
showStateMonitor: false,
|
|
16
|
-
stateMonitorHistory: {
|
|
17
|
-
current: '',
|
|
18
|
-
stack: [],
|
|
19
|
-
index: -1,
|
|
20
|
-
},
|
|
21
|
-
teamId: null,
|
|
22
|
-
current: {
|
|
23
|
-
workitems: {},
|
|
24
|
-
dialogs: {},
|
|
25
|
-
},
|
|
26
|
-
workitems: {},
|
|
27
|
-
workitemsByContext: {},
|
|
28
|
-
last: {},
|
|
29
|
-
navigating: false,
|
|
30
|
-
working: false,
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
'start-nav': (state) => {
|
|
35
|
-
return state.set('navigating', true);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
'end-nav': (state) => {
|
|
39
|
-
return state.set('navigating', false);
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
//---------------//
|
|
43
|
-
// Notifications //
|
|
44
|
-
//---------------//
|
|
45
|
-
'set-dnd': (state, action) => {
|
|
46
|
-
return state.set('dnd', action.get('show'));
|
|
47
|
-
},
|
|
48
|
-
'set-only-news': (state, action) => {
|
|
49
|
-
return state.set('onlyNews', action.get('show'));
|
|
50
|
-
},
|
|
51
|
-
'set-notifications': (state, action) => {
|
|
52
|
-
return state.set('showNotifications', action.get('show'));
|
|
53
|
-
},
|
|
54
|
-
'add-notification': (state, action) => {
|
|
55
|
-
const notificationId = action.get('notificationId');
|
|
56
|
-
let count = state.get('notifications').count();
|
|
57
|
-
const notification = {
|
|
58
|
-
id: notificationId,
|
|
59
|
-
order: count++,
|
|
60
|
-
command: action.get('command'),
|
|
61
|
-
status: 'not-read',
|
|
62
|
-
glyph: action.get('glyph'),
|
|
63
|
-
color: action.get('color'),
|
|
64
|
-
message: action.get('message'),
|
|
65
|
-
current: action.get('current'),
|
|
66
|
-
total: action.get('total'),
|
|
67
|
-
externalUrl: action.get('externalUrl'),
|
|
68
|
-
isDownload: action.get('isDownload'),
|
|
69
|
-
};
|
|
70
|
-
return state.set(`notifications.${notificationId}`, notification);
|
|
71
|
-
},
|
|
72
|
-
'update-not-read-count': (state) => {
|
|
73
|
-
const notifications = state.get('notifications').select((i, v) => v.toJS());
|
|
74
|
-
const count = notifications.reduce((acc, n) => {
|
|
75
|
-
if (n.status === 'not-read') {
|
|
76
|
-
return acc + 1;
|
|
77
|
-
}
|
|
78
|
-
return acc;
|
|
79
|
-
}, 0);
|
|
80
|
-
return state.set('notReadCount', count);
|
|
81
|
-
},
|
|
82
|
-
'read-all': (state) => {
|
|
83
|
-
const notifications = state.get('notifications');
|
|
84
|
-
const newNotifications = notifications.transform(
|
|
85
|
-
(i) => i,
|
|
86
|
-
(i, v) => v.set('status', 'read')
|
|
87
|
-
);
|
|
88
|
-
return state.set('notifications', newNotifications);
|
|
89
|
-
},
|
|
90
|
-
'remove-notification': (state, action) => {
|
|
91
|
-
const id = action.get('notification').id;
|
|
92
|
-
return state.del(`notifications.${id}`);
|
|
93
|
-
},
|
|
94
|
-
'remove-notifications': (state) => {
|
|
95
|
-
return state.set(`notifications`, {});
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
//--------------//
|
|
99
|
-
// StateMonitor //
|
|
100
|
-
//--------------//
|
|
101
|
-
'show-state-monitor': (state, action) => {
|
|
102
|
-
const show = action.get('show');
|
|
103
|
-
return state.set('showStateMonitor', show);
|
|
104
|
-
},
|
|
105
|
-
'add-state-monitor': (state, action) => {
|
|
106
|
-
const key = action.get('key');
|
|
107
|
-
const doPush = action.get('doPush');
|
|
108
|
-
|
|
109
|
-
const h = state.get('stateMonitorHistory');
|
|
110
|
-
const stack = h.get('stack').valueSeq().toArray();
|
|
111
|
-
let index = h.get('index');
|
|
112
|
-
|
|
113
|
-
if (doPush) {
|
|
114
|
-
// Truncate keys after the current index in the history.
|
|
115
|
-
stack.splice(index + 1);
|
|
116
|
-
index = stack.length - 1;
|
|
117
|
-
|
|
118
|
-
// If key already exist in the history, remove it.
|
|
119
|
-
const i = stack.indexOf(key);
|
|
120
|
-
if (i !== -1) {
|
|
121
|
-
stack.splice(i, 1);
|
|
122
|
-
index = stack.length - 1;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Insert the new key to the end of the history.
|
|
126
|
-
stack.push(key);
|
|
127
|
-
index = stack.length - 1;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
state = state.set('stateMonitorHistory', {current: key, stack, index});
|
|
131
|
-
state = state.set('showStateMonitor', true);
|
|
132
|
-
|
|
133
|
-
return state;
|
|
134
|
-
},
|
|
135
|
-
'back-state-monitor': (state) => {
|
|
136
|
-
const index = state.get('stateMonitorHistory.index');
|
|
137
|
-
return state.set('stateMonitorHistory.index', index - 1);
|
|
138
|
-
},
|
|
139
|
-
'forward-state-monitor': (state) => {
|
|
140
|
-
const index = state.get('stateMonitorHistory.index');
|
|
141
|
-
return state.set('stateMonitorHistory.index', index + 1);
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
/******************************************************************************/
|
|
145
|
-
|
|
146
|
-
'navToContext': (state, action) => {
|
|
147
|
-
return state.set('current.workcontext', action.get('contextId'));
|
|
148
|
-
},
|
|
149
|
-
'add-workitem': (state, action) => {
|
|
150
|
-
return state.set('working', action.get('working'));
|
|
151
|
-
},
|
|
152
|
-
'setHinter': (state, action) => {
|
|
153
|
-
const workcontext = state.get('current.workcontext');
|
|
154
|
-
const wid = state.get(`current.workitems.${workcontext}`);
|
|
155
|
-
return state.set(`workitems.${wid}.hinter`, action.get('hinterId'));
|
|
156
|
-
},
|
|
157
|
-
'setDetail': (state, action) => {
|
|
158
|
-
const workcontext = state.get('current.workcontext');
|
|
159
|
-
const wid = state.get(`current.workitems.${workcontext}`);
|
|
160
|
-
return state.set(`workitems.${wid}.detail`, action.get('detailId'));
|
|
161
|
-
},
|
|
162
|
-
'set-workitem': (state, action) => {
|
|
163
|
-
const wid = action.get('id');
|
|
164
|
-
const workcontext = action.get('context');
|
|
165
|
-
return state
|
|
166
|
-
.set(`workitems.${wid}`, {
|
|
167
|
-
id: wid,
|
|
168
|
-
kind: action.get('kind'),
|
|
169
|
-
entityId: action.get('entityId'),
|
|
170
|
-
context: workcontext,
|
|
171
|
-
view: action.get('view'),
|
|
172
|
-
name: action.get('name'),
|
|
173
|
-
description: action.get('description'),
|
|
174
|
-
glyph: action.get('glyph'),
|
|
175
|
-
closable: action.get('closable'),
|
|
176
|
-
})
|
|
177
|
-
.push(`workitemsByContext.${workcontext}`, wid);
|
|
178
|
-
},
|
|
179
|
-
'removeWorkitem': (state, action) => {
|
|
180
|
-
const wid = action.get('workitemId');
|
|
181
|
-
const workcontext = state.get(`workitems.${wid}.context`);
|
|
182
|
-
if (!workcontext) {
|
|
183
|
-
return state;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
state = state.del(`workitems.${wid}`);
|
|
187
|
-
state = state.unpush(`workitemsByContext.${workcontext}`, wid);
|
|
188
|
-
|
|
189
|
-
const last = state.get(`last.${workcontext}.workitem`);
|
|
190
|
-
if (last === wid) {
|
|
191
|
-
const newLast = state.get(`workitemsByContext.${workcontext}`).last();
|
|
192
|
-
if (newLast.state) {
|
|
193
|
-
state = state.set(`last.${workcontext}.workitem`, newLast.state);
|
|
194
|
-
} else {
|
|
195
|
-
state = state.set(`last.${workcontext}.workitem`, null);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const currentWorkitem = state.get(`current.workitems.${workcontext}`);
|
|
200
|
-
if (currentWorkitem === wid) {
|
|
201
|
-
const newLast = state.get(`workitemsByContext.${workcontext}`).last();
|
|
202
|
-
if (newLast.state) {
|
|
203
|
-
state = state.set(`current.workitems.${workcontext}`, newLast.state);
|
|
204
|
-
} else {
|
|
205
|
-
state = state.set(`current.workitems.${workcontext}`, null);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return state;
|
|
210
|
-
},
|
|
211
|
-
'change-team': (state, action) => {
|
|
212
|
-
return state.set('teamId', action.get('teamId'));
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
'setCurrentWorkitemByContext': (state, action) => {
|
|
216
|
-
const destinationContext = action.get('contextId');
|
|
217
|
-
const lastWorkitem = state.get(`current.workitems.${destinationContext}`);
|
|
218
|
-
return state
|
|
219
|
-
.set(`current.workitems.${destinationContext}`, action.get('workitemId'))
|
|
220
|
-
.set(`last.${destinationContext}`, {
|
|
221
|
-
workitem: lastWorkitem,
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
'setCurrentDialogByContext': (state, action) => {
|
|
226
|
-
const workcontext = action.get('contextId');
|
|
227
|
-
return state.set(
|
|
228
|
-
`current.dialogs.${workcontext}`,
|
|
229
|
-
action.get('workitemId')
|
|
230
|
-
);
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
'set-note': (state, action) => {
|
|
234
|
-
const content = action.get('content');
|
|
235
|
-
return state.set(`note`, content);
|
|
236
|
-
},
|
|
237
|
-
};
|
|
1
|
+
//T:2019-02-27
|
|
2
|
+
module.exports = {
|
|
3
|
+
'create': (state, action) => {
|
|
4
|
+
const id = action.get('id');
|
|
5
|
+
return state.set('', {
|
|
6
|
+
id: id,
|
|
7
|
+
username: action.get('username', 'guest'),
|
|
8
|
+
profileKey: action.get('profileKey'),
|
|
9
|
+
routes: action.get('routes'),
|
|
10
|
+
showNotifications: false,
|
|
11
|
+
dnd: false,
|
|
12
|
+
onlyNews: false,
|
|
13
|
+
notReadCount: 0,
|
|
14
|
+
notifications: {},
|
|
15
|
+
showStateMonitor: false,
|
|
16
|
+
stateMonitorHistory: {
|
|
17
|
+
current: '',
|
|
18
|
+
stack: [],
|
|
19
|
+
index: -1,
|
|
20
|
+
},
|
|
21
|
+
teamId: null,
|
|
22
|
+
current: {
|
|
23
|
+
workitems: {},
|
|
24
|
+
dialogs: {},
|
|
25
|
+
},
|
|
26
|
+
workitems: {},
|
|
27
|
+
workitemsByContext: {},
|
|
28
|
+
last: {},
|
|
29
|
+
navigating: false,
|
|
30
|
+
working: false,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
'start-nav': (state) => {
|
|
35
|
+
return state.set('navigating', true);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
'end-nav': (state) => {
|
|
39
|
+
return state.set('navigating', false);
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
//---------------//
|
|
43
|
+
// Notifications //
|
|
44
|
+
//---------------//
|
|
45
|
+
'set-dnd': (state, action) => {
|
|
46
|
+
return state.set('dnd', action.get('show'));
|
|
47
|
+
},
|
|
48
|
+
'set-only-news': (state, action) => {
|
|
49
|
+
return state.set('onlyNews', action.get('show'));
|
|
50
|
+
},
|
|
51
|
+
'set-notifications': (state, action) => {
|
|
52
|
+
return state.set('showNotifications', action.get('show'));
|
|
53
|
+
},
|
|
54
|
+
'add-notification': (state, action) => {
|
|
55
|
+
const notificationId = action.get('notificationId');
|
|
56
|
+
let count = state.get('notifications').count();
|
|
57
|
+
const notification = {
|
|
58
|
+
id: notificationId,
|
|
59
|
+
order: count++,
|
|
60
|
+
command: action.get('command'),
|
|
61
|
+
status: 'not-read',
|
|
62
|
+
glyph: action.get('glyph'),
|
|
63
|
+
color: action.get('color'),
|
|
64
|
+
message: action.get('message'),
|
|
65
|
+
current: action.get('current'),
|
|
66
|
+
total: action.get('total'),
|
|
67
|
+
externalUrl: action.get('externalUrl'),
|
|
68
|
+
isDownload: action.get('isDownload'),
|
|
69
|
+
};
|
|
70
|
+
return state.set(`notifications.${notificationId}`, notification);
|
|
71
|
+
},
|
|
72
|
+
'update-not-read-count': (state) => {
|
|
73
|
+
const notifications = state.get('notifications').select((i, v) => v.toJS());
|
|
74
|
+
const count = notifications.reduce((acc, n) => {
|
|
75
|
+
if (n.status === 'not-read') {
|
|
76
|
+
return acc + 1;
|
|
77
|
+
}
|
|
78
|
+
return acc;
|
|
79
|
+
}, 0);
|
|
80
|
+
return state.set('notReadCount', count);
|
|
81
|
+
},
|
|
82
|
+
'read-all': (state) => {
|
|
83
|
+
const notifications = state.get('notifications');
|
|
84
|
+
const newNotifications = notifications.transform(
|
|
85
|
+
(i) => i,
|
|
86
|
+
(i, v) => v.set('status', 'read')
|
|
87
|
+
);
|
|
88
|
+
return state.set('notifications', newNotifications);
|
|
89
|
+
},
|
|
90
|
+
'remove-notification': (state, action) => {
|
|
91
|
+
const id = action.get('notification').id;
|
|
92
|
+
return state.del(`notifications.${id}`);
|
|
93
|
+
},
|
|
94
|
+
'remove-notifications': (state) => {
|
|
95
|
+
return state.set(`notifications`, {});
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
//--------------//
|
|
99
|
+
// StateMonitor //
|
|
100
|
+
//--------------//
|
|
101
|
+
'show-state-monitor': (state, action) => {
|
|
102
|
+
const show = action.get('show');
|
|
103
|
+
return state.set('showStateMonitor', show);
|
|
104
|
+
},
|
|
105
|
+
'add-state-monitor': (state, action) => {
|
|
106
|
+
const key = action.get('key');
|
|
107
|
+
const doPush = action.get('doPush');
|
|
108
|
+
|
|
109
|
+
const h = state.get('stateMonitorHistory');
|
|
110
|
+
const stack = h.get('stack').valueSeq().toArray();
|
|
111
|
+
let index = h.get('index');
|
|
112
|
+
|
|
113
|
+
if (doPush) {
|
|
114
|
+
// Truncate keys after the current index in the history.
|
|
115
|
+
stack.splice(index + 1);
|
|
116
|
+
index = stack.length - 1;
|
|
117
|
+
|
|
118
|
+
// If key already exist in the history, remove it.
|
|
119
|
+
const i = stack.indexOf(key);
|
|
120
|
+
if (i !== -1) {
|
|
121
|
+
stack.splice(i, 1);
|
|
122
|
+
index = stack.length - 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Insert the new key to the end of the history.
|
|
126
|
+
stack.push(key);
|
|
127
|
+
index = stack.length - 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
state = state.set('stateMonitorHistory', {current: key, stack, index});
|
|
131
|
+
state = state.set('showStateMonitor', true);
|
|
132
|
+
|
|
133
|
+
return state;
|
|
134
|
+
},
|
|
135
|
+
'back-state-monitor': (state) => {
|
|
136
|
+
const index = state.get('stateMonitorHistory.index');
|
|
137
|
+
return state.set('stateMonitorHistory.index', index - 1);
|
|
138
|
+
},
|
|
139
|
+
'forward-state-monitor': (state) => {
|
|
140
|
+
const index = state.get('stateMonitorHistory.index');
|
|
141
|
+
return state.set('stateMonitorHistory.index', index + 1);
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
/******************************************************************************/
|
|
145
|
+
|
|
146
|
+
'navToContext': (state, action) => {
|
|
147
|
+
return state.set('current.workcontext', action.get('contextId'));
|
|
148
|
+
},
|
|
149
|
+
'add-workitem': (state, action) => {
|
|
150
|
+
return state.set('working', action.get('working'));
|
|
151
|
+
},
|
|
152
|
+
'setHinter': (state, action) => {
|
|
153
|
+
const workcontext = state.get('current.workcontext');
|
|
154
|
+
const wid = state.get(`current.workitems.${workcontext}`);
|
|
155
|
+
return state.set(`workitems.${wid}.hinter`, action.get('hinterId'));
|
|
156
|
+
},
|
|
157
|
+
'setDetail': (state, action) => {
|
|
158
|
+
const workcontext = state.get('current.workcontext');
|
|
159
|
+
const wid = state.get(`current.workitems.${workcontext}`);
|
|
160
|
+
return state.set(`workitems.${wid}.detail`, action.get('detailId'));
|
|
161
|
+
},
|
|
162
|
+
'set-workitem': (state, action) => {
|
|
163
|
+
const wid = action.get('id');
|
|
164
|
+
const workcontext = action.get('context');
|
|
165
|
+
return state
|
|
166
|
+
.set(`workitems.${wid}`, {
|
|
167
|
+
id: wid,
|
|
168
|
+
kind: action.get('kind'),
|
|
169
|
+
entityId: action.get('entityId'),
|
|
170
|
+
context: workcontext,
|
|
171
|
+
view: action.get('view'),
|
|
172
|
+
name: action.get('name'),
|
|
173
|
+
description: action.get('description'),
|
|
174
|
+
glyph: action.get('glyph'),
|
|
175
|
+
closable: action.get('closable'),
|
|
176
|
+
})
|
|
177
|
+
.push(`workitemsByContext.${workcontext}`, wid);
|
|
178
|
+
},
|
|
179
|
+
'removeWorkitem': (state, action) => {
|
|
180
|
+
const wid = action.get('workitemId');
|
|
181
|
+
const workcontext = state.get(`workitems.${wid}.context`);
|
|
182
|
+
if (!workcontext) {
|
|
183
|
+
return state;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
state = state.del(`workitems.${wid}`);
|
|
187
|
+
state = state.unpush(`workitemsByContext.${workcontext}`, wid);
|
|
188
|
+
|
|
189
|
+
const last = state.get(`last.${workcontext}.workitem`);
|
|
190
|
+
if (last === wid) {
|
|
191
|
+
const newLast = state.get(`workitemsByContext.${workcontext}`).last();
|
|
192
|
+
if (newLast.state) {
|
|
193
|
+
state = state.set(`last.${workcontext}.workitem`, newLast.state);
|
|
194
|
+
} else {
|
|
195
|
+
state = state.set(`last.${workcontext}.workitem`, null);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const currentWorkitem = state.get(`current.workitems.${workcontext}`);
|
|
200
|
+
if (currentWorkitem === wid) {
|
|
201
|
+
const newLast = state.get(`workitemsByContext.${workcontext}`).last();
|
|
202
|
+
if (newLast.state) {
|
|
203
|
+
state = state.set(`current.workitems.${workcontext}`, newLast.state);
|
|
204
|
+
} else {
|
|
205
|
+
state = state.set(`current.workitems.${workcontext}`, null);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return state;
|
|
210
|
+
},
|
|
211
|
+
'change-team': (state, action) => {
|
|
212
|
+
return state.set('teamId', action.get('teamId'));
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
'setCurrentWorkitemByContext': (state, action) => {
|
|
216
|
+
const destinationContext = action.get('contextId');
|
|
217
|
+
const lastWorkitem = state.get(`current.workitems.${destinationContext}`);
|
|
218
|
+
return state
|
|
219
|
+
.set(`current.workitems.${destinationContext}`, action.get('workitemId'))
|
|
220
|
+
.set(`last.${destinationContext}`, {
|
|
221
|
+
workitem: lastWorkitem,
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
'setCurrentDialogByContext': (state, action) => {
|
|
226
|
+
const workcontext = action.get('contextId');
|
|
227
|
+
return state.set(
|
|
228
|
+
`current.dialogs.${workcontext}`,
|
|
229
|
+
action.get('workitemId')
|
|
230
|
+
);
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
'set-note': (state, action) => {
|
|
234
|
+
const content = action.get('content');
|
|
235
|
+
return state.set(`note`, content);
|
|
236
|
+
},
|
|
237
|
+
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
//T:2019-02-27
|
|
2
|
-
import {fromJS} from 'immutable';
|
|
3
|
-
|
|
4
|
-
const initialState = fromJS({
|
|
5
|
-
showPrompt: false,
|
|
6
|
-
widgetsCache: {},
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const WIDGETS_CACHE_LIMIT = 128;
|
|
10
|
-
|
|
11
|
-
export default (state = initialState, action = {}) => {
|
|
12
|
-
switch (action.type) {
|
|
13
|
-
case 'TOGGLEPROMPT': {
|
|
14
|
-
return state.set('showPrompt', !state.get('showPrompt'));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* Limited cache in size to store values for some widgets like for example
|
|
18
|
-
* the ScrollableContainer. Because this cache is limited, it's possible
|
|
19
|
-
* to lose the data at any time.
|
|
20
|
-
*/
|
|
21
|
-
case 'WIDGET_CACHE': {
|
|
22
|
-
const id = action.widgetId;
|
|
23
|
-
if (state.has(`widgetsCache.${id}`)) {
|
|
24
|
-
return state.set(`widgetsCache.${id}`, action.value);
|
|
25
|
-
}
|
|
26
|
-
let widgetsCache = state.get('widgetsCache');
|
|
27
|
-
if (widgetsCache.size >= WIDGETS_CACHE_LIMIT) {
|
|
28
|
-
const _id = widgetsCache.keySeq().first();
|
|
29
|
-
state = state.del(`widgetsCache.${_id}`);
|
|
30
|
-
}
|
|
31
|
-
return state.set(`widgetsCache.${id}`, action.value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return state;
|
|
35
|
-
};
|
|
1
|
+
//T:2019-02-27
|
|
2
|
+
import {fromJS} from 'immutable';
|
|
3
|
+
|
|
4
|
+
const initialState = fromJS({
|
|
5
|
+
showPrompt: false,
|
|
6
|
+
widgetsCache: {},
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const WIDGETS_CACHE_LIMIT = 128;
|
|
10
|
+
|
|
11
|
+
export default (state = initialState, action = {}) => {
|
|
12
|
+
switch (action.type) {
|
|
13
|
+
case 'TOGGLEPROMPT': {
|
|
14
|
+
return state.set('showPrompt', !state.get('showPrompt'));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Limited cache in size to store values for some widgets like for example
|
|
18
|
+
* the ScrollableContainer. Because this cache is limited, it's possible
|
|
19
|
+
* to lose the data at any time.
|
|
20
|
+
*/
|
|
21
|
+
case 'WIDGET_CACHE': {
|
|
22
|
+
const id = action.widgetId;
|
|
23
|
+
if (state.has(`widgetsCache.${id}`)) {
|
|
24
|
+
return state.set(`widgetsCache.${id}`, action.value);
|
|
25
|
+
}
|
|
26
|
+
let widgetsCache = state.get('widgetsCache');
|
|
27
|
+
if (widgetsCache.size >= WIDGETS_CACHE_LIMIT) {
|
|
28
|
+
const _id = widgetsCache.keySeq().first();
|
|
29
|
+
state = state.del(`widgetsCache.${_id}`);
|
|
30
|
+
}
|
|
31
|
+
return state.set(`widgetsCache.${id}`, action.value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return state;
|
|
35
|
+
};
|