1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

Merge branch 'dev' for release 6.2.0

This commit is contained in:
Nicolas Florentin 2023-10-13 16:02:21 +02:00
commit 60da6a8cc1
38 changed files with 242 additions and 41 deletions

View File

@ -1,5 +1,14 @@
# Changelog Fab-manager
## v6.2.0 2023 October 13
- Fix a bug: fix ReservationReminderWorker, was sending reservation reminder to users with a event reservation not validated by admin + adds tests for all scenarios
- Fix a bug: admin could not create new SupportingDocumentType (problem was on js side)
- Fix a bug: fix back button on space edit page
- Fix a bug: fix members tour (help), a selector was not valid anymore
- Fix a bug: unable to save OpenID extra_authorize_params as json
- Fix machine list bug : when there is no user logged in and access machines list with at least one machine associated to a space
## v6.1.2 2023 October 2
- Fix a bug: minor pb (exception raised) when bot hit api/projects#search without beeing authenticated

View File

@ -218,7 +218,8 @@ export const EventForm: React.FC<EventFormProps> = ({ action, event, onError, on
id="event_image_attributes"
accept="image/*"
defaultImage={output.event_image_attributes}
label={t('app.admin.event_form.matching_visual')} />
label={t('app.admin.event_form.illustration')}
tooltip={t('app.admin.event_form.illustration_recommendation')} />
<FormRichText control={control}
id="description"
rules={{ required: true }}

View File

@ -28,7 +28,7 @@ type FormImageUploadProps<TFieldValues, TContext extends object> = FormComponent
/**
* This component allows to upload image, in forms managed by react-hook-form.
*/
export const FormImageUpload = <TFieldValues extends FieldValues, TContext extends object>({ id, label, register, control, defaultImage, className, rules, disabled, error, warning, formState, onFileChange, onFileRemove, accept, setValue, size, onFileIsMain, mainOption = false }: FormImageUploadProps<TFieldValues, TContext>) => {
export const FormImageUpload = <TFieldValues extends FieldValues, TContext extends object>({ id, label, register, control, defaultImage, className, rules, disabled, error, warning, formState, onFileChange, onFileRemove, accept, setValue, size, onFileIsMain, mainOption = false, tooltip }: FormImageUploadProps<TFieldValues, TContext>) => {
const { t } = useTranslation('shared');
const [file, setFile] = useState<ImageType>(defaultImage);
@ -125,7 +125,8 @@ export const FormImageUpload = <TFieldValues extends FieldValues, TContext exten
warning={warning}
id={`${id}.attachment_files`}
onChange={onFileSelected}
placeholder={placeholder()}/>
placeholder={placeholder()}
tooltip={tooltip} />
{hasImage() && <FabButton onClick={onRemoveFile} icon={<Trash size={20} weight="fill" />} className="is-main" />}
</div>
</div>

View File

@ -58,7 +58,7 @@ const MachineCard: React.FC<MachineCardProps> = ({ user, machine, onShowMachine,
return (
<div className={`machine-card ${loading ? 'loading' : ''} ${machine.disabled ? 'disabled' : ''} ${!machine.reservable ? 'unreservable' : ''}`}>
{machinePicture()}
{machine.space && user.role === 'admin' && <FabBadge icon='pin-map' iconWidth='3rem' /> }
{machine.space && user && user.role === 'admin' && <FabBadge icon='pin-map' iconWidth='3rem' /> }
<div className="machine-name">
{machine.name}
</div>

View File

@ -123,7 +123,8 @@ export const MachineForm: React.FC<MachineFormProps> = ({ action, machine, onErr
id="machine_image_attributes"
accept="image/*"
defaultImage={output.machine_image_attributes}
label={t('app.admin.machine_form.illustration')} />
label={t('app.admin.machine_form.illustration')}
tooltip={t('app.admin.machine_form.illustration_recommendation')} />
<FormRichText control={control}
id="description"
rules={{ required: true }}

View File

@ -123,7 +123,8 @@ export const SpaceForm: React.FC<SpaceFormProps> = ({ action, space, onError, on
id="space_image_attributes"
accept="image/*"
defaultImage={output.space_image_attributes}
label={t('app.admin.space_form.illustration')} />
label={t('app.admin.space_form.illustration')}
tooltip={t('app.admin.space_form.illustration_recommendation')} />
<FormInput register={register}
type="number"
id="default_places"

View File

@ -57,13 +57,20 @@ export const SupportingDocumentsTypeForm: React.FC<SupportingDocumentsTypeFormPr
onChange('name', value);
};
/**
* to know if select input for groups is display or not
*/
const displayGroupsSelect = (): boolean => {
return (supportingDocumentType == null || supportingDocumentType?.document_type === 'User') && (groups.length > 0);
};
return (
<div className="supporting-documents-type-form">
<div className="info-area">
{t('app.admin.settings.account.supporting_documents_type_form.type_form_info')}
</div>
<form name="supportingDocumentTypeForm">
{supportingDocumentType?.document_type === 'User' &&
{displayGroupsSelect() &&
<div className="field">
<Select defaultValue={groupsValues()}
placeholder={t('app.admin.settings.account.supporting_documents_type_form.select_group')}

View File

@ -49,7 +49,9 @@ const SupportingDocumentsTypesList: React.FC<SupportingDocumentsTypesListProps>
// get groups
useEffect(() => {
GroupAPI.index({ disabled: false }).then(data => {
if (documentType === 'User') {
setGroups(data);
}
SupportingDocumentTypeAPI.index({ document_type: documentType }).then(pData => {
setSupportingDocumentsTypes(pData);
});

View File

@ -126,7 +126,8 @@ export const TrainingForm: React.FC<TrainingFormProps> = ({ action, training, on
id="training_image_attributes"
accept="image/*"
defaultImage={output.training_image_attributes}
label={t('app.admin.training_form.illustration')} />
label={t('app.admin.training_form.illustration')}
tooltip={t('app.admin.training_form.illustration_recommendation')} />
<FormRichText control={control}
id="description"
rules={{ required: true }}

View File

@ -511,7 +511,7 @@ Application.Controllers.controller('AdminMembersController', ['$scope', '$sce',
});
if ($scope.members.length > 0) {
uitour.createStep({
selector: '.members-management .members-list .buttons',
selector: '.members-management .members-list .member-actions',
stepId: 'actions',
order: 4,
title: _t('app.admin.tour.members.actions.title'),

View File

@ -268,6 +268,12 @@ Application.Controllers.controller('EditSpaceController', ['$scope', '$state', '
return space;
}
/**
* Changes the current user's view, redirecting him to the spaces list
*/
$scope.cancel = function () { $state.go('app.public.spaces_list'); };
// Using the SpacesController
return new SpacesController($scope, $state);
}]);

View File

@ -191,7 +191,6 @@
overflow: hidden;
img {
aspect-ratio: 16/9;
object-fit: cover;
object-position: center;
}
@ -200,7 +199,7 @@
img {
display: block;
max-width: 100%;
height: auto;
max-height: 700px;
}
}

View File

@ -11,7 +11,7 @@
}
.project-image {
@include imageRatio(50%);
@include imageRatio(56%);
background-size: cover;
background-position: center;
border-bottom: 1px solid var(--gray-soft-dark);

View File

@ -333,6 +333,7 @@
</div>
</div>
</div>
<span class="block m-t-xs m-l text-gray text-sm" translate>{{ 'app.admin.settings.background_picture_recommendation' }}</span>
<button name="button" type="submit" class="btn btn-warning m-t m-l" ng-disabled="profileImageForm.$invalid" translate>{{ 'app.shared.buttons.save' }}</button>
</form>
</div>

View File

@ -28,6 +28,7 @@
<div class="fileinput-preview fileinput-exists thumbnail" data-trigger="fileinput" style="max-width: 334px;">
<img ng-src="{{ project.project_image }}" alt="" />
</div>
<span class="help-block text-sm" translate>{{ 'app.shared.project.illustration_recommendation' }}</span>
<div>
<span class="btn btn-default btn-file"><span class="fileinput-new">{{ 'app.shared.project.add_an_illustration' | translate }} <i class="fa fa-upload fa-fw"></i></span><span class="fileinput-exists" translate>{{ 'app.shared.buttons.change' }}</span>
<input type="file"

View File

@ -2,7 +2,7 @@
<div class="row no-gutter">
<div class="col-md-1 hidden-xs">
<section class="heading-btn">
<a ng-click="backPrevLocation($event)"><i class="fas fa-long-arrow-alt-left "></i></a>
<a ng-click="cancel()"><i class="fas fa-long-arrow-alt-left "></i></a>
</section>
</div>
<div class="col-md-8 b-l b-r">

View File

@ -16,4 +16,16 @@ class OpenIdConnectProvider < ApplicationRecord
validates :display, inclusion: { in: %w[page popup touch wap], allow_nil: true }
validates :prompt, inclusion: { in: %w[none login consent select_account], allow_nil: true }
validates :client_auth_method, inclusion: { in: %w[basic jwks] }
store_accessor :extra_authorize_params
def extra_authorize_params=(val)
return unless val.is_a?(String)
begin
super JSON.parse(val)
rescue JSON::ParserError
errors[:extra_authorize_params].add('is not valid JSON')
super
end
end
end

View File

@ -16,6 +16,6 @@ if @provider.providable_type == OpenIdConnectProvider.name
:prompt, :send_scope_to_token_endpoint, :client__identifier, :client__secret, :client__authorization_endpoint,
:client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url
json.scope @provider.providable[:scope]
json.extra_authorize_params @provider.providable[:extra_authorize_params]
json.extra_authorize_params @provider.providable[:extra_authorize_params].to_json
end
end

View File

@ -26,13 +26,13 @@
<a href="<%= root_url %>">
<img src="<%= File.join(root_url, CustomAsset.get_url('logo-file')) %>"
alt="<%=fablab_name%>"
width="140px;" />
width="140" />
</a>
<% else %>
<a href="<%= root_url %>">
<img src="<%= File.join(root_url, asset_pack_path('static/fabmanager-logo.png')) %>"
alt="<%=fablab_name%>"
width="140px;" />
width="140" />
</a>
<% end %>
</td>

View File

@ -17,6 +17,7 @@ class ReservationReminderWorker
Reservation.joins(slots_reservations: :slot)
.where('slots.start_at >= ? AND slots.start_at <= ? AND slots_reservations.canceled_at IS NULL', starting, ending)
.includes(:reservable, :slots_reservations)
.each do |r|
already_sent = Notification.where(
attached_object_type: Reservation.name,
@ -24,6 +25,7 @@ class ReservationReminderWorker
notification_type_id: NotificationType.find_by(name: 'notify_member_reservation_reminder')
).count
next if already_sent.positive?
next if r.reservable.is_a?(Event) && r.reservable.pre_registration? && !r.slots_reservations.all?(&:is_valid?)
NotificationCenter.call type: 'notify_member_reservation_reminder',
receiver: r.user,

View File

@ -47,6 +47,7 @@ de:
description: "Beschreibung"
name: "Name"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Technical specifications"
category: "Kategorie"
attachments: "Anhänge"
@ -66,7 +67,8 @@ de:
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
description: "Beschreibung"
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Add a new training"
validate_your_training: "Validate your training"
settings: "Einstellungen"
@ -98,7 +100,8 @@ de:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Achtung! Beim Erstellen eines neuen Raums wird sein Preis für alle Abonnements mit 0 angelegt."
consider_changing_its_prices_before_creating_any_reservation_slot: "Ändern Sie ggf. die Preise, bevor Sie Reservierungs-Slots erstellen."
name: "Name"
illustration: "Abbildung"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Beschreibung"
characteristics: "Eigenschaften"
attachments: "Dateianhänge"
@ -118,7 +121,8 @@ de:
event_form:
ACTION_title: "{ACTION, select, create{Neue} other{Aktualisiere die}} Veranstaltung"
title: "Titel"
matching_visual: "Matching visual"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Beschreibung"
attachments: "Anhänge"
attached_files_pdf: "Angehängte Dateien (pdf)"
@ -1664,6 +1668,7 @@ de:
secondary_colour: "Sekundärfarbe:"
secondary: "Sekundär"
background_picture_of_the_profile_banner: "Hintergrundbild des Profil-Banners"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Profil-Banner ändern"
home_page: "Homepage"
news_of_the_home_page: "Neuigkeiten der Homepage:"

View File

@ -47,6 +47,7 @@ en:
description: "Description"
name: "Name"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Technical specifications"
category: "Category"
attachments: "Attachments"
@ -66,7 +67,8 @@ en:
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
description: "Description"
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Add a new training"
validate_your_training: "Validate your training"
settings: "Settings"
@ -98,7 +100,8 @@ en:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Watch out! When creating a new space, its prices are initialized at 0 for all subscriptions."
consider_changing_its_prices_before_creating_any_reservation_slot: "Consider changing its prices before creating any reservation slot."
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
characteristics: "Characteristics"
attachments: "Attachments"
@ -118,7 +121,8 @@ en:
event_form:
ACTION_title: "{ACTION, select, create{New} other{Update the}} event"
title: "Title"
matching_visual: "Matching visual"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
attachments: "Attachments"
attached_files_pdf: "Attached files (pdf)"
@ -1664,6 +1668,7 @@ en:
secondary_colour: "Secondary colour:"
secondary: "Secondary"
background_picture_of_the_profile_banner: "Background picture of the profile banner"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Change the profile banner"
home_page: "Home page"
news_of_the_home_page: "News of the home page:"

View File

@ -47,6 +47,7 @@ es:
description: "Descripción"
name: "Nombre"
illustration: "Ilustración"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Especificaciones técnicas"
category: "Categoría"
attachments: "Adjuntos"
@ -66,7 +67,8 @@ es:
dont_forget_to_change_them_before_creating_slots_for_this_training: "No olvide cambiarlos antes de crear franjas horarias para esta formación."
description: "Descripción"
name: "Nombre"
illustration: "Ilustración"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Añadir una nueva formación"
validate_your_training: "Valide su formación"
settings: "Configuración"
@ -98,7 +100,8 @@ es:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "¡Cuidado! Al crear un nuevo espacio, sus precios se inicializan a 0 para todas las suscripciones."
consider_changing_its_prices_before_creating_any_reservation_slot: "Considere cambiar sus precios antes de crear cualquier espacio de reserva."
name: "Nombre"
illustration: "Illustración"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Descripción"
characteristics: "Características"
attachments: "Adjuntos"
@ -118,7 +121,8 @@ es:
event_form:
ACTION_title: "{ACTION, select, create{Nuevo} other{Actualiza el}} evento"
title: "Título"
matching_visual: "Coincidiendo visual"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Descripción"
attachments: "Adjuntos"
attached_files_pdf: "Archivos adjuntos (pdf)"
@ -1664,6 +1668,7 @@ es:
secondary_colour: "Color secundario:"
secondary: "Secundario"
background_picture_of_the_profile_banner: "Imagen de fondo de la bandera del perfil"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Cambiar la bandera del perfil"
home_page: "Página de inicio"
news_of_the_home_page: "Noticias de la página principal:"

View File

@ -47,6 +47,7 @@ fr:
description: "Description"
name: "Nom"
illustration: "Illustration"
illustration_recommendation: "Taille maximale d'affichage : 932 * 700 px (ratio non contraint). L'image peut être recadrée dans la vue en liste. Seule la page de description affiche l'image complète."
technical_specifications: "Caractéristiques techniques"
category: "Catégorie"
attachments: "Pièces jointes"
@ -67,6 +68,7 @@ fr:
description: "Description"
name: "Nom"
illustration: "Visuel"
illustration_recommendation: "Taille maximale d'affichage : 932 * 700 px (ratio non contraint). L'image peut être recadrée dans la vue en liste. Seule la page de description affiche l'image complète."
add_a_new_training: "Ajouter une nouvelle formation"
validate_your_training: "Valider votre formation"
settings: "Paramètres"
@ -99,6 +101,7 @@ fr:
consider_changing_its_prices_before_creating_any_reservation_slot: "Pensez à modifier ces prix avant de créer des créneaux pour cet espace."
name: "Nom"
illustration: "Visuel"
illustration_recommendation: "Taille maximale d'affichage : 932 * 700 px (ratio non contraint). L'image peut être recadrée dans la vue en liste. Seule la page de description affiche l'image complète."
description: "Description"
characteristics: "Caractéristiques"
attachments: "Pièces jointes"
@ -118,7 +121,8 @@ fr:
event_form:
ACTION_title: "{ACTION, select, create{Nouvel } other{Mettre à jour l''}}événement"
title: "Titre"
matching_visual: "Visuel associé"
illustration: "Visuel"
illustration_recommendation: "Taille maximale d'affichage : 932 * 700 px (ratio non contraint). L'image peut être recadrée dans la vue en liste. Seule la page de description affiche l'image complète."
description: "Description"
attachments: "Pièces jointes"
attached_files_pdf: "Pièces jointes (pdf)"
@ -1664,6 +1668,7 @@ fr:
secondary_colour: "Couleur secondaire :"
secondary: "Secondaire"
background_picture_of_the_profile_banner: "Image de fond du bandeau de profil"
background_picture_recommendation: "Seulement un fichier .png. Taille recommandée : ratio 4/1, 1600 * 400 px."
change_the_profile_banner: "Changer le bandeau de profil"
home_page: "Page d'accueil"
news_of_the_home_page: "Brève de la page d'accueil :"

View File

@ -47,6 +47,7 @@ it:
description: "Descrizione"
name: "Nome"
illustration: "Illustrazione"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Specifiche tecniche"
category: "Categoria"
attachments: "Allegati"
@ -66,7 +67,8 @@ it:
dont_forget_to_change_them_before_creating_slots_for_this_training: "Non dimenticare di cambiarli prima di creare slot per questo addestramento."
description: "Descrizione"
name: "Nome"
illustration: "Illustrazione"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Aggiungi un nuovo addestramento"
validate_your_training: "Convalida il tuo addestramento"
settings: "Impostazioni"
@ -98,7 +100,8 @@ it:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Attenzione! Quando si crea un nuovo spazio, i suoi prezzi sono inizializzati a 0 per tutti gli abbonamenti."
consider_changing_its_prices_before_creating_any_reservation_slot: "Valuta se cambiare i suoi prezzi prima di creare qualsiasi slot di prenotazione."
name: "Nome"
illustration: "Illustrazione"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Descrizione"
characteristics: "Caratteristiche"
attachments: "Allegati"
@ -118,7 +121,8 @@ it:
event_form:
ACTION_title: "{ACTION, select, create{Nuovo} other{Aggiorna}} evento"
title: "Titolo"
matching_visual: "Corrispondenza illustazione"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Descrizione"
attachments: "Allegati"
attached_files_pdf: "File allegati (pdf)"
@ -1664,6 +1668,7 @@ it:
secondary_colour: "Colore secondario:"
secondary: "Secondario"
background_picture_of_the_profile_banner: "Immagine di sfondo del banner del profilo"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Cambia il banner del profilo"
home_page: "Home page"
news_of_the_home_page: "Notizie della home page:"

View File

@ -47,6 +47,7 @@
description: "Description"
name: "Name"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Technical specifications"
category: "Category"
attachments: "Attachments"
@ -66,7 +67,8 @@
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
description: "Description"
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Add a new training"
validate_your_training: "Validate your training"
settings: "Settings"
@ -98,7 +100,8 @@
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Watch out! When creating a new space, its prices are initialized at 0 for all subscriptions."
consider_changing_its_prices_before_creating_any_reservation_slot: "Consider changing its prices before creating any reservation slot."
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
characteristics: "Characteristics"
attachments: "Attachments"
@ -118,7 +121,8 @@
event_form:
ACTION_title: "{ACTION, select, create{New} other{Update the}} event"
title: "Title"
matching_visual: "Matching visual"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
attachments: "Attachments"
attached_files_pdf: "Attached files (pdf)"
@ -1664,6 +1668,7 @@
secondary_colour: "Secondary colour:"
secondary: "Secondary"
background_picture_of_the_profile_banner: "Background picture of the profile banner"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Change the profile banner"
home_page: "Hjemmeside"
news_of_the_home_page: "News of the home page:"

View File

@ -47,6 +47,7 @@ pt:
description: "Descrição"
name: "Nome"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
technical_specifications: "Especificações técnicas"
category: "Categoria"
attachments: "Anexos"
@ -66,7 +67,8 @@ pt:
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
description: "Descrição"
name: "Nome"
illustration: "Ilustração"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
add_a_new_training: "Adicionar um novo treinamento"
validate_your_training: "Validar seu treinamento"
settings: "Confirgurações"
@ -98,7 +100,8 @@ pt:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Watch out! When creating a new space, its prices are initialized at 0 for all subscriptions."
consider_changing_its_prices_before_creating_any_reservation_slot: "Consider changing its prices before creating any reservation slot."
name: "Name"
illustration: "Illustration"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
characteristics: "Characteristics"
attachments: "Attachments"
@ -118,7 +121,8 @@ pt:
event_form:
ACTION_title: "{ACTION, select, create{New} other{Update the}} event"
title: "Title"
matching_visual: "Matching visual"
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio). The image may be cropped in list view. Only the description page displays the full image."
description: "Description"
attachments: "Attachments"
attached_files_pdf: "Attached files (pdf)"
@ -1664,6 +1668,7 @@ pt:
secondary_colour: "Cor secundária:"
secondary: "Secundária"
background_picture_of_the_profile_banner: "Imagem de plano de fundo do perfil"
background_picture_recommendation: "Only .png file. Recommended size: 4/1 ratio, 1600*400 px."
change_the_profile_banner: "Alterar a capa do perfil"
home_page: "Página inicial"
news_of_the_home_page: "Notícias da página inicial:"

View File

@ -47,6 +47,7 @@ zu:
description: "crwdns31665:0crwdne31665:0"
name: "crwdns31659:0crwdne31659:0"
illustration: "crwdns31661:0crwdne31661:0"
illustration_recommendation: "crwdns38114:0crwdne38114:0"
technical_specifications: "crwdns31667:0crwdne31667:0"
category: "crwdns36215:0crwdne36215:0"
attachments: "crwdns36833:0crwdne36833:0"
@ -66,7 +67,8 @@ zu:
dont_forget_to_change_them_before_creating_slots_for_this_training: "crwdns36843:0crwdne36843:0"
description: "crwdns31767:0crwdne31767:0"
name: "crwdns31763:0crwdne31763:0"
illustration: "crwdns31765:0crwdne31765:0"
illustration: "crwdns38116:0crwdne38116:0"
illustration_recommendation: "crwdns38118:0crwdne38118:0"
add_a_new_training: "crwdns31769:0crwdne31769:0"
validate_your_training: "crwdns31771:0crwdne31771:0"
settings: "crwdns36845:0crwdne36845:0"
@ -98,7 +100,8 @@ zu:
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "crwdns36877:0crwdne36877:0"
consider_changing_its_prices_before_creating_any_reservation_slot: "crwdns36879:0crwdne36879:0"
name: "crwdns31793:0crwdne31793:0"
illustration: "crwdns31795:0crwdne31795:0"
illustration: "crwdns38120:0crwdne38120:0"
illustration_recommendation: "crwdns38122:0crwdne38122:0"
description: "crwdns31797:0crwdne31797:0"
characteristics: "crwdns31799:0crwdne31799:0"
attachments: "crwdns36881:0crwdne36881:0"
@ -118,7 +121,8 @@ zu:
event_form:
ACTION_title: "crwdns36887:0ACTION={ACTION}crwdne36887:0"
title: "crwdns31817:0crwdne31817:0"
matching_visual: "crwdns31819:0crwdne31819:0"
illustration: "crwdns38124:0crwdne38124:0"
illustration_recommendation: "crwdns38126:0crwdne38126:0"
description: "crwdns31821:0crwdne31821:0"
attachments: "crwdns31823:0crwdne31823:0"
attached_files_pdf: "crwdns36889:0crwdne36889:0"
@ -1664,6 +1668,7 @@ zu:
secondary_colour: "crwdns26398:0crwdne26398:0"
secondary: "crwdns26400:0crwdne26400:0"
background_picture_of_the_profile_banner: "crwdns26402:0crwdne26402:0"
background_picture_recommendation: "crwdns38128:0crwdne38128:0"
change_the_profile_banner: "crwdns26404:0crwdne26404:0"
home_page: "crwdns26406:0crwdne26406:0"
news_of_the_home_page: "crwdns26408:0crwdne26408:0"

View File

@ -128,6 +128,7 @@ de:
name: "Name"
name_is_required: "Name ist erforderlich."
illustration: "Ansicht"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Illustration hinzufügen"
CAD_file: "CAD-Datei"
CAD_files: "CAD files"

View File

@ -128,6 +128,7 @@ en:
name: "Name"
name_is_required: "Name is required."
illustration: "Visual"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Add an illustration"
CAD_file: "CAD file"
CAD_files: "CAD files"

View File

@ -128,6 +128,7 @@ es:
name: "Nombre"
name_is_required: "Se requiere un nombre."
illustration: "Ilustración"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Añadir una ilustración"
CAD_file: "Fichero CAD"
CAD_files: "Archivos CAD"

View File

@ -128,6 +128,7 @@ fr:
name: "Nom"
name_is_required: "Le nom est requis."
illustration: "Illustration"
illustration_recommendation: "Taille maximale d'affichage : 932 * 700 px (ratio non contraint)."
add_an_illustration: "Ajouter un visuel"
CAD_file: "Fichier CAO"
CAD_files: "Fichiers CAD"

View File

@ -128,6 +128,7 @@ it:
name: "Nome"
name_is_required: "Il nome è obbligatorio."
illustration: "Illustrazione"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Aggiungi un'illustrazione"
CAD_file: "File CAD"
CAD_files: "File CAD"

View File

@ -128,6 +128,7 @@
name: "Navn"
name_is_required: "Navn er påkrevd."
illustration: "Bilde"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Legg til en illustrasjon"
CAD_file: "CAD-filer"
CAD_files: "CAD files"

View File

@ -128,6 +128,7 @@ pt:
name: "Nome"
name_is_required: "Nome é obrigatório."
illustration: "Foto"
illustration_recommendation: "Maximum display size: 932 * 700 px (unconstrained ratio)."
add_an_illustration: "Adicionar foto"
CAD_file: "Arquivo CAD"
CAD_files: "CAD files"

View File

@ -128,6 +128,7 @@ zu:
name: "crwdns28724:0crwdne28724:0"
name_is_required: "crwdns28726:0crwdne28726:0"
illustration: "crwdns28728:0crwdne28728:0"
illustration_recommendation: "crwdns38130:0crwdne38130:0"
add_an_illustration: "crwdns28730:0crwdne28730:0"
CAD_file: "crwdns28732:0crwdne28732:0"
CAD_files: "crwdns37647:0crwdne37647:0"

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "6.1.2",
"version": "6.2.0",
"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",

View File

@ -0,0 +1,109 @@
# frozen_string_literal: true
require 'test_helper'
require 'minitest/autorun'
class ReservationReminderWorkerTest < ActiveSupport::TestCase
include ActionMailer::TestHelper
setup do
@worker = ReservationReminderWorker.new
@training_slot = slots(:slot_1)
@event = events(:event_1)
@event_slot = slots(:slot_129)
@event_reservation = Reservation.create!(
reservable: @event,
nb_reserve_places: 1,
statistic_profile_id: statistic_profiles(:pdurand).id,
slots_reservations_attributes: [slot_id: @event_slot.id]
)
end
test 'send a reminder 24 hours before by default and is idempotent' do
travel_to @training_slot.start_at - 24.hours
assert_enqueued_emails 1 do
@worker.perform
end
assert_enqueued_emails 0 do
@worker.perform
end
end
test 'reminder_delay can be changed and is respected' do
Setting.set('reminder_delay', 15)
travel_to @training_slot.start_at - 17.hours
assert_enqueued_emails 0 do
@worker.perform
end
travel_to @training_slot.start_at - 13.hours
assert_enqueued_emails 0 do
@worker.perform
end
travel_to @training_slot.start_at - 15.hours
assert_enqueued_emails 1 do
@worker.perform
end
assert_enqueued_emails 0 do
@worker.perform
end
end
test 'do nothing if setting reminder_enable is false' do
Setting.set('reminder_enable', false)
assert_enqueued_emails 0 do
assert_nil @worker.perform
end
end
test 'do nothing if slots_reservations is canceled' do
travel_to @training_slot.start_at - 24.hours
@training_slot.slots_reservations[0].update!(canceled_at: 1.day.ago)
assert_enqueued_emails 0 do
@worker.perform
end
end
test '[event] do nothing if event.pre_registration is true and slots_reservation is not valid' do
@event.update!(pre_registration: true)
@event_reservation.slots_reservations.update_all(is_valid: false)
travel_to @event_slot.start_at - 24.hours
assert_enqueued_emails 0 do
@worker.perform
end
end
test '[event] do send the notification if event.pre_registration is true and slots_reservation is valid' do
@event.update!(pre_registration: true)
@event_reservation.slots_reservations.update_all(is_valid: true)
travel_to @event_slot.start_at - 24.hours
assert_enqueued_emails 1 do
@worker.perform
end
end
test '[event] do send the notification if event.pre_registration is false' do
travel_to @event_slot.start_at - 24.hours
assert_enqueued_emails 1 do
@worker.perform
end
end
end