goblin-desktop 2.0.0 → 2.0.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 (130) hide show
  1. package/README.md +108 -108
  2. package/builders/wizard.js +478 -478
  3. package/contexts.js +13 -13
  4. package/desktop-manager.js +10 -10
  5. package/desktop-window.js +13 -13
  6. package/desktop.js +13 -13
  7. package/lib/service.js +135 -135
  8. package/package.json +36 -36
  9. package/password-wizard.js +13 -13
  10. package/quest-run-wizard.js +13 -13
  11. package/taskbar.js +13 -13
  12. package/widgets/audio/sfx.js +177 -177
  13. package/widgets/board/view.js +37 -37
  14. package/widgets/board/widget.js +65 -65
  15. package/widgets/contexts/logic-handlers.js +36 -36
  16. package/widgets/contexts/service.js +40 -40
  17. package/widgets/contexts/view.js +22 -22
  18. package/widgets/contexts/widget.js +147 -147
  19. package/widgets/datagrid/datagrid-entity.js +82 -82
  20. package/widgets/datagrid/datagrid-headers.js +272 -272
  21. package/widgets/datagrid/datagrid-item.js +82 -82
  22. package/widgets/datagrid/styles.js +13 -13
  23. package/widgets/datagrid/widget.js +191 -191
  24. package/widgets/datagrid-cell/styles.js +52 -52
  25. package/widgets/datagrid-cell/widget.js +41 -41
  26. package/widgets/default/view.js +91 -91
  27. package/widgets/desktop/compensator.js +9 -9
  28. package/widgets/desktop/logic-handlers.js +237 -237
  29. package/widgets/desktop/service.js +816 -816
  30. package/widgets/desktop/styles.js +28 -28
  31. package/widgets/desktop/widget.js +175 -175
  32. package/widgets/desktop-clock/styles.js +69 -69
  33. package/widgets/desktop-clock/widget.js +387 -387
  34. package/widgets/desktop-clock-clock/styles.js +56 -56
  35. package/widgets/desktop-clock-clock/widget.js +96 -96
  36. package/widgets/desktop-clock-menu/styles.js +129 -129
  37. package/widgets/desktop-clock-menu/widget.js +63 -63
  38. package/widgets/desktop-connection-status/reducer.js +15 -15
  39. package/widgets/desktop-connection-status/styles.js +44 -44
  40. package/widgets/desktop-connection-status/widget.js +129 -129
  41. package/widgets/desktop-content/widget.js +68 -68
  42. package/widgets/desktop-footer/reducer.js +31 -31
  43. package/widgets/desktop-footer/styles.js +36 -36
  44. package/widgets/desktop-footer/widget.js +52 -52
  45. package/widgets/desktop-monitors/styles.js +155 -155
  46. package/widgets/desktop-monitors/widget.js +273 -273
  47. package/widgets/desktop-notebook/styles.js +155 -155
  48. package/widgets/desktop-notebook/widget.js +253 -253
  49. package/widgets/desktop-notifications/styles.js +147 -147
  50. package/widgets/desktop-notifications/widget.js +231 -231
  51. package/widgets/desktop-scale/reducer.js +15 -15
  52. package/widgets/desktop-scale/styles.js +48 -48
  53. package/widgets/desktop-scale/widget.js +172 -172
  54. package/widgets/desktop-state-monitor/styles.js +72 -72
  55. package/widgets/desktop-state-monitor/widget.js +123 -123
  56. package/widgets/desktop-taskbar/widget.js +57 -57
  57. package/widgets/desktop-themes-menu/widget.js +121 -121
  58. package/widgets/desktop-topbar/widget.js +201 -201
  59. package/widgets/desktop-window/service.js +56 -56
  60. package/widgets/desktop-window/styles.js +22 -22
  61. package/widgets/desktop-window/widget.js +70 -70
  62. package/widgets/detail/view.js +40 -40
  63. package/widgets/detail/widget.js +125 -125
  64. package/widgets/editor/widget.js +80 -80
  65. package/widgets/entity-alerts/styles.js +77 -77
  66. package/widgets/entity-alerts/widget.js +328 -328
  67. package/widgets/entity-list/view.js +36 -36
  68. package/widgets/entity-list/widget.js +209 -209
  69. package/widgets/entity-list-item/widget.js +68 -68
  70. package/widgets/entity-row/styles.js +104 -104
  71. package/widgets/entity-row/widget.js +523 -523
  72. package/widgets/entity-row-button/styles.js +46 -46
  73. package/widgets/entity-row-button/widget.js +57 -57
  74. package/widgets/entity-view/reducer.js +20 -20
  75. package/widgets/entity-view/styles.js +90 -90
  76. package/widgets/entity-view/widget.js +516 -516
  77. package/widgets/facet-checkbox/styles.js +17 -17
  78. package/widgets/facet-checkbox/widget.js +43 -43
  79. package/widgets/facet-filter/widget.js +94 -94
  80. package/widgets/facet-filter-add/styles.js +30 -30
  81. package/widgets/facet-filter-add/widget.js +105 -105
  82. package/widgets/facet-filter-button/styles.js +74 -74
  83. package/widgets/facet-filter-button/widget.js +214 -214
  84. package/widgets/facet-filter-list-dialog/styles.js +59 -59
  85. package/widgets/facet-filter-list-dialog/widget.js +253 -253
  86. package/widgets/facet-filter-list-dialog-footer/styles.js +22 -22
  87. package/widgets/facet-filter-list-dialog-footer/widget.js +105 -105
  88. package/widgets/facet-filter-range-dialog/styles.js +82 -82
  89. package/widgets/facet-filter-range-dialog/widget.js +398 -398
  90. package/widgets/facet-filter-range-dialog-footer/styles.js +22 -22
  91. package/widgets/facet-filter-range-dialog-footer/widget.js +182 -182
  92. package/widgets/gamepad/widget.js +75 -75
  93. package/widgets/helpers/facet-helpers.js +105 -105
  94. package/widgets/hinter/reducer.js +35 -35
  95. package/widgets/hinter/styles.js +79 -79
  96. package/widgets/hinter/view.js +31 -31
  97. package/widgets/hinter/widget.js +292 -292
  98. package/widgets/junction/styles.js +22 -22
  99. package/widgets/junction/widget.js +50 -50
  100. package/widgets/main-tab-menu/widget.js +136 -136
  101. package/widgets/map/view.js +49 -49
  102. package/widgets/map/widget.js +65 -65
  103. package/widgets/monitor/widget.js +66 -66
  104. package/widgets/navigating-layer/widget.js +25 -25
  105. package/widgets/notifications-button/widget.js +44 -44
  106. package/widgets/password-wizard/service.js +53 -53
  107. package/widgets/password-wizard/ui.js +66 -66
  108. package/widgets/plugin/styles.js +294 -294
  109. package/widgets/plugin/widget.js +636 -636
  110. package/widgets/quest-run-wizard/service.js +49 -49
  111. package/widgets/quest-run-wizard/ui.js +25 -25
  112. package/widgets/search/styles.js +80 -80
  113. package/widgets/search/widget.js +286 -284
  114. package/widgets/simple/view.js +29 -29
  115. package/widgets/status-filters/widget.js +121 -121
  116. package/widgets/tab/styles.js +16 -16
  117. package/widgets/tab/widget.js +88 -88
  118. package/widgets/tab-content/widget.js +35 -35
  119. package/widgets/tabs/widget.js +48 -48
  120. package/widgets/taskbar/service.js +99 -99
  121. package/widgets/taskbar/view.js +24 -24
  122. package/widgets/taskbar/widget.js +169 -169
  123. package/widgets/widget-doc-caller/widget.js +55 -55
  124. package/widgets/wizard/widget.js +299 -299
  125. package/widgets/wizard-buttons/widget.js +107 -107
  126. package/widgets/workitem/styles.js +281 -281
  127. package/widgets/workitem/view.js +62 -62
  128. package/widgets/workitem/widget.js +967 -940
  129. package/widgets/workitem-dialog/widget.js +86 -86
  130. package/widgets/workitem-fields/widget.js +63 -63
@@ -1,284 +1,286 @@
1
- //T:2019-04-09
2
-
3
- import T from 't';
4
- import React from 'react';
5
- import FrontendForm from 'goblin-laboratory/widgets/frontend-form/widget';
6
- import Widget from 'goblin-laboratory/widgets/widget';
7
- import throttle from 'lodash/throttle';
8
-
9
- import Container from 'goblin-gadgets/widgets/container/widget';
10
- import Label from 'goblin-gadgets/widgets/label/widget';
11
- import Button from 'goblin-gadgets/widgets/button/widget';
12
- import StatusFilters from 'goblin-desktop/widgets/status-filters/widget';
13
- import C from 'goblin-laboratory/widgets/connect-helpers/c';
14
- import TextField from 'goblin-gadgets/widgets/text-field/widget';
15
-
16
- import EntityView from 'goblin-desktop/widgets/entity-view/widget';
17
-
18
- /******************************************************************************/
19
-
20
- class HinterNewButton extends Widget {
21
- constructor() {
22
- super(...arguments);
23
- this.onNew = this.onNew.bind(this);
24
- }
25
-
26
- static get wiring() {
27
- return {
28
- id: 'id',
29
- type: 'type',
30
- kind: 'kind',
31
- title: 'title',
32
- glyph: 'glyph',
33
- status: 'status',
34
- onNew: 'onNew',
35
- withDetails: 'withDetails',
36
- newButtonTitle: 'newButtonTitle',
37
- };
38
- }
39
-
40
- onNew() {
41
- const model = this.getRouting().get('location.hash').substring(1);
42
- const value = this.getModelValue(model, true);
43
- this.doAs('hinter', 'create-new', {
44
- value,
45
- });
46
- }
47
-
48
- render() {
49
- const {id, onNew, title} = this.props;
50
-
51
- if (!id) {
52
- return null;
53
- }
54
- return (
55
- <>
56
- {onNew ? (
57
- <Button
58
- kind="action"
59
- place="1/1"
60
- glyph="solid/plus"
61
- text={title}
62
- grow="1"
63
- onClick={this.onNew}
64
- />
65
- ) : null}
66
- </>
67
- );
68
- }
69
- }
70
- const NewEntityButton = Widget.Wired(HinterNewButton)();
71
-
72
- /******************************************************************************/
73
-
74
- class CountNC extends Widget {
75
- render() {
76
- const p = this.props;
77
- return (
78
- <Container busy={p.count === undefined}>
79
- <Label
80
- text={T(
81
- `{count, plural,
82
- =0 {Aucun élément}
83
- one {1/{initialCount} élément}
84
- other {{count}/{initialCount} éléments}
85
- }`,
86
- null,
87
- {count: p.count, initialCount: p.initialCount}
88
- )}
89
- />
90
- </Container>
91
- );
92
- }
93
- }
94
- const Count = Widget.connect((state, props) => {
95
- return {
96
- count: state.get(`backend.${props.id}.count`, 0),
97
- initialCount: state.get(`backend.${props.id}.initialCount`, 0),
98
- };
99
- })(CountNC);
100
-
101
- /******************************************************************************/
102
-
103
- class Search extends Widget {
104
- constructor() {
105
- super(...arguments);
106
-
107
- this.state = {
108
- showParams: true,
109
- };
110
-
111
- this.onToggleParams = this.onToggleParams.bind(this);
112
- this._entityIds = [];
113
- this._drillDownInternal = this._drillDownInternal.bind(this);
114
- this._drillDown = throttle(this._drillDownInternal, 100).bind(this);
115
- this.drillDown = this.drillDown.bind(this);
116
- this.filter = this.filter.bind(this);
117
- this.resetFilter = this.resetFilter.bind(this);
118
- }
119
-
120
- static get wiring() {
121
- return {
122
- id: 'id',
123
- name: 'name',
124
- title: 'title',
125
- type: 'type',
126
- hinter: 'hinter',
127
- hinterId: 'hinterId',
128
- hintText: 'hintText',
129
- };
130
- }
131
-
132
- //#region get/set
133
- get showParams() {
134
- return this.state.showParams;
135
- }
136
- set showParams(value) {
137
- this.setState({
138
- showParams: value,
139
- });
140
- }
141
- //#endregion
142
-
143
- onToggleParams() {
144
- this.showParams = !this.showParams;
145
- }
146
-
147
- _drillDownInternal() {
148
- const name = this.props.name || `${this.props.type}-search`;
149
- this.doAs(name, 'drill-down', {
150
- entityIds: this._entityIds,
151
- view: ['isReady', {meta: {summaries: ['description']}}],
152
- });
153
- this._entityIds = [];
154
- }
155
-
156
- drillDown(entityId) {
157
- this._entityIds.push(entityId);
158
- this._drillDown();
159
- }
160
-
161
- filter(value) {
162
- this.dispatchTo(
163
- this.props.id,
164
- {type: 'select-row', rowId: null, entityId: null},
165
- 'entity-view'
166
- );
167
- this.dispatchTo(
168
- this.props.id,
169
- {type: 'CHANGE', path: 'value', newValue: value},
170
- 'frontend-form'
171
- );
172
- this.doFor(`list@${this.props.id}`, 'set-filter-value', {
173
- filterValue: value,
174
- });
175
- }
176
-
177
- resetFilter() {
178
- this.filter('');
179
- }
180
-
181
- renderParams() {
182
- const listId = `list@${this.props.id}`;
183
-
184
- return (
185
- <div className={this.styles.classNames.params}>
186
- <div className={this.styles.classNames.pane}>
187
- <Label text={this.props.title} grow="1" kind="title" />
188
- <div className={this.styles.classNames.separator} />
189
- <FrontendForm widgetId={this.props.id}>
190
- <Container kind="row">
191
- <TextField
192
- grow="1"
193
- hintText={this.props.hintText || T('Chercher')}
194
- value={C('.value')}
195
- changeMode="throttled"
196
- onChange={this.filter}
197
- autoFocus={true}
198
- selectAllOnFocus={true}
199
- shape={this.props.hasFilter ? 'left-rounded' : 'rounded'}
200
- horizontalSpacing={this.props.hasFilter ? 'overlap' : null}
201
- />
202
- {this.props.hasFilter ? (
203
- <Button
204
- shape="right-rounded"
205
- glyph="solid/times"
206
- tooltip={T('Tout montrer')}
207
- onClick={this.resetFilter}
208
- />
209
- ) : null}
210
- </Container>
211
- </FrontendForm>
212
- </div>
213
-
214
- <div className={this.styles.classNames.scrollablePane}>
215
- <StatusFilters id={listId} type={this.props.type} />
216
- <div className={this.styles.classNames.separator} />
217
- <Count id={listId} />
218
- </div>
219
-
220
- <div className={this.styles.classNames.sajex} />
221
-
222
- <Container kind="actions">
223
- <NewEntityButton id={this.props.hinterId} />
224
- </Container>
225
- </div>
226
- );
227
- }
228
-
229
- renderList() {
230
- return (
231
- <EntityView
232
- id={this.props.id}
233
- hinter={this.props.hinter}
234
- type={this.props.type}
235
- />
236
- );
237
- }
238
-
239
- renderButton() {
240
- const style = this.showParams
241
- ? this.styles.classNames.button
242
- : this.styles.classNames.buttonWithoutParams;
243
-
244
- return (
245
- <div className={style}>
246
- <Button
247
- kind="subaction"
248
- width="20px"
249
- height="20px"
250
- glyph={this.showParams ? 'solid/chevron-left' : 'solid/chevron-right'}
251
- glyphSize="80%"
252
- onClick={this.onToggleParams}
253
- />
254
- </div>
255
- );
256
- }
257
-
258
- render() {
259
- if (!this.props.id || !this.props.type) {
260
- return null;
261
- }
262
-
263
- const style = this.showParams
264
- ? this.styles.classNames.search
265
- : this.styles.classNames.searchWithoutParams;
266
-
267
- return (
268
- <div className={style}>
269
- {this.renderParams()}
270
- {this.renderList()}
271
- {this.renderButton()}
272
- </div>
273
- );
274
- }
275
- }
276
-
277
- /******************************************************************************/
278
-
279
- const ConnectedSearch = Widget.connect((state, prop) => {
280
- const hasFilter = !!state.get(`widgets.${prop.id}.value`, null);
281
- return {hasFilter};
282
- })(Search);
283
-
284
- export default Widget.Wired(ConnectedSearch)();
1
+ //T:2019-04-09
2
+
3
+ import T from 't';
4
+ import React from 'react';
5
+ import FrontendForm from 'goblin-laboratory/widgets/frontend-form/widget';
6
+ import Widget from 'goblin-laboratory/widgets/widget';
7
+ import throttle from 'lodash/throttle';
8
+
9
+ import Container from 'goblin-gadgets/widgets/container/widget';
10
+ import Label from 'goblin-gadgets/widgets/label/widget';
11
+ import Button from 'goblin-gadgets/widgets/button/widget';
12
+ import CommandButton from 'goblin-gadgets/widgets/command-button/widget';
13
+ import StatusFilters from 'goblin-desktop/widgets/status-filters/widget';
14
+ import C from 'goblin-laboratory/widgets/connect-helpers/c';
15
+ import TextField from 'goblin-gadgets/widgets/text-field/widget';
16
+
17
+ import EntityView from 'goblin-desktop/widgets/entity-view/widget';
18
+
19
+ /******************************************************************************/
20
+
21
+ class HinterNewButton extends Widget {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.onNew = this.onNew.bind(this);
25
+ }
26
+
27
+ static get wiring() {
28
+ return {
29
+ id: 'id',
30
+ type: 'type',
31
+ kind: 'kind',
32
+ title: 'title',
33
+ glyph: 'glyph',
34
+ status: 'status',
35
+ onNew: 'onNew',
36
+ withDetails: 'withDetails',
37
+ newButtonTitle: 'newButtonTitle',
38
+ };
39
+ }
40
+
41
+ onNew() {
42
+ const model = this.getRouting().get('location.hash').substring(1);
43
+ const value = this.getModelValue(model, true);
44
+ this.doAs('hinter', 'create-new', {
45
+ value,
46
+ });
47
+ }
48
+
49
+ render() {
50
+ const {id, onNew, title, type} = this.props;
51
+
52
+ if (!id) {
53
+ return null;
54
+ }
55
+ return (
56
+ <>
57
+ {onNew ? (
58
+ <CommandButton
59
+ command={`${type}-workitem.edit`}
60
+ kind="action"
61
+ place="1/1"
62
+ glyph="solid/plus"
63
+ text={title}
64
+ grow="1"
65
+ onClick={this.onNew}
66
+ />
67
+ ) : null}
68
+ </>
69
+ );
70
+ }
71
+ }
72
+ const NewEntityButton = Widget.Wired(HinterNewButton)();
73
+
74
+ /******************************************************************************/
75
+
76
+ class CountNC extends Widget {
77
+ render() {
78
+ const p = this.props;
79
+ return (
80
+ <Container busy={p.count === undefined}>
81
+ <Label
82
+ text={T(
83
+ `{count, plural,
84
+ =0 {Aucun élément}
85
+ one {1/{initialCount} élément}
86
+ other {{count}/{initialCount} éléments}
87
+ }`,
88
+ null,
89
+ {count: p.count, initialCount: p.initialCount}
90
+ )}
91
+ />
92
+ </Container>
93
+ );
94
+ }
95
+ }
96
+ const Count = Widget.connect((state, props) => {
97
+ return {
98
+ count: state.get(`backend.${props.id}.count`, 0),
99
+ initialCount: state.get(`backend.${props.id}.initialCount`, 0),
100
+ };
101
+ })(CountNC);
102
+
103
+ /******************************************************************************/
104
+
105
+ class Search extends Widget {
106
+ constructor() {
107
+ super(...arguments);
108
+
109
+ this.state = {
110
+ showParams: true,
111
+ };
112
+
113
+ this.onToggleParams = this.onToggleParams.bind(this);
114
+ this._entityIds = [];
115
+ this._drillDownInternal = this._drillDownInternal.bind(this);
116
+ this._drillDown = throttle(this._drillDownInternal, 100).bind(this);
117
+ this.drillDown = this.drillDown.bind(this);
118
+ this.filter = this.filter.bind(this);
119
+ this.resetFilter = this.resetFilter.bind(this);
120
+ }
121
+
122
+ static get wiring() {
123
+ return {
124
+ id: 'id',
125
+ name: 'name',
126
+ title: 'title',
127
+ type: 'type',
128
+ hinter: 'hinter',
129
+ hinterId: 'hinterId',
130
+ hintText: 'hintText',
131
+ };
132
+ }
133
+
134
+ //#region get/set
135
+ get showParams() {
136
+ return this.state.showParams;
137
+ }
138
+ set showParams(value) {
139
+ this.setState({
140
+ showParams: value,
141
+ });
142
+ }
143
+ //#endregion
144
+
145
+ onToggleParams() {
146
+ this.showParams = !this.showParams;
147
+ }
148
+
149
+ _drillDownInternal() {
150
+ const name = this.props.name || `${this.props.type}-search`;
151
+ this.doAs(name, 'drill-down', {
152
+ entityIds: this._entityIds,
153
+ view: ['isReady', {meta: {summaries: ['description']}}],
154
+ });
155
+ this._entityIds = [];
156
+ }
157
+
158
+ drillDown(entityId) {
159
+ this._entityIds.push(entityId);
160
+ this._drillDown();
161
+ }
162
+
163
+ filter(value) {
164
+ this.dispatchTo(
165
+ this.props.id,
166
+ {type: 'select-row', rowId: null, entityId: null},
167
+ 'entity-view'
168
+ );
169
+ this.dispatchTo(
170
+ this.props.id,
171
+ {type: 'CHANGE', path: 'value', newValue: value},
172
+ 'frontend-form'
173
+ );
174
+ this.doFor(`list@${this.props.id}`, 'set-filter-value', {
175
+ filterValue: value,
176
+ });
177
+ }
178
+
179
+ resetFilter() {
180
+ this.filter('');
181
+ }
182
+
183
+ renderParams() {
184
+ const listId = `list@${this.props.id}`;
185
+
186
+ return (
187
+ <div className={this.styles.classNames.params}>
188
+ <div className={this.styles.classNames.pane}>
189
+ <Label text={this.props.title} grow="1" kind="title" />
190
+ <div className={this.styles.classNames.separator} />
191
+ <FrontendForm widgetId={this.props.id}>
192
+ <Container kind="row">
193
+ <TextField
194
+ grow="1"
195
+ hintText={this.props.hintText || T('Chercher')}
196
+ value={C('.value')}
197
+ changeMode="throttled"
198
+ onChange={this.filter}
199
+ autoFocus={true}
200
+ selectAllOnFocus={true}
201
+ shape={this.props.hasFilter ? 'left-rounded' : 'rounded'}
202
+ horizontalSpacing={this.props.hasFilter ? 'overlap' : null}
203
+ />
204
+ {this.props.hasFilter ? (
205
+ <Button
206
+ shape="right-rounded"
207
+ glyph="solid/times"
208
+ tooltip={T('Tout montrer')}
209
+ onClick={this.resetFilter}
210
+ />
211
+ ) : null}
212
+ </Container>
213
+ </FrontendForm>
214
+ </div>
215
+
216
+ <div className={this.styles.classNames.scrollablePane}>
217
+ <StatusFilters id={listId} type={this.props.type} />
218
+ <div className={this.styles.classNames.separator} />
219
+ <Count id={listId} />
220
+ </div>
221
+
222
+ <div className={this.styles.classNames.sajex} />
223
+
224
+ <Container kind="actions">
225
+ <NewEntityButton id={this.props.hinterId} />
226
+ </Container>
227
+ </div>
228
+ );
229
+ }
230
+
231
+ renderList() {
232
+ return (
233
+ <EntityView
234
+ id={this.props.id}
235
+ hinter={this.props.hinter}
236
+ type={this.props.type}
237
+ />
238
+ );
239
+ }
240
+
241
+ renderButton() {
242
+ const style = this.showParams
243
+ ? this.styles.classNames.button
244
+ : this.styles.classNames.buttonWithoutParams;
245
+
246
+ return (
247
+ <div className={style}>
248
+ <Button
249
+ kind="subaction"
250
+ width="20px"
251
+ height="20px"
252
+ glyph={this.showParams ? 'solid/chevron-left' : 'solid/chevron-right'}
253
+ glyphSize="80%"
254
+ onClick={this.onToggleParams}
255
+ />
256
+ </div>
257
+ );
258
+ }
259
+
260
+ render() {
261
+ if (!this.props.id || !this.props.type) {
262
+ return null;
263
+ }
264
+
265
+ const style = this.showParams
266
+ ? this.styles.classNames.search
267
+ : this.styles.classNames.searchWithoutParams;
268
+
269
+ return (
270
+ <div className={style}>
271
+ {this.renderParams()}
272
+ {this.renderList()}
273
+ {this.renderButton()}
274
+ </div>
275
+ );
276
+ }
277
+ }
278
+
279
+ /******************************************************************************/
280
+
281
+ const ConnectedSearch = Widget.connect((state, prop) => {
282
+ const hasFilter = !!state.get(`widgets.${prop.id}.value`, null);
283
+ return {hasFilter};
284
+ })(Search);
285
+
286
+ export default Widget.Wired(ConnectedSearch)();
@@ -1,29 +1,29 @@
1
- //T:2019-02-27
2
-
3
- import React from 'react';
4
- import importer from 'goblin_importer';
5
- import Widget from 'goblin-laboratory/widgets/widget';
6
- import View from 'goblin-laboratory/widgets/view';
7
- import Container from 'goblin-gadgets/widgets/container/widget';
8
-
9
- const widgetImporter = importer('widget');
10
-
11
- class SimpleView extends View {
12
- render() {
13
- const {workitemId} = this.props;
14
- if (!workitemId) {
15
- return null;
16
- }
17
-
18
- const workitem = workitemId.split('@')[0];
19
- const wireWidget = Widget.Wired(widgetImporter(workitem));
20
- const WiredWidget = wireWidget(workitemId);
21
- return (
22
- <Container kind="views">
23
- <WiredWidget />
24
- </Container>
25
- );
26
- }
27
- }
28
-
29
- export default SimpleView;
1
+ //T:2019-02-27
2
+
3
+ import React from 'react';
4
+ import importer from 'goblin_importer';
5
+ import Widget from 'goblin-laboratory/widgets/widget';
6
+ import View from 'goblin-laboratory/widgets/view';
7
+ import Container from 'goblin-gadgets/widgets/container/widget';
8
+
9
+ const widgetImporter = importer('widget');
10
+
11
+ class SimpleView extends View {
12
+ render() {
13
+ const {workitemId} = this.props;
14
+ if (!workitemId) {
15
+ return null;
16
+ }
17
+
18
+ const workitem = workitemId.split('@')[0];
19
+ const wireWidget = Widget.Wired(widgetImporter(workitem));
20
+ const WiredWidget = wireWidget(workitemId);
21
+ return (
22
+ <Container kind="views">
23
+ <WiredWidget />
24
+ </Container>
25
+ );
26
+ }
27
+ }
28
+
29
+ export default SimpleView;