Skip to content

Commit

Permalink
Merge pull request #560 from danskernesdigitalebibliotek/release/2023…
Browse files Browse the repository at this point in the history
…-50-0

Release/2023 50 0
  • Loading branch information
spaceo authored Dec 18, 2023
2 parents 1c65194 + 6cd4373 commit 7497041
Show file tree
Hide file tree
Showing 22 changed files with 2,016 additions and 2,697 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
"type": "package",
"package": {
"name": "danskernesdigitalebibliotek/dpl-react",
"version": "2023.49.0",
"version": "2023.50.0",
"type": "drupal-library",
"dist": {
"url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/release-release%2F2023-49-0/dist.zip",
"url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/branch-release%2F2023-50-0/dist-release-2023-50-0.zip",
"type": "zip"
},
"require": {
Expand All @@ -52,9 +52,9 @@
"package": {
"name": "danskernesdigitalebibliotek/dpl-design-system",
"type": "drupal-library",
"version": "2023.49.0",
"version": "2023.50.0",
"dist": {
"url": "https://github.com/danskernesdigitalebibliotek/dpl-design-system/releases/download/release-release%2F2023-49-0/dist.zip",
"url": "https://github.com/danskernesdigitalebibliotek/dpl-design-system/releases/download/branch-release%2F2023-50-0/dist-release-2023-50-0.zip",
"type": "zip"
}
}
Expand All @@ -73,8 +73,8 @@
"amazeeio/drupal_integrations": "0.3.7",
"composer/installers": "1.12.0",
"cweagans/composer-patches": "1.7.3",
"danskernesdigitalebibliotek/dpl-design-system": "2023.49.0",
"danskernesdigitalebibliotek/dpl-react": "2023.49.0",
"danskernesdigitalebibliotek/dpl-design-system": "^2023.50",
"danskernesdigitalebibliotek/dpl-react": "^2023.50",
"danskernesdigitalebibliotek/fbs-client": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"deoliveiralucas/array-keys-case-transform": "^1.1",
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion config/sync/dpl_library_agency.general_settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
reservation_sms_notifications_disabled: 0
expiration_warning_days_before_config: 6
interest_periods_config: '[ { "value": "30", "label": "1 month" }, { "value": "60", "label": "2 months" }, { "value": "90", "label": "3 months" }, { "value": "180", "label": "6 months" }, { "value": "360", "label": "1 year" } ]'
interest_periods_config: '180-6 måneder'
default_interest_period_config: '[
{
"value": "180",
"label": "6 måneder"
}
]'
ereolen_my_page_url: 'https://ereolen.dk/user/me'
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
use Drupal\dpl_dashboard\DplDashboardSettings;
use Drupal\dpl_library_agency\Branch\BranchRepositoryInterface;
use Drupal\dpl_library_agency\BranchSettings;
use Drupal\dpl_library_agency\Form\GeneralSettingsForm;
use Drupal\dpl_library_agency\GeneralSettings;
use Drupal\dpl_react\DplReactConfigInterface;
use Drupal\dpl_react_apps\Controller\DplReactAppsController;
use Symfony\Component\DependencyInjection\ContainerInterface;
use function Safe\json_encode as json_encode;

/**
* Provides user intermediate list.
Expand Down Expand Up @@ -40,6 +41,8 @@ class DashboardBlock extends BlockBase implements ContainerFactoryPluginInterfac
* Branch repository.
* @param \Drupal\dpl_react\DplReactConfigInterface $dashboardSettings
* Dashboard settings.
* @param \Drupal\dpl_library_agency\GeneralSettings $generalSettings
* General settings.
*/
public function __construct(
array $configuration,
Expand All @@ -48,7 +51,8 @@ public function __construct(
private ConfigFactoryInterface $configFactory,
private BranchSettings $branchSettings,
private BranchRepositoryInterface $branchRepository,
private DplReactConfigInterface $dashboardSettings
private DplReactConfigInterface $dashboardSettings,
private GeneralSettings $generalSettings
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configuration = $configuration;
Expand All @@ -65,7 +69,8 @@ public static function create(ContainerInterface $container, array $configuratio
$container->get('config.factory'),
$container->get('dpl_library_agency.branch_settings'),
$container->get('dpl_library_agency.branch.repository'),
\Drupal::service('dpl_dashboard.settings')
\Drupal::service('dpl_dashboard.settings'),
$container->get('dpl_library_agency.general_settings'),
);
}

Expand All @@ -74,6 +79,8 @@ public static function create(ContainerInterface $container, array $configuratio
*
* @return mixed[]
* The app render array.
*
* @throws \Safe\Exceptions\JsonException
*/
public function build(): array {
$dashboardSettings = $this->dashboardSettings->loadConfig();
Expand All @@ -83,105 +90,37 @@ public function build(): array {
// Config.
'page-size-desktop' => $dashboardSettings->get('page_size_desktop') ?? DplDashboardSettings::PAGE_SIZE_DESKTOP,
'page-size-mobile' => $dashboardSettings->get('page_size_mobile') ?? DplDashboardSettings::PAGE_SIZE_MOBILE,
'expiration-warning-days-before-config' => $generalSettings->get('expiration_warning_days_before_config') ?? GeneralSettingsForm::EXPIRATION_WARNING_DAYS_BEFORE_CONFIG,
'interest-periods-config' => DplReactAppsController::getInterestPeriods(),
'reservation-detail-allow-remove-ready-reservations-config' => $generalSettings->get('reservation_detail_allow_remove_ready_reservations') ?? GeneralSettingsForm::RESERVATION_DETAIL_ALLOW_REMOVE_READY_RESERVATIONS,
'expiration-warning-days-before-config' => $generalSettings->get('expiration_warning_days_before_config') ?? GeneralSettings::EXPIRATION_WARNING_DAYS_BEFORE_CONFIG,
'interest-periods-config' => json_encode($this->generalSettings->getInterestPeriodsConfig()),
'reservation-detail-allow-remove-ready-reservations-config' => $generalSettings->get('reservation_detail_allow_remove_ready_reservations') ?? GeneralSettings::RESERVATION_DETAIL_ALLOW_REMOVE_READY_RESERVATIONS,
'blacklisted-pickup-branches-config' => DplReactAppsController::buildBranchesListProp($this->branchSettings->getExcludedReservationBranches()),
'branches-config' => DplReactAppsController::buildBranchesJsonProp($this->branchRepository->getBranches()),

// Urls.
// Cannot find that route. Does it exist?
'intermediate-url' => '/user/me/intermediates',
'ereolen-my-page-url' => dpl_react_apps_format_app_url($generalSettings->get('ereolen_my_page_url'), GeneralSettingsForm::EREOLEN_MY_PAGE_URL),
'ereolen-my-page-url' => dpl_react_apps_format_app_url($generalSettings->get('ereolen_my_page_url'), GeneralSettings::EREOLEN_MY_PAGE_URL),

// Texts.
'accept-modal-accept-button-text' => $this->t("Yes, renew", [], ['context' => 'Dashboard']),
'accept-modal-are-you-sure-text' => $this->t("Are you sure you want to renew?", [], ['context' => 'Dashboard']),
'accept-modal-aria-description-text' => $this->t("accept modal aria description text", [], ['context' => 'Dashboard (Aria)']),
'accept-modal-aria-label-text' => $this->t("accept modal aria label text", [], ['context' => 'Dashboard (Aria)']),
'accept-modal-body-text' => $this->t("If you renew your fee will be raised", [], ['context' => 'Dashboard']),
'accept-modal-cancel-button-text' => $this->t("Cancel renewal", [], ['context' => 'Dashboard']),
'accept-modal-header-text' => $this->t("Your fee is raised", [], ['context' => 'Dashboard']),
'choose-all-text' => $this->t('Select all', [], ['context' => 'Dashboard']),
'dashboard-number-in-line-text' => $this->t('Number @count in line', [], ['context' => 'Dashboard']),
'delete-reservation-modal-aria-description-text' => $this->t('This button opens a modal that covers the entire page and contains the possibility to delete a selected reservation, or multiple selected reservations', [], ['context' => 'Dashboard (Aria)']),
'delete-reservation-modal-close-modal-text' => $this->t('Close delete reservation modal', [], ['context' => 'Dashboard']),
'delete-reservation-modal-delete-button-text' => $this->t('Cancel reservation', [], ['context' => 'Dashboard']),
'delete-reservation-modal-delete-question-text' => $this->t('Do you want to cancel your reservation?', [], ['context' => 'Dashboard']),
'delete-reservation-modal-header-text' => [
'type' => 'plural',
'text' => [
$this->t('Cancel reservation', [], ['context' => 'Dashboard']),
$this->t('Cancel reservations', [], ['context' => 'Dashboard']),
],
],
'delete-reservation-modal-not-regrettable-text' => $this->t('You cannot regret this action', [], ['context' => 'Dashboard']),
'digital-reservations-header-text' => $this->t('Digital reservations', [], ['context' => 'Dashboard']),
'dashboard-see-more-fees-text' => $this->t('See more', [], ['context' => 'Dashboard']),
'dashboard-see-more-fees-aria-label-text' => $this->t('See your fees and how to pay', [], ['context' => 'Dashboard']),
'digital-text' => $this->t('Digital', [], ['context' => 'Dashboard']),
'et-al-text' => $this->t('et al.', [], ['context' => 'Dashboard']),
'fees-text' => $this->t('Fees', [], ['context' => 'Dashboard']),
'group-modal-aria-description-text' => $this->t('This modal makes it possible to renew materials', [], ['context' => 'Dashboard (Aria)']),
'group-modal-button-text' => $this->t('Renewable (@count)', [], ['context' => 'Dashboard']),
'group-modal-checkbox-text' => $this->t('Choose all', [], ['context' => 'Dashboard']),
'group-modal-due-date-aria-description-text' => $this->t('This modal groups loans after due date and makes it possible to renew said loans', [], ['context' => 'Dashboard']),
'group-modal-due-date-header-text' => $this->t('Due date @date', [], ['context' => 'Dashboard']),
'group-modal-due-date-renew-loan-close-modal-aria-label-text' => $this->t('Close renew loans modal', [], ['context' => 'Dashboard']),
'group-modal-due-date-warning-loan-overdue-text' => $this->t('The due date of return is exceeded, therefore you will be charged a fee, when the item is returned', [], ['context' => 'Dashboard']),
'group-modal-hidden-label-checkbox-on-material-text' => $this->t('Select @label for renewal', [], ['context' => 'Dashboard']),
'group-modal-loans-aria-description-text' => $this->t("This modal makes it possible to renew materials", [], ['context' => 'Dashboard (Aria)']),
'group-modal-loans-close-modal-aria-label-text' => $this->t("Close modal with grouped loans", [], ['context' => 'Patron menu (Aria)']),
'group-modal-reservations-close-modal-aria-label-text' => $this->t('Close modal with grouped reservations', [], ['context' => 'Dashboard (Aria)']),
'group-modal-reservations-loans-aria-description-text' => $this->t('This modal makes it possible to delete reservations', [], ['context' => 'Dashboard (Aria)']),
'intermediate-text' => $this->t('Intermediates', [], ['context' => 'Dashboard']),
'list-details-nothing-selected-label-text' => $this->t('Pick', [], ['context' => 'Dashboard']),
'loans-not-overdue-text' => $this->t('Longer return time', [], ['context' => 'Dashboard']),
'loans-overdue-text' => $this->t('Returned too late', [], ['context' => 'Dashboard']),
'loans-soon-overdue-text' => $this->t('To be returned soon', [], ['context' => 'Dashboard']),
'material-and-author-text' => $this->t('and', [], ['context' => 'Dashboard']),
'material-by-author-text' => $this->t('By', [], ['context' => 'Dashboard']),
'material-details-close-modal-aria-label-text' => $this->t('Close material details modal', [], ['context' => 'Dashboard (Aria)']),
'material-details-link-to-page-with-fees-text' => $this->t('Read more about fees', [], ['context' => 'Dashboard']),
'material-details-loan-date-label-text' => $this->t('Loan date', [], ['context' => 'Dashboard']),
'material-details-material-number-label-text' => $this->t('Material Item Number', [], ['context' => 'Dashboard']),
'material-details-modal-aria-description-text' => $this->t('This modal shows material details, and makes it possible to renew a material, of that material is renewable', [], ['context' => 'Dashboard (Aria)']),
'material-details-overdue-text' => $this->t('Expired', [], ['context' => 'Dashboard']),
'material-details-physical-due-date-label-text' => $this->t('Afleveres', [], ['context' => 'Dashboard']),
'material-details-warning-loan-overdue-text' => $this->t('The due date of return is exceeded, therefore you will be charged a fee, when the item is returned', [], ['context' => 'Dashboard']),
'no-physical-loans-text' => $this->t('At the moment, you have 0 physical loans', [], ['context' => 'Dashboard']),
'no-reservations-text' => $this->t('At the moment, you have 0 reservations', [], ['context' => 'Dashboard']),
'pay-owed-text' => $this->t('Pay', [], ['context' => 'Dashboard']),
'physical-loans-text' => $this->t('Loans', [], ['context' => 'Dashboard']),
'physical-reservations-header-text' => $this->t('Physical reservations', [], ['context' => 'Dashboard']),
'pick-up-latest-text' => $this->t('Pick up before @date', [], ['context' => 'Dashboard']),
'publizon-audio-book-text' => $this->t('Audiobook', [], ['context' => 'Dashboard']),
'publizon-ebook-text' => $this->t('E-book', [], ['context' => 'Dashboard']),
'publizon-podcast-text' => $this->t('Podcast', [], ['context' => 'Dashboard']),
'queued-reservations-text' => $this->t('Queued reservations', [], ['context' => 'Dashboard']),
'ready-for-loan-counter-label-text' => $this->t('Ready', [], ['context' => 'Dashboard']),
'ready-for-loan-text' => $this->t('Ready for pickup', [], ['context' => 'Dashboard']),
'remove-all-reservations-text' => $this->t('Remove reservations (@amount)', [], ['context' => 'Dashboard']),
'reservation-details-borrow-before-text' => $this->t('Borrow before @date', [], ['context' => 'Dashboard']),
'reservation-details-button-remove-text' => $this->t('Remove your reservation', [], ['context' => 'Dashboard']),
'reservation-details-change-text' => $this->t('Apply changes', [], ['context' => 'Dashboard']),
'reservation-details-date-of-reservation-title-text' => $this->t('Date of reservation', [], ['context' => 'Dashboard']),
'reservation-details-digital-reservation-go-to-ereolen-text' => $this->t('Go to eReolen', [], ['context' => 'Dashboard']),
'reservation-details-no-interest-after-title-text' => $this->t('Not interested after', [], ['context' => 'Dashboard']),
'reservation-details-number-in-queue-label-text' => $this->t('@count queued', [], ['context' => 'Dashboard']),
'reservation-details-others-in-queue-text' => $this->t('Others are queueing for this material', [], ['context' => 'Dashboard']),
'reservation-details-pick-up-at-title-text' => $this->t('Pickup branch', [], ['context' => 'Dashboard']),
'reservation-details-pickup-deadline-title-text' => $this->t('Pickup deadline', [], ['context' => 'Dashboard']),
'reservation-details-ready-for-loan-text' => $this->t('Ready for pickup', [], ['context' => 'Dashboard']),
'reservation-details-remove-digital-reservation-text' => $this->t('Remove your reservation', [], ['context' => 'Dashboard']),
'reservation-details-status-title-text' => $this->t('Status', [], ['context' => 'Dashboard']),
'reservations-ready-text' => $this->t('Ready for you', [], ['context' => 'Dashboard']),
'reservations-still-in-queue-for-text' => $this->t('Still in queue', [], ['context' => 'Dashboard']),
'reservations-text' => $this->t('Reservations', [], ['context' => 'Dashboard']),
'result-pager-status-text' => $this->t('Showing @itemsShown out of @hitcount elements', [], ['context' => 'Dashboard']),
'status-badge-warning-text' => $this->t('Expires soon', [], ['context' => 'Dashboard']),
'total-amount-fee-text' => $this->t('@total,-', [], ['context' => 'Dashboard']),
'total-owed-text' => $this->t('You owe in total', [], ['context' => 'Dashboard']),
'your-profile-text' => $this->t('Your profile', [], ['context' => 'Dashboard']),
] + dpl_react_apps_texts_renewal() + DplReactAppsController::externalApiBaseUrls();
] + DplReactAppsController::externalApiBaseUrls();

return [
'#theme' => 'dpl_react_app',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,9 @@ public function build() {
"page-size-mobile" => $favoritesListSettings->get('page_size_mobile') ?? DplFavoritesListSettings::PAGE_SIZE_MOBILE,

// Texts.
"by-author-text" => $this->t("By", [], ['context' => 'Favorites list']),
"et-al-text" => $this->t("et al", [], ['context' => 'Favorites list']),
"favorites-list-empty-text" => $this->t("Your favorites list is empty", [], ['context' => 'Favorites list']),
"favorites-list-header-text" => $this->t("Favorites", [], ['context' => 'Favorites list']),
"favorites-list-materials-text" => $this->t("@count materials", [], ['context' => 'Favorites list']),
"in-series-text" => $this->t("in series", [], ['context' => 'Favorites list']),
"number-description-text" => $this->t("Number description", [], ['context' => 'Favorites list']),
"remove-from-favorites-aria-label-text" => $this->t("Remove @title from favorites list", [], ['context' => 'Favorites list (aria)']),
"add-to-favorites-aria-label-text" => $this->t("Add @title to favorites list", [], ['context' => 'Favorites list (aria)']),
"result-pager-status-text" => $this->t("Showing @itemsShown out of @hitcount results", [], ['context' => 'Favorites list']),
"show-more-text" => $this->t("show more", [], ['context' => 'Favorites list']),
'group-modal-checkbox-text' => $this->t("Choose all renewable", [], ['context' => 'Favorites list']),
] + DplReactAppsController::externalApiBaseUrls();

return [
Expand Down
Loading

0 comments on commit 7497041

Please sign in to comment.