lanes 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/client/lanes/Config.coffee +26 -9
  3. data/client/lanes/access/screens/user-management/UserManagement.cjsx +1 -1
  4. data/client/lanes/components/grid/EditingMixin.cjsx +8 -4
  5. data/client/lanes/components/grid/PopOverMixin.cjsx +7 -1
  6. data/client/lanes/components/modal/Modal.cjsx +11 -1
  7. data/client/lanes/components/record-finder/RecordFinder.cjsx +8 -4
  8. data/client/lanes/components/shared/DateTime.cjsx +8 -6
  9. data/client/lanes/components/shared/FieldMixin.cjsx +3 -3
  10. data/client/lanes/components/shared/Icon.cjsx +1 -1
  11. data/client/lanes/components/shared/ImageAsset.cjsx +23 -11
  12. data/client/lanes/components/shared/NetworkActivityOverlay.cjsx +2 -0
  13. data/client/lanes/extension/Base.coffee +2 -0
  14. data/client/lanes/fonts/fontawesome-webfont.woff +0 -0
  15. data/client/lanes/fonts/fontawesome-webfont.woff2 +0 -0
  16. data/client/lanes/lib/RequestAssets.coffee +30 -0
  17. data/client/lanes/lib/all.js +1 -0
  18. data/client/lanes/lib/loader.js +93 -0
  19. data/client/lanes/lib/utilFunctions.coffee +12 -0
  20. data/client/lanes/models/Asset.coffee +3 -4
  21. data/client/lanes/models/AssociationMap.coffee +17 -6
  22. data/client/lanes/models/Base.coffee +20 -13
  23. data/client/lanes/models/Collection.coffee +4 -1
  24. data/client/lanes/models/PubSub.coffee +2 -3
  25. data/client/lanes/models/SmtpSettings.coffee +7 -0
  26. data/client/lanes/models/Sync.coffee +2 -2
  27. data/client/lanes/react/Viewport.coffee +14 -10
  28. data/client/lanes/react/mixins/FieldErrors.coffee +3 -4
  29. data/client/lanes/react/mixins/ReadEditingState.coffee +1 -0
  30. data/client/lanes/remote/Bootstrap.coffee +85 -0
  31. data/client/lanes/remote/api.coffee +2 -1
  32. data/client/lanes/remote/onDocumentReady.coffee +12 -0
  33. data/client/lanes/screens/Definitions.coffee +29 -12
  34. data/client/lanes/screens/SystemSettings.cjsx +12 -3
  35. data/client/lanes/styles/fonts/_bordered-pulled.scss +9 -0
  36. data/client/lanes/styles/fonts/_core.scss +1 -2
  37. data/client/lanes/styles/fonts/_icons.scss +56 -0
  38. data/client/lanes/styles/fonts/_mixins.scss +37 -4
  39. data/client/lanes/styles/fonts/_path.scss +2 -2
  40. data/client/lanes/styles/fonts/_screen-reader.scss +5 -0
  41. data/client/lanes/styles/fonts/_variables.scss +58 -2
  42. data/client/lanes/styles/fonts/font-awesome.scss +3 -1
  43. data/client/lanes/vendor/development/calendar.js +56 -57
  44. data/client/lanes/vendor/development/commons.js +31319 -29618
  45. data/client/lanes/vendor/development/data.js +8468 -7607
  46. data/client/lanes/vendor/development/helpers.js +265 -131
  47. data/client/lanes/vendor/development/toggle.js +288 -184
  48. data/client/lanes/vendor/development/ui.js +3387 -3492
  49. data/client/lanes/vendor/development/widgets.js +972 -1229
  50. data/client/lanes/vendor/production/calendar.js +60 -61
  51. data/client/lanes/vendor/production/commons.js +30695 -29032
  52. data/client/lanes/vendor/production/data.js +8457 -7598
  53. data/client/lanes/vendor/production/toggle.js +288 -184
  54. data/client/lanes/vendor/production/ui.js +3264 -3373
  55. data/client/lanes/vendor/production/widgets.js +972 -1229
  56. data/client/lanes/vendor/standalone/index.js +21106 -18761
  57. data/client/lanes/vendor/styles/toggle.scss +4 -3
  58. data/client/lanes/workspace/ScreenView.cjsx +2 -2
  59. data/client/lanes/workspace/styles/header.scss +4 -0
  60. data/config/routes.rb +0 -2
  61. data/db/migrate/01_create_system_settings.rb +1 -1
  62. data/db/migrate/02_create_assets.rb +1 -1
  63. data/lanes.gemspec +1 -0
  64. data/lib/lanes.rb +1 -0
  65. data/lib/lanes/access/track_modifications.rb +4 -2
  66. data/lib/lanes/api.rb +1 -0
  67. data/lib/lanes/api/cable.rb +11 -3
  68. data/lib/lanes/api/controller_base.rb +23 -19
  69. data/lib/lanes/api/default_routes.rb +9 -1
  70. data/lib/lanes/api/generic_controller.rb +1 -1
  71. data/lib/lanes/api/handlers/asset.rb +2 -3
  72. data/lib/lanes/api/helper_methods.rb +5 -11
  73. data/lib/lanes/api/pub_sub.rb +13 -7
  74. data/lib/lanes/api/request_wrapper.rb +1 -1
  75. data/lib/lanes/api/routing.rb +10 -7
  76. data/lib/lanes/api/to_json.rb +7 -0
  77. data/lib/lanes/asset.rb +4 -1
  78. data/lib/lanes/concerns/set_attribute_data.rb +2 -1
  79. data/lib/lanes/extension.rb +3 -1
  80. data/lib/lanes/mailer.rb +40 -0
  81. data/lib/lanes/rake_tasks.rb +4 -0
  82. data/lib/lanes/spec_helper.rb +11 -3
  83. data/lib/lanes/system_settings.rb +22 -9
  84. data/lib/lanes/version.rb +1 -1
  85. data/lib/lanes/workspace/extension.rb +5 -0
  86. data/npm-build/package.json +2 -2
  87. data/npm-build/react-toggle.js +1 -1
  88. data/npm-build/standalone.js +3 -0
  89. data/spec/command-reference-files/initial/Gemfile +1 -1
  90. data/spec/command-reference-files/initial/client/appy-app/Extension.coffee +2 -1
  91. data/spec/command-reference-files/model/db/migrate/20150218032025_create_test_tests.rb +1 -1
  92. data/spec/command-reference-files/screen/client/appy-app/Extension.coffee +2 -1
  93. data/spec/fixtures/system_settings.yml +8 -1
  94. data/spec/server/mailer_spec.rb +33 -0
  95. data/spec/server/system_settings_spec.rb +16 -0
  96. data/templates/client/Extension.coffee +2 -1
  97. data/templates/config/database.yml +1 -1
  98. data/templates/db/create_table_migration.rb +1 -1
  99. metadata +27 -6
  100. data/client/fonts/fontawesome-webfont.woff +0 -0
  101. data/client/fonts/fontawesome-webfont.woff2 +0 -0
  102. data/client/lanes/lib/loader.coffee +0 -100
  103. data/client/lanes/workspace/Modal.cjsx +0 -47
@@ -1,100 +0,0 @@
1
- # inspiration from https://github.com/ramitos/lazyload/blob/master/src/lazyload.js
2
- #
3
- GECKO = /Gecko\//.test(navigator.userAgent)
4
-
5
- class Lanes.lib.AssetLoader
6
-
7
- constructor: (urls, cb) ->
8
- finished = 0
9
- completed = {}
10
- onComplete = (url, success, error = false) ->
11
- finished += 1
12
- completed[url] = { success: success == true, error: error }
13
- cb(completed) if finished == urls.length
14
-
15
- this.head = document.querySelector('head')
16
- this.body = document.body
17
-
18
- for baseUrl in urls
19
- url = "#{baseUrl}?#{parseInt(Math.random() * 100000)}"
20
- if /.css($|\?)/.test(url)
21
- this.loadCSS(url, onComplete)
22
- else
23
- this.loadJS(url, onComplete)
24
-
25
-
26
-
27
- loadCSS: (url, fn) ->
28
- getStylesheet = ->
29
- Array::filter.call(document.styleSheets, (stylesheet) ->
30
- stylesheet.ownerNode is node
31
- ).shift()
32
- poll = ->
33
- return if called
34
- stylesheet = getStylesheet()
35
- return setTimeout(poll, 250) if not stylesheet or not stylesheet.cssRules
36
- return setTimeout(poll, 250) if not stylesheet or not stylesheet.rules or not stylesheet.rules.length
37
- called = true
38
- fn(url, true)
39
- exists = Array::some.call(document.styleSheets, (stylesheet) ->
40
- stylesheet.href is url
41
- )
42
- return fn(url, true) if exists
43
- called = false
44
- tag = "link" #if GECKO then "style" else "link"
45
- node = _.el( tag,
46
- type: "text/css"
47
- href: url
48
- media: "screen"
49
- rel: "stylesheet"
50
- )
51
-
52
- onloaded = (success, err) ->
53
- return if called
54
- called = true
55
- fn(url, success, err)
56
- node.onload = -> onloaded(true, false)
57
- node.onerror = (err) -> onloaded(false, err)
58
- node.onreadystatechange = ->
59
- return if not (/loaded|complete/.test(node.readyState)) or called
60
- called = true
61
- fn(url, true)
62
- @head.appendChild node
63
- # GECKO cannot query the node immediatly after it's created
64
- if GECKO then _.delay(poll, 250) else poll()
65
-
66
-
67
-
68
- loadJS: (url, fn) ->
69
- called = false
70
- node = _.el("script",
71
- type: "text/javascript"
72
- src: url
73
- charset: "utf-8"
74
- async: false
75
- )
76
- onloaded = (success, err) ->
77
- return if called
78
- called = true
79
- fn(url, success, err)
80
- node.onload = -> onloaded(true, false)
81
- node.onerror = (err) -> onloaded(false, err)
82
- node.onreadystatechange = ->
83
- return if not (/loaded|complete/.test(node.readyState)) or called
84
- called = true
85
- fn(url, true)
86
- this.body.appendChild(node)
87
-
88
-
89
- Lanes.lib.RequestAssets = (urls...) ->
90
- urls = urls[0] if urls.length == 1 && _.isArray(urls[0])
91
- new _.Promise( (resolve, reject) ->
92
- new Lanes.lib.AssetLoader(urls, (completed) ->
93
- failures = _.pick(completed, (status, url) -> !status.success )
94
- if _.isEmpty(failures)
95
- resolve(completed)
96
- else
97
- Lanes.warn( _.keys(failures).join(',') + " failed to load" )
98
- reject( failures )
99
- )
100
- )
@@ -1,47 +0,0 @@
1
- # This is the "real" dialog component. It's rendered to a div under document.body
2
- class Lanes.Workspace.Dialog extends Lanes.React.Component
3
-
4
- propTypes:
5
- title: React.PropTypes.string.isRequired
6
- onOk: React.PropTypes.func.isRequired
7
- onCancel: React.PropTypes.func.isRequired
8
- body: React.PropTypes.element.isRequired
9
- show: React.PropTypes.bool
10
- buttons: React.PropTypes.object
11
- className: React.PropTypes.string
12
-
13
- getDefaultProps: ->
14
- buttons: {'Cancel': 'default', 'OK': 'primary'}
15
-
16
- getInitialState: ->
17
- show: true
18
-
19
- componentWillReceiveProps: (nextProps) ->
20
- @setState(show: nextProps.show) if nextProps.show?
21
-
22
- _hide: ->
23
- @setState(show: false)
24
-
25
- hide: ->
26
- @_hide()
27
- @props.onCancel()
28
-
29
- render: ->
30
- return null unless @state.show
31
-
32
- buttons = for name, style of @props.buttons
33
- <BS.Button key={name} className={name}
34
- onClick={_.partial(@props.onButton, name)}>{name}</BS.Button>
35
-
36
- classes = _.classnames('layout-dialog', @props.className)
37
-
38
- <BS.Modal.Dialog className={classes}>
39
- <BS.Modal.Header>
40
- <BS.Modal.Title>{@props.title}</BS.Modal.Title>
41
- </BS.Modal.Header>
42
-
43
- <BS.Modal.Body>{@props.body}</BS.Modal.Body>
44
-
45
- <BS.Modal.Footer>{@buttons}</BS.Modal.Footer>
46
-
47
- </BS.Modal.Dialog>