mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
Merge branch 'dev' for release 5.3.4
This commit is contained in:
commit
68e71c2bae
@ -1,5 +1,12 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
|
## v5.3.4 2022 March 01
|
||||||
|
|
||||||
|
- Fix line break on home events' cards
|
||||||
|
- Fix typo "projets" => "projects"
|
||||||
|
- Removes dead code about OpenAPI (open_api_calls_count_tracings)
|
||||||
|
- Fix a bug: unable to modify OpenLab url for production
|
||||||
|
|
||||||
## v5.3.3 2022 February 08
|
## v5.3.3 2022 February 08
|
||||||
|
|
||||||
- Updated german translations
|
- Updated german translations
|
||||||
|
@ -6,7 +6,7 @@ class API::OpenlabProjectsController < API::ApiController
|
|||||||
before_action :init_openlab
|
before_action :init_openlab
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render json: @projets.search(params[:q], page: params[:page], per_page: params[:per_page]).response.body
|
render json: @projects.search(params[:q], page: params[:page], per_page: params[:per_page]).response.body
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
render json: { errors: ['service unavailable'] }
|
render json: { errors: ['service unavailable'] }
|
||||||
end
|
end
|
||||||
@ -15,6 +15,6 @@ class API::OpenlabProjectsController < API::ApiController
|
|||||||
|
|
||||||
def init_openlab
|
def init_openlab
|
||||||
client = Openlab::Client.new(app_secret: Setting.get('openlab_app_secret'))
|
client = Openlab::Client.new(app_secret: Setting.get('openlab_app_secret'))
|
||||||
@projets = Openlab::Projects.new(client)
|
@projects = Openlab::Projects.new(client)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -157,6 +157,8 @@ Application.Filters.filter('breakFilter', [function () {
|
|||||||
Application.Filters.filter('simpleText', [function () {
|
Application.Filters.filter('simpleText', [function () {
|
||||||
return function (text) {
|
return function (text) {
|
||||||
if (text != null) {
|
if (text != null) {
|
||||||
|
// add a line break after specific closing tags
|
||||||
|
text = text.replace(/(<\/p>|<\/h4>|<\/h5>|<\/h6>|<\/pre>|<\/blockquote>)/g, '\n');
|
||||||
text = text.replace(/<br\s*\/?>/g, '\n');
|
text = text.replace(/<br\s*\/?>/g, '\n');
|
||||||
return text.replace(/<\/?\w+[^>]*>/g, '');
|
return text.replace(/<\/?\w+[^>]*>/g, '');
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
class OpenAPI::CallsCountTracing < ApplicationRecord
|
|
||||||
belongs_to :projets, foreign_key: :open_api_client_id
|
|
||||||
validates :projets, :at, presence: true
|
|
||||||
end
|
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
# OpenAPI::Client keeps track of the authorized accesses to the 3-rd party API (aka. OpenAPI)
|
# OpenAPI::Client keeps track of the authorized accesses to the 3-rd party API (aka. OpenAPI)
|
||||||
class OpenAPI::Client < ApplicationRecord
|
class OpenAPI::Client < ApplicationRecord
|
||||||
has_many :calls_count_tracings, foreign_key: :open_api_client_id, dependent: :destroy
|
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates_uniqueness_of :token
|
validates_uniqueness_of :token
|
||||||
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
class OpenAPITraceCallsCountWorker < Sidekiq::Workers
|
|
||||||
include Sidekiq::Worker
|
|
||||||
sidekiq_options queue: 'default', retry: true
|
|
||||||
|
|
||||||
def perform
|
|
||||||
OpenAPI::Client.find_each do |client|
|
|
||||||
OpenAPI::CallsCountTracing.create!(projets: client, calls_count: client.calls_count, at: DateTime.current)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -7,7 +7,7 @@ class OpenlabWorker
|
|||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
client = Openlab::Client.new(app_secret: Setting.get('openlab_app_secret'))
|
client = Openlab::Client.new(app_secret: Setting.get('openlab_app_secret'))
|
||||||
@projets = Openlab::Projects.new(client)
|
@projects = Openlab::Projects.new(client)
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -17,12 +17,12 @@ class OpenlabWorker
|
|||||||
case action.to_s
|
case action.to_s
|
||||||
when /create/
|
when /create/
|
||||||
project = Project.find(project_id)
|
project = Project.find(project_id)
|
||||||
response = @projets.create(project.openlab_attributes)
|
response = @projects.create(project.openlab_attributes)
|
||||||
when /update/
|
when /update/
|
||||||
project = Project.find(project_id)
|
project = Project.find(project_id)
|
||||||
response = @projets.update(project_id, project.openlab_attributes)
|
response = @projects.update(project_id, project.openlab_attributes)
|
||||||
when /destroy/
|
when /destroy/
|
||||||
response = @projets.destroy(project_id)
|
response = @projects.destroy(project_id)
|
||||||
else
|
else
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
Openlab.configure do |config|
|
Openlab.configure do |config|
|
||||||
config.base_uri = Rails.application.secrets.openlab_base_uri unless Rails.env.production?
|
config.base_uri = Rails.application.secrets.openlab_base_uri if Rails.application.secrets.openlab_base_uri
|
||||||
end
|
end
|
||||||
|
@ -20,10 +20,6 @@ i_calendar_import:
|
|||||||
class: "ICalendarImportWorker"
|
class: "ICalendarImportWorker"
|
||||||
queue: default
|
queue: default
|
||||||
|
|
||||||
open_api_trace_calls_count:
|
|
||||||
cron: "0 4 * * 0" # every sunday at 4am
|
|
||||||
class: "OpenAPITraceCallsCountWorker"
|
|
||||||
|
|
||||||
reservation_reminder:
|
reservation_reminder:
|
||||||
cron: "1 * * * *"
|
cron: "1 * * * *"
|
||||||
class: "ReservationReminderWorker"
|
class: "ReservationReminderWorker"
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
class DropTableOpenAPICallsCountTracings < ActiveRecord::Migration[5.2]
|
||||||
|
def up
|
||||||
|
drop_table :open_api_calls_count_tracings
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
create_table :open_api_calls_count_tracings do |t|
|
||||||
|
t.belongs_to :open_api_client, foreign_key: true, index: true
|
||||||
|
t.integer :calls_count, null: false
|
||||||
|
t.datetime :at, null: false
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
31
db/schema.rb
31
db/schema.rb
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
ActiveRecord::Schema.define(version: 2022_02_25_143203) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "fuzzystrmatch"
|
enable_extension "fuzzystrmatch"
|
||||||
@ -19,8 +19,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
enable_extension "unaccent"
|
enable_extension "unaccent"
|
||||||
|
|
||||||
create_table "abuses", id: :serial, force: :cascade do |t|
|
create_table "abuses", id: :serial, force: :cascade do |t|
|
||||||
t.integer "signaled_id"
|
|
||||||
t.string "signaled_type"
|
t.string "signaled_type"
|
||||||
|
t.integer "signaled_id"
|
||||||
t.string "first_name"
|
t.string "first_name"
|
||||||
t.string "last_name"
|
t.string "last_name"
|
||||||
t.string "email"
|
t.string "email"
|
||||||
@ -49,8 +49,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
t.string "locality"
|
t.string "locality"
|
||||||
t.string "country"
|
t.string "country"
|
||||||
t.string "postal_code"
|
t.string "postal_code"
|
||||||
t.integer "placeable_id"
|
|
||||||
t.string "placeable_type"
|
t.string "placeable_type"
|
||||||
|
t.integer "placeable_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
@ -64,8 +64,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "assets", id: :serial, force: :cascade do |t|
|
create_table "assets", id: :serial, force: :cascade do |t|
|
||||||
t.integer "viewable_id"
|
|
||||||
t.string "viewable_type"
|
t.string "viewable_type"
|
||||||
|
t.integer "viewable_id"
|
||||||
t.string "attachment"
|
t.string "attachment"
|
||||||
t.string "type"
|
t.string "type"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
@ -133,8 +133,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "credits", id: :serial, force: :cascade do |t|
|
create_table "credits", id: :serial, force: :cascade do |t|
|
||||||
t.integer "creditable_id"
|
|
||||||
t.string "creditable_type"
|
t.string "creditable_type"
|
||||||
|
t.integer "creditable_id"
|
||||||
t.integer "plan_id"
|
t.integer "plan_id"
|
||||||
t.integer "hours"
|
t.integer "hours"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
@ -356,15 +356,15 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
|
|
||||||
create_table "notifications", id: :serial, force: :cascade do |t|
|
create_table "notifications", id: :serial, force: :cascade do |t|
|
||||||
t.integer "receiver_id"
|
t.integer "receiver_id"
|
||||||
t.integer "attached_object_id"
|
|
||||||
t.string "attached_object_type"
|
t.string "attached_object_type"
|
||||||
|
t.integer "attached_object_id"
|
||||||
t.integer "notification_type_id"
|
t.integer "notification_type_id"
|
||||||
t.boolean "is_read", default: false
|
t.boolean "is_read", default: false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "receiver_type"
|
t.string "receiver_type"
|
||||||
t.boolean "is_send", default: false
|
t.boolean "is_send", default: false
|
||||||
t.jsonb "meta_data", default: {}
|
t.jsonb "meta_data", default: "{}"
|
||||||
t.index ["notification_type_id"], name: "index_notifications_on_notification_type_id"
|
t.index ["notification_type_id"], name: "index_notifications_on_notification_type_id"
|
||||||
t.index ["receiver_id"], name: "index_notifications_on_receiver_id"
|
t.index ["receiver_id"], name: "index_notifications_on_receiver_id"
|
||||||
end
|
end
|
||||||
@ -402,15 +402,6 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
t.index ["subscription_id"], name: "index_offer_days_on_subscription_id"
|
t.index ["subscription_id"], name: "index_offer_days_on_subscription_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "open_api_calls_count_tracings", id: :serial, force: :cascade do |t|
|
|
||||||
t.integer "open_api_client_id"
|
|
||||||
t.integer "calls_count", null: false
|
|
||||||
t.datetime "at", null: false
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "updated_at", null: false
|
|
||||||
t.index ["open_api_client_id"], name: "index_open_api_calls_count_tracings_on_open_api_client_id"
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "open_api_clients", id: :serial, force: :cascade do |t|
|
create_table "open_api_clients", id: :serial, force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.integer "calls_count", default: 0
|
t.integer "calls_count", default: 0
|
||||||
@ -492,7 +483,6 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
t.integer "weight"
|
t.integer "weight"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.text "description"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "plans", id: :serial, force: :cascade do |t|
|
create_table "plans", id: :serial, force: :cascade do |t|
|
||||||
@ -550,8 +540,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
create_table "prices", id: :serial, force: :cascade do |t|
|
create_table "prices", id: :serial, force: :cascade do |t|
|
||||||
t.integer "group_id"
|
t.integer "group_id"
|
||||||
t.integer "plan_id"
|
t.integer "plan_id"
|
||||||
t.integer "priceable_id"
|
|
||||||
t.string "priceable_type"
|
t.string "priceable_type"
|
||||||
|
t.integer "priceable_id"
|
||||||
t.integer "amount"
|
t.integer "amount"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
@ -661,8 +651,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
t.text "message"
|
t.text "message"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "reservable_id"
|
|
||||||
t.string "reservable_type"
|
t.string "reservable_type"
|
||||||
|
t.integer "reservable_id"
|
||||||
t.integer "nb_reserve_places"
|
t.integer "nb_reserve_places"
|
||||||
t.integer "statistic_profile_id"
|
t.integer "statistic_profile_id"
|
||||||
t.index ["reservable_type", "reservable_id"], name: "index_reservations_on_reservable_type_and_reservable_id"
|
t.index ["reservable_type", "reservable_id"], name: "index_reservations_on_reservable_type_and_reservable_id"
|
||||||
@ -671,8 +661,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
|
|
||||||
create_table "roles", id: :serial, force: :cascade do |t|
|
create_table "roles", id: :serial, force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.integer "resource_id"
|
|
||||||
t.string "resource_type"
|
t.string "resource_type"
|
||||||
|
t.integer "resource_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
|
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
|
||||||
@ -1009,7 +999,6 @@ ActiveRecord::Schema.define(version: 2022_01_18_123741) do
|
|||||||
add_foreign_key "invoices", "wallet_transactions"
|
add_foreign_key "invoices", "wallet_transactions"
|
||||||
add_foreign_key "invoicing_profiles", "users"
|
add_foreign_key "invoicing_profiles", "users"
|
||||||
add_foreign_key "o_auth2_mappings", "o_auth2_providers"
|
add_foreign_key "o_auth2_mappings", "o_auth2_providers"
|
||||||
add_foreign_key "open_api_calls_count_tracings", "open_api_clients"
|
|
||||||
add_foreign_key "organizations", "invoicing_profiles"
|
add_foreign_key "organizations", "invoicing_profiles"
|
||||||
add_foreign_key "payment_gateway_objects", "payment_gateway_objects"
|
add_foreign_key "payment_gateway_objects", "payment_gateway_objects"
|
||||||
add_foreign_key "payment_schedule_items", "invoices"
|
add_foreign_key "payment_schedule_items", "invoices"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "fab-manager",
|
"name": "fab-manager",
|
||||||
"version": "5.3.3",
|
"version": "5.3.4",
|
||||||
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
|
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"fablab",
|
"fablab",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user