updates based on F5 testing

This commit is contained in:
2020-03-06 08:35:12 -05:00
parent 8288595b3f
commit f1ef618dae
18 changed files with 66 additions and 32 deletions
+2
View File
@@ -48,3 +48,5 @@ erl_crash.dump
/db/data
/db/config
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.include_relations(:employee, :supplier)
# Only select shifts from currently linked and employees
@employee_shifts.select! do |shift|
return false unless current_supplier.employee_ids.include?(shift.employee.try(:id))
shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
true
end
#@employee_shifts.select! do |shift|
# return false unless current_supplier.employee_ids.include?(shift.employee.try(:id))
# shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
# true
#end
#@employee_shifts.each { |shift| shift.employee.enrich_with_settings current_supplier.settings_for(shift.employee)
render json: @employee_shifts
end
def create
@@ -8,6 +8,7 @@ module Suppliers
# GET /employees.json
def index
@employees = current_supplier.employees
@employees.each { |employee| employee.enrich_with_settings current_supplier.settings_for(employee) }
render json: @employees
end
+14 -2
View File
@@ -15,8 +15,20 @@ module Users
#EMBER
def current
@list = current_user.active_list
params[:id] = @list.try(:id) # serializer determines collection or not based on the presence of this
show
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
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
def table
+10 -4
View File
@@ -4,10 +4,16 @@ module Users
def show
@supplier = Supplier.find(params[:id])
render json: {}, status: :not_found and return unless @supplier.present?
render json: @supplier, include: %w[
product_categories
product_categories.products
product_categories.products.product_variants
render json: @supplier
end
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
+12 -11
View File
@@ -3,19 +3,19 @@ module Users
respond_to :json
def show
@table = Table.find(params[:id])
render json: JSONAPI::Serializer.serialize(@table, serializer: Users::TableSerializer)
render json: @table, include: ['supplier']
end
def supplier
table = Table.find(params[:id])
supplier = table.supplier
supplier.product_categories.include_relations(products: :product_variants)
render json: supplier, include: %w[
product_categories
product_categories.products
product_categories.products.product_variants
]
end
#def supplier
# table = Table.find(params[:id])
# supplier = table.supplier
# supplier.product_categories.include_relations(products: :product_variants)
# render json: supplier, include: %w[
# product_categories
# product_categories.products
# product_categories.products.product_variants
# ]
#end
# POST /tables/:id/needs_help.json
def needs_help
@@ -67,6 +67,7 @@ module Users
res = {}
res[:active_list_present] = true if active_list.present?
res[:occupied] = table.occupied?
res[:active] = table.active?
res[:reserved] = table.reserved?
res[:supplier_closed] = table.supplier.closed?
res[:no_product_orders] = true unless product_orders = new_order_product_orders.presence
+4 -1
View File
@@ -32,7 +32,10 @@ class List
add_user(user)
user.save
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
+1
View File
@@ -9,6 +9,7 @@ class Table
property :needs_help, type: :boolean, default: false
property :width, type: Float, default: 0.8
property :height, type: Float, default: 0.8
property :active, type: :boolean, default: true
belongs_to :supplier
belongs_to :section
@@ -1,4 +1,4 @@
class Suppliers::TableSerializer
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
@@ -2,4 +2,5 @@ class Users::SupplierSerializer
include Qwaiter::UserBaseSerializer
attributes :open, :name, :orders_placed_count, :orders_in_process_count, :user_message
has_many :product_categories, serializer: Users::ProductCategorySerializer
related_link_for :product_categories
end
+2 -2
View File
@@ -1,13 +1,13 @@
class Users::TableSerializer
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
#def list_id
#object.active_list_id || object.active_list.try(:id)
#end
related_link_for :supplier
#related_link_for :supplier
#def list
#object.active_list
#end
+1 -1
View File
@@ -1,4 +1,4 @@
class Waiter::TableSerializer
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
+1
View File
@@ -21,6 +21,7 @@ if Rails.env.development?
alias_method :old_execute, :execute
def execute(method, path, options, payload = nil, &block)
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)
end
end
+1
View File
@@ -0,0 +1 @@
qGuAi9ahLUJEShPQPWLZJXisYOSUQbrHQHNK1FAR0WcDIpK108h/2BRj3UHq29kkXffQx/L685yBZ7+M+BkActkD7ewjiZkeTFoVrs04PpRofA6AuCotSdqP2loBBcm90zHZZJ+NHlxGWNl/+LDxx59hQLLW59iyKZer+rUSXZ13PUVKmzq0JdjKlYmKi+GiNv5loZOH/e8v0qjUlrNZSHXpYrCTLesFFOk+TRs7yyWwz0LDzDhzqMTZqGUe9HtDNmocwFnEcXGASxNeV6DL3BgNs3C7TP2fr/3Mzw5DfoS65JhlE1OVjTHl25VuUc9M6+9t/SIBcgwNk/b5CNwSDzrd5JdFhn9DMJKHNQVV42vQ56K7+7LSurWgpf9LogAF+UOTan/oXz1xg4ckDczJTSHAqDrxD0Mtbc/H--OJqRgtqB2Y1zTwMG--umJWjBt94H2enx6iUyRHqw==
+1 -1
View File
@@ -62,7 +62,7 @@ Qwaiter::Application.configure do
# config.cache_store = :mem_cache_store
# 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)
# config.assets.precompile += %w( search.js )
+5 -2
View File
@@ -78,7 +78,11 @@ Qwaiter::Application.routes.draw do
get '/close_window' => 'dashboard#close_window'
namespace :users, path: '/user/api/v1' do
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
collection do
get :current
@@ -102,7 +106,6 @@ Qwaiter::Application.routes.draw do
post :join
post :order_products
get :status_info
get :supplier
end
end
end
+1 -1
View File
@@ -19,4 +19,4 @@ test:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_key_base: 9b7e6a299a820824ebe2c4717e0125e7a5c64c6950dbeb1b69389e41121f891ecc97b4a54f272b8aee20fecb42b3cc03e39825333bd9058fb1b4e033ced892a1
+2 -1
View File
@@ -15,7 +15,8 @@ fi
if [ -d "$certs_dir" ]; then
echo "Found certificates directory, copy it to local for inclusion in the docker build"
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
# 2. stop and remove all running/existing containers