From 67414ddaf54c76ad642128d23ee32de768478a3f Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 15 Jan 2024 14:10:01 +0100 Subject: [PATCH 1/2] Added notes on OIDC --- CHANGELOG.md | 2 ++ migrations/Version20240115130632.php | 31 +++++++++++++++++++++ src/Controller/Admin/OIDCCrudController.php | 10 ++----- src/Entity/OIDC.php | 15 ++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 migrations/Version20240115130632.php diff --git a/CHANGELOG.md b/CHANGELOG.md index faac5f1..fac866a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#42](https://github.com/itk-dev/devops_itksites/pull/42) Add and apply CS fixer rule to enforce strict types on all files. +- [#44](https://github.com/itk-dev/devops_itksites/pull/44) + Added notes on OIDC ## [1.5.0] - 2023-09-20 diff --git a/migrations/Version20240115130632.php b/migrations/Version20240115130632.php new file mode 100644 index 0000000..d56b2df --- /dev/null +++ b/migrations/Version20240115130632.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE oidc ADD notes LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE oidc DROP notes'); + } +} diff --git a/src/Controller/Admin/OIDCCrudController.php b/src/Controller/Admin/OIDCCrudController.php index 0cd661e..e0db331 100644 --- a/src/Controller/Admin/OIDCCrudController.php +++ b/src/Controller/Admin/OIDCCrudController.php @@ -6,13 +6,13 @@ use App\Entity\OIDC; use App\Repository\SiteRepository; -use App\Types\ServerTypeType; use EasyCorp\Bundle\EasyAdminBundle\Config\Action; use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; use EasyCorp\Bundle\EasyAdminBundle\Field\DateField; +use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; use EasyCorp\Bundle\EasyAdminBundle\Field\UrlField; use Symfony\Component\Translation\TranslatableMessage; @@ -53,17 +53,13 @@ public function configureFields(string $pageName): iterable ->setLabel('Site'); } - yield ChoiceField::new('type') - ->hideOnForm() - ->setChoices(ServerTypeType::CHOICES) - ->renderExpanded()->setColumns(8) - ->setTemplatePath('EasyAdminBundle/Fields/server_type.html.twig'); - yield UrlField::new('onePasswordUrl') ->setLabel(new TranslatableMessage('1Password url')); yield UrlField::new('usageDocumentationUrl')->hideOnIndex() ->setHelp(new TranslatableMessage('Tell where to find documentation on how OpenID Connect is used on the site and how to configure the use.')); yield DateField::new('expirationTime')->setFormat('yyyy-MM-dd')->setLabel('Expiration Date'); + + yield TextareaField::new('notes'); } } diff --git a/src/Entity/OIDC.php b/src/Entity/OIDC.php index 41dea3f..badf0dc 100644 --- a/src/Entity/OIDC.php +++ b/src/Entity/OIDC.php @@ -32,6 +32,9 @@ class OIDC extends AbstractBaseEntity #[ORM\Column(length: 10)] private ?string $type = null; + #[ORM\Column(type: Types::TEXT, nullable: true)] + private ?string $notes = null; + public function getDomain(): ?string { return $this->domain; @@ -91,4 +94,16 @@ public function setType(string $type): self return $this; } + + public function getNotes(): ?string + { + return $this->notes; + } + + public function setNotes(?string $notes): static + { + $this->notes = $notes; + + return $this; + } } From afb2c1306b9d5c6d356654496288f1215767f20b Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 15 Jan 2024 15:23:26 +0100 Subject: [PATCH 2/2] Update src/Entity/OIDC.php Co-authored-by: Jeppe Kuhlmann Andersen <78410897+jekuaitk@users.noreply.github.com> --- src/Entity/OIDC.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/OIDC.php b/src/Entity/OIDC.php index badf0dc..f84697b 100644 --- a/src/Entity/OIDC.php +++ b/src/Entity/OIDC.php @@ -100,7 +100,7 @@ public function getNotes(): ?string return $this->notes; } - public function setNotes(?string $notes): static + public function setNotes(?string $notes): self { $this->notes = $notes;