Skip to content

Commit

Permalink
Merge branch 'dev' for release 6.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
gnepud committed Jul 7, 2023
2 parents 80642fa + 9bd570b commit 8003961
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 30 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog Fab-manager

## v6.0.9 2023 July 07

- Fix a bug: unable to show project step image in markdown file
- Fix a bug: unable to update Store Order sub type in statistics
- Fix a bug: unable to create plan with plan limitation
- Ability to show all availabilities in calender for admin
- Improved performance when marking all notifications as read
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`

## v6.0.8 2023 July 03

- Improved projects list filter
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ GEM

PLATFORMS
x86_64-darwin-20
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/api/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def update
end

def update_all
current_user.notifications.where(is_read: false).find_each(&:mark_as_read)
current_user.notifications.where(is_read: false)
.update_all(is_read: true, updated_at: Time.current) # rubocop:disable Rails/SkipsModelValidations
head :no_content
end

Expand Down
4 changes: 2 additions & 2 deletions app/frontend/src/javascript/controllers/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ Application.Controllers.controller('ProjectsController', ['$scope', '$state', 'P
$location.$$search.member_id = '';
}

fromDate = $location.$$search.from_date ? new Date($location.$$search.from_date) : undefined;
toDate = $location.$$search.to_date ? new Date($location.$$search.to_date) : undefined;
const fromDate = $location.$$search.from_date ? new Date($location.$$search.from_date) : undefined;
const toDate = $location.$$search.to_date ? new Date($location.$$search.to_date) : undefined;

// default search parameters
$scope.search = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@include header();
padding-top: 0;
}
label { font-weight: 400; }
.switch {
display: flex;
justify-content: space-between;
Expand Down
2 changes: 1 addition & 1 deletion app/models/plan_limitation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PlanLimitation < ApplicationRecord
belongs_to :machine, foreign_key: 'limitable_id', inverse_of: :plan_limitations
belongs_to :machine_category, foreign_key: 'limitable_id', inverse_of: :plan_limitations

validates :limitable_id, :limitable_type, :limit, :plan_id, presence: true
validates :limitable_id, :limitable_type, :limit, presence: true
validates :limitable_id, uniqueness: { scope: %i[limitable_type plan_id] }

# @return [Array<Machine,Event,Space,Training>]
Expand Down
2 changes: 1 addition & 1 deletion app/services/availabilities/visibility_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def initialize
# @return [Array<ActiveSupport::TimeWithZone,Date,Time>] as: [start,end]
def visibility(user, available_type, range_start, range_end)
if user&.privileged?
window_start = [range_start, 1.month.ago].max
window_start = range_start
window_end = range_end
else
end_at = @maximum_visibility[:other]
Expand Down
8 changes: 7 additions & 1 deletion app/services/orders/order_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ def update_state(order, current_user, state, note = nil)

# update in elasticsearch (statistics)
stat_order = Stats::Order.search(query: { term: { orderId: order.id } })
stat_order.map { |s| s.update(state: state) }
sub_type = if state.in?(%w[paid in_progress ready delivered])
'paid-processed'
elsif state.in?(%w[payment_failed refunded canceled])
'aborted'
end

stat_order.map { |s| s.update(subType: sub_type, state: state) } if sub_type.present?

order
end
Expand Down
4 changes: 2 additions & 2 deletions app/services/project_to_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def call
md << ReverseMarkdown.convert(project_step.description.to_s)

project_step.project_step_images.each_with_index do |image, i|
md << "![#{I18n.t('app.shared.project.step_image')} #{i+1}](#{full_url(project.project_image.attachment.url)})"
md << "![#{I18n.t('app.shared.project.step_image')} #{i+1}](#{full_url(image.attachment.url)})"
end
end
end
Expand Down Expand Up @@ -85,4 +85,4 @@ def call
def full_url(path)
"#{Rails.application.routes.url_helpers.root_url[...-1]}#{path}"
end
end
end
18 changes: 9 additions & 9 deletions config/locales/app.admin.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ fr:
add_a_material: "Ajouter un matériau"
themes: "Thématiques"
add_a_new_theme: "Ajouter une nouvelle thématique"
project_categories: "Categories"
add_a_new_project_category: "Add a new category"
project_categories: "Catégories"
add_a_new_project_category: "Ajouter une nouvelle catégorie"
licences: "Licences"
statuses: "Statuts"
description: "Description"
Expand Down Expand Up @@ -447,10 +447,10 @@ fr:
open_lab_app_secret: "Secret"
openlab_default_info_html: "Dans la galerie de projets, les visiteurs peuvent choisir entre deux vues : tous les projets de l'ensemble du réseau OpenLab, ou uniquement les projets documentés dans votre Fab Lab.<br/>Ici, vous pouvez choisir quelle vue est affichée par défaut."
default_to_openlab: "Afficher OpenLab par défaut"
filters: Projects list filters
project_categories: Categories
filters: Affichage des filtres
project_categories: Personnalisation du filtre Catégories
project_categories:
name: "Name"
name: "Nom"
projects_setting:
add: "Ajouter"
actions_controls: "Actions"
Expand Down Expand Up @@ -1779,10 +1779,10 @@ fr:
extended_prices_in_same_day: "Prix étendus le même jour"
public_registrations: "Inscriptions publiques"
show_username_in_admin_list: "Afficher le nom d'utilisateur dans la liste"
projects_list_member_filter_presence: "Presence of member filter on projects list"
projects_list_date_filters_presence: "Presence of date filters on projects list"
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
projects_list_member_filter_presence: "Permettre la recherche de projets par membre"
projects_list_date_filters_presence: "Permettre la recherche de projets par dates"
project_categories_filter_placeholder: "Dans la galerie de projets, renommer le filtre \"Toutes les catégories\""
project_categories_wording: "Dans la fiche projet, renommer l'intitulé de l'encart Catégories"
overlapping_options:
training_reservations: "Formations"
machine_reservations: "Machines"
Expand Down
12 changes: 6 additions & 6 deletions config/locales/app.public.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fr:
full_price: "Plein tarif : "
#projects gallery
projects_list:
filter: Filter
filter: Filtre
the_fablab_projects: "Les projets"
add_a_project: "Ajouter un projet"
network_search: "Réseau Fab-Manager"
Expand All @@ -184,10 +184,10 @@ fr:
all_materials: "Tous les matériaux"
load_next_projects: "Charger les projets suivants"
rough_draft: "Brouillon"
filter_by_member: "Filter by member"
created_from: Created from
created_to: Created to
download_archive: Download
filter_by_member: "Filtrer par membre"
created_from: Créés depuis le
created_to: Créés jusqu'au
download_archive: Télécharger
status_filter:
all_statuses: "Tous les statuts"
select_status: "Sélectionnez un statut"
Expand Down Expand Up @@ -221,7 +221,7 @@ fr:
report: "Signaler"
do_you_really_want_to_delete_this_project: "Êtes-vous sur de vouloir supprimer ce projet ?"
status: "Statut"
markdown_file: "Markdown file"
markdown_file: "Fichier Markdown"
#list of machines
machines_list:
the_fablab_s_machines: "Les machines"
Expand Down
4 changes: 2 additions & 2 deletions config/locales/app.shared.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fr:
illustration: "Illustration"
add_an_illustration: "Ajouter un visuel"
CAD_file: "Fichier CAO"
CAD_files: "CAD files"
CAD_files: "Fichiers CAD"
allowed_extensions: "Extensions autorisées :"
add_a_new_file: "Ajouter un nouveau fichier"
description: "Description"
Expand All @@ -151,7 +151,7 @@ fr:
employed_materials: "Matériaux utilisés"
employed_machines: "Machines utilisées"
collaborators: "Les collaborateurs"
author: Author
author: Auteur
creative_commons_licences: "Licences Creative Commons"
licence: "Licence"
themes: "Thématiques"
Expand Down
8 changes: 4 additions & 4 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ fr:
trainings_authorization_validity_duration: "Durée de la période de validité des formations"
trainings_invalidation_rule: "Invalidation automatique des formations"
trainings_invalidation_rule_period: "Période de grâce avant d'invalider une formation"
projects_list_member_filter_presence: "Presence of member filter on projects list"
projects_list_date_filters_presence: "Presence of dates filter on projects list"
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
projects_list_member_filter_presence: "Permettre la recherche de projets par membre"
projects_list_date_filters_presence: "Filtre de présence de dates sur la liste des projets"
project_categories_filter_placeholder: "Dans la galerie de projets, renommer le filtre \"Toutes les catégories\""
project_categories_wording: "Dans la fiche projet, renommer l'intitulé de l'encart Catégories"
#statuses of projects
statuses:
new: "Nouveau"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "6.0.8",
"version": "6.0.9",
"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": [
"fablab",
Expand Down

0 comments on commit 8003961

Please sign in to comment.