From a58513a6088647b91c34458189e40ce48ead0925 Mon Sep 17 00:00:00 2001 From: Pavel Serikov Date: Tue, 14 Mar 2017 00:17:54 +0300 Subject: [PATCH 01/15] Portability of docker-compose.yml file has been improved --- docker/docker-compose.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8b5435319..71c1364f5 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,14 +6,14 @@ services: RAILS_ENV: production RACK_ENV: production env_file: - - /home/core/fabmanager/config/env + - ${PWD}/config/env volumes: - - /home/core/fabmanager/public/assets:/usr/src/app/public/assets - - /home/core/fabmanager/public/uploads:/usr/src/app/public/uploads - - /home/core/fabmanager/invoices:/usr/src/app/invoices - - /home/core/fabmanager/exports:/usr/src/app/exports - - /home/core/fabmanager/log:/var/log/supervisor - - /home/core/fabmanager/plugins:/usr/src/app/plugins + - ${PWD}/public/assets:/usr/src/app/public/assets + - ${PWD}/public/uploads:/usr/src/app/public/uploads + - ${PWD}/invoices:/usr/src/app/invoices + - ${PWD}/exports:/usr/src/app/exports + - ${PWD}/log:/var/log/supervisor + - ${PWD}/plugins:/usr/src/app/plugins depends_on: - postgres - redis @@ -23,19 +23,19 @@ services: postgres: image: postgres:9.4 volumes: - - /home/core/fabmanager/postgresql:/var/lib/postgresql/data + - ${PWD}/postgresql:/var/lib/postgresql/data restart: always elasticsearch: image: elasticsearch:1.7 volumes: - - /home/core/fabmanager/elasticsearch:/usr/share/elasticsearch/data + - ${PWD}/elasticsearch:/usr/share/elasticsearch/data restart: always redis: image: redis:3.0 volumes: - - /home/core/fabmanager/redis:/data + - ${PWD}/redis:/data restart: always nginx: @@ -44,9 +44,9 @@ services: - "80:80" - "443:443" volumes: - - /home/core/fabmanager/config/nginx:/etc/nginx/conf.d - - /home/core/fabmanager/letsencrypt/etc:/etc/letsencrypt - - /home/core/fabmanager/log:/var/log/nginx + - ${PWD}/config/nginx:/etc/nginx/conf.d + - ${PWD}/letsencrypt/etc:/etc/letsencrypt + - ${PWD}/log:/var/log/nginx volumes_from: - fabmanager:ro links: From 8d5966396d9af0d20d0be3f01db2dab939762e54 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 15 Mar 2017 12:50:19 +0100 Subject: [PATCH 02/15] [bug] editing a plan remove the rolling attribute --- CHANGELOG.md | 4 ++++ .../javascripts/controllers/admin/plans.coffee.erb | 2 +- app/assets/templates/admin/plans/_form.html.erb | 4 ++-- lib/tasks/fablab/fix.rake | 9 +++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c5482390..9866cc9e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog Fab Manager +## v2.4.11 2017 March 15 +- Fix a bug: editing and saving a plan, result in removing the rolling attribute +- [TODO DEPLOY] `rake fablab:fix:rolling_plans` + ## v2.4.10 2017 January 9 - Optimized notifications system diff --git a/app/assets/javascripts/controllers/admin/plans.coffee.erb b/app/assets/javascripts/controllers/admin/plans.coffee.erb index c632790b8..31b722d60 100644 --- a/app/assets/javascripts/controllers/admin/plans.coffee.erb +++ b/app/assets/javascripts/controllers/admin/plans.coffee.erb @@ -107,7 +107,7 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', interval: null intervalCount: 0 amount: null - isRolling: false + is_rolling: false partnerId: null partnerContact: null ui_weight: 0 diff --git a/app/assets/templates/admin/plans/_form.html.erb b/app/assets/templates/admin/plans/_form.html.erb index f68eced4c..5026b187e 100644 --- a/app/assets/templates/admin/plans/_form.html.erb +++ b/app/assets/templates/admin/plans/_form.html.erb @@ -99,7 +99,7 @@
{{ (plan.is_rolling ? 'yes' : 'no') | translate }} - + {{ 'a_rolling_subscription_will_begin_the_day_of_the_first_training' | translate }} {{ 'otherwise_it_will_begin_as_soon_as_it_is_bought' | translate }} diff --git a/lib/tasks/fablab/fix.rake b/lib/tasks/fablab/fix.rake index f230f2d47..f936d8e1a 100644 --- a/lib/tasks/fablab/fix.rake +++ b/lib/tasks/fablab/fix.rake @@ -16,5 +16,14 @@ namespace :fablab do e.save! end end + + task rolling_plans: :environment do + Plan.where(is_rolling: nil).each do |p| + if p.is_rolling.nil? and p.is_rolling != false + p.is_rolling = true + p.save! + end + end + end end end From b1abf35ae189657098a49ad20010b97fbc1223cf Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 15 Mar 2017 12:51:53 +0100 Subject: [PATCH 03/15] Version 2.4.11 --- .fabmanager-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fabmanager-version b/.fabmanager-version index a6c4b4a24..e393c3c55 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.4.10 \ No newline at end of file +2.4.11 \ No newline at end of file From 8e206cd3c52743f235cbd1b1cd6f4c298b6f14aa Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 15 Mar 2017 16:31:51 +0100 Subject: [PATCH 04/15] [bug] subscription name is not shown in invoices --- CHANGELOG.md | 1 + config/locales/en.yml | 2 +- config/locales/fr.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89494f74d..8db7c470b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix a bug: unable to delete an administrator from the system - Fix a bug: unable to delete an event with a linked custom price (#61) - Fix a bug: navigation in client calendar is bogus when browsing months (#59) +- Fix a bug: subscription name is not shown in invoices - [TODO DEPLOY] `rake db:migrate`, then `rake db:seed` - [TODO DEPLOY] add the `FABLAB_WITHOUT_SPACES` environment variable - [TODO DEPLOY] `rake fablab:es_add_spaces` diff --git a/config/locales/en.yml b/config/locales/en.yml index 910fc6d6e..a7aaed932 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -83,7 +83,7 @@ en: details: "Details" amount: "Amount" subscription_extended_for_free_from_START_to_END: "Subscription extended for free - From %{START} to %{END}" - subscription_NAME_from_START_to_END: "Subscription - From %{START} to %{END}" + subscription_NAME_from_START_to_END: "Subscription %{NAME} - From %{START} to %{END}" machine_reservation_DESCRIPTION: "Machine reservation - %{DESCRIPTION}" space_reservation_DESCRIPTION: "Space reservation - %{DESCRIPTION}" training_reservation_DESCRIPTION: "Training reservation - %{DESCRIPTION}" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 2efae5864..accf3c94d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -83,7 +83,7 @@ fr: details: "Détails" amount: "Montant" subscription_extended_for_free_from_START_to_END: "Abonnement prolongé gratuitement - Du %{START} au %{END}" - subscription_NAME_from_START_to_END: "Abonnement - Du %{START} au %{END}" + subscription_NAME_from_START_to_END: "Abonnement %{NAME} - Du %{START} au %{END}" machine_reservation_DESCRIPTION: "Réservation Machine - %{DESCRIPTION}" space_reservation_DESCRIPTION: "Réservation Espace - %{DESCRIPTION}" training_reservation_DESCRIPTION: "Réservation Formation - %{DESCRIPTION}" From 21560dd5d93136e53153d297c5e0553913d8abeb Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Mar 2017 12:06:58 +0100 Subject: [PATCH 05/15] show space details on image-click --- app/assets/templates/spaces/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/templates/spaces/index.html.erb b/app/assets/templates/spaces/index.html.erb index e640c1ec8..b0208155f 100644 --- a/app/assets/templates/spaces/index.html.erb +++ b/app/assets/templates/spaces/index.html.erb @@ -28,10 +28,10 @@
-
+
-
+

{{space.name}}

From 5abc85ae0a2170535bdf2b727640372c35674688 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Mar 2017 13:06:02 +0100 Subject: [PATCH 06/15] [feature] weekly plans --- app/assets/templates/admin/plans/_form.html.erb | 1 + app/models/plan.rb | 2 +- config/locales/app.shared.en.yml | 1 + config/locales/app.shared.fr.yml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/templates/admin/plans/_form.html.erb b/app/assets/templates/admin/plans/_form.html.erb index 609d5fe05..9f3e1bb38 100644 --- a/app/assets/templates/admin/plans/_form.html.erb +++ b/app/assets/templates/admin/plans/_form.html.erb @@ -49,6 +49,7 @@ ng-model="plan.interval" ng-disabled="method == 'PATCH'" required="required"> + diff --git a/app/models/plan.rb b/app/models/plan.rb index a9a7f72e2..16ecdbd5e 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -27,7 +27,7 @@ class Plan < ActiveRecord::Base validates :amount, :group, :base_name, presence: true validates :interval_count, numericality: { only_integer: true, greater_than_or_equal_to: 1 } - validates :interval, inclusion: { in: %w(year month) } + validates :interval, inclusion: { in: %w(year month week) } def self.create_for_all_groups(plan_params) plans = [] diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 73717c478..146a5d7c1 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -213,6 +213,7 @@ en: period: "Period" year: "Year" month: "Month" + week: "Week" period_is_required: "Period is required." subscription_price: "Subscription price" price_is_required: "Price is required." diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 31e080b30..b63e7154d 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -213,6 +213,7 @@ fr: period: "Période" year: "Année" month: "Mois" + week: "Semaine" period_is_required: "La période est requise." subscription_price: "Coût de l'abonnement" price_is_required: "Le prix est requis." From f4187d0b4bc815a96bd9782f920c2946bd4f1d92 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Mar 2017 15:47:25 +0100 Subject: [PATCH 07/15] [bug] news plans statistics are not shown --- CHANGELOG.md | 2 ++ app/models/plan.rb | 3 ++- lib/tasks/fablab/fix.rake | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db7c470b..cb22150e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,11 @@ - Fix a bug: unable to delete an event with a linked custom price (#61) - Fix a bug: navigation in client calendar is bogus when browsing months (#59) - Fix a bug: subscription name is not shown in invoices +- Fix a bug: news plans statistics are not shown - [TODO DEPLOY] `rake db:migrate`, then `rake db:seed` - [TODO DEPLOY] add the `FABLAB_WITHOUT_SPACES` environment variable - [TODO DEPLOY] `rake fablab:es_add_spaces` +- [TODO DEPLOY] `rake fablab:fix:new_plans_statistics` if you have created plans from v2.4.10 ## v2.4.11 2017 March 15 - Fix a bug: editing and saving a plan, result in removing the rolling attribute diff --git a/app/models/plan.rb b/app/models/plan.rb index a9a7f72e2..39cf549f7 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -11,7 +11,7 @@ class Plan < ActiveRecord::Base has_many :prices, dependent: :destroy extend FriendlyId - friendly_id :name, use: :slugged + friendly_id :base_name, use: :slugged accepts_nested_attributes_for :prices accepts_nested_attributes_for :plan_file, allow_destroy: true, reject_if: :all_blank @@ -28,6 +28,7 @@ class Plan < ActiveRecord::Base validates :amount, :group, :base_name, presence: true validates :interval_count, numericality: { only_integer: true, greater_than_or_equal_to: 1 } validates :interval, inclusion: { in: %w(year month) } + validates :base_name, :slug, presence: true def self.create_for_all_groups(plan_params) plans = [] diff --git a/lib/tasks/fablab/fix.rake b/lib/tasks/fablab/fix.rake index f936d8e1a..cc35f5c0b 100644 --- a/lib/tasks/fablab/fix.rake +++ b/lib/tasks/fablab/fix.rake @@ -25,5 +25,15 @@ namespace :fablab do end end end + + task new_plans_statistics: :environment do + StatisticSubType.where(key: nil).each do |sst| + p = Plan.find_by(name: sst.label) + if p + sst.key = p.slug + sst.save! + end + end + end end end From 1c483944b9235f406405fb642e8f6dae1b80e6d2 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Mar 2017 15:48:13 +0100 Subject: [PATCH 08/15] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb22150e2..30bce83ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - [TODO DEPLOY] `rake fablab:fix:new_plans_statistics` if you have created plans from v2.4.10 ## v2.4.11 2017 March 15 + - Fix a bug: editing and saving a plan, result in removing the rolling attribute - [TODO DEPLOY] `rake fablab:fix:rolling_plans` From c65525de6007ef17816f80712e550ca9ad07828b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 21 Mar 2017 15:55:41 +0100 Subject: [PATCH 09/15] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30bce83ff..fdd170dd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Improved admin's interface to create availabilities - Complete rewrote of the reservation cart functionality with improved stability, performance and sustainability - Replaced letter_opener by MailCatcher to preview e-mails in development environments +- Ability to create plans with durations based on weeks - Fix a bug: trainings reservations are not shown in the admin's calendar - Fix a bug: unable to delete an administrator from the system - Fix a bug: unable to delete an event with a linked custom price (#61) From 57ad5ca50e437791376e3ff89274a78c1c6b7c54 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 28 Mar 2017 13:30:10 +0200 Subject: [PATCH 10/15] updated schema --- db/schema.rb | 180 +++++++++++++++++++++++++-------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 372d18c04..a76ff5499 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -15,8 +15,8 @@ ActiveRecord::Schema.define(version: 20170227114634) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - enable_extension "pg_trgm" enable_extension "unaccent" + enable_extension "pg_trgm" create_table "abuses", force: :cascade do |t| t.integer "signaled_id" @@ -32,14 +32,14 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "abuses", ["signaled_type", "signaled_id"], name: "index_abuses_on_signaled_type_and_signaled_id", using: :btree create_table "addresses", force: :cascade do |t| - t.string "address", limit: 255 - t.string "street_number", limit: 255 - t.string "route", limit: 255 - t.string "locality", limit: 255 - t.string "country", limit: 255 - t.string "postal_code", limit: 255 + t.string "address" + t.string "street_number" + t.string "route" + t.string "locality" + t.string "country" + t.string "postal_code" t.integer "placeable_id" - t.string "placeable_type", limit: 255 + t.string "placeable_type" t.datetime "created_at" t.datetime "updated_at" end @@ -55,9 +55,9 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "assets", force: :cascade do |t| t.integer "viewable_id" - t.string "viewable_type", limit: 255 - t.string "attachment", limit: 255 - t.string "type", limit: 255 + t.string "viewable_type" + t.string "attachment" + t.string "type" t.datetime "created_at" t.datetime "updated_at" end @@ -74,11 +74,11 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "availabilities", force: :cascade do |t| t.datetime "start_at" t.datetime "end_at" - t.string "available_type", limit: 255 + t.string "available_type" t.datetime "created_at" t.datetime "updated_at" t.integer "nb_total_places" - t.boolean "destroying", default: false + t.boolean "destroying", default: false end create_table "availability_tags", force: :cascade do |t| @@ -92,7 +92,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "availability_tags", ["tag_id"], name: "index_availability_tags_on_tag_id", using: :btree create_table "categories", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" t.string "slug" @@ -101,7 +101,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "categories", ["slug"], name: "index_categories_on_slug", unique: true, using: :btree create_table "components", force: :cascade do |t| - t.string "name", limit: 255, null: false + t.string "name", null: false end create_table "coupons", force: :cascade do |t| @@ -119,7 +119,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "credits", force: :cascade do |t| t.integer "creditable_id" - t.string "creditable_type", limit: 255 + t.string "creditable_type" t.integer "plan_id" t.integer "hours" t.datetime "created_at" @@ -160,7 +160,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "event_themes", ["slug"], name: "index_event_themes_on_slug", unique: true, using: :btree create_table "events", force: :cascade do |t| - t.string "title", limit: 255 + t.string "title" t.text "description" t.datetime "created_at" t.datetime "updated_at" @@ -198,10 +198,10 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "exports", ["user_id"], name: "index_exports_on_user_id", using: :btree create_table "friendly_id_slugs", force: :cascade do |t| - t.string "slug", limit: 255, null: false - t.integer "sluggable_id", null: false + t.string "slug", null: false + t.integer "sluggable_id", null: false t.string "sluggable_type", limit: 50 - t.string "scope", limit: 255 + t.string "scope" t.datetime "created_at" end @@ -211,17 +211,17 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree create_table "groups", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "slug", limit: 255 + t.string "slug" end add_index "groups", ["slug"], name: "index_groups_on_slug", unique: true, using: :btree create_table "invoice_items", force: :cascade do |t| t.integer "invoice_id" - t.string "stp_invoice_item_id", limit: 255 + t.string "stp_invoice_item_id" t.integer "amount" t.datetime "created_at" t.datetime "updated_at" @@ -234,17 +234,17 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "invoices", force: :cascade do |t| t.integer "invoiced_id" - t.string "invoiced_type", limit: 255 - t.string "stp_invoice_id", limit: 255 + t.string "invoiced_type" + t.string "stp_invoice_id" t.integer "total" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" - t.string "reference", limit: 255 - t.string "avoir_mode", limit: 255 + t.string "reference" + t.string "avoir_mode" t.datetime "avoir_date" t.integer "invoice_id" - t.string "type", limit: 255 + t.string "type" t.boolean "subscription_to_expire" t.text "description" t.integer "wallet_amount" @@ -258,17 +258,17 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "invoices", ["wallet_transaction_id"], name: "index_invoices_on_wallet_transaction_id", using: :btree create_table "licences", force: :cascade do |t| - t.string "name", limit: 255, null: false + t.string "name", null: false t.text "description" end create_table "machines", force: :cascade do |t| - t.string "name", limit: 255, null: false + t.string "name", null: false t.text "description" t.text "spec" t.datetime "created_at" t.datetime "updated_at" - t.string "slug", limit: 255 + t.string "slug" end add_index "machines", ["slug"], name: "index_machines_on_slug", unique: true, using: :btree @@ -284,14 +284,14 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "notifications", force: :cascade do |t| t.integer "receiver_id" t.integer "attached_object_id" - t.string "attached_object_type", limit: 255 + t.string "attached_object_type" t.integer "notification_type_id" - t.boolean "is_read", default: false + t.boolean "is_read", default: false t.datetime "created_at" t.datetime "updated_at" t.string "receiver_type" - t.boolean "is_send", default: false - t.jsonb "meta_data", default: {} + t.boolean "is_send", default: false + t.jsonb "meta_data", default: {} end add_index "notifications", ["notification_type_id"], name: "index_notifications_on_notification_type_id", using: :btree @@ -360,20 +360,20 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "organizations", ["profile_id"], name: "index_organizations_on_profile_id", using: :btree create_table "plans", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.integer "amount" - t.string "interval", limit: 255 + t.string "interval" t.integer "group_id" - t.string "stp_plan_id", limit: 255 + t.string "stp_plan_id" t.datetime "created_at" t.datetime "updated_at" - t.integer "training_credit_nb", default: 0 - t.boolean "is_rolling", default: true + t.integer "training_credit_nb", default: 0 + t.boolean "is_rolling", default: true t.text "description" t.string "type" t.string "base_name" - t.integer "ui_weight", default: 0 - t.integer "interval_count", default: 1 + t.integer "ui_weight", default: 0 + t.integer "interval_count", default: 1 t.string "slug" end @@ -402,11 +402,11 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "profiles", force: :cascade do |t| t.integer "user_id" - t.string "first_name", limit: 255 - t.string "last_name", limit: 255 + t.string "first_name" + t.string "last_name" t.boolean "gender" t.date "birthday" - t.string "phone", limit: 255 + t.string "phone" t.text "interest" t.text "software_mastered" t.datetime "created_at" @@ -436,7 +436,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do t.integer "project_id" t.datetime "created_at" t.datetime "updated_at" - t.string "title", limit: 255 + t.string "title" t.integer "step_nb" end @@ -447,27 +447,27 @@ ActiveRecord::Schema.define(version: 20170227114634) do t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" - t.boolean "is_valid", default: false - t.string "valid_token", limit: 255 + t.boolean "is_valid", default: false + t.string "valid_token" end add_index "project_users", ["project_id"], name: "index_project_users_on_project_id", using: :btree add_index "project_users", ["user_id"], name: "index_project_users_on_user_id", using: :btree create_table "projects", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.text "description" t.datetime "created_at" t.datetime "updated_at" t.integer "author_id" t.text "tags" t.integer "licence_id" - t.string "state", limit: 255 - t.string "slug", limit: 255 + t.string "state" + t.string "slug" t.datetime "published_at" end - add_index "projects", ["slug"], name: "index_projects_on_slug", using: :btree + add_index "projects", ["slug"], name: "index_projects_on_slug", unique: true, using: :btree create_table "projects_components", force: :cascade do |t| t.integer "project_id" @@ -507,19 +507,19 @@ ActiveRecord::Schema.define(version: 20170227114634) do t.datetime "created_at" t.datetime "updated_at" t.integer "reservable_id" - t.string "reservable_type", limit: 255 - t.string "stp_invoice_id", limit: 255 + t.string "reservable_type" + t.string "stp_invoice_id" t.integer "nb_reserve_places" end - add_index "reservations", ["reservable_id", "reservable_type"], name: "index_reservations_on_reservable_id_and_reservable_type", using: :btree + add_index "reservations", ["reservable_type", "reservable_id"], name: "index_reservations_on_reservable_type_and_reservable_id", using: :btree add_index "reservations", ["stp_invoice_id"], name: "index_reservations_on_stp_invoice_id", using: :btree add_index "reservations", ["user_id"], name: "index_reservations_on_user_id", using: :btree create_table "roles", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.integer "resource_id" - t.string "resource_type", limit: 255 + t.string "resource_type" t.datetime "created_at" t.datetime "updated_at" end @@ -593,18 +593,18 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "statistic_fields", force: :cascade do |t| t.integer "statistic_index_id" - t.string "key", limit: 255 - t.string "label", limit: 255 + t.string "key" + t.string "label" t.datetime "created_at" t.datetime "updated_at" - t.string "data_type", limit: 255 + t.string "data_type" end add_index "statistic_fields", ["statistic_index_id"], name: "index_statistic_fields_on_statistic_index_id", using: :btree create_table "statistic_graphs", force: :cascade do |t| t.integer "statistic_index_id" - t.string "chart_type", limit: 255 + t.string "chart_type" t.integer "limit" t.datetime "created_at" t.datetime "updated_at" @@ -613,17 +613,17 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "statistic_graphs", ["statistic_index_id"], name: "index_statistic_graphs_on_statistic_index_id", using: :btree create_table "statistic_indices", force: :cascade do |t| - t.string "es_type_key", limit: 255 - t.string "label", limit: 255 + t.string "es_type_key" + t.string "label" t.datetime "created_at" t.datetime "updated_at" - t.boolean "table", default: true - t.boolean "ca", default: true + t.boolean "table", default: true + t.boolean "ca", default: true end create_table "statistic_sub_types", force: :cascade do |t| - t.string "key", limit: 255 - t.string "label", limit: 255 + t.string "key" + t.string "label" t.datetime "created_at" t.datetime "updated_at" end @@ -640,8 +640,8 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "statistic_types", force: :cascade do |t| t.integer "statistic_index_id" - t.string "key", limit: 255 - t.string "label", limit: 255 + t.string "key" + t.string "label" t.boolean "graph" t.datetime "created_at" t.datetime "updated_at" @@ -659,7 +659,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do create_table "subscriptions", force: :cascade do |t| t.integer "plan_id" t.integer "user_id" - t.string "stp_subscription_id", limit: 255 + t.string "stp_subscription_id" t.datetime "created_at" t.datetime "updated_at" t.datetime "expired_at" @@ -678,7 +678,7 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree create_table "themes", force: :cascade do |t| - t.string "name", limit: 255, null: false + t.string "name", null: false end create_table "tickets", force: :cascade do |t| @@ -693,13 +693,13 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "tickets", ["reservation_id"], name: "index_tickets_on_reservation_id", using: :btree create_table "trainings", force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" t.integer "nb_total_places" - t.string "slug", limit: 255 + t.string "slug" t.text "description" - t.boolean "public_page", default: true + t.boolean "public_page", default: true end add_index "trainings", ["slug"], name: "index_trainings_on_slug", unique: true, using: :btree @@ -754,32 +754,32 @@ ActiveRecord::Schema.define(version: 20170227114634) do add_index "user_trainings", ["user_id"], name: "index_user_trainings_on_user_id", using: :btree create_table "users", force: :cascade do |t| - t.string "email", limit: 255, default: "", null: false - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email", limit: 255 - t.integer "failed_attempts", default: 0, null: false - t.string "unlock_token", limit: 255 + t.string "unconfirmed_email" + t.integer "failed_attempts", default: 0, null: false + t.string "unlock_token" t.datetime "locked_at" t.datetime "created_at" t.datetime "updated_at" - t.boolean "is_allow_contact", default: true + t.boolean "is_allow_contact", default: true t.integer "group_id" - t.string "stp_customer_id", limit: 255 - t.string "username", limit: 255 - t.string "slug", limit: 255 - t.boolean "is_active", default: true - t.boolean "invoicing_disabled", default: false + t.string "stp_customer_id" + t.string "username" + t.string "slug" + t.boolean "is_active", default: true + t.boolean "invoicing_disabled", default: false t.string "provider" t.string "uid" t.string "auth_token" From 966ada599d35a2ee703d02ac11383a368472908a Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 28 Mar 2017 13:44:02 +0200 Subject: [PATCH 11/15] Version 2.5.0 --- .fabmanager-version | 2 +- CHANGELOG.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.fabmanager-version b/.fabmanager-version index 84a98500c..437459cd9 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.5.0-dev \ No newline at end of file +2.5.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd170dd0..8919751d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab Manager -## next release (v2.5.0) +## v2.5.0 2017 March 28 + - Ability to remove an unused custom price for an event (#61) - Prevent polling notifications when the application is in background - Ability to export the availabilities and their reservation rate from the admin calendar @@ -9,12 +10,13 @@ - Complete rewrote of the reservation cart functionality with improved stability, performance and sustainability - Replaced letter_opener by MailCatcher to preview e-mails in development environments - Ability to create plans with durations based on weeks +- Ease installations with docker-compose, in any directory (#63) - Fix a bug: trainings reservations are not shown in the admin's calendar - Fix a bug: unable to delete an administrator from the system - Fix a bug: unable to delete an event with a linked custom price (#61) - Fix a bug: navigation in client calendar is bogus when browsing months (#59) - Fix a bug: subscription name is not shown in invoices -- Fix a bug: news plans statistics are not shown +- Fix a bug: new plans statistics are not shown - [TODO DEPLOY] `rake db:migrate`, then `rake db:seed` - [TODO DEPLOY] add the `FABLAB_WITHOUT_SPACES` environment variable - [TODO DEPLOY] `rake fablab:es_add_spaces` From 2cc8096236a00b2e10f8a9101d2fd84bae6cbaed Mon Sep 17 00:00:00 2001 From: Peng DU Date: Tue, 28 Mar 2017 19:45:36 +0200 Subject: [PATCH 12/15] fix bug: cant get list of training reservation --- app/controllers/api/trainings_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/trainings_controller.rb b/app/controllers/api/trainings_controller.rb index 45ae39af5..9e452b346 100644 --- a/app/controllers/api/trainings_controller.rb +++ b/app/controllers/api/trainings_controller.rb @@ -57,7 +57,7 @@ class API::TrainingsController < API::ApiController def availabilities authorize Training @training = Training.find(params[:id]) - @availabilities = @training.availabilities.includes(slots: {reservation: {user: [:profile, :trainings] }}).order('start_at DESC') + @availabilities = @training.availabilities.includes(slots: {reservations: {user: [:profile, :trainings] }}).order('start_at DESC') end private From 1d53e3b5b7bd620c546ef981f9c8ebe3407c6476 Mon Sep 17 00:00:00 2001 From: Peng DU Date: Tue, 28 Mar 2017 19:53:48 +0200 Subject: [PATCH 13/15] fix json template of training reservation --- app/views/api/trainings/availabilities.json.jbuilder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/api/trainings/availabilities.json.jbuilder b/app/views/api/trainings/availabilities.json.jbuilder index 424cfc3ba..d65a5a1c8 100644 --- a/app/views/api/trainings/availabilities.json.jbuilder +++ b/app/views/api/trainings/availabilities.json.jbuilder @@ -4,8 +4,8 @@ json.availabilities @availabilities do |a| json.start_at a.start_at.iso8601 json.end_at a.end_at.iso8601 json.reservation_users a.slots.map do |slot| - json.id slot.reservation.user_id - json.full_name slot.reservation.user.profile.full_name - json.is_valid slot.reservation.user.trainings.include?(@training) + json.id slot.reservations.first.user_id + json.full_name slot.reservations.first.user.profile.full_name + json.is_valid slot.reservations.first.user.trainings.include?(@training) end end From 3fcf61de24229cb5cbd420dbe10cdb82807a4e34 Mon Sep 17 00:00:00 2001 From: cyril Date: Tue, 28 Mar 2017 20:13:18 +0200 Subject: [PATCH 14/15] hide spaces in admin's credit management if spaces are disabled --- app/assets/templates/admin/pricing/credits.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/templates/admin/pricing/credits.html.erb b/app/assets/templates/admin/pricing/credits.html.erb index b9647dec1..730759928 100644 --- a/app/assets/templates/admin/pricing/credits.html.erb +++ b/app/assets/templates/admin/pricing/credits.html.erb @@ -96,11 +96,11 @@ -

{{ 'pricing.spaces' }}

-
+

{{ 'pricing.spaces' }}

+
- +
From 4245bda9fd312076ceba3cd2ff7c4aabcc70ad26 Mon Sep 17 00:00:00 2001 From: cyril Date: Tue, 28 Mar 2017 20:26:32 +0200 Subject: [PATCH 15/15] Version 2.5.1 --- .fabmanager-version | 2 +- CHANGELOG.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.fabmanager-version b/.fabmanager-version index 437459cd9..73462a5a1 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.5.0 +2.5.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8919751d5..938ab5c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog Fab Manager +## v2.5.1 2017 March 28 +- hide spaces in admin's credit management if spaces are disabled +- Fix a bug : Can not display training tracking (this bug was introduced in version 2.5.0) +- [TODO DEPLOY] `rake assets:precompile` + ## v2.5.0 2017 March 28 - Ability to remove an unused custom price for an event (#61)
{{ 'pricing.space' }}