1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(feat) create settings for machines banner backend

This commit is contained in:
Karen 2023-01-23 12:11:25 +01:00 committed by Sylvain
parent ddc2dd4c6e
commit 5658e0aeed
4 changed files with 26 additions and 2 deletions

View File

@ -243,6 +243,11 @@ export const trainingSettings = [
'trainings_invalidation_rule_period'
] as const;
export const bannersSettings = [
'machines_banner_text',
'machines_banner_button'
] as const;
export const allSettings = [
...homePageSettings,
...privacyPolicySettings,
@ -269,7 +274,8 @@ export const allSettings = [
...poymentSettings,
...displaySettings,
...storeSettings,
...trainingSettings
...trainingSettings,
...bannersSettings
] as const;
export type SettingName = typeof allSettings[number];

View File

@ -173,6 +173,12 @@ class Setting < ApplicationRecord
trainings_authorization_validity_duration
trainings_invalidation_rule
trainings_invalidation_rule_period] }
trainings_auto_cancel_deadline
machines_banner_active
machines_banner_text
machines_banner_cta_active
machines_banner_cta_label
machines_banner_cta_url] }
# WARNING: when adding a new key, you may also want to add it in:
# - config/locales/en.yml#settings
# - app/frontend/src/javascript/models/setting.ts#SettingName

View File

@ -43,7 +43,7 @@ class SettingPolicy < ApplicationPolicy
pack_only_for_subscription overlapping_categories public_registrations facebook twitter viadeo linkedin instagram
youtube vimeo dailymotion github echosciences pinterest lastfm flickr machines_module user_change_group
user_validation_required user_validation_required_list store_module store_withdrawal_instructions store_hidden
external_id]
external_id machines_banner_active machines_banner_text machines_banner_cta_active machines_banner_cta_label machines_banner_cta_url]
end
##

View File

@ -747,6 +747,18 @@ export const settings: Array<Setting> = [
value: 'TVA',
last_update: '2022-12-23T14:39:12+0100',
localized: 'Nom de la TVA'
},
{
name: 'machines_banner_text',
value: 'false',
last_update: '2022-12-23T14:39:12+0100',
localized: 'Text of the banner in Machines List'
},
{
name: 'machines_banner_button',
value: 'false',
last_update: '2022-12-23T14:39:12+0100',
localized: 'Button of the banner in Machines List'
}
];