Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added notes on OIDC #44

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
rimi-itk marked this conversation as resolved.
Show resolved Hide resolved
{
$this->notes = $notes;

return $this;
}
}