Skip to content

Commit

Permalink
Added notes on OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Jan 15, 2024
1 parent 322a8d4 commit 67414dd
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 31 additions & 0 deletions migrations/Version20240115130632.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240115130632 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->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');
}
}
10 changes: 3 additions & 7 deletions src/Controller/Admin/OIDCCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
}
15 changes: 15 additions & 0 deletions src/Entity/OIDC.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 67414dd

Please sign in to comment.