Skip to content

Commit

Permalink
DDFLSBP-210 - Removed unused form field pause_reservation_start_date_…
Browse files Browse the repository at this point in the history
…config in GeneralSettingssForm
  • Loading branch information
Dresse committed Nov 27, 2023
1 parent 4eb9fae commit 989311b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ public function buildForm(array $form, FormStateInterface $form_state): array {
'#default_value' => $config->get('pause_reservation_info_url') ?? GeneralSettings::PAUSE_RESERVATION_INFO_URL,
];

$form['reservations']['pause_reservation_start_date_config'] = [
'#type' => 'date',
'#title' => $this->t('Start date', [], ['context' => 'Library Agency Configuration']),
'#description' => $this->t('Pause reservation start date', [], ['context' => 'Library Agency Configuration']),
'#default_value' => $config->get('pause_reservation_start_date_config') ?? GeneralSettings::PAUSE_RESERVATION_START_DATE_CONFIG,
];

$form['settings']['blocked_user'] = [
'#type' => 'fieldset',
'#title' => $this->t('Blocked user'),
Expand Down Expand Up @@ -305,7 +298,6 @@ public function submitForm(array &$form, FormStateInterface $form_state): void {
->set('blocked_patron_e_link_url', $form_state->getValue('blocked_patron_e_link_url'))
->set('ereolen_my_page_url', $form_state->getValue('ereolen_my_page_url'))
->set('ereolen_homepage_url', $form_state->getValue('ereolen_homepage_url'))
->set('pause_reservation_start_date_config', $form_state->getValue('pause_reservation_start_date_config'))
->save();

$this->branchSettings->setExcludedAvailabilityBranches(array_filter($form_state->getValue('availability')));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GeneralSettings extends DplReactConfigBase {
// not expected to be changing often.
const EREOLEN_MY_PAGE_URL = 'https://ereolen.dk/user/me';
const EREOLEN_HOMEPAGE_URL = 'https://ereolen.dk';
const PAUSE_RESERVATION_START_DATE_CONFIG = '';


/**
* Gets the configuration key for general settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,12 @@ public function build() {
$patron_page_settings = $this->patronPageSettings->loadConfig();

$general_config = $this->configFactory->get('dpl_library_agency.general_settings');
$dateConfig = $general_config->get('pause_reservation_start_date_config') ?? GeneralSettings::PAUSE_RESERVATION_START_DATE_CONFIG;

$data = [
// Configuration.
// @todo write service for getting branches.
'blacklisted-pickup-branches-config' => DplReactAppsController::buildBranchesListProp($this->branchSettings->getExcludedReservationBranches()),
'branches-config' => DplReactAppsController::buildBranchesJsonProp($this->branchRepository->getBranches()),
'pause-reservation-start-date-config' => $dateConfig,
'pincode-length-max-config' => $patron_page_settings->get('pincode_length_max') ?? DplPatronPageSettings::PINCODE_LENGTH_MAX,
'pincode-length-min-config' => $patron_page_settings->get('pincode_length_min') ?? DplPatronPageSettings::PINCODE_LENGTH_MIN,
'text-notifications-enabled-config' => (int) $this->reservationSettings->smsNotificationsIsEnabled(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function build(): array {
'interest-periods-config' => json_encode($this->generalSettings->getInterestPeriodsConfig()),
'page-size-desktop' => $config->get('page_size_desktop') ?? DplReservationsSettings::PAGE_SIZE_DESKTOP,
'page-size-mobile' => $config->get('page_size_mobile') ?? DplReservationsSettings::PAGE_SIZE_MOBILE,
'pause-reservation-start-date-config' => $generalSettings->get('pause_reservation_start_date_config') ?? GeneralSettings::PAUSE_RESERVATION_START_DATE_CONFIG,
'expiration-warning-days-before-config' => $generalSettings->get('expiration_warning_days_before_config') ?? GeneralSettings::EXPIRATION_WARNING_DAYS_BEFORE_CONFIG,

// Texts.
Expand Down

0 comments on commit 989311b

Please sign in to comment.