@things-factory/reference-app 8.0.0-alpha.1 → 8.0.0-alpha.10

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.
@@ -17,7 +17,20 @@ import { PageView, store } from '@operato/shell'
17
17
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
18
18
  import { isMobileDevice } from '@operato/utils'
19
19
 
20
- const DEFAULT_TZ = Intl.DateTimeFormat().resolvedOptions().timeZone
20
+ function getSystemTimeZone() {
21
+ try {
22
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
23
+ if (!timeZone) {
24
+ throw new Error('Unable to resolve timeZone')
25
+ }
26
+ return timeZone
27
+ } catch (e) {
28
+ console.warn('Failed to get system timeZone, falling back to UTC.', e)
29
+ return 'UTC'
30
+ }
31
+ }
32
+
33
+ const DEFAULT_TZ = getSystemTimeZone()
21
34
  const TIMEZONE_OPTIONS = ['', DEFAULT_TZ, ...moment.tz.names().filter(tz => tz !== DEFAULT_TZ)]
22
35
 
23
36
  const ENTRY_TYPES = [
@@ -251,11 +264,16 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
251
264
  title: 'data entry mockup form',
252
265
  handlers: {
253
266
  click: (columns, data, column, record, rowIndex) => {
254
- openPopup(html` <data-entry-mockup-form .dataSet=${record} style="background-color: white;"></data-entry-mockup-form> `, {
255
- backdrop: true,
256
- size: 'large',
257
- title: i18next.t('title.data-entry-form')
258
- })
267
+ openPopup(
268
+ html`
269
+ <data-entry-mockup-form .dataSet=${record} style="background-color: white;"></data-entry-mockup-form>
270
+ `,
271
+ {
272
+ backdrop: true,
273
+ size: 'large',
274
+ title: i18next.t('title.data-entry-form')
275
+ }
276
+ )
259
277
  }
260
278
  }
261
279
  },
@@ -736,7 +754,9 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
736
754
  ...this.grist._config.columns
737
755
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
738
756
  .reduce((record, column) => {
739
- record[column.imex.key] = column.imex.key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
757
+ record[column.imex.key] = column.imex.key
758
+ .split('.')
759
+ .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
740
760
  return record
741
761
  }, {})
742
762
  }