@things-factory/operato-fleet 9.1.19 → 10.0.0-beta.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 (56) hide show
  1. package/Dockerfile +1 -1
  2. package/_index.html +1 -2
  3. package/client/commons/{common-map.js → common-map.ts} +29 -4
  4. package/client/commons/{fleet-search.js → fleet-search.ts} +30 -5
  5. package/client/pages/admin/{admin.js → admin.ts} +1 -2
  6. package/client/pages/client/{client.js → client.ts} +1 -2
  7. package/client/pages/device/{device.js → device.ts} +1 -2
  8. package/client/pages/geofence/{geofence.js → geofence.ts} +1 -2
  9. package/client/pages/monitoring/{monitoring.js → monitoring.ts} +33 -8
  10. package/client/pages/report/{report-based-on-track.js → report-based-on-track.ts} +17 -5
  11. package/client/pages/report/{report-delivery.js → report-delivery.ts} +1 -2
  12. package/client/pages/report/{report-device.js → report-device.ts} +1 -2
  13. package/client/pages/report/{report.js → report.ts} +30 -6
  14. package/client/viewparts/{infowindow-setting-let.js → infowindow-setting-let.ts} +30 -6
  15. package/client/viewparts/{menu-tools.js → menu-tools.ts} +30 -6
  16. package/dist-server/tsconfig.tsbuildinfo +1 -1
  17. package/package.json +61 -61
  18. package/views/auth-page.html +1 -1
  19. package/views/public/home.html +1 -1
  20. /package/client/actions/{fleets.js → fleets.ts} +0 -0
  21. /package/client/{bootstrap.js → bootstrap.ts} +0 -0
  22. /package/client/commons/{board-wrapper.js → board-wrapper.ts} +0 -0
  23. /package/client/commons/{fetch-client.js → fetch-client.ts} +0 -0
  24. /package/client/commons/{fetch-device.js → fetch-device.ts} +0 -0
  25. /package/client/commons/{fetch-fleets.js → fetch-fleets.ts} +0 -0
  26. /package/client/commons/{fetch-geofence.js → fetch-geofence.ts} +0 -0
  27. /package/client/commons/{fetch-track.js → fetch-track.ts} +0 -0
  28. /package/client/commons/{fleet-item.js → fleet-item.ts} +0 -0
  29. /package/client/commons/{geofence-item.js → geofence-item.ts} +0 -0
  30. /package/client/commons/{geofence-search.js → geofence-search.ts} +0 -0
  31. /package/client/commons/{google-map-loader.js → google-map-loader.ts} +0 -0
  32. /package/client/commons/{iso-6709.js → iso-6709.ts} +0 -0
  33. /package/client/commons/{map-builder.js → map-builder.ts} +0 -0
  34. /package/client/commons/{marker-info-content.js → marker-info-content.ts} +0 -0
  35. /package/client/commons/{script-loader.js → script-loader.ts} +0 -0
  36. /package/client/commons/{track-popup.js → track-popup.ts} +0 -0
  37. /package/client/{const.js → const.ts} +0 -0
  38. /package/client/icons/{event-marker-icons.js → event-marker-icons.ts} +0 -0
  39. /package/client/icons/{fleet-marker-icons.js → fleet-marker-icons.ts} +0 -0
  40. /package/client/icons/{location-marker-icons.js → location-marker-icons.ts} +0 -0
  41. /package/client/icons/{marker-icons.js → marker-icons.ts} +0 -0
  42. /package/client/icons/{menu-icons.js → menu-icons.ts} +0 -0
  43. /package/client/icons/{warehouse-marker-icons.js → warehouse-marker-icons.ts} +0 -0
  44. /package/client/{index.js → index.ts} +0 -0
  45. /package/client/pages/{fleet-page-style.js → fleet-page-style.ts} +0 -0
  46. /package/client/pages/monitoring/{map-mode.js → map-mode.ts} +0 -0
  47. /package/client/pages/report/{report-air-pressure.js → report-air-pressure.ts} +0 -0
  48. /package/client/pages/report/{report-breakdown.js → report-breakdown.ts} +0 -0
  49. /package/client/pages/report/{report-humidity.js → report-humidity.ts} +0 -0
  50. /package/client/pages/report/{report-illuminance.js → report-illuminance.ts} +0 -0
  51. /package/client/pages/report/{report-shock.js → report-shock.ts} +0 -0
  52. /package/client/pages/report/{report-style.js → report-style.ts} +0 -0
  53. /package/client/pages/report/{report-temperature.js → report-temperature.ts} +0 -0
  54. /package/client/reducers/{fleets.js → fleets.ts} +0 -0
  55. /package/client/{route.js → route.ts} +0 -0
  56. /package/client/viewparts/{user-circle.js → user-circle.ts} +0 -0
package/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # Use an official ubuntu image
2
- FROM hatiolab/operato-env:latest
2
+ FROM hatiolab/operato-env:22.22
3
3
 
4
4
  # Set the working directory to /app
5
5
  WORKDIR /app
package/_index.html CHANGED
@@ -62,8 +62,7 @@
62
62
  <noscript> Please enable JavaScript to view this website. </noscript>
63
63
  <!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
64
64
  <script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
65
- <script src="/node_modules/web-animations-js/web-animations-next.min.js"></script>
66
- <script src="/node_modules/@hatiolab/things-scene/things-scene-min.js"></script>
65
+
67
66
  <!-- Built with love using PWA Starter Kit -->
68
67
  </body>
69
68
  </html>
@@ -1,11 +1,10 @@
1
1
  import { LitElement, html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import { store } from '@operato/shell'
4
3
  import { ScrollbarStyles } from '@operato/styles'
5
4
 
6
5
  import GoogleMapLoader from './google-map-loader'
7
6
 
8
- export class CommonMap extends connect(store)(LitElement) {
7
+ export class CommonMap extends LitElement {
9
8
  static get styles() {
10
9
  return [
11
10
  ScrollbarStyles,
@@ -48,8 +47,34 @@ export class CommonMap extends connect(store)(LitElement) {
48
47
  }
49
48
  }
50
49
 
51
- stateChanged(state) {
52
- this.defaultCenter = state.fleets?.location
50
+ private _unsubscribe?: () => void
51
+
52
+
53
+ connectedCallback() {
54
+
55
+ super.connectedCallback()
56
+
57
+ this._applyState()
58
+
59
+ this._unsubscribe = store.subscribe(() => this._applyState())
60
+
61
+ }
62
+
63
+
64
+ disconnectedCallback() {
65
+
66
+ super.disconnectedCallback()
67
+
68
+ this._unsubscribe?.()
69
+
70
+ }
71
+
72
+
73
+ private _applyState() {
74
+
75
+ const __state__ = store.getState() as any
76
+ this.defaultCenter = __state__.fleets?.location
77
+
53
78
  }
54
79
 
55
80
  get anchor() {
@@ -1,7 +1,6 @@
1
1
  import '@operato/i18n/ox-i18n.js'
2
2
 
3
3
  import { LitElement, html, css } from 'lit'
4
- import { connect } from 'pwa-helpers/connect-mixin.js'
5
4
  import { store } from '@operato/shell'
6
5
  import { ScrollbarStyles } from '@operato/styles'
7
6
  import { localize, i18next } from '@operato/i18n'
@@ -21,7 +20,7 @@ function scrollIntoViewIfNeeded(container, target) {
21
20
  }
22
21
  }
23
22
 
24
- export class FleetSearch extends connect(store)(localize(i18next)(LitElement)) {
23
+ export class FleetSearch extends localize(i18next)(LitElement) {
25
24
  static get styles() {
26
25
  return [
27
26
  ScrollbarStyles,
@@ -75,9 +74,35 @@ export class FleetSearch extends connect(store)(localize(i18next)(LitElement)) {
75
74
  }
76
75
  }
77
76
 
78
- stateChanged(state) {
79
- this.fleets = state.fleets?.fleets || []
80
- this.focusedFleetId = state.fleets?.focusedFleetId
77
+ private _unsubscribe?: () => void
78
+
79
+
80
+ connectedCallback() {
81
+
82
+ super.connectedCallback()
83
+
84
+ this._applyState()
85
+
86
+ this._unsubscribe = store.subscribe(() => this._applyState())
87
+
88
+ }
89
+
90
+
91
+ disconnectedCallback() {
92
+
93
+ super.disconnectedCallback()
94
+
95
+ this._unsubscribe?.()
96
+
97
+ }
98
+
99
+
100
+ private _applyState() {
101
+
102
+ const __state__ = store.getState() as any
103
+ this.fleets = __state__.fleets?.fleets || []
104
+ this.focusedFleetId = __state__.fleets?.focusedFleetId
105
+
81
106
  }
82
107
 
83
108
  async updated(changes) {
@@ -1,12 +1,11 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import { store, PageView } from '@operato/shell'
5
4
  import { i18next, localize } from '@operato/i18n'
6
5
  import { ScrollbarStyles } from '@operato/styles'
7
6
  import { FMSPageStyles } from '../fleet-page-style'
8
7
 
9
- class FMSAdmin extends connect(store)(localize(i18next)(PageView)) {
8
+ class FMSAdmin extends localize(i18next)(PageView) {
10
9
  static get properties() {
11
10
  return {}
12
11
  }
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
  import { store, PageView } from '@operato/shell'
@@ -11,7 +10,7 @@ import { FMSPageStyles } from '../fleet-page-style'
11
10
 
12
11
  import { fetchClients } from '../../commons/fetch-client'
13
12
 
14
- class FMSClient extends connect(store)(localize(i18next)(PageView)) {
13
+ class FMSClient extends localize(i18next)(PageView) {
15
14
  static get properties() {
16
15
  return {}
17
16
  }
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
  import { store, PageView } from '@operato/shell'
@@ -11,7 +10,7 @@ import { FMSPageStyles } from '../fleet-page-style'
11
10
 
12
11
  import { fetchDevices } from '../../commons/fetch-device'
13
12
 
14
- class FMSDevice extends connect(store)(localize(i18next)(PageView)) {
13
+ class FMSDevice extends localize(i18next)(PageView) {
15
14
  static get properties() {
16
15
  return {}
17
16
  }
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
  import { store, PageView } from '@operato/shell'
@@ -11,7 +10,7 @@ import { FMSPageStyles } from '../fleet-page-style'
11
10
  import '../../commons/geofence-search'
12
11
  import '../../commons/common-map'
13
12
 
14
- class FMSGeoFence extends connect(store)(localize(i18next)(PageView)) {
13
+ class FMSGeoFence extends localize(i18next)(PageView) {
15
14
  static get properties() {
16
15
  return {
17
16
  map: Object,
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
 
@@ -43,7 +42,7 @@ const FOCUSED_ICON = {
43
42
  scaledSize: FOCUSED_MARKER_SIZE
44
43
  }
45
44
 
46
- class FMSMonitoring extends connect(store)(localize(i18next)(PageView)) {
45
+ class FMSMonitoring extends localize(i18next)(PageView) {
47
46
  static get properties() {
48
47
  return {
49
48
  _polylines: Array,
@@ -243,13 +242,39 @@ class FMSMonitoring extends connect(store)(localize(i18next)(PageView)) {
243
242
  }
244
243
  }
245
244
 
246
- stateChanged(state) {
247
- this.fleetBoardId = state.boardSetting[MARKER_IW_BOARD_FOR_FLEET]?.board.id
248
- this.trackBoardId = state.boardSetting[MARKER_IW_BOARD_FOR_TRACK]?.board.id
245
+ private _unsubscribe?: () => void
246
+
247
+
248
+ connectedCallback() {
249
+
250
+ super.connectedCallback()
251
+
252
+ this._applyState()
253
+
254
+ this._unsubscribe = store.subscribe(() => this._applyState())
255
+
256
+ }
257
+
258
+
259
+ disconnectedCallback() {
260
+
261
+ super.disconnectedCallback()
262
+
263
+ this._unsubscribe?.()
264
+
265
+ }
266
+
267
+
268
+ private _applyState() {
269
+
270
+ const __state__ = store.getState() as any
271
+ this.fleetBoardId = __state__.boardSetting[MARKER_IW_BOARD_FOR_FLEET]?.board.id
272
+ this.trackBoardId = __state__.boardSetting[MARKER_IW_BOARD_FOR_TRACK]?.board.id
273
+
274
+ this.fleets = __state__.fleets?.fleets || []
275
+ this.fleetId = __state__.fleets?.focusedFleetId
276
+ this.search = __state__.fleets?.search
249
277
 
250
- this.fleets = state.fleets?.fleets || []
251
- this.fleetId = state.fleets?.focusedFleetId
252
- this.search = state.fleets?.search
253
278
  }
254
279
 
255
280
  get infoWindow() {
@@ -5,8 +5,6 @@ import '../../commons/track-popup'
5
5
  import '../../commons/marker-info-content'
6
6
 
7
7
  import Chance from 'chance'
8
- import { connect } from 'pwa-helpers/connect-mixin.js'
9
-
10
8
  import { openPopup } from '@operato/layout'
11
9
  import { i18next, localize } from '@operato/i18n'
12
10
  import { PageView, store } from '@operato/shell'
@@ -18,9 +16,23 @@ import { EVENT_ICONS } from '../../icons/event-marker-icons'
18
16
 
19
17
  const EVENT_MARKER_SIZE = { width: 32, height: 32 }
20
18
 
21
- export class ReportBasedOnTrack extends connect(store)(localize(i18next)(PageView)) {
22
- stateChanged(state) {
23
- this.trackBoardId = (state.boardSetting[MARKER_IW_BOARD_FOR_TRACK] || { board: {} }).board.id
19
+ export class ReportBasedOnTrack extends localize(i18next)(PageView) {
20
+ private _unsubscribe?: () => void
21
+
22
+ connectedCallback() {
23
+ super.connectedCallback()
24
+ this._applyState()
25
+ this._unsubscribe = store.subscribe(() => this._applyState())
26
+ }
27
+
28
+ disconnectedCallback() {
29
+ super.disconnectedCallback()
30
+ this._unsubscribe?.()
31
+ }
32
+
33
+ private _applyState() {
34
+ const __state__ = store.getState() as any
35
+ this.trackBoardId = (__state__.boardSetting[MARKER_IW_BOARD_FOR_TRACK] || { board: {} }).board.id
24
36
  }
25
37
 
26
38
  showTrack() {
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
  import { store, PageView } from '@operato/shell'
@@ -10,7 +9,7 @@ import { ScrollbarStyles } from '@operato/styles'
10
9
 
11
10
  import { ReportStyles } from './report-style'
12
11
 
13
- class ReportDelivery extends connect(store)(localize(i18next)(PageView)) {
12
+ class ReportDelivery extends localize(i18next)(PageView) {
14
13
  static get properties() {
15
14
  return {}
16
15
  }
@@ -1,5 +1,4 @@
1
1
  import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
2
  import '@material/mwc-button'
4
3
  import '@material/mwc-textfield'
5
4
  import { store, PageView } from '@operato/shell'
@@ -10,7 +9,7 @@ import { ScrollbarStyles } from '@operato/styles'
10
9
 
11
10
  import { ReportStyles } from './report-style'
12
11
 
13
- class ReportDevice extends connect(store)(localize(i18next)(PageView)) {
12
+ class ReportDevice extends localize(i18next)(PageView) {
14
13
  static get properties() {
15
14
  return {}
16
15
  }
@@ -3,8 +3,6 @@ import '@operato/oops'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html } from 'lit'
6
- import { connect } from 'pwa-helpers/connect-mixin.js'
7
-
8
6
  import { provider } from '@things-factory/board-ui'
9
7
  import { i18next, localize } from '@operato/i18n'
10
8
  import { client, PageView, store } from '@things-factory/shell'
@@ -15,7 +13,7 @@ import { FMSPageStyles } from '../fleet-page-style'
15
13
  const NOOP = () => {}
16
14
  const DASHBOARD = 'dashboard'
17
15
 
18
- export class FMSReport extends connect(store)(localize(i18next)(PageView)) {
16
+ export class FMSReport extends localize(i18next)(PageView) {
19
17
  static get properties() {
20
18
  return {
21
19
  _board: Object,
@@ -120,10 +118,36 @@ export class FMSReport extends connect(store)(localize(i18next)(PageView)) {
120
118
  }
121
119
  }
122
120
 
123
- stateChanged(state) {
124
- this._baseUrl = state.app.baseUrl
121
+ private _unsubscribe?: () => void
122
+
123
+
124
+ connectedCallback() {
125
+
126
+ super.connectedCallback()
127
+
128
+ this._applyState()
129
+
130
+ this._unsubscribe = store.subscribe(() => this._applyState())
131
+
132
+ }
133
+
134
+
135
+ disconnectedCallback() {
136
+
137
+ super.disconnectedCallback()
138
+
139
+ this._unsubscribe?.()
140
+
141
+ }
142
+
143
+
144
+ private _applyState() {
145
+
146
+ const __state__ = store.getState() as any
147
+ this._baseUrl = __state__.app.baseUrl
148
+
149
+ this._boardId = (__state__.boardSetting[DASHBOARD] || { board: {} }).board.id
125
150
 
126
- this._boardId = (state.boardSetting[DASHBOARD] || { board: {} }).board.id
127
151
  }
128
152
 
129
153
  async refresh() {
@@ -4,8 +4,6 @@ import '@operato/i18n/ox-i18n.js'
4
4
 
5
5
  import gql from 'graphql-tag'
6
6
  import { css, html, LitElement } from 'lit'
7
- import { connect } from 'pwa-helpers'
8
-
9
7
  import { openPopup } from '@operato/layout'
10
8
  import { fetchBoardSettings, UPDATE_BOARD_SETTINGS } from '@things-factory/dashboard'
11
9
  import { i18next, localize } from '@operato/i18n'
@@ -19,7 +17,7 @@ import {
19
17
  MARKER_IW_BOARD_FOR_TRACK_DESCRIPTION
20
18
  } from '../const'
21
19
 
22
- export class InfowindowSettingLet extends connect(store)(localize(i18next)(LitElement)) {
20
+ export class InfowindowSettingLet extends localize(i18next)(LitElement) {
23
21
  static get styles() {
24
22
  return [
25
23
  css`
@@ -161,12 +159,38 @@ export class InfowindowSettingLet extends connect(store)(localize(i18next)(LitEl
161
159
  `
162
160
  }
163
161
 
164
- stateChanged(state) {
165
- var fleetBoard = state.boardSetting[MARKER_IW_BOARD_FOR_FLEET]
166
- var trackBoard = state.boardSetting[MARKER_IW_BOARD_FOR_TRACK]
162
+ private _unsubscribe?: () => void
163
+
164
+
165
+ connectedCallback() {
166
+
167
+ super.connectedCallback()
168
+
169
+ this._applyState()
170
+
171
+ this._unsubscribe = store.subscribe(() => this._applyState())
172
+
173
+ }
174
+
175
+
176
+ disconnectedCallback() {
177
+
178
+ super.disconnectedCallback()
179
+
180
+ this._unsubscribe?.()
181
+
182
+ }
183
+
184
+
185
+ private _applyState() {
186
+
187
+ const __state__ = store.getState() as any
188
+ var fleetBoard = __state__.boardSetting[MARKER_IW_BOARD_FOR_FLEET]
189
+ var trackBoard = __state__.boardSetting[MARKER_IW_BOARD_FOR_TRACK]
167
190
 
168
191
  this.fleetBoard = (fleetBoard ? fleetBoard.board : {}) || {}
169
192
  this.trackBoard = (trackBoard ? trackBoard.board : {}) || {}
193
+
170
194
  }
171
195
 
172
196
  onClickBoardSelector(name, description) {
@@ -1,6 +1,4 @@
1
1
  import { css, html, LitElement } from 'lit'
2
- import { connect } from 'pwa-helpers'
3
-
4
2
  import { store } from '@operato/shell'
5
3
 
6
4
  import {
@@ -14,7 +12,7 @@ import {
14
12
  ICONS_ADMINISTRATOR
15
13
  } from '../icons/menu-icons'
16
14
 
17
- export class MenuTools extends connect(store)(LitElement) {
15
+ export class MenuTools extends LitElement {
18
16
  static get properties() {
19
17
  return {
20
18
  page: String,
@@ -192,9 +190,35 @@ export class MenuTools extends connect(store)(LitElement) {
192
190
  `
193
191
  }
194
192
 
195
- stateChanged(state) {
196
- this.page = state.route.page
197
- this.width = state.layout.width
193
+ private _unsubscribe?: () => void
194
+
195
+
196
+ connectedCallback() {
197
+
198
+ super.connectedCallback()
199
+
200
+ this._applyState()
201
+
202
+ this._unsubscribe = store.subscribe(() => this._applyState())
203
+
204
+ }
205
+
206
+
207
+ disconnectedCallback() {
208
+
209
+ super.disconnectedCallback()
210
+
211
+ this._unsubscribe?.()
212
+
213
+ }
214
+
215
+
216
+ private _applyState() {
217
+
218
+ const __state__ = store.getState() as any
219
+ this.page = __state__.route.page
220
+ this.width = __state__.layout.width
221
+
198
222
  }
199
223
  }
200
224