lanes 0.1.9.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Rakefile +1 -1
- data/client/lanes/Boot.cjsx +3 -3
- data/client/lanes/Config.coffee +38 -3
- data/client/lanes/access/Extension.coffee +1 -1
- data/client/lanes/access/LoginDialog.cjsx +57 -47
- data/client/lanes/access/Roles.coffee +2 -2
- data/client/lanes/access/User.coffee +4 -3
- data/client/lanes/access/screens/user-management/UserManagement.cjsx +12 -11
- data/client/lanes/components/calendar/Calendar.cjsx +16 -0
- data/client/lanes/components/calendar/index.js +3 -0
- data/client/lanes/components/calendar/styles.scss +3 -0
- data/client/lanes/components/grid/Body.cjsx +86 -0
- data/client/lanes/components/grid/CellStyles.coffee +20 -0
- data/client/lanes/components/grid/EditingMixin.cjsx +84 -24
- data/client/lanes/components/grid/Editor.cjsx +45 -0
- data/client/lanes/components/grid/Grid.cjsx +62 -104
- data/client/lanes/components/grid/Header.cjsx +35 -0
- data/client/lanes/components/grid/PopOverMixin.cjsx +19 -9
- data/client/lanes/components/grid/PopoverEditor.cjsx +7 -1
- data/client/lanes/components/grid/RowEditor.cjsx +1 -1
- data/client/lanes/components/grid/Selections.cjsx +39 -0
- data/client/lanes/components/grid/Toolbar.cjsx +24 -5
- data/client/lanes/components/grid/editors.scss +22 -50
- data/client/lanes/components/grid/index.js +0 -1
- data/client/lanes/components/grid/row-editor.scss +68 -0
- data/client/lanes/components/grid/styles.scss +79 -3
- data/client/lanes/components/modal/Modal.cjsx +64 -24
- data/client/lanes/components/modal/styles.scss +12 -0
- data/client/lanes/components/record-finder/Clause.cjsx +11 -4
- data/client/lanes/components/record-finder/Dialog.cjsx +23 -24
- data/client/lanes/components/record-finder/RecordFinder.cjsx +45 -14
- data/client/lanes/components/record-finder/styles.scss +9 -6
- data/client/lanes/components/select-field/SelectField.cjsx +108 -53
- data/client/lanes/components/select-field/styles.scss +19 -0
- data/client/lanes/components/shared/ControlLabel.cjsx +45 -0
- data/client/lanes/components/shared/DateTime.cjsx +48 -0
- data/client/lanes/components/shared/DisplayValue.cjsx +16 -0
- data/client/lanes/components/shared/FieldMixin.cjsx +54 -23
- data/client/lanes/components/shared/FieldSet.cjsx +12 -35
- data/client/lanes/components/shared/FieldWrapper.cjsx +13 -0
- data/client/lanes/components/shared/FormGroup.cjsx +37 -0
- data/client/lanes/components/shared/Icon.cjsx +20 -0
- data/client/lanes/components/shared/ImageSaver.cjsx +33 -0
- data/client/lanes/components/shared/Input.cjsx +19 -0
- data/client/lanes/components/shared/InputFieldMixin.cjsx +48 -0
- data/client/lanes/components/shared/JobProgress.cjsx +27 -0
- data/client/lanes/components/shared/NetworkActivityOverlay.cjsx +58 -0
- data/client/lanes/components/shared/NumberInput.cjsx +29 -0
- data/client/lanes/components/shared/ResizeSensor.cjsx +11 -0
- data/client/lanes/components/shared/ScreenWrapper.cjsx +13 -0
- data/client/lanes/components/shared/Throbber.cjsx +3 -0
- data/client/lanes/components/shared/ToggleField.cjsx +33 -0
- data/client/lanes/components/shared/Tooltip.cjsx +2 -2
- data/client/lanes/components/shared/fields.scss +75 -13
- data/client/lanes/components/shared/fieldset.scss +3 -5
- data/client/lanes/components/shared/image-saver.scss +38 -0
- data/client/lanes/components/shared/index.js +2 -0
- data/client/lanes/{styles/plugins → components/shared}/overlay.scss +17 -4
- data/client/lanes/components/shared/resize-sensor.scss +30 -0
- data/client/lanes/components/shared/styles.scss +13 -0
- data/client/lanes/components/shared/throbber.scss +53 -0
- data/client/lanes/components/toolbar/RemoteChangeSets.cjsx +21 -48
- data/client/lanes/components/toolbar/SaveButton.cjsx +24 -0
- data/client/lanes/components/toolbar/Toolbar.cjsx +24 -37
- data/client/lanes/components/toolbar/changes-notification.scss +10 -6
- data/client/lanes/components/toolbar/styles.scss +29 -9
- data/client/lanes/extension/Base.coffee +4 -5
- data/client/lanes/index.js +0 -1
- data/client/lanes/index.scss.erb +10 -1
- data/client/lanes/lib/HotReload.coffee +13 -15
- data/client/lanes/lib/MakeBaseClass.coffee +6 -1
- data/client/lanes/lib/development.coffee +2 -0
- data/client/lanes/lib/dom-polyfills.coffee +5 -0
- data/client/lanes/lib/dom.coffee +38 -9
- data/client/lanes/lib/format.coffee +11 -0
- data/client/lanes/lib/index.js.erb +2 -0
- data/client/lanes/lib/production.coffee +6 -0
- data/client/lanes/lib/utilFunctions.coffee +50 -15
- data/client/lanes/models/AssociationMap.coffee +122 -46
- data/client/lanes/models/AssociationProxy.coffee +147 -0
- data/client/lanes/models/Base.coffee +97 -85
- data/client/lanes/models/ChangeMonitor.coffee +7 -3
- data/client/lanes/models/ChangeSet.coffee +2 -2
- data/client/lanes/models/Collection.coffee +49 -6
- data/client/lanes/models/JobStatus.coffee +32 -0
- data/client/lanes/models/PubSub.coffee +7 -5
- data/client/lanes/models/Query.coffee +115 -34
- data/client/lanes/models/ServerCache.coffee +67 -52
- data/client/lanes/models/State.coffee +97 -0
- data/client/lanes/models/Sync.coffee +18 -13
- data/client/lanes/models/SystemSettings.coffee +0 -0
- data/client/lanes/models/index.js +1 -0
- data/client/lanes/models/mixins/FileSupport.coffee +60 -0
- data/client/lanes/models/mixins/HasCodeField.coffee +13 -6
- data/client/lanes/models/query/ArrayResult.coffee +188 -0
- data/client/lanes/models/query/CollectionResult.coffee +71 -0
- data/client/lanes/models/query/Result.coffee +9 -0
- data/client/lanes/react/Component.coffee +7 -3
- data/client/lanes/react/PubSub.coffee +7 -7
- data/client/lanes/react/Root.cjsx +1 -4
- data/client/lanes/react/Screen.coffee +1 -0
- data/client/lanes/react/TypeValidators.coffee +3 -3
- data/client/lanes/react/Viewport.coffee +41 -7
- data/client/lanes/react/index.js +0 -1
- data/client/lanes/react/mixins/Access.coffee +4 -1
- data/client/lanes/react/mixins/Data.coffee +40 -25
- data/client/lanes/react/mixins/FieldErrors.coffee +27 -0
- data/client/lanes/react/mixins/RelayEditingState.coffee +4 -0
- data/client/lanes/react/mixins/Screen.coffee +14 -0
- data/client/lanes/react/mixins/Viewport.coffee +9 -3
- data/client/lanes/screens/ChangeListener.coffee +3 -3
- data/client/lanes/screens/Commands.coffee +14 -7
- data/client/lanes/screens/CommonComponents.cjsx +20 -0
- data/client/lanes/screens/Definitions.coffee +64 -20
- data/client/lanes/screens/SystemSettings.cjsx +56 -0
- data/client/lanes/screens/UserPreferences.cjsx +38 -0
- data/client/lanes/screens/index.js +3 -0
- data/client/lanes/screens/styles.scss +2 -1
- data/client/lanes/styles/fonts.scss +1 -0
- data/client/lanes/styles/global.scss +2 -1
- data/client/lanes/styles/global/flexbox.scss +16 -0
- data/client/lanes/styles/global/styles.scss +1 -0
- data/client/lanes/styles/mixins/_dropdown.scss +21 -0
- data/client/lanes/styles/mixins/_flexbox.scss +394 -0
- data/client/lanes/styles/mixins/all.scss +2 -0
- data/client/lanes/styles/variables.scss +28 -0
- data/client/lanes/testing/BeforeEach.coffee +15 -14
- data/client/lanes/testing/Helpers.coffee +14 -5
- data/client/lanes/testing/TestObjects.coffee +10 -2
- data/client/lanes/testing/index.js +1 -0
- data/client/lanes/testing/jasmine-react.js +125 -0
- data/client/lanes/vendor/base.js +56049 -74987
- data/client/lanes/vendor/calendar.js +17301 -0
- data/client/lanes/vendor/calendar.scss +303 -0
- data/client/lanes/vendor/commons.js +14990 -15847
- data/client/lanes/vendor/development.js +4912 -1952
- data/client/lanes/vendor/grid.js +14246 -5551
- data/client/lanes/vendor/grid.scss +876 -335
- data/client/lanes/vendor/index.js +1 -0
- data/client/lanes/vendor/message-bus-ajax.js +44 -0
- data/client/lanes/vendor/message-bus.js +414 -0
- data/client/lanes/vendor/rw-widgets.eot +0 -0
- data/client/lanes/vendor/rw-widgets.svg +18 -0
- data/client/lanes/vendor/rw-widgets.ttf +0 -0
- data/client/lanes/vendor/rw-widgets.woff +0 -0
- data/client/lanes/vendor/toggle.js +345 -0
- data/client/lanes/vendor/toggle.scss +138 -0
- data/client/lanes/vendor/widgets.js +21245 -6839
- data/client/lanes/vendor/widgets.scss +83 -67
- data/client/lanes/workspace/Layout.cjsx +18 -8
- data/client/lanes/workspace/Modal.cjsx +47 -0
- data/client/lanes/workspace/Navbar.cjsx +16 -2
- data/client/lanes/workspace/ScreenView.cjsx +10 -3
- data/client/lanes/workspace/ScreensMenu.cjsx +23 -7
- data/client/lanes/workspace/Tabs.cjsx +55 -0
- data/client/lanes/workspace/UIState.coffee +7 -8
- data/client/lanes/workspace/index.js +2 -1
- data/client/lanes/workspace/mixin.coffee +11 -0
- data/client/lanes/workspace/mixins/UIState.coffee +8 -0
- data/client/lanes/workspace/mixins/index.js +3 -0
- data/client/lanes/workspace/styles.scss +2 -1
- data/client/lanes/workspace/styles/header.scss +23 -1
- data/client/lanes/workspace/styles/layout.scss +26 -24
- data/client/lanes/workspace/styles/screens.scss +0 -4
- data/client/lanes/workspace/styles/tabs.scss +3 -10
- data/config/routes.rb +10 -4
- data/config/screens.rb +25 -0
- data/db/migrate/01_create_system_settings.rb +10 -0
- data/docs/todo-example-part-1.md +18 -20
- data/lanes.gemspec +15 -6
- data/lib/lanes.rb +4 -2
- data/lib/lanes/access/config/routes.rb +5 -3
- data/lib/lanes/access/config/screens.rb +1 -0
- data/lib/lanes/access/db/migrate/20140615031600_create_lanes_users.rb +1 -1
- data/lib/lanes/access/user.rb +1 -1
- data/lib/lanes/api.rb +2 -1
- data/lib/lanes/api/controller.rb +32 -71
- data/lib/lanes/api/default_routes.rb +10 -8
- data/lib/lanes/api/formatted_reply.rb +53 -0
- data/lib/lanes/api/handlers/file.rb +26 -0
- data/lib/lanes/api/helper_methods.rb +29 -5
- data/lib/lanes/api/javascript_processor.rb +36 -17
- data/lib/lanes/api/pub_sub.rb +6 -9
- data/lib/lanes/api/request_wrapper.rb +1 -2
- data/lib/lanes/api/root.rb +11 -43
- data/lib/lanes/api/routing.rb +63 -0
- data/lib/lanes/api/sprockets_extension.rb +15 -7
- data/lib/lanes/api/updates.rb +1 -2
- data/lib/lanes/command.rb +0 -1
- data/lib/lanes/command/app.rb +6 -5
- data/lib/lanes/command/console.rb +1 -0
- data/lib/lanes/command/generate.rb +3 -0
- data/lib/lanes/command/generate_migration.rb +33 -0
- data/lib/lanes/command/generate_model.rb +4 -26
- data/lib/lanes/command/migration_support.rb +29 -0
- data/lib/lanes/command/update_model.rb +14 -5
- data/lib/lanes/concerns/all.rb +2 -0
- data/lib/lanes/concerns/api_path.rb +4 -2
- data/lib/lanes/concerns/association_extensions.rb +1 -1
- data/lib/lanes/concerns/attr_accessor_with_default.rb +3 -1
- data/lib/lanes/concerns/code_identifier.rb +1 -1
- data/lib/lanes/concerns/image_uploader.rb +42 -0
- data/lib/lanes/concerns/pub_sub.rb +0 -1
- data/lib/lanes/concerns/queries.rb +2 -2
- data/lib/lanes/concerns/set_attribute_data.rb +4 -13
- data/lib/lanes/concerns/sorting_expressions.rb +34 -0
- data/lib/lanes/configuration.rb +48 -9
- data/lib/lanes/extension.rb +16 -7
- data/lib/lanes/extension/definition.rb +8 -2
- data/lib/lanes/job.rb +78 -0
- data/lib/lanes/job/failure_logger.rb +33 -0
- data/lib/lanes/model.rb +4 -0
- data/lib/lanes/rake_tasks.rb +6 -0
- data/lib/lanes/redis.rb +13 -0
- data/lib/lanes/screen.rb +34 -18
- data/lib/lanes/system_settings.rb +66 -0
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes/workspace/extension.rb +1 -1
- data/npm-build/base.js +10 -3
- data/npm-build/calendar.js +6 -0
- data/npm-build/development.js +4 -5
- data/npm-build/grid.js +3 -5
- data/npm-build/package.json +40 -29
- data/npm-build/react-toggle.js +5 -0
- data/npm-build/react-widgets.js +6 -0
- data/npm-build/update-dayz +14 -0
- data/npm-build/webpack.config.js +5 -2
- data/spec/command-reference-files/initial/Gemfile +1 -1
- data/spec/command-reference-files/initial/config/routes.rb +2 -0
- data/spec/command-reference-files/initial/lib/appy-app.rb +4 -0
- data/spec/command-reference-files/initial/lib/appy-app/extension.rb +2 -0
- data/spec/command-reference-files/initial/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/spec/command-reference-files/model/config/routes.rb +2 -0
- data/spec/command-reference-files/model/spec/server/test_test_spec.rb +1 -1
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.cjsx +6 -4
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/index.scss +4 -3
- data/spec/command-reference-files/screen/config/screens.rb +4 -2
- data/spec/command-reference-files/screen/spec/appy-app/screens/ready-set-go/ReadySetGoSpec.coffee +1 -1
- data/spec/fixtures/system_settings.yml +1 -0
- data/spec/lanes/components/grid/GridSpec.coffee +56 -31
- data/spec/lanes/components/grid/RowEditorSpec.coffee +96 -0
- data/spec/lanes/components/select-field/SelectFieldSpec.coffee +99 -0
- data/spec/lanes/components/shared/NetworkActivityOverlaySpec.coffee +34 -0
- data/spec/lanes/models/AssociationMapSpec.coffee +36 -2
- data/spec/lanes/models/AssociationProxySpec.coffee +77 -0
- data/spec/lanes/models/BaseSpec.coffee +37 -4
- data/spec/lanes/models/CollectionSpec.coffee +11 -17
- data/spec/lanes/models/PubSubSpec.coffee +1 -1
- data/spec/lanes/models/ServerCacheSpec.coffee +65 -0
- data/spec/server/api/coffeescript_processor_spec.rb +1 -1
- data/spec/server/concerns/pub_sub_spec.rb +9 -10
- data/spec/server/concerns/sorting_expressions_spec.rb +34 -0
- data/spec/server/configuration_spec.rb +3 -3
- data/spec/server/job_spec.rb +54 -0
- data/spec/server/spec_helper.rb +0 -5
- data/spec/server/system_settings_spec.rb +23 -0
- data/templates/client/screens/Screen.cjsx +6 -4
- data/templates/client/screens/styles.scss +4 -3
- data/templates/config/routes.rb +2 -0
- data/templates/config/screen.rb +4 -2
- data/templates/lib/namespace.rb +4 -0
- data/templates/lib/namespace/extension.rb +2 -0
- data/templates/spec/client/Screen.coffee +1 -1
- data/templates/spec/server/model_spec.rb +1 -1
- data/templates/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/views/lanes_root_view.erb +70 -0
- data/views/specs.erb +2 -2
- metadata +207 -68
- data/client/images/lanes/dataTables/Sorting icons.psd +0 -0
- data/client/images/lanes/dataTables/back_disabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/favicon.ico +0 -0
- data/client/images/lanes/dataTables/forward_disabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/loading-background.png +0 -0
- data/client/images/lanes/dataTables/sort_asc.png +0 -0
- data/client/images/lanes/dataTables/sort_asc_disabled.png +0 -0
- data/client/images/lanes/dataTables/sort_both.png +0 -0
- data/client/images/lanes/dataTables/sort_desc.png +0 -0
- data/client/images/lanes/dataTables/sort_desc_disabled.png +0 -0
- data/client/lanes/components/shared/Resize.cjsx +0 -152
- data/client/lanes/components/shared/TextArea.cjsx +0 -19
- data/client/lanes/components/shared/TextField.cjsx +0 -25
- data/client/lanes/models/Bootstrap.coffee +0 -5
- data/client/lanes/models/QueryResults.coffee +0 -93
- data/client/lanes/react/FormBindings.coffee +0 -103
- data/client/lanes/react/Router.cjsx +0 -18
- data/client/lanes/styles/dataTables.scss +0 -4
- data/client/lanes/styles/plugins/all.scss +0 -2
- data/client/lanes/styles/plugins/resize-sensor.scss +0 -24
- data/client/lanes/vendor/jquery-2.js +0 -9190
- data/client/lanes/vendor/jquery.tap.js +0 -401
- data/client/lanes/vendor/magicsuggest.js +0 -1565
- data/client/lanes/vendor/message-bus.coffee +0 -264
- data/client/lanes/workspace/ActiveScreenSwitcher.cjsx +0 -38
- data/client/lanes/workspace/styles/toolbar.scss +0 -4
- data/lib/lanes/api/eco.js +0 -516
- data/lib/lanes/api/sprockets_compressor.rb +0 -39
- data/spec/command-reference-files/model/lib/appy-app.rb +0 -11
- data/views/index.erb +0 -19
@@ -0,0 +1,48 @@
|
|
1
|
+
Lanes.Components.Form.InputFieldMixin =
|
2
|
+
|
3
|
+
mixins: [
|
4
|
+
Lanes.Components.Form.FieldMixin
|
5
|
+
]
|
6
|
+
|
7
|
+
propTypes:
|
8
|
+
unlabled: React.PropTypes.bool
|
9
|
+
onlyNumeric: React.PropTypes.bool
|
10
|
+
selctOnFocus: React.PropTypes.bool
|
11
|
+
|
12
|
+
getDefaultProps: ->
|
13
|
+
type: 'text'
|
14
|
+
|
15
|
+
getValue: ->
|
16
|
+
@refs.input.getValue()
|
17
|
+
|
18
|
+
handleKeyDown: (ev) ->
|
19
|
+
@props.onEnter() if ev.key is 'Enter'
|
20
|
+
|
21
|
+
selectOnFocus: (ev) ->
|
22
|
+
ev.target.select()
|
23
|
+
|
24
|
+
onFieldBlur: ->
|
25
|
+
@onFieldInteraction()
|
26
|
+
@props.onBlur?()
|
27
|
+
|
28
|
+
renderEdit: (label) ->
|
29
|
+
value = @props.value or @_getValue()
|
30
|
+
label ||= @props.label or _.field2title(@props.name)
|
31
|
+
|
32
|
+
props = _.extend({
|
33
|
+
ref: 'input'
|
34
|
+
className: _.classnames('value',
|
35
|
+
changeset: @state.changeset
|
36
|
+
)
|
37
|
+
|
38
|
+
label: if @props.unlabeled then false else label
|
39
|
+
onChange: @handleChange
|
40
|
+
}, @props, {value: value})
|
41
|
+
|
42
|
+
handlers = { onBlur: @onFieldBlur }
|
43
|
+
|
44
|
+
if @isFieldValueInvalid() then props.bsStyle = 'error'
|
45
|
+
if @props.onEnter then handlers.onKeyDown = @handleKeyDown
|
46
|
+
if @props.selectOnFocus then handlers.onFocus = @selectOnFocus
|
47
|
+
|
48
|
+
@renderInputField(props, handlers, label)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Lanes.Components.JobStatus extends Lanes.React.Component
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
job: Lanes.PropTypes.State
|
5
|
+
onlyExecuting: React.PropTypes.bool
|
6
|
+
message: React.PropTypes.string
|
7
|
+
|
8
|
+
pubsub: true
|
9
|
+
listenNetworkEvents: true
|
10
|
+
dataObjects: { job: 'props' }
|
11
|
+
statusMessage: ->
|
12
|
+
if _.isEmpty(@job.stepsCompleted) then '' else
|
13
|
+
'Completed: ' + _.toSentence(@job.stepsCompleted)
|
14
|
+
|
15
|
+
progressBar: ->
|
16
|
+
return null unless @job.progress
|
17
|
+
<BS.ProgressBar now={@job.progress * 100} />
|
18
|
+
|
19
|
+
render: ->
|
20
|
+
return null if @props.onlyExecuting and not @job.isExecuting
|
21
|
+
<div className="job-executing">
|
22
|
+
<h3 className="message">{@props.message}</h3>
|
23
|
+
<LC.Throbber />
|
24
|
+
<div className="status">{@statusMessage()}</div>
|
25
|
+
{@progressBar()}
|
26
|
+
{@props.children}
|
27
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Lanes.Components.NetworkActivityOverlay extends Lanes.React.Component
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
model: Lanes.PropTypes.Model.isRequired
|
5
|
+
message: React.PropTypes.string
|
6
|
+
timeout: React.PropTypes.number
|
7
|
+
visible: React.PropTypes.bool
|
8
|
+
errorTimeout: React.PropTypes.number
|
9
|
+
|
10
|
+
getDefaultProps: ->
|
11
|
+
timeout: 30000, errorTimeout: 2000
|
12
|
+
|
13
|
+
removeMessage: ->
|
14
|
+
return unless @isMounted()
|
15
|
+
@setState(isRequesting: false, hasError: false)
|
16
|
+
|
17
|
+
clearTimeout: ->
|
18
|
+
clearTimeout(@state.removeHandler) if @state.removeHandler
|
19
|
+
|
20
|
+
installRemoval: (state) ->
|
21
|
+
@clearTimeout()
|
22
|
+
@setState(removeHandler: _.delay(@removeMessage,
|
23
|
+
if state.hasError then @props.errorTimeout else @props.timeout
|
24
|
+
))
|
25
|
+
|
26
|
+
listenNetworkEvents: true
|
27
|
+
|
28
|
+
setDataState: (state) ->
|
29
|
+
if state.hasError or state.isRequesting
|
30
|
+
@installRemoval(state)
|
31
|
+
else if not @state.hasError
|
32
|
+
@removeMessage()
|
33
|
+
@setState(state)
|
34
|
+
|
35
|
+
render: ->
|
36
|
+
return null unless @props.visible or @state.isRequesting or @state.hasError
|
37
|
+
message = @props.message or (
|
38
|
+
if @state.hasError
|
39
|
+
errorMsg = @model.errorMessage
|
40
|
+
if errorMsg and _.isString(errorMsg) then errorMsg else "Error"
|
41
|
+
else if @state.isRequesting is 'GET'
|
42
|
+
'Loading…'
|
43
|
+
else if _.includes(['PATCH', 'POST', 'PUT'], @state.isRequesting)
|
44
|
+
'Saving…'
|
45
|
+
else if @state.isRequesting is 'DELETE'
|
46
|
+
'Deleting…'
|
47
|
+
else
|
48
|
+
'Pending…'
|
49
|
+
)
|
50
|
+
icon = if @state.hasError then 'exclamation-circle' else 'spinner'
|
51
|
+
classes = _.classnames 'overlay', {rounded: @props.roundedCorners}
|
52
|
+
<div className={classes}>
|
53
|
+
<div className="mask" />
|
54
|
+
<div className="message">
|
55
|
+
<LC.Icon type={icon} animated={not @state.hasError} />
|
56
|
+
{message}
|
57
|
+
</div>
|
58
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Lanes.Components.NumberInput extends Lanes.React.Component
|
2
|
+
|
3
|
+
mixins: [
|
4
|
+
Lanes.Components.Form.InputFieldMixin
|
5
|
+
]
|
6
|
+
handleNumberChange: (n) ->
|
7
|
+
@handleChange(target: value: n)
|
8
|
+
|
9
|
+
renderInputField: (props, handlers, label) ->
|
10
|
+
props.format ||= '#,###.00'
|
11
|
+
props = _.omit(props, 'label')
|
12
|
+
input = <Lanes.Vendor.ReactWidgets.NumberPicker
|
13
|
+
ref="select"
|
14
|
+
className={@props.className}
|
15
|
+
{...handlers}
|
16
|
+
{...props}
|
17
|
+
onChange={@handleNumberChange}
|
18
|
+
value={Number(props.value)}
|
19
|
+
/>
|
20
|
+
if @props.unstyled
|
21
|
+
input
|
22
|
+
else
|
23
|
+
<LC.FormGroup
|
24
|
+
{...@props}
|
25
|
+
className={@formGroupClassNames()}
|
26
|
+
label={@getLabelValue()}
|
27
|
+
>
|
28
|
+
{input}
|
29
|
+
</LC.FormGroup>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class Lanes.Components.ResizeSensor extends Lanes.React.BaseComponent
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
onResize: React.PropTypes.func.isRequired
|
5
|
+
|
6
|
+
render: ->
|
7
|
+
<Lanes.Vendor.ComponentResize
|
8
|
+
{...@props}
|
9
|
+
embedCss={false}
|
10
|
+
className={_.classnames('lanes-resize-sensor', @props.className)}
|
11
|
+
>{@props.children}</Lanes.Vendor.ComponentResize>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Lanes.Components.ScreenWrapper extends Lanes.React.Component
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
identifier: React.PropTypes.string.isRequired
|
5
|
+
|
6
|
+
render: ->
|
7
|
+
classes = _.classnames(
|
8
|
+
'screen-wrapper', @props.identifier,
|
9
|
+
'flex-vertically': @props.flexVertical
|
10
|
+
)
|
11
|
+
<div className={classes}>
|
12
|
+
{@props.children}
|
13
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class Lanes.Components.ToggleField extends Lanes.React.Component
|
2
|
+
mixins: [ Lanes.Components.Form.FieldMixin ]
|
3
|
+
|
4
|
+
formGroupClass: 'toggle'
|
5
|
+
|
6
|
+
renderDisplayValue: ->
|
7
|
+
<Lanes.Vendor.ReactToggle
|
8
|
+
defaultChecked={!!@props.model[@props.name]}
|
9
|
+
checked={!!@props.model[@props.name]}
|
10
|
+
disabled={true}
|
11
|
+
/>
|
12
|
+
|
13
|
+
handleToggleChange: (ev) ->
|
14
|
+
@props.model[@props.name] = ev.target.checked
|
15
|
+
null
|
16
|
+
|
17
|
+
renderEdit: (label) ->
|
18
|
+
props = _.omit(@props, 'label')
|
19
|
+
toggle = <Lanes.Vendor.ReactToggle
|
20
|
+
onChange={@handleToggleChange}
|
21
|
+
checked={!!@props.model[@props.name]}
|
22
|
+
defaultChecked={!!@props.model[@props.name]}
|
23
|
+
/>
|
24
|
+
if @props.unstyled
|
25
|
+
toggle
|
26
|
+
else
|
27
|
+
<LC.FormGroup
|
28
|
+
{...props}
|
29
|
+
className={@formGroupClassNames()}
|
30
|
+
label={label}
|
31
|
+
>
|
32
|
+
{toggle}
|
33
|
+
</LC.FormGroup>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class Lanes.Components.Tooltip extends Lanes.React.Component
|
2
2
|
|
3
|
-
TTProps: ['placement', 'positionLeft', 'positionTop', 'arrowOffsetLeft', 'arrowOffsetTop']
|
3
|
+
TTProps: ['id', 'placement', 'positionLeft', 'positionTop', 'arrowOffsetLeft', 'arrowOffsetTop']
|
4
4
|
|
5
5
|
render: ->
|
6
6
|
ttprops = _.pick(@props, @TTProps...)
|
7
7
|
tooltip = <BS.Tooltip {...ttprops}>{@props.content}</BS.Tooltip>
|
8
|
-
<BS.OverlayTrigger overlay={tooltip} container={@context.viewport.
|
8
|
+
<BS.OverlayTrigger overlay={tooltip} placement='left' container={@context.viewport.lanes}>
|
9
9
|
{@props.children}
|
10
10
|
</BS.OverlayTrigger>
|
@@ -1,19 +1,33 @@
|
|
1
|
+
@import "lanes/styles/bootstrap/variables";
|
2
|
+
@import "lanes/styles/bootstrap/mixins";
|
3
|
+
|
4
|
+
$lanes-field-margin: 6px;
|
5
|
+
|
1
6
|
label.field {
|
2
7
|
display: block;
|
3
8
|
}
|
4
9
|
.field {
|
5
|
-
|
6
|
-
.
|
10
|
+
font-weight: normal;
|
11
|
+
.input-group {
|
7
12
|
font-weight: normal;
|
8
|
-
|
9
|
-
margin-top: 5px;
|
10
|
-
height: 34px;
|
13
|
+
width: 100%;
|
11
14
|
}
|
12
|
-
|
13
|
-
|
15
|
+
&.display {
|
16
|
+
.input-group {
|
17
|
+
display: block;
|
18
|
+
}
|
19
|
+
.value {
|
20
|
+
padding-left: $lanes-field-margin;
|
21
|
+
padding-right: $lanes-field-margin;
|
22
|
+
display: block;
|
23
|
+
height: $lanes-field-value-height;
|
24
|
+
line-height: $lanes-field-value-height;
|
25
|
+
border-bottom: 1px solid $input-border;
|
26
|
+
}
|
27
|
+
|
14
28
|
}
|
15
|
-
|
16
|
-
@extend .form-control;
|
29
|
+
&.read-only .input-group {
|
30
|
+
@extend .form-control !optional;
|
17
31
|
padding: 6px 12px;
|
18
32
|
cursor: not-allowed;
|
19
33
|
}
|
@@ -21,15 +35,63 @@ label.field {
|
|
21
35
|
padding: 0;
|
22
36
|
font-size: 85%;
|
23
37
|
}
|
24
|
-
|
38
|
+
&.read-only .title { margin-bottom: 5px; }
|
25
39
|
}
|
26
40
|
|
27
|
-
.field,
|
28
|
-
.
|
41
|
+
.field, {
|
42
|
+
.form-group {
|
43
|
+
background-color: rgba(255, 255, 255, 1);
|
44
|
+
transition: background-color 1000ms linear;
|
45
|
+
input { transition: background-color 1000ms linear; }
|
46
|
+
}
|
47
|
+
&.changeset .form-group {
|
29
48
|
$color-rgba: rgba(255, 241, 72, .6);
|
30
|
-
border-color: $color-rgba;
|
49
|
+
border-color: darken($color-rgba, 10%);
|
50
|
+
background-color: $color-rgba;
|
31
51
|
outline: 0;
|
32
52
|
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
|
53
|
+
input {
|
54
|
+
background-color: darken($color-rgba, 20%);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
&.display {
|
58
|
+
&.toggle {
|
59
|
+
.value { border-bottom: 0; }
|
60
|
+
.react-toggle { cursor: inherit; }
|
61
|
+
}
|
62
|
+
&.editing .react-toggle { margin-top: 5px; }
|
63
|
+
.value span {
|
64
|
+
display: inline-block;
|
65
|
+
text-overflow: ellipsis;
|
66
|
+
white-space: nowrap;
|
67
|
+
overflow: hidden;
|
68
|
+
width: 100%;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
.label-title {
|
72
|
+
display: inline-block;
|
33
73
|
}
|
74
|
+
label {
|
75
|
+
display: block;
|
76
|
+
overflow: hidden;
|
77
|
+
text-overflow: ellipsis;
|
78
|
+
white-space: nowrap;
|
79
|
+
width: 100%;
|
80
|
+
}
|
81
|
+
i.error {
|
82
|
+
margin-left: $lanes-field-margin;
|
83
|
+
}
|
84
|
+
.control-label {
|
85
|
+
margin-left: $lanes-field-margin;
|
86
|
+
margin-right: $lanes-field-margin;
|
87
|
+
}
|
88
|
+
|
34
89
|
|
35
90
|
}
|
91
|
+
|
92
|
+
.align-right{
|
93
|
+
.control-label, .value, .rw-widget input {text-align: right; }
|
94
|
+
}
|
95
|
+
.align-center{
|
96
|
+
.control-label, .value, .rw-widget input { text-align: center; }
|
97
|
+
}
|
@@ -15,15 +15,13 @@ fieldset.collapsible {
|
|
15
15
|
padding: 0 10px;
|
16
16
|
}
|
17
17
|
}
|
18
|
+
&.expanded {
|
19
|
+
legend:after { @extend .icon-minus-square-o:before; }
|
20
|
+
}
|
18
21
|
&.collapsed {
|
19
22
|
border-bottom-left-radius: 0;
|
20
23
|
border-bottom-right-radius: 0;
|
21
|
-
}
|
22
|
-
&.plus {
|
23
24
|
legend:after { @extend .icon-plus-square-o:before; }
|
24
25
|
}
|
25
|
-
&.minus {
|
26
|
-
legend:after { @extend .icon-minus-square-o:before; }
|
27
|
-
}
|
28
26
|
|
29
27
|
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@import "../../styles/bootstrap/buttons";
|
2
|
+
|
3
|
+
.image-saver {
|
4
|
+
&.field {
|
5
|
+
.value {
|
6
|
+
border-bottom: 0;
|
7
|
+
height: inherit;
|
8
|
+
}
|
9
|
+
&.display {
|
10
|
+
.value {
|
11
|
+
padding-left: 0;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
input.file {
|
16
|
+
width: 0.1px;
|
17
|
+
height: 0.1px;
|
18
|
+
opacity: 0;
|
19
|
+
overflow: hidden;
|
20
|
+
position: absolute;
|
21
|
+
z-index: -1;
|
22
|
+
}
|
23
|
+
label.selector {
|
24
|
+
@extend .btn;
|
25
|
+
@extend .btn-default;
|
26
|
+
}
|
27
|
+
&.with-image label.selector {
|
28
|
+
position: absolute;
|
29
|
+
top: 5px;
|
30
|
+
right: 5px;
|
31
|
+
z-index: 2;
|
32
|
+
box-shadow: 0 8px 6px -6px black;
|
33
|
+
}
|
34
|
+
img {
|
35
|
+
height: auto;
|
36
|
+
width: 100%;
|
37
|
+
}
|
38
|
+
}
|
@@ -7,7 +7,13 @@ $gray-darker: lighten(#000, 13.5%) !default;
|
|
7
7
|
|
8
8
|
.overlay {
|
9
9
|
position: absolute;
|
10
|
-
z-index:
|
10
|
+
z-index: 11;
|
11
|
+
height: 100%;
|
12
|
+
width: 100%;
|
13
|
+
left: 0;
|
14
|
+
right: 0;
|
15
|
+
top: 0;
|
16
|
+
bottom: 0;
|
11
17
|
.mask {
|
12
18
|
background-color: white;
|
13
19
|
height: 100%;
|
@@ -17,24 +23,31 @@ $gray-darker: lighten(#000, 13.5%) !default;
|
|
17
23
|
top: 0;
|
18
24
|
width: 100%;
|
19
25
|
}
|
26
|
+
&.rounded {
|
27
|
+
.mask { border-radius: $border-radius-large; }
|
28
|
+
}
|
29
|
+
|
20
30
|
.message {
|
21
|
-
|
31
|
+
width: 450px;
|
32
|
+
max-width: 90%;
|
22
33
|
min-height: 65px;
|
23
|
-
line-height:
|
34
|
+
line-height: 3rem;
|
24
35
|
border: 2px solid $well-border;
|
25
36
|
margin-left: auto;
|
26
37
|
margin-right: auto;
|
38
|
+
font-size: 2rem;
|
27
39
|
position: relative;
|
28
40
|
top: 25%;
|
29
41
|
border-radius: $border-radius-large;
|
30
42
|
padding: 10px;
|
31
43
|
box-shadow: 6px 7px 5px $gray-light;
|
32
44
|
background-color: $body-bg;
|
33
|
-
|
45
|
+
|
34
46
|
i {
|
35
47
|
display: inline-block;
|
36
48
|
font-size: 3.2rem;
|
37
49
|
float: left;
|
50
|
+
margin-right: 0.5rem;
|
38
51
|
&.loading-spinner {
|
39
52
|
background:url(image-path('images/lanes/ajax-loader.gif')) no-repeat;
|
40
53
|
height: 32px;
|