From 7ad1f8da3f61d7cda0b74475a7aeeae23c7369f9 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 14 Mar 2023 17:37:45 +0100 Subject: [PATCH] (quality) delete a plan limitation --- CHANGELOG.md | 1 + .../api/plan_limitations_controller.rb | 12 -- .../src/javascript/api/plan-limitation.ts | 9 -- .../components/base/edit-destroy-buttons.tsx | 38 +++++-- .../machines/machine-categories-list.tsx | 2 +- .../javascript/components/plans/plan-form.tsx | 1 - .../components/plans/plan-limit-form.tsx | 61 +++++----- .../machines/configure-packs-button.tsx | 2 +- .../components/store/product-item.tsx | 2 +- .../components/trainings/trainings.tsx | 2 +- .../modules/plans/plan-limit-form.scss | 21 ++++ app/policies/plan_limitation_policy.rb | 8 -- config/locales/app.admin.de.yml | 107 +++++++++--------- config/locales/app.admin.en.yml | 7 +- config/locales/app.admin.es.yml | 7 +- config/locales/app.admin.fr.yml | 5 +- config/locales/app.admin.no.yml | 7 +- config/locales/app.admin.pt.yml | 7 +- config/locales/app.admin.zu.yml | 7 +- config/routes.rb | 1 - 20 files changed, 157 insertions(+), 150 deletions(-) delete mode 100644 app/controllers/api/plan_limitations_controller.rb delete mode 100644 app/frontend/src/javascript/api/plan-limitation.ts delete mode 100644 app/policies/plan_limitation_policy.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eaf4fc0a..087ea6005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab-manager - [TODO DEPLOY] `rails db:seed` +- [TODO DEPLOY] `rails fablab:maintenance:rebuild_stylesheet` ## v5.8.2 2023 March 13 diff --git a/app/controllers/api/plan_limitations_controller.rb b/app/controllers/api/plan_limitations_controller.rb deleted file mode 100644 index ea2171d61..000000000 --- a/app/controllers/api/plan_limitations_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# API Controller for resources of type PlanLimitation -# PlanLimitation allows to restrict bookings of resources for the subscribers of that plan. -class API::PlanLimitationsController < API::ApiController - def destroy - @limitation = PlanLimitation.find(params[:id]) - authorize @limitation - @limitation.destroy - head :no_content - end -end diff --git a/app/frontend/src/javascript/api/plan-limitation.ts b/app/frontend/src/javascript/api/plan-limitation.ts deleted file mode 100644 index b167a104c..000000000 --- a/app/frontend/src/javascript/api/plan-limitation.ts +++ /dev/null @@ -1,9 +0,0 @@ -import apiClient from './clients/api-client'; -import { AxiosResponse } from 'axios'; - -export default class PlanLimitationAPI { - static async destroy (id: number): Promise { - const res: AxiosResponse = await apiClient.delete(`/api/plan_limitations/${id}`); - return res?.data; - } -} diff --git a/app/frontend/src/javascript/components/base/edit-destroy-buttons.tsx b/app/frontend/src/javascript/components/base/edit-destroy-buttons.tsx index d61de771d..3add0e256 100644 --- a/app/frontend/src/javascript/components/base/edit-destroy-buttons.tsx +++ b/app/frontend/src/javascript/components/base/edit-destroy-buttons.tsx @@ -6,28 +6,33 @@ import { FabButton } from './fab-button'; import { FabModal } from './fab-modal'; type EditDestroyButtonsCommon = { - onDeleteSuccess: (message: string) => void, onError: (message: string) => void, onEdit: () => void, itemId: number, - apiDestroy: (itemId: number) => Promise, + destroy: (itemId: number) => Promise, className?: string, iconSize?: number, showEditButton?: boolean, } -type EditDestroyButtonsMessages = - { itemType: string, confirmationTitle?: string, confirmationMessage?: string|ReactNode, deleteSuccessMessage?: string } | - { itemType?: never, confirmationTitle: string, confirmationMessage: string|ReactNode, deleteSuccessMessage: string} +type DeleteSuccess = + { onDeleteSuccess: (message: string) => void, deleteSuccessMessage: string } | + { onDeleteSuccess?: never, deleteSuccessMessage?: never } -type EditDestroyButtonsProps = EditDestroyButtonsCommon & EditDestroyButtonsMessages; +type DestroyMessages = + ({ showDestroyConfirmation?: true } & + ({ itemType: string, confirmationTitle?: string, confirmationMessage?: string|ReactNode } | + { itemType?: never, confirmationTitle: string, confirmationMessage: string|ReactNode })) | + { showDestroyConfirmation: false, itemType?: never, confirmationTitle?: never, confirmationMessage?: never }; + +type EditDestroyButtonsProps = EditDestroyButtonsCommon & DeleteSuccess & DestroyMessages; /** * This component shows a group of two buttons. * Destroy : shows a modal dialog to ask the user for confirmation about the deletion of the provided item. * Edit : triggers the provided function. */ -export const EditDestroyButtons: React.FC = ({ onDeleteSuccess, onError, onEdit, itemId, itemType, apiDestroy, confirmationTitle, confirmationMessage, deleteSuccessMessage, className, iconSize = 20, showEditButton = true }) => { +export const EditDestroyButtons: React.FC = ({ onDeleteSuccess, onError, onEdit, itemId, itemType, destroy, confirmationTitle, confirmationMessage, deleteSuccessMessage, className, iconSize = 20, showEditButton = true, showDestroyConfirmation = true }) => { const { t } = useTranslation('admin'); const [deletionModal, setDeletionModal] = useState(false); @@ -39,17 +44,28 @@ export const EditDestroyButtons: React.FC = ({ onDelete setDeletionModal(!deletionModal); }; + /** + * Triggered when the user clicks on the 'destroy' button + */ + const handleDestroyRequest = (): void => { + if (showDestroyConfirmation) { + toggleDeletionModal(); + } else { + onDeleteConfirmed(); + } + }; + /** * The deletion has been confirmed by the user. * Call the API to trigger the deletion of the given item */ const onDeleteConfirmed = (): void => { - apiDestroy(itemId).then(() => { - onDeleteSuccess(deleteSuccessMessage || t('app.admin.edit_destroy_buttons.deleted', { TYPE: itemType })); + destroy(itemId).then(() => { + typeof onDeleteSuccess === 'function' && onDeleteSuccess(deleteSuccessMessage || t('app.admin.edit_destroy_buttons.deleted')); }).catch((error) => { onError(t('app.admin.edit_destroy_buttons.unable_to_delete') + error); }); - toggleDeletionModal(); + setDeletionModal(false); }; return ( @@ -58,7 +74,7 @@ export const EditDestroyButtons: React.FC = ({ onDelete {showEditButton && } - + diff --git a/app/frontend/src/javascript/components/machines/machine-categories-list.tsx b/app/frontend/src/javascript/components/machines/machine-categories-list.tsx index addc6ae43..430783fbb 100644 --- a/app/frontend/src/javascript/components/machines/machine-categories-list.tsx +++ b/app/frontend/src/javascript/components/machines/machine-categories-list.tsx @@ -124,7 +124,7 @@ export const MachineCategoriesList: React.FC = ({ on onEdit={editMachineCategory(category)} itemId={category.id} itemType={t('app.admin.machine_categories_list.machine_category')} - apiDestroy={MachineCategoryAPI.destroy} /> + destroy={MachineCategoryAPI.destroy} /> diff --git a/app/frontend/src/javascript/components/plans/plan-form.tsx b/app/frontend/src/javascript/components/plans/plan-form.tsx index d66dd3882..17c33ec1e 100644 --- a/app/frontend/src/javascript/components/plans/plan-form.tsx +++ b/app/frontend/src/javascript/components/plans/plan-form.tsx @@ -333,7 +333,6 @@ export const PlanForm: React.FC = ({ action, plan, onError, onSuc register={register} formState={formState} onError={onError} - onSuccess={onSuccess} getValues={getValues} resetField={resetField} /> } diff --git a/app/frontend/src/javascript/components/plans/plan-limit-form.tsx b/app/frontend/src/javascript/components/plans/plan-limit-form.tsx index 7f33ad0ba..601dcce53 100644 --- a/app/frontend/src/javascript/components/plans/plan-limit-form.tsx +++ b/app/frontend/src/javascript/components/plans/plan-limit-form.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useEffect, useState } from 'react'; +import React, { ReactNode, useEffect, useState } from 'react'; import { Control, FormState, UseFormGetValues, UseFormResetField } from 'react-hook-form/dist/types/form'; import { FormSwitch } from '../form/form-switch'; import { useTranslation } from 'react-i18next'; @@ -12,14 +12,13 @@ import MachineAPI from '../../api/machine'; import MachineCategoryAPI from '../../api/machine-category'; import { FormUnsavedList } from '../form/form-unsaved-list'; import { EditDestroyButtons } from '../base/edit-destroy-buttons'; -import PlanLimitationAPI from '../../api/plan-limitation'; +import { X } from 'phosphor-react'; interface PlanLimitFormProps { register: UseFormRegister, control: Control, formState: FormState, onError: (message: string) => void, - onSuccess: (message: string) => void, getValues: UseFormGetValues, resetField: UseFormResetField } @@ -27,7 +26,7 @@ interface PlanLimitFormProps { /** * Form tab to manage a subscription's usage limit */ -export const PlanLimitForm = ({ register, control, formState, onError, onSuccess, getValues, resetField }: PlanLimitFormProps) => { +export const PlanLimitForm = ({ register, control, formState, onError, getValues, resetField }: PlanLimitFormProps) => { const { t } = useTranslation('admin'); const { fields, append, remove, update } = useFieldArray({ control, name: 'plan_limitations_attributes' }); const limiting = useWatch({ control, name: 'limiting' }); @@ -89,16 +88,24 @@ export const PlanLimitForm = ({ register, control, for }; /** - * Callback triggered when a previously-saved limitation was deleted. Return a callback accepting a message. + * Callback triggered when a saved limitation is requested to be deleted */ - const onLimitationDeleted = (index: number): (message: string) => void => { - return (message: string) => { - onSuccess(message); - remove(index); - // This have a little drowback: remove(index) will set the form as "dirty", and trigger the "unsaved form alert", even if clicking on save or not - // won't change anything to the deleted item. To improve this we could do the following: do not destroy the limitation through the API and instead - // set {_destroy: true} and destroy the limitation when saving the form, but we need some UI for items about to be deleted - // update(index, { ...getValues(`plan_limitations_attributes.${index}`), _destroy: true }); + const handleLimitationDelete = (index: number): () => Promise => { + return () => { + return new Promise((resolve) => { + update(index, { ...getValues(`plan_limitations_attributes.${index}`), _destroy: true }); + resolve(); + }); + }; + }; + + /** + * Triggered when the user clicks on "cancel" for a limitated previsouly marked as deleted + */ + const cancelDeletion = (index: number): (event: React.MouseEvent) => void => { + return (event) => { + event.preventDefault(); + update(index, { ...getValues(`plan_limitations_attributes.${index}`), _destroy: false }); }; }; @@ -178,7 +185,7 @@ export const PlanLimitForm = ({ register, control, for if (limitation.limitable_type !== 'MachineCategory' || limitation._modified) return false; return ( -
+
{t('app.admin.plan_limit_form.category')} @@ -191,14 +198,11 @@ export const PlanLimitForm = ({ register, control, for
- + showDestroyConfirmation={false} + destroy={handleLimitationDelete(index)} />
); @@ -213,7 +217,7 @@ export const PlanLimitForm = ({ register, control, for if (limitation.limitable_type !== 'Machine' || limitation._modified) return false; return ( -
+
{t('app.admin.plan_limit_form.machine')} @@ -223,17 +227,20 @@ export const PlanLimitForm = ({ register, control, for {t('app.admin.plan_limit_form.max_hours_per_day')}

{limitation.limit}

+ {limitation._destroy &&
{t('app.admin.plan_limit_form.ongoing_deletion')}
}
- + {t('app.admin.plan_limit_form.cancel_deletion')} + +

) || + + showDestroyConfirmation={false} + destroy={handleLimitationDelete(index)} />}
); diff --git a/app/frontend/src/javascript/components/pricing/machines/configure-packs-button.tsx b/app/frontend/src/javascript/components/pricing/machines/configure-packs-button.tsx index 3a2aa103f..de1126bad 100644 --- a/app/frontend/src/javascript/components/pricing/machines/configure-packs-button.tsx +++ b/app/frontend/src/javascript/components/pricing/machines/configure-packs-button.tsx @@ -114,7 +114,7 @@ export const ConfigurePacksButton: React.FC = ({ pack onEdit={() => handleRequestEdit(p)} itemId={p.id} itemType={t('app.admin.configure_packs_button.pack')} - apiDestroy={PrepaidPackAPI.destroy}/> + destroy={PrepaidPackAPI.destroy}/> = ({ product, onEdit, onDel onEdit={editProduct(product)} itemId={product.id} itemType={t('app.admin.store.product_item.product')} - apiDestroy={ProductAPI.destroy} /> + destroy={ProductAPI.destroy} />
); diff --git a/app/frontend/src/javascript/components/trainings/trainings.tsx b/app/frontend/src/javascript/components/trainings/trainings.tsx index 3ff49b787..f510507d2 100644 --- a/app/frontend/src/javascript/components/trainings/trainings.tsx +++ b/app/frontend/src/javascript/components/trainings/trainings.tsx @@ -199,7 +199,7 @@ export const Trainings: React.FC = ({ onError, onSuccess }) => { onEdit={() => toTrainingEdit(training)} itemId={training.id} itemType={t('app.admin.trainings.training')} - apiDestroy={TrainingAPI.destroy}/> + destroy={TrainingAPI.destroy}/>
))} diff --git a/app/frontend/src/stylesheets/modules/plans/plan-limit-form.scss b/app/frontend/src/stylesheets/modules/plans/plan-limit-form.scss index a9d8a1fac..5e1345622 100644 --- a/app/frontend/src/stylesheets/modules/plans/plan-limit-form.scss +++ b/app/frontend/src/stylesheets/modules/plans/plan-limit-form.scss @@ -58,6 +58,27 @@ } } } + + &.is-destroying { + background-color: var(--main-lightest); + .marker { + text-align: center; + font-weight: 500; + color: var(--main-dark); + margin: auto; + } + .actions > .cancel-action { + font-weight: normal; + svg { + vertical-align: middle; + margin-left: 1rem; + } + &:hover { + text-decoration: underline; + cursor: pointer; + } + } + } } } } diff --git a/app/policies/plan_limitation_policy.rb b/app/policies/plan_limitation_policy.rb deleted file mode 100644 index a2b2e94c0..000000000 --- a/app/policies/plan_limitation_policy.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# Check the access policies for API::PlanLimitationsController -class PlanLimitationPolicy < ApplicationPolicy - def destroy? - user.admin? - end -end diff --git a/config/locales/app.admin.de.yml b/config/locales/app.admin.de.yml index 3bf5b5482..2234321cc 100644 --- a/config/locales/app.admin.de.yml +++ b/config/locales/app.admin.de.yml @@ -2,7 +2,7 @@ de: app: admin: edit_destroy_buttons: - deleted: "The {TYPE} was successfully deleted." + deleted: "Successfully deleted." unable_to_delete: "Unable to delete: " delete_item: "Delete the {TYPE}" confirm_delete: "Delete" @@ -24,7 +24,7 @@ de: save: "Save" successfully_saved: "Your banner was successfully saved." machine_categories_list: - machine_categories: "Machines categories" + machine_categories: "Maschinen-Kategorien" add_a_machine_category: "Add a machine category" name: "Name" machines_number: "Number of machines" @@ -57,7 +57,7 @@ de: disabled_help: "When disabled, the machine won't be reservable and won't appear by default in the machines list." reservable: "Can this machine be reserved?" reservable_help: "When disabled, the machine will be shown in the default list of machines, but without the reservation button. If you already have created some availability slots for this machine, you may want to remove them: do it from the admin agenda." - save: "Save" + save: "Speichern" create_success: "The machine was created successfully" update_success: "The machine was updated successfully" training_form: @@ -74,7 +74,7 @@ de: associated_machines_help: "If you associate a machine to this training, the members will need to successfully pass this training before being able to reserve the machine." default_seats: "Default number of seats" public_page: "Show in training lists" - public_help: "When unchecked, this option will prevent the training from appearing in the trainings list." + public_help: "Wenn diese Option deaktiviert ist, wird verhindert, dass das Training in der Trainingliste erscheint." disable_training: "Disable the training" disabled_help: "When disabled, the training won't be reservable and won't appear by default in the trainings list." automatic_cancellation: "Automatic cancellation" @@ -90,39 +90,39 @@ de: validation_rule_info: "Define a rule that cancel an authorisation if the machines associated with the training are not reserved for a specific period of time. This rule prevails over the authorisations validity period." validation_rule_switch: "Activate the validation rule" validation_rule_period: "Time limit in months" - save: "Save" - create_success: "The training was created successfully" - update_success: "The training was updated successfully" + save: "Speichern" + create_success: "Die Schulung wurde erfolgreich erstellt" + update_success: "Die Schulung wurde erfolgreich aktualisiert" space_form: - ACTION_title: "{ACTION, select, create{New} other{Update the}} space" - 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." + ACTION_title: "{ACTION, select, create{Neu} other{Aktualisiere den}} Raum" + 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: "Illustration" - description: "Description" - characteristics: "Characteristics" - attachments: "Attachments" - attached_files_pdf: "Attached files (pdf)" - add_an_attachment: "Add an attachment" - settings: "Settings" - default_seats: "Default number of seats" - disable_space: "Disable the space" - disabled_help: "When disabled, the space won't be reservable and won't appear by default in the spaces list." - save: "Save" - create_success: "The space was created successfully" - update_success: "The space was updated successfully" + illustration: "Abbildung" + description: "Beschreibung" + characteristics: "Eigenschaften" + attachments: "Dateianhänge" + attached_files_pdf: "Angehängte Dateien (pdf)" + add_an_attachment: "Anhang hinzufügen" + settings: "Einstellungen" + default_seats: "Standardanzahl der Sitze" + disable_space: "Raum deaktivieren" + disabled_help: "Wenn deaktiviert, ist der Raum nicht reservierbar und erscheint standardmäßig nicht in der Liste der Leerzeichen." + save: "Speichern" + create_success: "Der Raum wurde erfolgreich erstellt" + update_success: "Der Raum wurde erfolgreich aktualisiert" event_form: - ACTION_title: "{ACTION, select, create{New} other{Update the}} event" - title: "Title" + ACTION_title: "{ACTION, select, create{Neue} other{Aktualisiere die}} Veranstaltung" + title: "Titel" matching_visual: "Matching visual" description: "Description" attachments: "Attachments" attached_files_pdf: "Attached files (pdf)" add_a_new_file: "Add a new file" - event_category: "Event category" + event_category: "Veranstaltungskategorie" dates_and_opening_hours: "Dates and opening hours" all_day: "All day" - all_day_help: "Will the event last all day or do you want to set times?" + all_day_help: "Wird das Ereignis den ganzen Tag dauern oder möchtest du Zeiten festlegen?" start_date: "Start date" end_date: "End date" start_time: "Start time" @@ -135,33 +135,33 @@ de: fare_class: "Fare class" price: "Price" seats_available: "Seats available" - seats_help: "If you leave this field empty, this event will be available without reservations." - event_themes: "Event themes" + seats_help: "Wenn sie dieses Feld leer lassen, ist diese Veranstaltung ohne Reservierung." + event_themes: "Veranstaltungsthemen" age_range: "Age range" add_price: "Add a price" save: "Save" - create_success: "The event was created successfully" - events_updated: "{COUNT, plural, =1{One event was} other{{COUNT} Events were}} successfully updated" - events_not_updated: "{TOTAL, plural, =1{The event was} other{On {TOTAL} events {COUNT, plural, =1{one was} other{{COUNT} were}}}} not updated." - error_deleting_reserved_price: "Unable to remove the requested price because it is associated with some existing reservations" - other_error: "An unexpected error occurred while updating the event" + create_success: "Die Veranstaltung wurde erfolgreich erstellt" + events_updated: "{COUNT, plural, one {}=1{Eine Veranstaltung wurde} other{{COUNT} Veranstaltungen wurden}} erfolgreich aktualisiert" + events_not_updated: "{TOTAL, plural, =1{Die Veranstaltung war} other{Auf {TOTAL} Veranstaltungen {COUNT, plural, =1{eins war} other{{COUNT} waren}}}} nicht aktualisiert." + error_deleting_reserved_price: "Der angeforderte Preis konnte nicht gelöscht werden, da er mit einigen Reservierungen verknüpft ist" + other_error: "Beim Aktualisieren der Veranstaltung ist ein unerwarteter Fehler aufgetreten" recurring: none: "None" - every_days: "Every days" - every_week: "Every week" - every_month: "Every month" - every_year: "Every year" + every_days: "Täglich" + every_week: "Wöchentlich" + every_month: "Monatlich" + every_year: "Jährlich" plan_form: ACTION_title: "{ACTION, select, create{New} other{Update the}} plan" - tab_settings: "Settings" + tab_settings: "Einstellungen" tab_usage_limits: "Usage limits" - description: "Description" - general_settings: "General settings" + description: "Beschreibung" + general_settings: "Generelle Einstellungen" general_settings_info: "Determine to which group this subscription is dedicated. Also set its price and duration in periods." activation_and_payment: "Subscription activation and payment" name: "Name" name_max_length: "Name length must be less than 24 characters." - group: "Group" + group: "Gruppe" transversal: "Transversal plan" transversal_help: "If this option is checked, a copy of this plan will be created for each currently enabled groups." display: "Display" @@ -208,9 +208,8 @@ de: ongoing_limitations: "Ongoing limitations" saved_limitations: "Saved limitations" cancel: "Cancel this limitation" - confirmation_title: "Delete the limitation" - confirmation_message: "Are you sure you want to delete this limitation? This will take effect immediately and cannot be undone." - delete_success: "The limitation was successfully deleted." + cancel_deletion: "Cancel" + ongoing_deletion: "Ongoing deletion" plan_limit_modal: title: "Manage limitation of use" limit_reservations: "Limit reservations" @@ -237,10 +236,10 @@ de: spaces: "Spaces" update_recurrent_modal: title: "Periodic event update" - edit_recurring_event: "You're about to update a periodic event. What do you want to update?" - edit_this_event: "Only this event" + edit_recurring_event: "Sie bearbeiten eine wiederkehrende Veranstaltung. Was möchten Sie ändern?" + edit_this_event: "Nur diese Veranstaltung" edit_this_and_next: "This event and the followings" - edit_all: "All events" + edit_all: "Alle Veranstaltungen" date_wont_change: "Warning: you have changed the event date. This modification won't be propagated to other occurrences of the periodic event." confirm: "Update the {MODE, select, single{event} other{events}}" advanced_accounting_form: @@ -262,7 +261,7 @@ de: subscriptions: "Subscriptions" machine: "Machine reservation" training: "Training reservation" - event: "Event reservation" + event: "Veranstaltungsreservierung" space: "Space reservation" prepaid_pack: "Pack of prepaid-hours" product: "Product of the store" @@ -621,13 +620,13 @@ de: events_settings: title: "Settings" generic_text_block: "Editorial text block" - generic_text_block_info: "Displays an editorial block above the list of events visible to members." + generic_text_block_info: "Zeigt einen redaktionellen Block oberhalb der für Mitglieder sichtbaren Veranstaltungsliste." generic_text_block_switch: "Display editorial block" cta_switch: "Display a button" cta_label: "Button label" cta_url: "url" save: "Save" - update_success: "The events settings were successfully updated" + update_success: "Die Einstellungen wurden erfolgreich aktualisiert" #subscriptions, prices, credits and coupons management pricing: pricing_management: "Preisverwaltung" @@ -2322,8 +2321,8 @@ de: low_stock: "Low stock" threshold_level: "Minimum threshold level" threshold_alert: "Notify me when the threshold is reached" - events_history: "Events history" - event_type: "Events:" + events_history: "Veranstaltungsverlauf" + event_type: "Veranstaltungen:" reason: "Reason" stocks: "Stock:" internal: "Private stock" @@ -2420,7 +2419,7 @@ de: VAT_rate_machine: "Machine reservation" VAT_rate_space: "Space reservation" VAT_rate_training: "Training reservation" - VAT_rate_event: "Event reservation" + VAT_rate_event: "Veranstaltungsreservierung" VAT_rate_subscription: "Subscription" VAT_rate_product: "Products (store)" multi_VAT_notice: "Please note: The current general rate is {RATE}%. You can define different VAT rates for each category.

For example, you can override this value, only for machine reservations, by filling in the corresponding field beside. If you don't fill any value, the general rate will apply." diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index fd3c7234a..cb2120813 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -2,7 +2,7 @@ en: app: admin: edit_destroy_buttons: - deleted: "The {TYPE} was successfully deleted." + deleted: "Successfully deleted." unable_to_delete: "Unable to delete: " delete_item: "Delete the {TYPE}" confirm_delete: "Delete" @@ -208,9 +208,8 @@ en: ongoing_limitations: "Ongoing limitations" saved_limitations: "Saved limitations" cancel: "Cancel this limitation" - confirmation_title: "Delete the limitation" - confirmation_message: "Are you sure you want to delete this limitation? This will take effect immediately and cannot be undone." - delete_success: "The limitation was successfully deleted." + cancel_deletion: "Cancel" + ongoing_deletion: "Ongoing deletion" plan_limit_modal: title: "Manage limitation of use" limit_reservations: "Limit reservations" diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml index 709f3535a..b2f74317b 100644 --- a/config/locales/app.admin.es.yml +++ b/config/locales/app.admin.es.yml @@ -2,7 +2,7 @@ es: app: admin: edit_destroy_buttons: - deleted: "The {TYPE} was successfully deleted." + deleted: "Successfully deleted." unable_to_delete: "Unable to delete: " delete_item: "Delete the {TYPE}" confirm_delete: "Delete" @@ -208,9 +208,8 @@ es: ongoing_limitations: "Ongoing limitations" saved_limitations: "Saved limitations" cancel: "Cancel this limitation" - confirmation_title: "Delete the limitation" - confirmation_message: "Are you sure you want to delete this limitation? This will take effect immediately and cannot be undone." - delete_success: "The limitation was successfully deleted." + cancel_deletion: "Cancel" + ongoing_deletion: "Ongoing deletion" plan_limit_modal: title: "Manage limitation of use" limit_reservations: "Limit reservations" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index ef93f982c..24eb69b53 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -208,9 +208,8 @@ fr: ongoing_limitations: "Limites en cours" saved_limitations: "Limites enregistrées" cancel: "Annuler cette limite" - confirmation_title: "Supprimer la limite" - confirmation_message: "Êtes-vous sûr de vouloir supprimer cette limite ? Cela prendra effet immédiatement et ne sera pas résersible." - delete_success: "La limite a bien été supprimée." + cancel_deletion: "Annuler" + ongoing_deletion: "Suppression en cours" plan_limit_modal: title: "Gérer la limite d'usage" limit_reservations: "Limiter les réservations" diff --git a/config/locales/app.admin.no.yml b/config/locales/app.admin.no.yml index f8a9e446a..7a01f3cba 100644 --- a/config/locales/app.admin.no.yml +++ b/config/locales/app.admin.no.yml @@ -2,7 +2,7 @@ app: admin: edit_destroy_buttons: - deleted: "The {TYPE} was successfully deleted." + deleted: "Successfully deleted." unable_to_delete: "Unable to delete: " delete_item: "Delete the {TYPE}" confirm_delete: "Delete" @@ -208,9 +208,8 @@ ongoing_limitations: "Ongoing limitations" saved_limitations: "Saved limitations" cancel: "Cancel this limitation" - confirmation_title: "Delete the limitation" - confirmation_message: "Are you sure you want to delete this limitation? This will take effect immediately and cannot be undone." - delete_success: "The limitation was successfully deleted." + cancel_deletion: "Cancel" + ongoing_deletion: "Ongoing deletion" plan_limit_modal: title: "Manage limitation of use" limit_reservations: "Limit reservations" diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml index 35c786b86..ebad84d16 100644 --- a/config/locales/app.admin.pt.yml +++ b/config/locales/app.admin.pt.yml @@ -2,7 +2,7 @@ pt: app: admin: edit_destroy_buttons: - deleted: "The {TYPE} was successfully deleted." + deleted: "Successfully deleted." unable_to_delete: "Unable to delete: " delete_item: "Delete the {TYPE}" confirm_delete: "Delete" @@ -208,9 +208,8 @@ pt: ongoing_limitations: "Ongoing limitations" saved_limitations: "Saved limitations" cancel: "Cancel this limitation" - confirmation_title: "Delete the limitation" - confirmation_message: "Are you sure you want to delete this limitation? This will take effect immediately and cannot be undone." - delete_success: "The limitation was successfully deleted." + cancel_deletion: "Cancel" + ongoing_deletion: "Ongoing deletion" plan_limit_modal: title: "Manage limitation of use" limit_reservations: "Limit reservations" diff --git a/config/locales/app.admin.zu.yml b/config/locales/app.admin.zu.yml index 9e785700c..2283cb521 100644 --- a/config/locales/app.admin.zu.yml +++ b/config/locales/app.admin.zu.yml @@ -2,7 +2,7 @@ zu: app: admin: edit_destroy_buttons: - deleted: "crwdns36793:0{TYPE}crwdne36793:0" + deleted: "crwdns36793:0crwdne36793:0" unable_to_delete: "crwdns36795:0crwdne36795:0" delete_item: "crwdns36797:0{TYPE}crwdne36797:0" confirm_delete: "crwdns36799:0crwdne36799:0" @@ -208,9 +208,8 @@ zu: ongoing_limitations: "crwdns37433:0crwdne37433:0" saved_limitations: "crwdns37435:0crwdne37435:0" cancel: "crwdns37437:0crwdne37437:0" - confirmation_title: "crwdns37439:0crwdne37439:0" - confirmation_message: "crwdns37441:0crwdne37441:0" - delete_success: "crwdns37443:0crwdne37443:0" + cancel_deletion: "crwdns37487:0crwdne37487:0" + ongoing_deletion: "crwdns37489:0crwdne37489:0" plan_limit_modal: title: "crwdns37445:0crwdne37445:0" limit_reservations: "crwdns37447:0crwdne37447:0" diff --git a/config/routes.rb b/config/routes.rb index 6e3b53396..496db7a04 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -116,7 +116,6 @@ Rails.application.routes.draw do patch 'cancel', on: :member end resources :plan_categories - resources :plan_limitations, only: [:destroy] resources :plans do get 'durations', on: :collection end