updates based on F5 testing
This commit is contained in:
@@ -48,3 +48,5 @@ erl_crash.dump
|
|||||||
/db/data
|
/db/data
|
||||||
/db/config
|
/db/config
|
||||||
public/user
|
public/user
|
||||||
|
|
||||||
|
/config/master.key
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ module Suppliers
|
|||||||
@employee_shifts = EmployeeShift.for_supplier(current_supplier, relevant_from: 1.week.ago)
|
@employee_shifts = EmployeeShift.for_supplier(current_supplier, relevant_from: 1.week.ago)
|
||||||
#@employee_shifts.include_relations(:employee, :supplier)
|
#@employee_shifts.include_relations(:employee, :supplier)
|
||||||
# Only select shifts from currently linked and employees
|
# Only select shifts from currently linked and employees
|
||||||
@employee_shifts.select! do |shift|
|
#@employee_shifts.select! do |shift|
|
||||||
return false unless current_supplier.employee_ids.include?(shift.employee.try(:id))
|
# return false unless current_supplier.employee_ids.include?(shift.employee.try(:id))
|
||||||
shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
|
# shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
|
||||||
true
|
# true
|
||||||
end
|
#end
|
||||||
|
#@employee_shifts.each { |shift| shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
|
||||||
render json: @employee_shifts
|
render json: @employee_shifts
|
||||||
end
|
end
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Suppliers
|
|||||||
# GET /employees.json
|
# GET /employees.json
|
||||||
def index
|
def index
|
||||||
@employees = current_supplier.employees
|
@employees = current_supplier.employees
|
||||||
|
@employees.each { |employee| employee.enrich_with_settings current_supplier.settings_for(employee) }
|
||||||
render json: @employees
|
render json: @employees
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,20 @@ module Users
|
|||||||
#EMBER
|
#EMBER
|
||||||
def current
|
def current
|
||||||
@list = current_user.active_list
|
@list = current_user.active_list
|
||||||
params[:id] = @list.try(:id) # serializer determines collection or not based on the presence of this
|
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
|
||||||
show
|
include_config = %w[
|
||||||
|
supplier
|
||||||
|
supplier.product_categories
|
||||||
|
supplier.product_categories.products
|
||||||
|
supplier.product_categories.products.product_variants
|
||||||
|
join_requests
|
||||||
|
join_requests.user
|
||||||
|
table
|
||||||
|
orders
|
||||||
|
orders.product_orders
|
||||||
|
]
|
||||||
|
include_config << 'users' if @list.user_ids.size > 1
|
||||||
|
render json: @list, include: include_config, serializer: Users::ListSerializer, is_collection: false
|
||||||
end
|
end
|
||||||
|
|
||||||
def table
|
def table
|
||||||
|
|||||||
@@ -4,10 +4,16 @@ module Users
|
|||||||
def show
|
def show
|
||||||
@supplier = Supplier.find(params[:id])
|
@supplier = Supplier.find(params[:id])
|
||||||
render json: {}, status: :not_found and return unless @supplier.present?
|
render json: {}, status: :not_found and return unless @supplier.present?
|
||||||
render json: @supplier, include: %w[
|
render json: @supplier
|
||||||
product_categories
|
end
|
||||||
product_categories.products
|
|
||||||
product_categories.products.product_variants
|
def product_categories
|
||||||
|
@supplier = Supplier.find(params[:id])
|
||||||
|
render json: {}, status: :not_found and return unless @supplier.present?
|
||||||
|
@supplier.product_categories.include_relations products: :product_variants
|
||||||
|
render json: @supplier.product_categories, serializer: Users::ProductCategorySerializer, is_collection: true, include: %w[
|
||||||
|
products
|
||||||
|
products.product_variants
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ module Users
|
|||||||
respond_to :json
|
respond_to :json
|
||||||
def show
|
def show
|
||||||
@table = Table.find(params[:id])
|
@table = Table.find(params[:id])
|
||||||
render json: JSONAPI::Serializer.serialize(@table, serializer: Users::TableSerializer)
|
render json: @table, include: ['supplier']
|
||||||
end
|
end
|
||||||
|
|
||||||
def supplier
|
#def supplier
|
||||||
table = Table.find(params[:id])
|
# table = Table.find(params[:id])
|
||||||
supplier = table.supplier
|
# supplier = table.supplier
|
||||||
supplier.product_categories.include_relations(products: :product_variants)
|
# supplier.product_categories.include_relations(products: :product_variants)
|
||||||
render json: supplier, include: %w[
|
# render json: supplier, include: %w[
|
||||||
product_categories
|
# product_categories
|
||||||
product_categories.products
|
# product_categories.products
|
||||||
product_categories.products.product_variants
|
# product_categories.products.product_variants
|
||||||
]
|
# ]
|
||||||
end
|
#end
|
||||||
|
|
||||||
# POST /tables/:id/needs_help.json
|
# POST /tables/:id/needs_help.json
|
||||||
def needs_help
|
def needs_help
|
||||||
@@ -67,6 +67,7 @@ module Users
|
|||||||
res = {}
|
res = {}
|
||||||
res[:active_list_present] = true if active_list.present?
|
res[:active_list_present] = true if active_list.present?
|
||||||
res[:occupied] = table.occupied?
|
res[:occupied] = table.occupied?
|
||||||
|
res[:active] = table.active?
|
||||||
res[:reserved] = table.reserved?
|
res[:reserved] = table.reserved?
|
||||||
res[:supplier_closed] = table.supplier.closed?
|
res[:supplier_closed] = table.supplier.closed?
|
||||||
res[:no_product_orders] = true unless product_orders = new_order_product_orders.presence
|
res[:no_product_orders] = true unless product_orders = new_order_product_orders.presence
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ class List
|
|||||||
add_user(user)
|
add_user(user)
|
||||||
user.save
|
user.save
|
||||||
join_request_user_ids_will_change!
|
join_request_user_ids_will_change!
|
||||||
save and broadcast_users 'join_request_approved', id: "jr-#{user.id}"
|
if save
|
||||||
|
broadcast_users 'join_request_approved', id: "jr-#{user.id}"
|
||||||
|
broadcast_supplier supplier_id, 'user_joined_list', list_id: id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class Table
|
|||||||
property :needs_help, type: :boolean, default: false
|
property :needs_help, type: :boolean, default: false
|
||||||
property :width, type: Float, default: 0.8
|
property :width, type: Float, default: 0.8
|
||||||
property :height, type: Float, default: 0.8
|
property :height, type: Float, default: 0.8
|
||||||
|
property :active, type: :boolean, default: true
|
||||||
|
|
||||||
belongs_to :supplier
|
belongs_to :supplier
|
||||||
belongs_to :section
|
belongs_to :section
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Suppliers::TableSerializer
|
class Suppliers::TableSerializer
|
||||||
include Qwaiter::SupplierBaseSerializer
|
include Qwaiter::SupplierBaseSerializer
|
||||||
attributes :number, :width, :height, :position_x, :position_y, :section_id#, :active_list_id
|
attributes :number, :width, :height, :position_x, :position_y, :section_id, :active#, :active_list_id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ class Users::SupplierSerializer
|
|||||||
include Qwaiter::UserBaseSerializer
|
include Qwaiter::UserBaseSerializer
|
||||||
attributes :open, :name, :orders_placed_count, :orders_in_process_count, :user_message
|
attributes :open, :name, :orders_placed_count, :orders_in_process_count, :user_message
|
||||||
has_many :product_categories, serializer: Users::ProductCategorySerializer
|
has_many :product_categories, serializer: Users::ProductCategorySerializer
|
||||||
|
related_link_for :product_categories
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
class Users::TableSerializer
|
class Users::TableSerializer
|
||||||
include Qwaiter::UserBaseSerializer
|
include Qwaiter::UserBaseSerializer
|
||||||
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied #, :supplier_id #, :alist_id
|
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :active #, :supplier_id #, :alist_id
|
||||||
has_one :supplier, serializer: Users::SupplierSerializer
|
has_one :supplier, serializer: Users::SupplierSerializer
|
||||||
|
|
||||||
#def list_id
|
#def list_id
|
||||||
#object.active_list_id || object.active_list.try(:id)
|
#object.active_list_id || object.active_list.try(:id)
|
||||||
#end
|
#end
|
||||||
|
|
||||||
related_link_for :supplier
|
#related_link_for :supplier
|
||||||
#def list
|
#def list
|
||||||
#object.active_list
|
#object.active_list
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Waiter::TableSerializer
|
class Waiter::TableSerializer
|
||||||
include Qwaiter::WaiterBaseSerializer
|
include Qwaiter::WaiterBaseSerializer
|
||||||
attributes :number, :width, :height, :position_x, :position_y, :section_id, :needs_help
|
attributes :number, :width, :height, :position_x, :position_y, :section_id, :needs_help, :active
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ if Rails.env.development?
|
|||||||
alias_method :old_execute, :execute
|
alias_method :old_execute, :execute
|
||||||
def execute(method, path, options, payload = nil, &block)
|
def execute(method, path, options, payload = nil, &block)
|
||||||
Rails.logger.debug "Couch: #{method} #{Rack::Utils.unescape path} #{options}"
|
Rails.logger.debug "Couch: #{method} #{Rack::Utils.unescape path} #{options}"
|
||||||
|
puts "Couch: #{method} #{Rack::Utils.unescape path} #{options}"
|
||||||
old_execute(method, path, options, payload, &block)
|
old_execute(method, path, options, payload, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
qGuAi9ahLUJEShPQPWLZJXisYOSUQbrHQHNK1FAR0WcDIpK108h/2BRj3UHq29kkXffQx/L685yBZ7+M+BkActkD7ewjiZkeTFoVrs04PpRofA6AuCotSdqP2loBBcm90zHZZJ+NHlxGWNl/+LDxx59hQLLW59iyKZer+rUSXZ13PUVKmzq0JdjKlYmKi+GiNv5loZOH/e8v0qjUlrNZSHXpYrCTLesFFOk+TRs7yyWwz0LDzDhzqMTZqGUe9HtDNmocwFnEcXGASxNeV6DL3BgNs3C7TP2fr/3Mzw5DfoS65JhlE1OVjTHl25VuUc9M6+9t/SIBcgwNk/b5CNwSDzrd5JdFhn9DMJKHNQVV42vQ56K7+7LSurWgpf9LogAF+UOTan/oXz1xg4ckDczJTSHAqDrxD0Mtbc/H--OJqRgtqB2Y1zTwMG--umJWjBt94H2enx6iUyRHqw==
|
||||||
@@ -62,7 +62,7 @@ Qwaiter::Application.configure do
|
|||||||
# config.cache_store = :mem_cache_store
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||||
config.action_controller.asset_host = "https://assets.mozo.bar"
|
config.assets.asset_host = "https://assets.mozo.bar"
|
||||||
|
|
||||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||||
# config.assets.precompile += %w( search.js )
|
# config.assets.precompile += %w( search.js )
|
||||||
|
|||||||
+5
-2
@@ -78,7 +78,11 @@ Qwaiter::Application.routes.draw do
|
|||||||
get '/close_window' => 'dashboard#close_window'
|
get '/close_window' => 'dashboard#close_window'
|
||||||
namespace :users, path: '/user/api/v1' do
|
namespace :users, path: '/user/api/v1' do
|
||||||
resources :product_categories, only: [:index]
|
resources :product_categories, only: [:index]
|
||||||
resources :suppliers, only: [:show]
|
resources :suppliers do
|
||||||
|
member do
|
||||||
|
get :product_categories
|
||||||
|
end
|
||||||
|
end
|
||||||
resources :lists, only: [:index, :show] do
|
resources :lists, only: [:index, :show] do
|
||||||
collection do
|
collection do
|
||||||
get :current
|
get :current
|
||||||
@@ -102,7 +106,6 @@ Qwaiter::Application.routes.draw do
|
|||||||
post :join
|
post :join
|
||||||
post :order_products
|
post :order_products
|
||||||
get :status_info
|
get :status_info
|
||||||
get :supplier
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -19,4 +19,4 @@ test:
|
|||||||
# Do not keep production secrets in the repository,
|
# Do not keep production secrets in the repository,
|
||||||
# instead read values from the environment.
|
# instead read values from the environment.
|
||||||
production:
|
production:
|
||||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
secret_key_base: 9b7e6a299a820824ebe2c4717e0125e7a5c64c6950dbeb1b69389e41121f891ecc97b4a54f272b8aee20fecb42b3cc03e39825333bd9058fb1b4e033ced892a1
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ fi
|
|||||||
if [ -d "$certs_dir" ]; then
|
if [ -d "$certs_dir" ]; then
|
||||||
echo "Found certificates directory, copy it to local for inclusion in the docker build"
|
echo "Found certificates directory, copy it to local for inclusion in the docker build"
|
||||||
rm -rf $script_dirname/ssl
|
rm -rf $script_dirname/ssl
|
||||||
cp -r $certs_dir $script_dirname/ssl
|
# Note the -L option for copy is required, since the target are symbolic links and we want the real files
|
||||||
|
cp -rL $certs_dir $script_dirname/ssl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. stop and remove all running/existing containers
|
# 2. stop and remove all running/existing containers
|
||||||
|
|||||||
Reference in New Issue
Block a user