Skip to content

Commit 8003961

Browse files
committed
Merge branch 'dev' for release 6.0.9
2 parents 80642fa + 9bd570b commit 8003961

File tree

14 files changed

+48
-30
lines changed

14 files changed

+48
-30
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog Fab-manager
22

3+
## v6.0.9 2023 July 07
4+
5+
- Fix a bug: unable to show project step image in markdown file
6+
- Fix a bug: unable to update Store Order sub type in statistics
7+
- Fix a bug: unable to create plan with plan limitation
8+
- Ability to show all availabilities in calender for admin
9+
- Improved performance when marking all notifications as read
10+
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`
11+
312
## v6.0.8 2023 July 03
413

514
- Improved projects list filter

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ GEM
529529

530530
PLATFORMS
531531
x86_64-darwin-20
532+
x86_64-darwin-21
532533
x86_64-linux
533534

534535
DEPENDENCIES

app/controllers/api/notifications_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def update
6565
end
6666

6767
def update_all
68-
current_user.notifications.where(is_read: false).find_each(&:mark_as_read)
68+
current_user.notifications.where(is_read: false)
69+
.update_all(is_read: true, updated_at: Time.current) # rubocop:disable Rails/SkipsModelValidations
6970
head :no_content
7071
end
7172

app/frontend/src/javascript/controllers/projects.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ Application.Controllers.controller('ProjectsController', ['$scope', '$state', 'P
322322
$location.$$search.member_id = '';
323323
}
324324

325-
fromDate = $location.$$search.from_date ? new Date($location.$$search.from_date) : undefined;
326-
toDate = $location.$$search.to_date ? new Date($location.$$search.to_date) : undefined;
325+
const fromDate = $location.$$search.from_date ? new Date($location.$$search.from_date) : undefined;
326+
const toDate = $location.$$search.to_date ? new Date($location.$$search.to_date) : undefined;
327327

328328
// default search parameters
329329
$scope.search = {

app/frontend/src/stylesheets/modules/projects/projects.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@include header();
1717
padding-top: 0;
1818
}
19+
label { font-weight: 400; }
1920
.switch {
2021
display: flex;
2122
justify-content: space-between;

app/models/plan_limitation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class PlanLimitation < ApplicationRecord
88
belongs_to :machine, foreign_key: 'limitable_id', inverse_of: :plan_limitations
99
belongs_to :machine_category, foreign_key: 'limitable_id', inverse_of: :plan_limitations
1010

11-
validates :limitable_id, :limitable_type, :limit, :plan_id, presence: true
11+
validates :limitable_id, :limitable_type, :limit, presence: true
1212
validates :limitable_id, uniqueness: { scope: %i[limitable_type plan_id] }
1313

1414
# @return [Array<Machine,Event,Space,Training>]

app/services/availabilities/visibility_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def initialize
2222
# @return [Array<ActiveSupport::TimeWithZone,Date,Time>] as: [start,end]
2323
def visibility(user, available_type, range_start, range_end)
2424
if user&.privileged?
25-
window_start = [range_start, 1.month.ago].max
25+
window_start = range_start
2626
window_end = range_end
2727
else
2828
end_at = @maximum_visibility[:other]

app/services/orders/order_service.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ def update_state(order, current_user, state, note = nil)
4545

4646
# update in elasticsearch (statistics)
4747
stat_order = Stats::Order.search(query: { term: { orderId: order.id } })
48-
stat_order.map { |s| s.update(state: state) }
48+
sub_type = if state.in?(%w[paid in_progress ready delivered])
49+
'paid-processed'
50+
elsif state.in?(%w[payment_failed refunded canceled])
51+
'aborted'
52+
end
53+
54+
stat_order.map { |s| s.update(subType: sub_type, state: state) } if sub_type.present?
4955

5056
order
5157
end

app/services/project_to_markdown.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def call
2424
md << ReverseMarkdown.convert(project_step.description.to_s)
2525

2626
project_step.project_step_images.each_with_index do |image, i|
27-
md << "![#{I18n.t('app.shared.project.step_image')} #{i+1}](#{full_url(project.project_image.attachment.url)})"
27+
md << "![#{I18n.t('app.shared.project.step_image')} #{i+1}](#{full_url(image.attachment.url)})"
2828
end
2929
end
3030
end
@@ -85,4 +85,4 @@ def call
8585
def full_url(path)
8686
"#{Rails.application.routes.url_helpers.root_url[...-1]}#{path}"
8787
end
88-
end
88+
end

config/locales/app.admin.fr.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ fr:
415415
add_a_material: "Ajouter un matériau"
416416
themes: "Thématiques"
417417
add_a_new_theme: "Ajouter une nouvelle thématique"
418-
project_categories: "Categories"
419-
add_a_new_project_category: "Add a new category"
418+
project_categories: "Catégories"
419+
add_a_new_project_category: "Ajouter une nouvelle catégorie"
420420
licences: "Licences"
421421
statuses: "Statuts"
422422
description: "Description"
@@ -447,10 +447,10 @@ fr:
447447
open_lab_app_secret: "Secret"
448448
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."
449449
default_to_openlab: "Afficher OpenLab par défaut"
450-
filters: Projects list filters
451-
project_categories: Categories
450+
filters: Affichage des filtres
451+
project_categories: Personnalisation du filtre Catégories
452452
project_categories:
453-
name: "Name"
453+
name: "Nom"
454454
projects_setting:
455455
add: "Ajouter"
456456
actions_controls: "Actions"
@@ -1779,10 +1779,10 @@ fr:
17791779
extended_prices_in_same_day: "Prix étendus le même jour"
17801780
public_registrations: "Inscriptions publiques"
17811781
show_username_in_admin_list: "Afficher le nom d'utilisateur dans la liste"
1782-
projects_list_member_filter_presence: "Presence of member filter on projects list"
1783-
projects_list_date_filters_presence: "Presence of date filters on projects list"
1784-
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
1785-
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
1782+
projects_list_member_filter_presence: "Permettre la recherche de projets par membre"
1783+
projects_list_date_filters_presence: "Permettre la recherche de projets par dates"
1784+
project_categories_filter_placeholder: "Dans la galerie de projets, renommer le filtre \"Toutes les catégories\""
1785+
project_categories_wording: "Dans la fiche projet, renommer l'intitulé de l'encart Catégories"
17861786
overlapping_options:
17871787
training_reservations: "Formations"
17881788
machine_reservations: "Machines"

config/locales/app.public.fr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fr:
167167
full_price: "Plein tarif : "
168168
#projects gallery
169169
projects_list:
170-
filter: Filter
170+
filter: Filtre
171171
the_fablab_projects: "Les projets"
172172
add_a_project: "Ajouter un projet"
173173
network_search: "Réseau Fab-Manager"
@@ -184,10 +184,10 @@ fr:
184184
all_materials: "Tous les matériaux"
185185
load_next_projects: "Charger les projets suivants"
186186
rough_draft: "Brouillon"
187-
filter_by_member: "Filter by member"
188-
created_from: Created from
189-
created_to: Created to
190-
download_archive: Download
187+
filter_by_member: "Filtrer par membre"
188+
created_from: Créés depuis le
189+
created_to: Créés jusqu'au
190+
download_archive: Télécharger
191191
status_filter:
192192
all_statuses: "Tous les statuts"
193193
select_status: "Sélectionnez un statut"
@@ -221,7 +221,7 @@ fr:
221221
report: "Signaler"
222222
do_you_really_want_to_delete_this_project: "Êtes-vous sur de vouloir supprimer ce projet ?"
223223
status: "Statut"
224-
markdown_file: "Markdown file"
224+
markdown_file: "Fichier Markdown"
225225
#list of machines
226226
machines_list:
227227
the_fablab_s_machines: "Les machines"

config/locales/app.shared.fr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fr:
131131
illustration: "Illustration"
132132
add_an_illustration: "Ajouter un visuel"
133133
CAD_file: "Fichier CAO"
134-
CAD_files: "CAD files"
134+
CAD_files: "Fichiers CAD"
135135
allowed_extensions: "Extensions autorisées :"
136136
add_a_new_file: "Ajouter un nouveau fichier"
137137
description: "Description"
@@ -151,7 +151,7 @@ fr:
151151
employed_materials: "Matériaux utilisés"
152152
employed_machines: "Machines utilisées"
153153
collaborators: "Les collaborateurs"
154-
author: Author
154+
author: Auteur
155155
creative_commons_licences: "Licences Creative Commons"
156156
licence: "Licence"
157157
themes: "Thématiques"

config/locales/fr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,10 @@ fr:
697697
trainings_authorization_validity_duration: "Durée de la période de validité des formations"
698698
trainings_invalidation_rule: "Invalidation automatique des formations"
699699
trainings_invalidation_rule_period: "Période de grâce avant d'invalider une formation"
700-
projects_list_member_filter_presence: "Presence of member filter on projects list"
701-
projects_list_date_filters_presence: "Presence of dates filter on projects list"
702-
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
703-
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
700+
projects_list_member_filter_presence: "Permettre la recherche de projets par membre"
701+
projects_list_date_filters_presence: "Filtre de présence de dates sur la liste des projets"
702+
project_categories_filter_placeholder: "Dans la galerie de projets, renommer le filtre \"Toutes les catégories\""
703+
project_categories_wording: "Dans la fiche projet, renommer l'intitulé de l'encart Catégories"
704704
#statuses of projects
705705
statuses:
706706
new: "Nouveau"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fab-manager",
3-
"version": "6.0.8",
3+
"version": "6.0.9",
44
"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.",
55
"keywords": [
66
"fablab",

0 commit comments

Comments
 (0)