End of day commit
This commit is contained in:
@@ -14,7 +14,7 @@ gem 'slim-rails'
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
gem 'active_model_serializers', '0.9.0' # explicitly outside assets
|
||||
gem 'active_model_serializers', '~> 0.9.3' # explicitly outside assets
|
||||
group :assets do
|
||||
gem 'jquery-rails'
|
||||
gem 'jquery-ui-rails'
|
||||
@@ -35,8 +35,8 @@ group :assets do
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
|
||||
gem 'ember-rails'
|
||||
gem 'ember-source', '~> 1.13.0'
|
||||
gem 'emblem-rails'
|
||||
#gem 'ember-source', '~> 1.13.0'
|
||||
#gem 'emblem-rails'
|
||||
gem 'ember-validations-rails'
|
||||
gem 'ember-emblem-template'
|
||||
|
||||
|
||||
+19
-28
@@ -54,13 +54,13 @@ GEM
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
active-model-adapter-source (1.13.5)
|
||||
active-model-adapter-source (1.13.6)
|
||||
ember-data-source (>= 1.13, < 3.0)
|
||||
active_attr (0.8.5)
|
||||
activemodel (>= 3.0.2, < 5.0)
|
||||
activesupport (>= 3.0.2, < 5.0)
|
||||
active_decorator (0.5.3)
|
||||
active_model_serializers (0.9.0)
|
||||
active_model_serializers (0.9.3)
|
||||
activemodel (>= 3.2)
|
||||
activejob (4.2.3)
|
||||
activesupport (= 4.2.3)
|
||||
@@ -79,15 +79,12 @@ GEM
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.8)
|
||||
airbrussh (0.6.0)
|
||||
airbrussh (0.7.0)
|
||||
sshkit (>= 1.6.1, != 1.7.0)
|
||||
arel (6.0.2)
|
||||
arel (6.0.3)
|
||||
barber (0.9.1)
|
||||
ember-source (>= 1.0, < 2)
|
||||
execjs (>= 1.2, < 3)
|
||||
barber-emblem (0.1.2)
|
||||
barber (>= 0.4.1)
|
||||
emblem-source
|
||||
bcrypt (3.1.10)
|
||||
binding_of_caller (0.7.2)
|
||||
debug_inspector (>= 0.0.1)
|
||||
@@ -121,7 +118,7 @@ GEM
|
||||
capybara-screenshot (1.0.11)
|
||||
capybara (>= 1.0, < 3)
|
||||
launchy
|
||||
celluloid (0.16.0)
|
||||
celluloid (0.16.1)
|
||||
timers (~> 4.0.0)
|
||||
childprocess (0.5.6)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
@@ -151,7 +148,7 @@ GEM
|
||||
crack (0.4.2)
|
||||
safe_yaml (~> 1.0.0)
|
||||
debug_inspector (0.0.2)
|
||||
devise (3.5.1)
|
||||
devise (3.5.2)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
@@ -173,7 +170,7 @@ GEM
|
||||
eventmachine (>= 1.0.0.beta.4)
|
||||
email_validator (1.6.0)
|
||||
activemodel
|
||||
ember-data-source (1.13.6)
|
||||
ember-data-source (1.13.8)
|
||||
ember-source (>= 1.8, < 3.0)
|
||||
ember-emblem-template (0.2.2)
|
||||
barber (>= 0.9.0)
|
||||
@@ -190,15 +187,11 @@ GEM
|
||||
ember-source (>= 1.8.0)
|
||||
jquery-rails (>= 1.0.17)
|
||||
railties (>= 3.1)
|
||||
ember-source (1.13.5)
|
||||
ember-source (1.13.7)
|
||||
ember-validations-rails (1.0.0)
|
||||
railties
|
||||
emblem-rails (0.2.2)
|
||||
barber-emblem (~> 0.1.1)
|
||||
ember-rails (>= 0.14.0)
|
||||
emblem-source (0.4.0)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.0.7)
|
||||
eventmachine (1.0.8)
|
||||
execjs (2.5.2)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
@@ -219,7 +212,7 @@ GEM
|
||||
eventmachine (>= 0.12.0)
|
||||
websocket-driver (>= 0.5.1)
|
||||
ffi (1.9.10)
|
||||
font-awesome-rails (4.3.0.0)
|
||||
font-awesome-rails (4.4.0.0)
|
||||
railties (>= 3.2, < 5.0)
|
||||
foreman (0.78.0)
|
||||
thor (~> 0.19.1)
|
||||
@@ -231,7 +224,7 @@ GEM
|
||||
ruby-progressbar (~> 1.4)
|
||||
gherkin (2.12.2)
|
||||
multi_json (~> 1.3)
|
||||
globalid (0.3.5)
|
||||
globalid (0.3.6)
|
||||
activesupport (>= 4.1.0)
|
||||
hashie (3.4.2)
|
||||
hike (1.2.3)
|
||||
@@ -247,7 +240,7 @@ GEM
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (5.0.5)
|
||||
railties (>= 3.2.16)
|
||||
js-routes (1.0.1)
|
||||
js-routes (1.1.0)
|
||||
railties (>= 3.2)
|
||||
sprockets-rails
|
||||
json (1.8.3)
|
||||
@@ -265,9 +258,9 @@ GEM
|
||||
mime-types (>= 1.16, < 3)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.6.1)
|
||||
mini_magick (4.2.7)
|
||||
mini_magick (4.2.10)
|
||||
mini_portile (0.6.2)
|
||||
minitest (5.7.0)
|
||||
minitest (5.8.0)
|
||||
multi_json (1.11.2)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (2.0.0)
|
||||
@@ -309,7 +302,7 @@ GEM
|
||||
slop (~> 3.4)
|
||||
pry-rails (0.3.4)
|
||||
pry (>= 0.9.10)
|
||||
puma (2.12.2)
|
||||
puma (2.12.3)
|
||||
quiet_assets (1.1.0)
|
||||
railties (>= 3.1, < 5.0)
|
||||
rack (1.6.4)
|
||||
@@ -327,7 +320,7 @@ GEM
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.2.3)
|
||||
sprockets-rails
|
||||
rails-assets-ember-qunit (0.4.6)
|
||||
rails-assets-ember-qunit (0.4.9)
|
||||
rails-assets-qunit (1.18.0)
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
@@ -385,7 +378,7 @@ GEM
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (~> 1.1)
|
||||
selenium-webdriver (2.46.2)
|
||||
selenium-webdriver (2.47.1)
|
||||
childprocess (~> 0.5)
|
||||
multi_json (~> 1.0)
|
||||
rubyzip (~> 1.0)
|
||||
@@ -431,7 +424,7 @@ GEM
|
||||
tilt (1.4.1)
|
||||
timers (4.0.1)
|
||||
hitimes
|
||||
tinymce-rails (4.2.2)
|
||||
tinymce-rails (4.2.3)
|
||||
railties (>= 3.1.1)
|
||||
turnip (1.3.1)
|
||||
gherkin (>= 2.5)
|
||||
@@ -468,7 +461,7 @@ DEPENDENCIES
|
||||
ace-rails-ap
|
||||
active_attr
|
||||
active_decorator
|
||||
active_model_serializers (= 0.9.0)
|
||||
active_model_serializers (~> 0.9.3)
|
||||
airbrussh
|
||||
bourbon
|
||||
cancancan
|
||||
@@ -486,9 +479,7 @@ DEPENDENCIES
|
||||
devise_simply_stored!
|
||||
ember-emblem-template
|
||||
ember-rails
|
||||
ember-source (~> 1.13.0)
|
||||
ember-validations-rails
|
||||
emblem-rails
|
||||
factory_girl_rails
|
||||
faye
|
||||
font-awesome-rails
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
App.SettingsController = Ember.Controller.extend
|
||||
needs: ['application']
|
||||
supplier: Ember.computed.alias 'globals.current_supplier'
|
||||
# model: (-> @get('controllers.application.supplier')).property('controllers.application.supplier')
|
||||
time_zones: (-> window.time_zones ).property()
|
||||
countries: (-> window.countries ).property()
|
||||
saving: false
|
||||
editIensProfile: (-> @get('model.country') is 'Netherlands' ).property('model.country')
|
||||
editIensProfile: (-> @get('supplier.country') is 'Netherlands' ).property('supplier.country')
|
||||
actions:
|
||||
saveSettings: ->
|
||||
@set 'saving', true
|
||||
@get('model').save().then (supplier) =>
|
||||
@get('supplier').save().then (supplier) =>
|
||||
@set 'saving', false
|
||||
$('.top-menu .supplier-name').text @get('model.name')
|
||||
$('.top-menu .supplier-name').text @get('supplier.name')
|
||||
@transitionToRoute 'index'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
App.SettingsRoute = Ember.Route.extend
|
||||
model: -> @get('globals.current_supplier')
|
||||
a: 3
|
||||
#model: -> @get('globals.current_supplier')
|
||||
#model: Ember.computed.alias 'globals.current_supplier'
|
||||
# setupController: (controller, model)->
|
||||
# #controller.set 'model', controller.get('controllers.application.supplier')
|
||||
# controller.set 'model', model.supplier
|
||||
|
||||
@@ -8,5 +8,5 @@ App.ApplicationStore = DS.Store
|
||||
#Ember.String.pluralize(Ember.String.decamelize(type))
|
||||
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
|
||||
namespace: 'supplier'
|
||||
#headers:
|
||||
#"Accept": "application/json, text/javascript; q=0.01"
|
||||
headers:
|
||||
"Accept": "application/json, text/javascript; q=0.01"
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
.row: .small-12.columns: h2=t 'settings.title'
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.name'
|
||||
.form-field= input value=controller.model.name classNames="supplier-name"
|
||||
.form-field= input value=supplier.name classNames="supplier-name"
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.email'
|
||||
.form-field= input value=controller.model.email type="email" classNames="supplier-email"
|
||||
.form-field= input value=supplier.email type="email" classNames="supplier-email"
|
||||
/input.location_picker name="location" type="text" valueBinding="location"
|
||||
/.form-row
|
||||
.location_picker_map
|
||||
= image_tag 'supplier/settings/location-balloon.png'
|
||||
/.form-row
|
||||
.form-label: label=t 'attributes.supplier.time_zone'
|
||||
.form-field: Ember.Select content=time_zones optionValuePath="content.name" optionLabelPath="content.formatted" valueBinding="controller.model.time_zone"
|
||||
.form-field: Ember.Select content=time_zones optionValuePath="content.name" optionLabelPath="content.formatted" valueBinding="supplier.time_zone"
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.address'
|
||||
.form-field.full
|
||||
.row
|
||||
.large-8.medium-8.columns= input value=controller.model.address
|
||||
.large-8.medium-8.columns= input value=supplier.address
|
||||
.large-1.show-for-large-up.columns
|
||||
.large-2.medium-2.small-3.columns= number-field numericValue=controller.model.house_number
|
||||
.large-1.medium-2.small-2.columns= input value=controller.model.house_number_addition
|
||||
.large-2.medium-2.small-3.columns= number-field numericValue=supplier.house_number
|
||||
.large-1.medium-2.small-2.columns= input value=supplier.house_number_addition
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.postal_code'
|
||||
.form-field= input value=controller.model.postal_code
|
||||
.form-field= input value=supplier.postal_code
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.city'
|
||||
.form-field= input value=controller.model.city
|
||||
.form-field= input value=supplier.city
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.country'
|
||||
.form-field: view "select" content=countries optionValuePath="content.name" optionLabelPath="content.name" value=controller.model.country
|
||||
.form-field: view "select" content=countries optionValuePath="content.name" optionLabelPath="content.name" value=supplier.country
|
||||
if editIensProfile
|
||||
.form-row
|
||||
.form-label: label=t 'attributes.supplier.iens_profile'
|
||||
.form-field
|
||||
= number-field numericValue=controller.model.iens_profile
|
||||
= number-field numericValue=supplier.iens_profile
|
||||
= image_tag 'supplier/settings/iens-example.png'
|
||||
span=t "settings.reviews.explanation"
|
||||
.row: .small-12.columns= language-switcher
|
||||
|
||||
@@ -19,6 +19,7 @@ Ember.Application.initializer
|
||||
Globals = Ember.Object.extend
|
||||
list: null
|
||||
notice: ''
|
||||
join_request_sent: false
|
||||
Ember.Application.initializer
|
||||
name: 'Globals'
|
||||
initialize: (container, application)->
|
||||
|
||||
@@ -2,4 +2,4 @@ App.ActiveListController = Ember.Controller.extend
|
||||
#orders: (->
|
||||
#@get('list.orders')
|
||||
#).property('list.orders')
|
||||
list: (-> @get('controllers.application.list') ).property('controllers.application.list')
|
||||
list: (-> @get('globals.list') ).property('globals.list')
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
App.ApplicationController = Ember.Controller.extend
|
||||
needs: ['product_orders']
|
||||
join_request_sent: false
|
||||
#notice: ''
|
||||
actions:
|
||||
confirmCancel: ->
|
||||
@@ -62,13 +61,14 @@ App.ApplicationController = Ember.Controller.extend
|
||||
requestor_id = data.id.substr(3)
|
||||
if requestor_id is Qstorage.getItem('user_id')
|
||||
@set 'globals.notice', t('join_request.requestor.join_request_rejected')
|
||||
@set 'join_request_sent', false
|
||||
@set 'globals.join_request_sent', false
|
||||
|
||||
join_request_approved: ->
|
||||
return if @get('list.id')
|
||||
@setCurrentList ->
|
||||
@transitionToRoute('active_list').then =>
|
||||
@set 'globals.notice', t('join_request.requestor.join_request_approved')
|
||||
@set 'globals.join_request_sent', false
|
||||
|
||||
list_changed_table: ->
|
||||
@setCurrentList()
|
||||
@@ -79,7 +79,7 @@ App.ApplicationController = Ember.Controller.extend
|
||||
new_order: (data)->
|
||||
# return if @store.all('order').findProperty('id', data.order.id)
|
||||
@store.pushPayload data
|
||||
@store.findById('list', data.list.id).then (list)=> @set 'controllers.application.list', list
|
||||
@store.findById('list', data.list.id).then (list)=> @set 'globals.list', list
|
||||
# @store.findById('order', data.order.id).then (order)->
|
||||
# list = order.get('list')
|
||||
# list.get('orders').addObject(order)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
App.JoinRequestsController = Ember.Controller.extend
|
||||
join_requests: (-> @get('controllers.application.list.join_requests') ).property('controllers.application.list.join_requests')
|
||||
join_requests: (-> @get('globals.list.join_requests') ).property('globals.list.join_requests')
|
||||
actions:
|
||||
rejectRequest: (join_request)->
|
||||
Ember.$.post("#{$data_host}/user/reject_join_request", user_id: join_request.get('user.id')).then (response)->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@App.modals.BaseController = Ember.Controller.extend
|
||||
alert_message: ""
|
||||
#modal_options: Ember.Object.create(closeOnOverlay: true, closeOnModalClick: false)
|
||||
title: (->
|
||||
# return title if directly set by options
|
||||
return @get('modal_options.title') if @get('modal_options.title')
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
@App.modals.ConfirmController = @App.modals.BaseController.extend
|
||||
body: Ember.computed 'modal_options.body', -> @get('modal_options.body')
|
||||
@@ -12,14 +12,14 @@ App.ProductOrdersController = Ember.Controller.extend
|
||||
# @get('product_orders').invoke 'eraseRecord'
|
||||
orderProducts: ->
|
||||
# table = @get('controllers.table.model')
|
||||
# list = @get('controllers.application.list')
|
||||
# list = @get('globals.list')
|
||||
# order = @store.createRecord('order', list: list, table: table)
|
||||
# new_product_orders = @store.all('product_order').filterProperty('order', null)
|
||||
# order.get('product_orders').pushObjects(new_product_orders)
|
||||
#
|
||||
# order.save().then (response)=>
|
||||
# new_product_orders.invoke 'eraseRecord'
|
||||
# if @get('controllers.application.list')
|
||||
# if @get('globals.list')
|
||||
# @transitionToRoute 'active_list'
|
||||
# else
|
||||
# # Get list info from the server
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
App.TableController = Ember.Controller.extend
|
||||
join_request_sent: (-> @get('controllers.application.join_request_sent')).property('controllers.application.join_request_sent')
|
||||
tableCanTakeOrders: (->
|
||||
return false unless @get('supplier.can_take_orders')
|
||||
list = @get('globals.list')
|
||||
@@ -10,14 +9,14 @@ App.TableController = Ember.Controller.extend
|
||||
else
|
||||
# no list and open supplier
|
||||
if @get('model.occupied') then false else true
|
||||
).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id')
|
||||
).property('globals.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'globals.list.table.id')
|
||||
supplier: Ember.computed 'model.supplier', -> @get('model.supplier')
|
||||
showJoinButton: (->
|
||||
return false unless @get('supplier.can_take_orders')
|
||||
return false if @get('controllers.application.list') # if you already have an active list, do not join another
|
||||
return false if @get('globals.list') # if you already have an active list, do not join another
|
||||
if @get('model.occupied') then true else false # no point in joining tables that are not occupied
|
||||
).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id')
|
||||
).property('globals.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'globals.list.table.id')
|
||||
actions:
|
||||
joinOccupiedTable: ->
|
||||
Ember.$.post("#{$data_host}/user/join_occupied_table.json", table_id: @get('model.id'))
|
||||
@set 'controllers.application.join_request_sent', true # keeps the button deactivated
|
||||
@set 'globals.join_request_sent', true # keeps the button deactivated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
App.ActiveListRoute = Ember.Route.extend App.ResetScroll
|
||||
#model: ->
|
||||
#@get('controllers.application.list')
|
||||
#@get('globals.list')
|
||||
#afterModel: ->
|
||||
#controller = @controllerFor('application')
|
||||
#table_id = controller.get('list.table.id')
|
||||
|
||||
@@ -55,7 +55,7 @@ App.ApplicationRoute = Ember.Route.extend
|
||||
defaultModalOptions =
|
||||
closeOnOverlay: true
|
||||
closeOnModalClick: false
|
||||
controller.set 'modal_options', $.extend(defaultModalOptions, options)
|
||||
controller.set 'modal_options', Ember.Object.create($.extend(defaultModalOptions, options))
|
||||
@render "modals/#{modalName}",
|
||||
into: 'application'
|
||||
outlet: 'modal'
|
||||
@@ -68,11 +68,8 @@ App.ApplicationRoute = Ember.Route.extend
|
||||
parentView: 'application'
|
||||
|
||||
confirm: (options = {})->
|
||||
@send 'openModal', 'confirm',
|
||||
model: Ember.Object.create(body: options.body)
|
||||
title: options.title
|
||||
cancel: options.cancel
|
||||
ok: options.ok
|
||||
options.model ||= Ember.Object.create()
|
||||
@send 'openModal', 'confirm', options
|
||||
sendFeedback: (feedback, callback)->
|
||||
return unless feedback
|
||||
$.post $user_feedback_path, feedback: feedback, callback
|
||||
@@ -124,8 +121,8 @@ App.ApplicationRoute = Ember.Route.extend
|
||||
else
|
||||
## Offer to move table
|
||||
@send 'confirm',
|
||||
title: t('move_table.confirmation_title')
|
||||
body: t('move_table.confirmation_body')
|
||||
title: t('move_table.confirmation_title', res.table)
|
||||
body: t('move_table.confirmation_body', res.table)
|
||||
ok: =>
|
||||
Ember.$.post "#{$data_host}/user/move_table.json", table_id: table._id, (res2)=>
|
||||
if res2.occupied
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
span.supplier-name= supplier.name
|
||||
span.table-number
|
||||
' #
|
||||
= number
|
||||
= model.number
|
||||
if showJoinButton
|
||||
if join_request_sent
|
||||
if globals.join_request_sent
|
||||
button.disabled
|
||||
span.fa.fa-spinner.fa-spin.fa-lg
|
||||
span=t 'join_request.requestor.waiting_for_approval'
|
||||
|
||||
@@ -9,5 +9,4 @@
|
||||
|
||||
$.extend($translations.en, <%= I18n.t('user', locale: :en).to_json %>);
|
||||
$.extend($translations.nl, <%= I18n.t('user', locale: :nl).to_json %>);
|
||||
|
||||
setLocale()
|
||||
|
||||
@@ -58,15 +58,16 @@ private
|
||||
I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
|
||||
end
|
||||
|
||||
def _render_with_renderer_json(resource, options)
|
||||
serializer = build_json_serializer(resource, options)
|
||||
#def _render_with_renderer_json(resource, options)
|
||||
#serializer = build_json_serializer(resource, options)
|
||||
|
||||
if serializer
|
||||
super(serializer, options)
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
#binding.pry
|
||||
#if serializer
|
||||
#super(serializer, options)
|
||||
#else
|
||||
#super
|
||||
#end
|
||||
#end
|
||||
|
||||
def layout_by_resource(*args)
|
||||
#if devise_controller?
|
||||
|
||||
@@ -44,6 +44,7 @@ class UserController < Users::ApplicationController
|
||||
res[:occupied] = @table.occupied?
|
||||
res[:reserved] = @table.reserved?
|
||||
res[:supplier_closed] = @table.supplier.closed?
|
||||
res[:table] = @table.attributes
|
||||
if list.present?
|
||||
res[:other_supplier] = true if list.supplier_id != @table.supplier_id
|
||||
res[:current_table_id] = list.table_id
|
||||
|
||||
+2
-1
@@ -63,6 +63,7 @@ class User
|
||||
end
|
||||
|
||||
def avatar
|
||||
return '' unless provider.present?
|
||||
case provider.to_sym
|
||||
when :facebook then "http://graph.facebook.com/#{uid}/picture?type=square"
|
||||
when :instagram then auth_data['info'].try(:[], 'image')
|
||||
@@ -85,7 +86,7 @@ class User
|
||||
|
||||
# This is the user name as it is shown to other users
|
||||
def friends_name
|
||||
auth_data['info']['nickname'] rescue ''
|
||||
auth_data['info']['nickname'] rescue name.to_s
|
||||
end
|
||||
|
||||
def has_active_list?
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Suppliers::SupplierSerializer < Qwaiter::Serializer
|
||||
self.root = :supplier
|
||||
attributes :extended_version, :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
|
||||
attributes :extended_version, :open, :name, :email, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
|
||||
:facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count
|
||||
|
||||
def extended_version
|
||||
|
||||
@@ -70,9 +70,9 @@ en:
|
||||
cannot_move_to_occupied_table: 'You cannot move to an occupied table'
|
||||
moved_to_another_table: 'The table is changed.'
|
||||
confirmation_title: 'Move to another table?'
|
||||
confirmation_body: 'Do you want to move to another table?'
|
||||
confirmation_body: 'Do you want to move to table %{number}?'
|
||||
confirm:
|
||||
cencel: Cancel
|
||||
cancel: Cancel
|
||||
confirm: 'Yes'
|
||||
list_needs_help:
|
||||
help_is_on_its_way: 'Help is already on its way'
|
||||
|
||||
@@ -68,9 +68,9 @@ nl:
|
||||
cannot_move_to_occupied_table: 'Je kan niet verhuizen naar een tafel die reeds gebruikt wordt.'
|
||||
moved_to_another_table: 'De tafel is gewijzigd.'
|
||||
confirmation_title: 'Naar een andere tafel verhuizen?'
|
||||
confirmation_body: 'Wil je aan een andere tafel gaan zitten?'
|
||||
confirmation_body: 'Wil je verplaatsen naar tafel %{number}?'
|
||||
confirm:
|
||||
cencel: Annuleer
|
||||
cancel: Annuleer
|
||||
confirm: 'Ja'
|
||||
list_needs_help:
|
||||
help_is_on_its_way: 'Er wordt al iemand naar je tafel gestuurd'
|
||||
|
||||
@@ -3,13 +3,13 @@ module Qwaiter
|
||||
# attribute :_id, key: :id
|
||||
attributes :id, :created_at, :updated_at
|
||||
# Bug in rails 4.1 serializing symbols in jsonify
|
||||
def to_json(*args)
|
||||
as_json.to_json(*args)
|
||||
end
|
||||
#def to_json(*args)
|
||||
#as_json.to_json(*args)
|
||||
#end
|
||||
|
||||
def id
|
||||
object._id
|
||||
end
|
||||
#def id
|
||||
#object._id
|
||||
#end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ step "the supplier table should have been linked to the first section" do
|
||||
end
|
||||
|
||||
step "the supplier clicks on the table having the new list in the section view" do
|
||||
page.find(".section-table-#{@table.id}").click
|
||||
js_click ".section-table-#{@table.id}"
|
||||
end
|
||||
|
||||
step "the supplier table actions of the new list should be visible" do
|
||||
|
||||
@@ -3,8 +3,8 @@ step "I provide a new supplier email address" do
|
||||
end
|
||||
|
||||
step "the supplier submits the supplier settings form" do
|
||||
find('.submit-supplier-settings').click
|
||||
sleep 1.5 # give application some time
|
||||
js_click '.submit-supplier-settings'
|
||||
#sleep 1.5 # give application some time
|
||||
end
|
||||
|
||||
step "the supplier email should not have been changed" do
|
||||
|
||||
@@ -4,7 +4,7 @@ step "there is another table" do
|
||||
end
|
||||
|
||||
step "the user should see a popup asking the user if he would like to change table" do
|
||||
move_table_body = page.evaluate_script "t('move_table.confirmation_body')"
|
||||
move_table_body = page.evaluate_script "t('move_table.confirmation_body', #{@other_table.attributes.to_json})"
|
||||
move_table_body.should be_present
|
||||
page.should have_content move_table_body
|
||||
end
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe User do
|
||||
let(:user){ build :user }
|
||||
let(:user_params){ {} }
|
||||
let(:user){ build :user, user_params }
|
||||
describe '#supplier_name' do
|
||||
it "displays the auth data name if available" do
|
||||
user.auth_data = {'info' => {'name' => 'Benji setup'}}
|
||||
@@ -19,8 +20,12 @@ describe User do
|
||||
user.friends_name.should == 'Benji'
|
||||
end
|
||||
|
||||
it 'falls back to unkown if not present' do
|
||||
it 'falls back to empty if not present' do
|
||||
user.friends_name.should == ''
|
||||
end
|
||||
it 'falls back to persisted property name if not present through auth data' do
|
||||
user_params[:name] = "Joe"
|
||||
user.friends_name.should == 'Joe'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,6 +65,16 @@ module SpecEmberHelpers
|
||||
def js_click(selector)
|
||||
find selector
|
||||
page.execute_script "$('#{selector}').click()"
|
||||
|
||||
# Wait for jQuery activity to finish
|
||||
wait_cycles = 0
|
||||
active_count = page.evaluate_script '$.active'
|
||||
while active_count > 0 and wait_cycles < 30
|
||||
sleep 0.1
|
||||
active_count = page.evaluate_script '$.active'
|
||||
wait_cycles += 1
|
||||
end
|
||||
raise "There are still active jQuery tasks" if active_count > 0
|
||||
end
|
||||
|
||||
def js_text(selector)
|
||||
|
||||
Reference in New Issue
Block a user