Skip to content

Commit

Permalink
Merge branch 'develop' into DDFBRA-138-setup-simple-oauth-module
Browse files Browse the repository at this point in the history
  • Loading branch information
Dresse committed Nov 21, 2024
2 parents 131a4d0 + 069a6d9 commit de7b67f
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 43 deletions.
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ tasks:
cmds:
- cmd: task dev:cli -- drush default-content:export-module dpl_example_content

dev:go:graphql-credentials:
desc: Get the GraphQL consumer credentials
cmds:
- cmd: task dev:cli -- drush dpl_consumers:consumer-credentials

ci:reset:
desc: Create CI setup in a clean state
cmds:
Expand Down
2 changes: 1 addition & 1 deletion assets/all.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
$settings['config_sync_directory'] = '../config/sync';

/**
* Private file path:
* Private file path.
*
* A local file system path where private files will be stored. This directory
* must be absolute, outside the Drupal installation directory and not
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"type": "package",
"package": {
"name": "danskernesdigitalebibliotek/dpl-react",
"version": "2024.46.0",
"version": "2024.47.0",
"type": "drupal-library",
"dist": {
"url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.46.0/dist-2024-46-0-7d4d8165940c12997e99f8f53768cb784021dccb.zip",
"url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.47.0/dist-2024-47-0-d262e234fe972eeb86cc0e21d663245a3a96331a.zip",
"type": "zip"
},
"require": {
Expand All @@ -56,9 +56,9 @@
"package": {
"name": "danskernesdigitalebibliotek/dpl-design-system",
"type": "drupal-library",
"version": "2024.46.0",
"version": "2024.47.1",
"dist": {
"url": "https://github.com/danskernesdigitalebibliotek/dpl-design-system/releases/download/2024.46.0/dist-2024-46-0-26b569fe9286c99caa7d35dfffb9e4d176826c7a.zip",
"url": "https://github.com/danskernesdigitalebibliotek/dpl-design-system/releases/download/2024.47.1/dist-2024-47-1-acd61eab1fefee5ed1bc3da76b31c9640caa8671.zip",
"type": "zip"
}
}
Expand Down Expand Up @@ -90,8 +90,8 @@
"composer/installers": "1.12.0",
"cweagans/composer-patches": "1.7.3",
"danskernesdigitalebibliotek/cms-api": "*",
"danskernesdigitalebibliotek/dpl-design-system": "^2024.46",
"danskernesdigitalebibliotek/dpl-react": "^2024.46",
"danskernesdigitalebibliotek/dpl-design-system": "^2024.47",
"danskernesdigitalebibliotek/dpl-react": "^2024.47",
"danskernesdigitalebibliotek/fbs-client": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"deoliveiralucas/array-keys-case-transform": "^1.1",
Expand All @@ -110,9 +110,9 @@
"drupal/consumers": "^1.19",
"drupal/content_lock": "^2.3",
"drupal/cookieinformation": "^2.1",
"drupal/core-composer-scaffold": "10.3.7",
"drupal/core-project-message": "10.3.7",
"drupal/core-recommended": "10.3.7",
"drupal/core-composer-scaffold": "10.3.9",
"drupal/core-project-message": "10.3.9",
"drupal/core-recommended": "10.3.9",
"drupal/date_range_formatter": "^4.0",
"drupal/default_content": "^2.0@alpha",
"drupal/devel": "^5.1",
Expand Down
63 changes: 32 additions & 31 deletions composer.lock

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

4 changes: 4 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ module.exports = defineConfig({
e2e: {
// baseUrl is set using environment variables because it differs between
// development and CI setups.
retries: {
runMode: 3,
openMode: 0,
},
},
env: {
// This is intentionally left empty.
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/opening-hours-editor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const validateOpeningHoursPage = ({
timeDuration: { start, end },
}: OpeningHourFormType) => {
cy.getBySel("opening-hours-week-list")
.scrollIntoView()
.should("be.visible")
.and("contain", openingHourCategory)
.and("contain", `${start} - ${end}`);
Expand Down
36 changes: 36 additions & 0 deletions web/modules/custom/dpl_consumers/dpl_consumers.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* @file
* DPL consumers module.
*/

/**
* Get consumer by Client ID.
*
* @return string
* The consumer UUID.
*
* @throws \Exception
*/
function dpl_consumers_get_consumer_uuid(string $client_id): string {
try {
$consumer = \Drupal::entityTypeManager()
->getStorage('consumer')
->loadByProperties(['client_id' => $client_id]);

// We assume that there is only one consumer with the given client ID
// as it is used an as unique identifier (machine name).
if (!empty($consumer)) {
$consumer = reset($consumer);

return $consumer->uuid() ?? throw new \Exception('UUID not found.');
}
else {
throw new \Exception('Consumer not found.');
}
}
catch (\Exception $e) {
throw new \Exception($e->getMessage());
}
}
5 changes: 5 additions & 0 deletions web/modules/custom/dpl_consumers/drush.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
dpl_consumer.commands:
class: \Drupal\dpl_consumers\Commands\DplConsumersCommands
tags:
- { name: drush.command }
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Drupal\dpl_consumers\Commands;

use Drupal\dpl_consumers\DplGraphqlConsumersConstants;
use Drush\Commands\DrushCommands;

/**
* Drush commands for DPL consumers.
*/
final class DplConsumersCommands extends DrushCommands {

/**
* Function is used for printing out the consumer credentials to the console.
*
* @command dpl_consumers:consumer-credentials
*/
public function getConsumerCredentials(): void {
$graphql_consumer_client_id = DplGraphqlConsumersConstants::GRAPHQL_CONSUMER_CLIENT_ID;
$consumer_uuid = dpl_consumers_get_consumer_uuid($graphql_consumer_client_id);
$this->output()->writeln('Consumer UUID: ' . $consumer_uuid);
}

}
16 changes: 14 additions & 2 deletions web/profiles/dpl_cms/translations/da.combined.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
# #-#-#-#-# da.config.po (PROJECT VERSION) #-#-#-#-#
# da translation of DPL CMS
#
#, fuzzy
msgid ""
msgstr ""
"#-#-#-#-# da.po (PROJECT VERSION) #-#-#-#-#\n"
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2024-11-19 11:06+0100\n"
"PO-Revision-Date: 2024-11-19 11:06+0100\n"
"POT-Creation-Date: 2024-11-21 12:23+0100\n"
"PO-Revision-Date: 2024-11-21 12:23+0100\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"#-#-#-#-# da.config.po (PROJECT VERSION) #-#-#-#-#\n"
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2024-11-21 12:24+0100\n"
"PO-Revision-Date: 2024-11-21 12:24+0100\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 2 additions & 0 deletions web/sites/default/default.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,8 @@
* Provide a fully qualified class name here if you would like to provide an
* alternate implementation YAML parser. The class must implement the
* \Drupal\Component\Serialization\SerializationInterface interface.
*
* This setting is deprecated in Drupal 10.3 and removed in Drupal 11.
*/
# $settings['yaml_parser_class'] = NULL;

Expand Down

0 comments on commit de7b67f

Please sign in to comment.