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,285 +1,283 @@
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 = model ?? this.getBackendState(model);
44
- this.doFor(this.props.id, 'create-new', {
45
- value,
46
- });
47
- }
48
-
49
- render() {
50
- const {id, onNew, title, type} = this.props;
51
- if (!id) {
52
- return null;
53
- }
54
- return (
55
- <>
56
- {onNew ? (
57
- <CommandButton
58
- command={`${type}-workitem.edit`}
59
- kind="action"
60
- place="1/1"
61
- glyph="solid/plus"
62
- text={title}
63
- grow="1"
64
- onClick={this.onNew}
65
- />
66
- ) : null}
67
- </>
68
- );
69
- }
70
- }
71
- const NewEntityButton = Widget.Wired(HinterNewButton);
72
-
73
- /******************************************************************************/
74
-
75
- class CountNC extends Widget {
76
- render() {
77
- const p = this.props;
78
- return (
79
- <Container busy={p.count === undefined}>
80
- <Label
81
- text={T(
82
- `{count, plural,
83
- =0 {Aucun élément}
84
- one {1/{initialCount} élément}
85
- other {{count}/{initialCount} éléments}
86
- }`,
87
- null,
88
- {count: p.count, initialCount: p.initialCount}
89
- )}
90
- />
91
- </Container>
92
- );
93
- }
94
- }
95
- const Count = Widget.connect((state, props) => {
96
- return {
97
- count: state.get(`backend.${props.id}.count`, 0),
98
- initialCount: state.get(`backend.${props.id}.initialCount`, 0),
99
- };
100
- })(CountNC);
101
-
102
- /******************************************************************************/
103
-
104
- class Search extends Widget {
105
- constructor() {
106
- super(...arguments);
107
-
108
- this.state = {
109
- showParams: true,
110
- };
111
-
112
- this.onToggleParams = this.onToggleParams.bind(this);
113
- this._entityIds = [];
114
- this._drillDownInternal = this._drillDownInternal.bind(this);
115
- this._drillDown = throttle(this._drillDownInternal, 100).bind(this);
116
- this.drillDown = this.drillDown.bind(this);
117
- this.filter = this.filter.bind(this);
118
- this.resetFilter = this.resetFilter.bind(this);
119
- }
120
-
121
- static get wiring() {
122
- return {
123
- id: 'id',
124
- name: 'name',
125
- title: 'title',
126
- type: 'type',
127
- hinter: 'hinter',
128
- hinterId: 'hinterId',
129
- hintText: 'hintText',
130
- };
131
- }
132
-
133
- //#region get/set
134
- get showParams() {
135
- return this.state.showParams;
136
- }
137
- set showParams(value) {
138
- this.setState({
139
- showParams: value,
140
- });
141
- }
142
- //#endregion
143
-
144
- onToggleParams() {
145
- this.showParams = !this.showParams;
146
- }
147
-
148
- _drillDownInternal() {
149
- const name = this.props.name || `${this.props.type}-search`;
150
- this.doAs(name, 'drill-down', {
151
- entityIds: this._entityIds,
152
- view: ['isReady', {meta: {summaries: ['description']}}],
153
- });
154
- this._entityIds = [];
155
- }
156
-
157
- drillDown(entityId) {
158
- this._entityIds.push(entityId);
159
- this._drillDown();
160
- }
161
-
162
- filter(value) {
163
- this.dispatchTo(
164
- this.props.id,
165
- {type: 'select-row', rowId: null, entityId: null},
166
- 'entity-view'
167
- );
168
- this.dispatchTo(
169
- this.props.id,
170
- {type: 'CHANGE', path: 'value', newValue: value},
171
- 'frontend-form'
172
- );
173
- this.doFor(`list@${this.props.id}`, 'set-filter-value', {
174
- filterValue: value,
175
- });
176
- }
177
-
178
- resetFilter() {
179
- this.filter('');
180
- }
181
-
182
- renderParams() {
183
- const listId = `list@${this.props.id}`;
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
- throttleDelay={600}
197
- onChange={this.filter}
198
- autoFocus={true}
199
- selectAllOnFocus={true}
200
- shape={this.props.hasFilter ? 'left-rounded' : 'rounded'}
201
- horizontalSpacing={this.props.hasFilter ? 'overlap' : null}
202
- />
203
- {this.props.hasFilter ? (
204
- <Button
205
- shape="right-rounded"
206
- glyph="solid/times"
207
- tooltip={T('Tout montrer')}
208
- onClick={this.resetFilter}
209
- />
210
- ) : null}
211
- </Container>
212
- </FrontendForm>
213
- </div>
214
-
215
- <div className={this.styles.classNames.scrollablePane}>
216
- <StatusFilters id={listId} type={this.props.type} />
217
- <div className={this.styles.classNames.separator} />
218
- <Count id={listId} />
219
- </div>
220
-
221
- <div className={this.styles.classNames.sajex} />
222
-
223
- <Container kind="actions">
224
- <NewEntityButton id={`hinter@${this.props.type}@${this.props.id}`} />
225
- </Container>
226
- </div>
227
- );
228
- }
229
-
230
- renderList() {
231
- return (
232
- <EntityView
233
- id={this.props.id}
234
- hinter={this.props.hinter}
235
- type={this.props.type}
236
- />
237
- );
238
- }
239
-
240
- renderButton() {
241
- const style = this.showParams
242
- ? this.styles.classNames.button
243
- : this.styles.classNames.buttonWithoutParams;
244
-
245
- return (
246
- <div className={style}>
247
- <Button
248
- kind="subaction"
249
- width="20px"
250
- height="20px"
251
- glyph={this.showParams ? 'solid/chevron-left' : 'solid/chevron-right'}
252
- glyphSize="80%"
253
- onClick={this.onToggleParams}
254
- />
255
- </div>
256
- );
257
- }
258
-
259
- render() {
260
- if (!this.props.id || !this.props.type) {
261
- return null;
262
- }
263
-
264
- const style = this.showParams
265
- ? this.styles.classNames.search
266
- : this.styles.classNames.searchWithoutParams;
267
-
268
- return (
269
- <div className={style}>
270
- {this.renderParams()}
271
- {this.renderList()}
272
- {this.renderButton()}
273
- </div>
274
- );
275
- }
276
- }
277
-
278
- /******************************************************************************/
279
-
280
- const ConnectedSearch = Widget.connect((state, prop) => {
281
- const hasFilter = !!state.get(`widgets.${prop.id}.value`, null);
282
- return {hasFilter};
283
- })(Search);
284
-
285
- 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
+ this.doFor(this.props.id, 'create-new', {
43
+ value: '',
44
+ });
45
+ }
46
+
47
+ render() {
48
+ const {id, onNew, title, type} = this.props;
49
+ if (!id) {
50
+ return null;
51
+ }
52
+ return (
53
+ <>
54
+ {onNew ? (
55
+ <CommandButton
56
+ command={`${type}-workitem.edit`}
57
+ kind="action"
58
+ place="1/1"
59
+ glyph="solid/plus"
60
+ text={title}
61
+ grow="1"
62
+ onClick={this.onNew}
63
+ />
64
+ ) : null}
65
+ </>
66
+ );
67
+ }
68
+ }
69
+ const NewEntityButton = Widget.Wired(HinterNewButton);
70
+
71
+ /******************************************************************************/
72
+
73
+ class CountNC extends Widget {
74
+ render() {
75
+ const p = this.props;
76
+ return (
77
+ <Container busy={p.count === undefined}>
78
+ <Label
79
+ text={T(
80
+ `{count, plural,
81
+ =0 {Aucun élément}
82
+ one {1/{initialCount} élément}
83
+ other {{count}/{initialCount} éléments}
84
+ }`,
85
+ null,
86
+ {count: p.count, initialCount: p.initialCount}
87
+ )}
88
+ />
89
+ </Container>
90
+ );
91
+ }
92
+ }
93
+ const Count = Widget.connect((state, props) => {
94
+ return {
95
+ count: state.get(`backend.${props.id}.count`, 0),
96
+ initialCount: state.get(`backend.${props.id}.initialCount`, 0),
97
+ };
98
+ })(CountNC);
99
+
100
+ /******************************************************************************/
101
+
102
+ class Search extends Widget {
103
+ constructor() {
104
+ super(...arguments);
105
+
106
+ this.state = {
107
+ showParams: true,
108
+ };
109
+
110
+ this.onToggleParams = this.onToggleParams.bind(this);
111
+ this._entityIds = [];
112
+ this._drillDownInternal = this._drillDownInternal.bind(this);
113
+ this._drillDown = throttle(this._drillDownInternal, 100).bind(this);
114
+ this.drillDown = this.drillDown.bind(this);
115
+ this.filter = this.filter.bind(this);
116
+ this.resetFilter = this.resetFilter.bind(this);
117
+ }
118
+
119
+ static get wiring() {
120
+ return {
121
+ id: 'id',
122
+ name: 'name',
123
+ title: 'title',
124
+ type: 'type',
125
+ hinter: 'hinter',
126
+ hinterId: 'hinterId',
127
+ hintText: 'hintText',
128
+ };
129
+ }
130
+
131
+ //#region get/set
132
+ get showParams() {
133
+ return this.state.showParams;
134
+ }
135
+ set showParams(value) {
136
+ this.setState({
137
+ showParams: value,
138
+ });
139
+ }
140
+ //#endregion
141
+
142
+ onToggleParams() {
143
+ this.showParams = !this.showParams;
144
+ }
145
+
146
+ _drillDownInternal() {
147
+ const name = this.props.name || `${this.props.type}-search`;
148
+ this.doAs(name, 'drill-down', {
149
+ entityIds: this._entityIds,
150
+ view: ['isReady', {meta: {summaries: ['description']}}],
151
+ });
152
+ this._entityIds = [];
153
+ }
154
+
155
+ drillDown(entityId) {
156
+ this._entityIds.push(entityId);
157
+ this._drillDown();
158
+ }
159
+
160
+ filter(value) {
161
+ this.dispatchTo(
162
+ this.props.id,
163
+ {type: 'select-row', rowId: null, entityId: null},
164
+ 'entity-view'
165
+ );
166
+ this.dispatchTo(
167
+ this.props.id,
168
+ {type: 'CHANGE', path: 'value', newValue: value},
169
+ 'frontend-form'
170
+ );
171
+ this.doFor(`list@${this.props.id}`, 'set-filter-value', {
172
+ filterValue: value,
173
+ });
174
+ }
175
+
176
+ resetFilter() {
177
+ this.filter('');
178
+ }
179
+
180
+ renderParams() {
181
+ const listId = `list@${this.props.id}`;
182
+ return (
183
+ <div className={this.styles.classNames.params}>
184
+ <div className={this.styles.classNames.pane}>
185
+ <Label text={this.props.title} grow="1" kind="title" />
186
+ <div className={this.styles.classNames.separator} />
187
+ <FrontendForm widgetId={this.props.id}>
188
+ <Container kind="row">
189
+ <TextField
190
+ grow="1"
191
+ hintText={this.props.hintText || T('Chercher')}
192
+ value={C('.value')}
193
+ changeMode="throttled"
194
+ throttleDelay={600}
195
+ onChange={this.filter}
196
+ autoFocus={true}
197
+ selectAllOnFocus={true}
198
+ shape={this.props.hasFilter ? 'left-rounded' : 'rounded'}
199
+ horizontalSpacing={this.props.hasFilter ? 'overlap' : null}
200
+ />
201
+ {this.props.hasFilter ? (
202
+ <Button
203
+ shape="right-rounded"
204
+ glyph="solid/times"
205
+ tooltip={T('Tout montrer')}
206
+ onClick={this.resetFilter}
207
+ />
208
+ ) : null}
209
+ </Container>
210
+ </FrontendForm>
211
+ </div>
212
+
213
+ <div className={this.styles.classNames.scrollablePane}>
214
+ <StatusFilters id={listId} type={this.props.type} />
215
+ <div className={this.styles.classNames.separator} />
216
+ <Count id={listId} />
217
+ </div>
218
+
219
+ <div className={this.styles.classNames.sajex} />
220
+
221
+ <Container kind="actions">
222
+ <NewEntityButton id={`hinter@${this.props.type}@${this.props.id}`} />
223
+ </Container>
224
+ </div>
225
+ );
226
+ }
227
+
228
+ renderList() {
229
+ return (
230
+ <EntityView
231
+ id={this.props.id}
232
+ hinter={this.props.hinter}
233
+ type={this.props.type}
234
+ />
235
+ );
236
+ }
237
+
238
+ renderButton() {
239
+ const style = this.showParams
240
+ ? this.styles.classNames.button
241
+ : this.styles.classNames.buttonWithoutParams;
242
+
243
+ return (
244
+ <div className={style}>
245
+ <Button
246
+ kind="subaction"
247
+ width="20px"
248
+ height="20px"
249
+ glyph={this.showParams ? 'solid/chevron-left' : 'solid/chevron-right'}
250
+ glyphSize="80%"
251
+ onClick={this.onToggleParams}
252
+ />
253
+ </div>
254
+ );
255
+ }
256
+
257
+ render() {
258
+ if (!this.props.id || !this.props.type) {
259
+ return null;
260
+ }
261
+
262
+ const style = this.showParams
263
+ ? this.styles.classNames.search
264
+ : this.styles.classNames.searchWithoutParams;
265
+
266
+ return (
267
+ <div className={style}>
268
+ {this.renderParams()}
269
+ {this.renderList()}
270
+ {this.renderButton()}
271
+ </div>
272
+ );
273
+ }
274
+ }
275
+
276
+ /******************************************************************************/
277
+
278
+ const ConnectedSearch = Widget.connect((state, prop) => {
279
+ const hasFilter = !!state.get(`widgets.${prop.id}.value`, null);
280
+ return {hasFilter};
281
+ })(Search);
282
+
283
+ export default Widget.Wired(ConnectedSearch);
@@ -1,28 +1,28 @@
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 WiredWidget = Widget.Wired(widgetImporter(workitem));
20
- return (
21
- <Container kind="views">
22
- <WiredWidget id={workitemId} />
23
- </Container>
24
- );
25
- }
26
- }
27
-
28
- 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 WiredWidget = Widget.Wired(widgetImporter(workitem));
20
+ return (
21
+ <Container kind="views">
22
+ <WiredWidget id={workitemId} />
23
+ </Container>
24
+ );
25
+ }
26
+ }
27
+
28
+ export default SimpleView;