goblin-desktop 4.2.0 → 4.2.2

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.
Files changed (144) hide show
  1. package/.editorconfig +9 -9
  2. package/.zou-flow +2 -2
  3. package/LICENSE +21 -21
  4. package/README.md +108 -108
  5. package/builders/builders.js +3 -3
  6. package/builders/wizard.js +462 -462
  7. package/contexts.js +13 -13
  8. package/desktop-manager.js +10 -10
  9. package/desktop-window.js +13 -13
  10. package/desktop.js +13 -13
  11. package/eslint.config.js +65 -65
  12. package/lib/service.js +137 -137
  13. package/package.json +48 -48
  14. package/password-wizard.js +24 -24
  15. package/quest-run-wizard.js +24 -24
  16. package/taskbar.js +13 -13
  17. package/widgets/audio/sfx.js +177 -177
  18. package/widgets/board/view.js +37 -37
  19. package/widgets/board/widget.js +65 -65
  20. package/widgets/contexts/logic-handlers.js +36 -36
  21. package/widgets/contexts/service.js +40 -40
  22. package/widgets/contexts/view.js +21 -21
  23. package/widgets/contexts/widget.js +147 -147
  24. package/widgets/datagrid/datagrid-entity.js +82 -82
  25. package/widgets/datagrid/datagrid-headers.js +274 -274
  26. package/widgets/datagrid/styles.js +13 -13
  27. package/widgets/datagrid/widget.js +192 -192
  28. package/widgets/datagrid-cell/styles.js +52 -52
  29. package/widgets/datagrid-cell/widget.js +41 -41
  30. package/widgets/datagrid-item/styles.js +15 -15
  31. package/widgets/datagrid-item/widget.js +74 -74
  32. package/widgets/default/view.js +160 -160
  33. package/widgets/desktop/compensator.js +9 -9
  34. package/widgets/desktop/logic-handlers.js +243 -243
  35. package/widgets/desktop/reducer.js +35 -35
  36. package/widgets/desktop/service.js +858 -858
  37. package/widgets/desktop/styles.js +28 -28
  38. package/widgets/desktop/widget.js +191 -191
  39. package/widgets/desktop-clock/styles.js +69 -69
  40. package/widgets/desktop-clock/widget.js +387 -387
  41. package/widgets/desktop-clock-clock/styles.js +56 -56
  42. package/widgets/desktop-clock-clock/widget.js +96 -96
  43. package/widgets/desktop-clock-menu/styles.js +129 -129
  44. package/widgets/desktop-clock-menu/widget.js +63 -63
  45. package/widgets/desktop-connection-status/reducer.js +15 -15
  46. package/widgets/desktop-connection-status/styles.js +44 -44
  47. package/widgets/desktop-connection-status/widget.js +134 -134
  48. package/widgets/desktop-content/widget.js +68 -68
  49. package/widgets/desktop-footer/reducer.js +31 -31
  50. package/widgets/desktop-footer/styles.js +36 -36
  51. package/widgets/desktop-footer/widget.js +52 -52
  52. package/widgets/desktop-monitors/styles.js +155 -155
  53. package/widgets/desktop-monitors/widget.js +272 -272
  54. package/widgets/desktop-notebook/styles.js +155 -155
  55. package/widgets/desktop-notebook/widget.js +252 -252
  56. package/widgets/desktop-notifications/styles.js +147 -147
  57. package/widgets/desktop-notifications/widget.js +231 -231
  58. package/widgets/desktop-scale/reducer.js +15 -15
  59. package/widgets/desktop-scale/styles.js +49 -49
  60. package/widgets/desktop-scale/widget.js +173 -172
  61. package/widgets/desktop-state-monitor/styles.js +72 -72
  62. package/widgets/desktop-state-monitor/widget.js +123 -123
  63. package/widgets/desktop-taskbar/widget.js +57 -57
  64. package/widgets/desktop-themes-menu/widget.js +121 -121
  65. package/widgets/desktop-topbar/widget.js +201 -201
  66. package/widgets/desktop-window/service.js +56 -56
  67. package/widgets/desktop-window/styles.js +22 -22
  68. package/widgets/desktop-window/widget.js +70 -70
  69. package/widgets/detail/compensator.js +17 -17
  70. package/widgets/detail/view.js +40 -40
  71. package/widgets/detail/widget.js +119 -119
  72. package/widgets/editor/widget.js +82 -82
  73. package/widgets/entity-alerts/styles.js +77 -77
  74. package/widgets/entity-alerts/widget.js +328 -328
  75. package/widgets/entity-list/styles.js +66 -66
  76. package/widgets/entity-list/view.js +36 -36
  77. package/widgets/entity-list/widget.js +209 -209
  78. package/widgets/entity-list-item/widget.js +68 -68
  79. package/widgets/entity-row/styles.js +105 -105
  80. package/widgets/entity-row/widget.js +524 -524
  81. package/widgets/entity-row-button/styles.js +46 -46
  82. package/widgets/entity-row-button/widget.js +57 -57
  83. package/widgets/entity-view/reducer.js +20 -20
  84. package/widgets/entity-view/styles.js +90 -90
  85. package/widgets/entity-view/widget.js +601 -601
  86. package/widgets/facet-checkbox/styles.js +17 -17
  87. package/widgets/facet-checkbox/widget.js +43 -43
  88. package/widgets/facet-filter/widget.js +94 -94
  89. package/widgets/facet-filter-add/styles.js +30 -30
  90. package/widgets/facet-filter-add/widget.js +105 -105
  91. package/widgets/facet-filter-button/styles.js +74 -74
  92. package/widgets/facet-filter-button/widget.js +214 -214
  93. package/widgets/facet-filter-list-dialog/styles.js +59 -59
  94. package/widgets/facet-filter-list-dialog/widget.js +273 -273
  95. package/widgets/facet-filter-list-dialog-footer/styles.js +22 -22
  96. package/widgets/facet-filter-list-dialog-footer/widget.js +105 -105
  97. package/widgets/facet-filter-range-dialog/styles.js +82 -82
  98. package/widgets/facet-filter-range-dialog/widget.js +399 -399
  99. package/widgets/facet-filter-range-dialog-footer/styles.js +22 -22
  100. package/widgets/facet-filter-range-dialog-footer/widget.js +182 -182
  101. package/widgets/gamepad/widget.js +75 -75
  102. package/widgets/helpers/facet-helpers.js +105 -105
  103. package/widgets/hinter/reducer.js +35 -35
  104. package/widgets/hinter/styles.js +79 -79
  105. package/widgets/hinter/view.js +32 -32
  106. package/widgets/hinter/widget.js +289 -291
  107. package/widgets/junction/styles.js +22 -22
  108. package/widgets/junction/widget.js +50 -50
  109. package/widgets/main-tab-menu/styles.js +17 -17
  110. package/widgets/main-tab-menu/widget.js +130 -130
  111. package/widgets/map/view.js +49 -49
  112. package/widgets/map/widget.js +64 -64
  113. package/widgets/monitor/reducer.js +15 -15
  114. package/widgets/monitor/widget.js +60 -60
  115. package/widgets/navigating-layer/widget.js +25 -25
  116. package/widgets/notifications-button/widget.js +44 -44
  117. package/widgets/password-wizard/service.js +53 -53
  118. package/widgets/password-wizard/ui.js +66 -66
  119. package/widgets/plugin/reducer.js +19 -19
  120. package/widgets/plugin/styles.js +294 -294
  121. package/widgets/plugin/widget.js +622 -622
  122. package/widgets/quest-run-wizard/service.js +49 -49
  123. package/widgets/quest-run-wizard/ui.js +25 -25
  124. package/widgets/search/styles.js +80 -80
  125. package/widgets/search/widget.js +283 -285
  126. package/widgets/simple/view.js +28 -28
  127. package/widgets/status-filters/widget.js +121 -121
  128. package/widgets/tab/styles.js +16 -16
  129. package/widgets/tab/widget.js +89 -89
  130. package/widgets/tab-content/widget.js +35 -35
  131. package/widgets/tabs/widget.js +48 -48
  132. package/widgets/taskbar/service.js +99 -99
  133. package/widgets/taskbar/view.js +27 -27
  134. package/widgets/taskbar/widget.js +167 -167
  135. package/widgets/widget-doc-caller/reducer.js +15 -15
  136. package/widgets/widget-doc-caller/styles.js +20 -20
  137. package/widgets/widget-doc-caller/widget.js +55 -55
  138. package/widgets/wizard/widget.js +298 -298
  139. package/widgets/wizard-buttons/widget.js +111 -111
  140. package/widgets/workitem/styles.js +286 -286
  141. package/widgets/workitem/view.js +62 -62
  142. package/widgets/workitem/widget.js +988 -988
  143. package/widgets/workitem-dialog/widget.js +86 -86
  144. package/widgets/workitem-fields/widget.js +64 -64
@@ -1,243 +1,243 @@
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
- temporary: action.get('temporary'),
70
- duration: action.get('duration'),
71
- };
72
- return state.set(`notifications.${notificationId}`, notification);
73
- },
74
- 'update-not-read-count': (state) => {
75
- const notifications = state.get('notifications').select((i, v) => v.toJS());
76
- const count = notifications.reduce((acc, n) => {
77
- if (n.status === 'not-read') {
78
- return acc + 1;
79
- }
80
- return acc;
81
- }, 0);
82
- return state.set('notReadCount', count);
83
- },
84
- 'read-all': (state) => {
85
- const notifications = state.get('notifications');
86
- const newNotifications = notifications.transform(
87
- (i) => i,
88
- (i, v) => v.set('status', 'read')
89
- );
90
- return state.set('notifications', newNotifications);
91
- },
92
- 'read-notification': (state, action) => {
93
- const id = action.get('notification').id;
94
- return state.set(`notifications.${id}.status`, 'read');
95
- },
96
- 'remove-notification': (state, action) => {
97
- const id = action.get('notification').id;
98
- return state.del(`notifications.${id}`);
99
- },
100
- 'remove-notifications': (state) => {
101
- return state.set(`notifications`, {});
102
- },
103
-
104
- //--------------//
105
- // StateMonitor //
106
- //--------------//
107
- 'show-state-monitor': (state, action) => {
108
- const show = action.get('show');
109
- return state.set('showStateMonitor', show);
110
- },
111
- 'add-state-monitor': (state, action) => {
112
- const key = action.get('key');
113
- const doPush = action.get('doPush');
114
-
115
- const h = state.get('stateMonitorHistory');
116
- const stack = h.get('stack').valueSeq().toArray();
117
- let index = h.get('index');
118
-
119
- if (doPush) {
120
- // Truncate keys after the current index in the history.
121
- stack.splice(index + 1);
122
- index = stack.length - 1;
123
-
124
- // If key already exist in the history, remove it.
125
- const i = stack.indexOf(key);
126
- if (i !== -1) {
127
- stack.splice(i, 1);
128
- index = stack.length - 1;
129
- }
130
-
131
- // Insert the new key to the end of the history.
132
- stack.push(key);
133
- index = stack.length - 1;
134
- }
135
-
136
- state = state.set('stateMonitorHistory', {current: key, stack, index});
137
- state = state.set('showStateMonitor', true);
138
-
139
- return state;
140
- },
141
- 'back-state-monitor': (state) => {
142
- const index = state.get('stateMonitorHistory.index');
143
- return state.set('stateMonitorHistory.index', index - 1);
144
- },
145
- 'forward-state-monitor': (state) => {
146
- const index = state.get('stateMonitorHistory.index');
147
- return state.set('stateMonitorHistory.index', index + 1);
148
- },
149
-
150
- /******************************************************************************/
151
-
152
- 'navToContext': (state, action) => {
153
- return state.set('current.workcontext', action.get('contextId'));
154
- },
155
- 'add-workitem': (state, action) => {
156
- return state.set('working', action.get('working'));
157
- },
158
- 'setHinter': (state, action) => {
159
- const workcontext = state.get('current.workcontext');
160
- const wid = state.get(`current.workitems.${workcontext}`);
161
- return state.set(`workitems.${wid}.hinter`, action.get('hinterId'));
162
- },
163
- 'setDetail': (state, action) => {
164
- const workcontext = state.get('current.workcontext');
165
- const wid = state.get(`current.workitems.${workcontext}`);
166
- return state.set(`workitems.${wid}.detail`, action.get('detailId'));
167
- },
168
- 'set-workitem': (state, action) => {
169
- const wid = action.get('id');
170
- const workcontext = action.get('context');
171
- return state
172
- .set(`workitems.${wid}`, {
173
- id: wid,
174
- kind: action.get('kind'),
175
- entityId: action.get('entityId'),
176
- context: workcontext,
177
- view: action.get('view'),
178
- name: action.get('name'),
179
- description: action.get('description'),
180
- glyph: action.get('glyph'),
181
- closable: action.get('closable'),
182
- })
183
- .push(`workitemsByContext.${workcontext}`, wid);
184
- },
185
- 'removeWorkitem': (state, action) => {
186
- const wid = action.get('workitemId');
187
- const workcontext = state.get(`workitems.${wid}.context`);
188
- if (!workcontext) {
189
- return state;
190
- }
191
-
192
- state = state.del(`workitems.${wid}`);
193
- state = state.unpush(`workitemsByContext.${workcontext}`, wid);
194
-
195
- const last = state.get(`last.${workcontext}.workitem`);
196
- if (last === wid) {
197
- const newLast = state.get(`workitemsByContext.${workcontext}`).last();
198
- if (newLast.state) {
199
- state = state.set(`last.${workcontext}.workitem`, newLast.state);
200
- } else {
201
- state = state.set(`last.${workcontext}.workitem`, null);
202
- }
203
- }
204
-
205
- const currentWorkitem = state.get(`current.workitems.${workcontext}`);
206
- if (currentWorkitem === wid) {
207
- const newLast = state.get(`workitemsByContext.${workcontext}`).last();
208
- if (newLast.state) {
209
- state = state.set(`current.workitems.${workcontext}`, newLast.state);
210
- } else {
211
- state = state.set(`current.workitems.${workcontext}`, null);
212
- }
213
- }
214
-
215
- return state;
216
- },
217
- 'change-team': (state, action) => {
218
- return state.set('teamId', action.get('teamId'));
219
- },
220
-
221
- 'setCurrentWorkitemByContext': (state, action) => {
222
- const destinationContext = action.get('contextId');
223
- const lastWorkitem = state.get(`current.workitems.${destinationContext}`);
224
- return state
225
- .set(`current.workitems.${destinationContext}`, action.get('workitemId'))
226
- .set(`last.${destinationContext}`, {
227
- workitem: lastWorkitem,
228
- });
229
- },
230
-
231
- 'setCurrentDialogByContext': (state, action) => {
232
- const workcontext = action.get('contextId');
233
- return state.set(
234
- `current.dialogs.${workcontext}`,
235
- action.get('workitemId')
236
- );
237
- },
238
-
239
- 'set-note': (state, action) => {
240
- const content = action.get('content');
241
- return state.set(`note`, content);
242
- },
243
- };
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
+ temporary: action.get('temporary'),
70
+ duration: action.get('duration'),
71
+ };
72
+ return state.set(`notifications.${notificationId}`, notification);
73
+ },
74
+ 'update-not-read-count': (state) => {
75
+ const notifications = state.get('notifications').select((i, v) => v.toJS());
76
+ const count = notifications.reduce((acc, n) => {
77
+ if (n.status === 'not-read') {
78
+ return acc + 1;
79
+ }
80
+ return acc;
81
+ }, 0);
82
+ return state.set('notReadCount', count);
83
+ },
84
+ 'read-all': (state) => {
85
+ const notifications = state.get('notifications');
86
+ const newNotifications = notifications.transform(
87
+ (i) => i,
88
+ (i, v) => v.set('status', 'read')
89
+ );
90
+ return state.set('notifications', newNotifications);
91
+ },
92
+ 'read-notification': (state, action) => {
93
+ const id = action.get('notification').id;
94
+ return state.set(`notifications.${id}.status`, 'read');
95
+ },
96
+ 'remove-notification': (state, action) => {
97
+ const id = action.get('notification').id;
98
+ return state.del(`notifications.${id}`);
99
+ },
100
+ 'remove-notifications': (state) => {
101
+ return state.set(`notifications`, {});
102
+ },
103
+
104
+ //--------------//
105
+ // StateMonitor //
106
+ //--------------//
107
+ 'show-state-monitor': (state, action) => {
108
+ const show = action.get('show');
109
+ return state.set('showStateMonitor', show);
110
+ },
111
+ 'add-state-monitor': (state, action) => {
112
+ const key = action.get('key');
113
+ const doPush = action.get('doPush');
114
+
115
+ const h = state.get('stateMonitorHistory');
116
+ const stack = h.get('stack').valueSeq().toArray();
117
+ let index = h.get('index');
118
+
119
+ if (doPush) {
120
+ // Truncate keys after the current index in the history.
121
+ stack.splice(index + 1);
122
+ index = stack.length - 1;
123
+
124
+ // If key already exist in the history, remove it.
125
+ const i = stack.indexOf(key);
126
+ if (i !== -1) {
127
+ stack.splice(i, 1);
128
+ index = stack.length - 1;
129
+ }
130
+
131
+ // Insert the new key to the end of the history.
132
+ stack.push(key);
133
+ index = stack.length - 1;
134
+ }
135
+
136
+ state = state.set('stateMonitorHistory', {current: key, stack, index});
137
+ state = state.set('showStateMonitor', true);
138
+
139
+ return state;
140
+ },
141
+ 'back-state-monitor': (state) => {
142
+ const index = state.get('stateMonitorHistory.index');
143
+ return state.set('stateMonitorHistory.index', index - 1);
144
+ },
145
+ 'forward-state-monitor': (state) => {
146
+ const index = state.get('stateMonitorHistory.index');
147
+ return state.set('stateMonitorHistory.index', index + 1);
148
+ },
149
+
150
+ /******************************************************************************/
151
+
152
+ 'navToContext': (state, action) => {
153
+ return state.set('current.workcontext', action.get('contextId'));
154
+ },
155
+ 'add-workitem': (state, action) => {
156
+ return state.set('working', action.get('working'));
157
+ },
158
+ 'setHinter': (state, action) => {
159
+ const workcontext = state.get('current.workcontext');
160
+ const wid = state.get(`current.workitems.${workcontext}`);
161
+ return state.set(`workitems.${wid}.hinter`, action.get('hinterId'));
162
+ },
163
+ 'setDetail': (state, action) => {
164
+ const workcontext = state.get('current.workcontext');
165
+ const wid = state.get(`current.workitems.${workcontext}`);
166
+ return state.set(`workitems.${wid}.detail`, action.get('detailId'));
167
+ },
168
+ 'set-workitem': (state, action) => {
169
+ const wid = action.get('id');
170
+ const workcontext = action.get('context');
171
+ return state
172
+ .set(`workitems.${wid}`, {
173
+ id: wid,
174
+ kind: action.get('kind'),
175
+ entityId: action.get('entityId'),
176
+ context: workcontext,
177
+ view: action.get('view'),
178
+ name: action.get('name'),
179
+ description: action.get('description'),
180
+ glyph: action.get('glyph'),
181
+ closable: action.get('closable'),
182
+ })
183
+ .push(`workitemsByContext.${workcontext}`, wid);
184
+ },
185
+ 'removeWorkitem': (state, action) => {
186
+ const wid = action.get('workitemId');
187
+ const workcontext = state.get(`workitems.${wid}.context`);
188
+ if (!workcontext) {
189
+ return state;
190
+ }
191
+
192
+ state = state.del(`workitems.${wid}`);
193
+ state = state.unpush(`workitemsByContext.${workcontext}`, wid);
194
+
195
+ const last = state.get(`last.${workcontext}.workitem`);
196
+ if (last === wid) {
197
+ const newLast = state.get(`workitemsByContext.${workcontext}`).last();
198
+ if (newLast.state) {
199
+ state = state.set(`last.${workcontext}.workitem`, newLast.state);
200
+ } else {
201
+ state = state.set(`last.${workcontext}.workitem`, null);
202
+ }
203
+ }
204
+
205
+ const currentWorkitem = state.get(`current.workitems.${workcontext}`);
206
+ if (currentWorkitem === wid) {
207
+ const newLast = state.get(`workitemsByContext.${workcontext}`).last();
208
+ if (newLast.state) {
209
+ state = state.set(`current.workitems.${workcontext}`, newLast.state);
210
+ } else {
211
+ state = state.set(`current.workitems.${workcontext}`, null);
212
+ }
213
+ }
214
+
215
+ return state;
216
+ },
217
+ 'change-team': (state, action) => {
218
+ return state.set('teamId', action.get('teamId'));
219
+ },
220
+
221
+ 'setCurrentWorkitemByContext': (state, action) => {
222
+ const destinationContext = action.get('contextId');
223
+ const lastWorkitem = state.get(`current.workitems.${destinationContext}`);
224
+ return state
225
+ .set(`current.workitems.${destinationContext}`, action.get('workitemId'))
226
+ .set(`last.${destinationContext}`, {
227
+ workitem: lastWorkitem,
228
+ });
229
+ },
230
+
231
+ 'setCurrentDialogByContext': (state, action) => {
232
+ const workcontext = action.get('contextId');
233
+ return state.set(
234
+ `current.dialogs.${workcontext}`,
235
+ action.get('workitemId')
236
+ );
237
+ },
238
+
239
+ 'set-note': (state, action) => {
240
+ const content = action.get('content');
241
+ return state.set(`note`, content);
242
+ },
243
+ };
@@ -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
+ };