From 101d2efe305816d6b7dc2608fe6a819c1891cb53 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 09:52:18 +0200 Subject: [PATCH 01/10] Cleaned up --- README.md | 2 +- Taskfile.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ed317c2..f70e0eb 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ task site:update > [!NOTE] > Running `task site:update` on [macOS (darwin)](https://en.wikipedia.org/wiki/Darwin_(operating_system)) will pull and -> patch the API Git submodule (cf. [#api](API)). See [`Taskfile.yml`](Taskfile.yml) for details. +> patch the API Git submodule (cf. [API](#api)). See [`Taskfile.yml`](Taskfile.yml) for details. Load fixtures with diff --git a/Taskfile.yml b/Taskfile.yml index f5e62a7..340aed5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -107,7 +107,6 @@ tasks: cmds: - task: api:fixtures:load - task: app:fixtures:load - - task: oidc:fixtures:load translations:extract: cmds: @@ -209,8 +208,8 @@ tasks: cmds: - for: - /api/v1/auth/me - - /api/v1/processes/processes/ - - /api/v1/processes/processes/1 + - /api/v1/processes/ + - /api/v1/processes/1 task: api:get vars: API_PATH: "{{.ITEM}}" From a32cd5c79d118eccac734dd31d77a89328b29289 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 10:27:13 +0200 Subject: [PATCH 02/10] Cleaned up handling of API for development --- .gitignore | 1 + Taskfile.yml | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 2c79b12..bd1b0d6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ ###< symfony/asset-mapper ### *.local +*.local.yml .idea # Generated widget code diff --git a/Taskfile.yml b/Taskfile.yml index 340aed5..323813d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -38,19 +38,30 @@ tasks: vars: TASK_ARGS: pull - # Additional setup for local development (assuming we're running on maxOS (darwin)) + # Additional setup if API service is enabled. - cmd: | - git -C api checkout . - git submodule update --init - # Apply a patch to support MySQL in the API and make building it work. - git -C api apply < patches/Process_Dashboard_API.patch - # https://taskfile.dev/docs/reference/schema#platforms - platforms: [darwin] + if [ -n "{{.API_ENABLED}}" ]; then + git -C api checkout . + git submodule update --init + # Apply a patch to support MySQL in the API and make building it work. + git -C api apply < patches/Process_Dashboard_API.patch + fi - task: compose vars: TASK_ARGS: up --build --detach --wait + # Unpatch API if API service is enabled. + - cmd: | + if [ -n "{{.API_ENABLED}}" ]; then + git -C api checkout . + fi + + vars: + API_ENABLED: + # Check if the api service is enabled. + sh: (task --silent compose -- config --services | grep "^api$") || true + logs: desc: Show live logs cmds: From 48634cb6daf5b20b8b2d6efe2b9bf000b038d204 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 10:57:18 +0200 Subject: [PATCH 03/10] Added admin user --- .env | 3 ++- docker-compose.oidc.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 39d597a..672fa69 100644 --- a/.env +++ b/.env @@ -51,7 +51,8 @@ ADMIN_OIDC_CLIENT_SECRET=client-secret ADMIN_OIDC_REDIRECT_URI=https://rpa-process-overview.local.itkdev.dk/ ADMIN_OIDC_LEEWAY=30 ADMIN_OIDC_ROLE_MAP='{ - "overview-manager": ["ROLE_OVERVIEW_MANAGER"] + "overview-manager": ["ROLE_OVERVIEW_MANAGER"], + "admin": ["ROLE_ADMIN"] }' # cli redirect url diff --git a/docker-compose.oidc.yml b/docker-compose.oidc.yml index 973b176..6a637bb 100644 --- a/docker-compose.oidc.yml +++ b/docker-compose.oidc.yml @@ -14,6 +14,8 @@ services: '{"sub": "user", "email": "user@example.com", "roles": ["user"]}', "--user-claims", '{"sub": "overview-manager", "email": "overview-manager@example.com", "roles": ["overview-manager"]}', + "--user-claims", + '{"sub": "admin", "email": "admin@example.com", "roles": ["admin"]}', ] ports: - "80" From 1684e857f89a39d5de2d5e1cf4b2faedf8e0e0be Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 10:57:42 +0200 Subject: [PATCH 04/10] Made API fixtures more informative --- scripts/api/fixtures.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/api/fixtures.py b/scripts/api/fixtures.py index b22a55e..f2f3ab1 100644 --- a/scripts/api/fixtures.py +++ b/scripts/api/fixtures.py @@ -9,7 +9,6 @@ from app.models import ( Process, ProcessRun, - ProcessRunStatus, ProcessStep, ProcessStepRun, StepRunStatus, @@ -54,7 +53,7 @@ def create_data(self, seed: int = 19750523) -> None: ) session.add(process) - print(f"process {process.id}") + print(f"process {process}") number_of_steps = fake.pyint(2, 7) steps = [] @@ -67,7 +66,7 @@ def create_data(self, seed: int = 19750523) -> None: session.add(step) steps.append(step) - print(f"step {step.id}") + print(f" step {step}") number_of_runs = fake.pyint(0, 100) for _ in range(number_of_runs): @@ -85,7 +84,7 @@ def create_data(self, seed: int = 19750523) -> None: ) session.add(run) - print(f"run {run.id}") + print(f" run {run}") failed_step_index = fake.pyint(-1, number_of_steps + 1) started_at = fake.past_datetime() @@ -117,7 +116,7 @@ def create_data(self, seed: int = 19750523) -> None: ) session.add(step_run) - print(f"step_run {step_run.id}") + print(f" step_run {step_run}") # @todo Should we generate pending steps? # if status == StepRunStatus.FAILED: From d53f34b9a8daa4a88f51329473f8bd433fdc3f55 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 10:58:01 +0200 Subject: [PATCH 05/10] Renamed repository class --- src/Entity/Process.php | 4 +-- src/Repository/ProcessRepository.php | 18 ++++++++++ src/Repository/ProcessStepRepository.php | 43 ------------------------ 3 files changed, 20 insertions(+), 45 deletions(-) create mode 100644 src/Repository/ProcessRepository.php delete mode 100644 src/Repository/ProcessStepRepository.php diff --git a/src/Entity/Process.php b/src/Entity/Process.php index 2755aed..36b292d 100644 --- a/src/Entity/Process.php +++ b/src/Entity/Process.php @@ -2,10 +2,10 @@ namespace App\Entity; -use App\Repository\ProcessStepRepository; +use App\Repository\ProcessRepository; use Doctrine\ORM\Mapping as ORM; -#[ORM\Entity(repositoryClass: ProcessStepRepository::class)] +#[ORM\Entity(repositoryClass: ProcessRepository::class)] #[ORM\Table(name: 'rpa_process_overview_process')] class Process { diff --git a/src/Repository/ProcessRepository.php b/src/Repository/ProcessRepository.php new file mode 100644 index 0000000..79976cf --- /dev/null +++ b/src/Repository/ProcessRepository.php @@ -0,0 +1,18 @@ + + */ +class ProcessRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Process::class); + } +} diff --git a/src/Repository/ProcessStepRepository.php b/src/Repository/ProcessStepRepository.php deleted file mode 100644 index d3112f3..0000000 --- a/src/Repository/ProcessStepRepository.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class ProcessStepRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Process::class); - } - - // /** - // * @return ProcessStep[] Returns an array of ProcessStep objects - // */ - // public function findByExampleField($value): array - // { - // return $this->createQueryBuilder('p') - // ->andWhere('p.exampleField = :val') - // ->setParameter('val', $value) - // ->orderBy('p.id', 'ASC') - // ->setMaxResults(10) - // ->getQuery() - // ->getResult() - // ; - // } - - // public function findOneBySomeField($value): ?ProcessStep - // { - // return $this->createQueryBuilder('p') - // ->andWhere('p.exampleField = :val') - // ->setParameter('val', $value) - // ->getQuery() - // ->getOneOrNullResult() - // ; - // } -} From aa6ceb22734a52b99869bfe0f75aa02eda568203 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 11:31:35 +0200 Subject: [PATCH 06/10] Removed Process entity --- src/Entity/Process.php | 67 ------------------- src/Entity/ProcessOverview.php | 43 ------------ .../ProcessOverviewGroupRepository.php | 25 ------- src/Repository/ProcessOverviewRepository.php | 25 ------- src/Repository/ProcessRepository.php | 18 ----- 5 files changed, 178 deletions(-) delete mode 100644 src/Entity/Process.php delete mode 100644 src/Repository/ProcessRepository.php diff --git a/src/Entity/Process.php b/src/Entity/Process.php deleted file mode 100644 index 36b292d..0000000 --- a/src/Entity/Process.php +++ /dev/null @@ -1,67 +0,0 @@ -id; - } - - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): static - { - $this->name = $name; - - return $this; - } - - public function getProcess(): ?ProcessOverview - { - return $this->process; - } - - public function setProcess(?ProcessOverview $process): static - { - $this->process = $process; - - return $this; - } - - public function getRank(): ?int - { - return $this->rank; - } - - public function setRank(int $rank): static - { - $this->rank = $rank; - - return $this; - } -} diff --git a/src/Entity/ProcessOverview.php b/src/Entity/ProcessOverview.php index 7157709..c0a8d4e 100644 --- a/src/Entity/ProcessOverview.php +++ b/src/Entity/ProcessOverview.php @@ -3,8 +3,6 @@ namespace App\Entity; use App\Repository\ProcessOverviewRepository; -use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Event\PreUpdateEventArgs; use Doctrine\ORM\Mapping as ORM; @@ -31,12 +29,6 @@ class ProcessOverview #[ORM\JoinColumn(nullable: false)] private ?ProcessOverviewGroup $group = null; - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: Process::class, mappedBy: 'process', orphanRemoval: true)] - private Collection $steps; - #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $options = null; @@ -47,11 +39,6 @@ class ProcessOverview #[ORM\Column(length: 255, nullable: true)] private ?string $processId = null; - public function __construct() - { - $this->steps = new ArrayCollection(); - } - public function getId(): ?int { return $this->id; @@ -81,36 +68,6 @@ public function setGroup(?ProcessOverviewGroup $group): static return $this; } - /** - * @return Collection - */ - public function getSteps(): Collection - { - return $this->steps; - } - - public function addStep(Process $step): static - { - if (!$this->steps->contains($step)) { - $this->steps->add($step); - $step->setProcess($this); - } - - return $this; - } - - public function removeStep(Process $step): static - { - if ($this->steps->removeElement($step)) { - // set the owning side to null (unless already changed) - if ($step->getProcess() === $this) { - $step->setProcess(null); - } - } - - return $this; - } - public function getOptions(): ?string { return $this->options; diff --git a/src/Repository/ProcessOverviewGroupRepository.php b/src/Repository/ProcessOverviewGroupRepository.php index 7e6ea25..9e93289 100644 --- a/src/Repository/ProcessOverviewGroupRepository.php +++ b/src/Repository/ProcessOverviewGroupRepository.php @@ -15,29 +15,4 @@ public function __construct(ManagerRegistry $registry) { parent::__construct($registry, ProcessOverviewGroup::class); } - - // /** - // * @return Group[] Returns an array of Group objects - // */ - // public function findByExampleField($value): array - // { - // return $this->createQueryBuilder('g') - // ->andWhere('g.exampleField = :val') - // ->setParameter('val', $value) - // ->orderBy('g.id', 'ASC') - // ->setMaxResults(10) - // ->getQuery() - // ->getResult() - // ; - // } - - // public function findOneBySomeField($value): ?Group - // { - // return $this->createQueryBuilder('g') - // ->andWhere('g.exampleField = :val') - // ->setParameter('val', $value) - // ->getQuery() - // ->getOneOrNullResult() - // ; - // } } diff --git a/src/Repository/ProcessOverviewRepository.php b/src/Repository/ProcessOverviewRepository.php index 3eedc46..ee11946 100644 --- a/src/Repository/ProcessOverviewRepository.php +++ b/src/Repository/ProcessOverviewRepository.php @@ -15,29 +15,4 @@ public function __construct(ManagerRegistry $registry) { parent::__construct($registry, ProcessOverview::class); } - - // /** - // * @return Process[] Returns an array of Process objects - // */ - // public function findByExampleField($value): array - // { - // return $this->createQueryBuilder('p') - // ->andWhere('p.exampleField = :val') - // ->setParameter('val', $value) - // ->orderBy('p.id', 'ASC') - // ->setMaxResults(10) - // ->getQuery() - // ->getResult() - // ; - // } - - // public function findOneBySomeField($value): ?Process - // { - // return $this->createQueryBuilder('p') - // ->andWhere('p.exampleField = :val') - // ->setParameter('val', $value) - // ->getQuery() - // ->getOneOrNullResult() - // ; - // } } diff --git a/src/Repository/ProcessRepository.php b/src/Repository/ProcessRepository.php deleted file mode 100644 index 79976cf..0000000 --- a/src/Repository/ProcessRepository.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ -class ProcessRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Process::class); - } -} From bf1dbf6a1c086d8357eb9617fab7ac08a204ad35 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 11:32:20 +0200 Subject: [PATCH 07/10] Fixed handling of processes data --- src/Controller/Admin/ProcessOverviewCrudController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/Admin/ProcessOverviewCrudController.php b/src/Controller/Admin/ProcessOverviewCrudController.php index a44f65d..a5c2f28 100644 --- a/src/Controller/Admin/ProcessOverviewCrudController.php +++ b/src/Controller/Admin/ProcessOverviewCrudController.php @@ -106,7 +106,7 @@ public function configureFields(string $pageName): iterable ->setFormTypeOptions([ // @todo Add search for process 'choice_loader' => new CallbackChoiceLoader(function () use ($dataSource): array { - $processes = $this->dataSourceHelper->getProcesses($dataSource); + $processes = $this->dataSourceHelper->getProcesses($dataSource)['items'] ?? []; $options = array_combine( array_column($processes, 'name'), array_column($processes, 'id'), From bfee66ccf7766e27ee565334586933cb30e2f3f3 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 11:35:52 +0200 Subject: [PATCH 08/10] Used MySQL --- .env | 3 +- migrations/Version20250926120922.php | 40 ------------------- migrations/Version20250926123121.php | 35 ----------------- migrations/Version20250926123652.php | 39 ------------------- migrations/Version20251001122515.php | 32 --------------- migrations/Version20251001123027.php | 58 ---------------------------- migrations/Version20251003082431.php | 36 ----------------- migrations/Version20251022093419.php | 41 ++++++++++++++++++++ src/Entity/ProcessOverview.php | 1 - src/Entity/ProcessOverviewGroup.php | 1 - 10 files changed, 42 insertions(+), 244 deletions(-) delete mode 100644 migrations/Version20250926120922.php delete mode 100644 migrations/Version20250926123121.php delete mode 100644 migrations/Version20250926123652.php delete mode 100644 migrations/Version20251001122515.php delete mode 100644 migrations/Version20251001123027.php delete mode 100644 migrations/Version20251003082431.php create mode 100644 migrations/Version20251022093419.php diff --git a/.env b/.env index 672fa69..49ad0bd 100644 --- a/.env +++ b/.env @@ -15,8 +15,7 @@ APP_SECRET= # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" # DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" -# DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.11.14-MariaDB&charset=utf8" -DATABASE_URL="sqlite:///%kernel.project_dir%/var/app.db" +DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.11.14-MariaDB&charset=utf8" ###< doctrine/doctrine-bundle ### ###> symfony/mercure-bundle ### diff --git a/migrations/Version20250926120922.php b/migrations/Version20250926120922.php deleted file mode 100644 index 8b5337a..0000000 --- a/migrations/Version20250926120922.php +++ /dev/null @@ -1,40 +0,0 @@ -addSql('CREATE TABLE data_source (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB NOT NULL)'); - $this->addSql('CREATE TABLE rpa_process_overview_process (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, rank INTEGER NOT NULL, process_id INTEGER NOT NULL, CONSTRAINT FK_13CB2757EC2F574 FOREIGN KEY (process_id) REFERENCES rpa_process_overview_process_overview (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); - $this->addSql('CREATE INDEX IDX_13CB2757EC2F574 ON rpa_process_overview_process (process_id)'); - $this->addSql('CREATE TABLE rpa_process_overview_process_overview (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB DEFAULT NULL, process_id VARCHAR(255) DEFAULT NULL, group_id INTEGER NOT NULL, data_source_id INTEGER NOT NULL, CONSTRAINT FK_437BDF18FE54D947 FOREIGN KEY (group_id) REFERENCES rpa_process_overview_process_overview_group (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_437BDF181A935C57 FOREIGN KEY (data_source_id) REFERENCES data_source (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); - $this->addSql('CREATE INDEX IDX_437BDF18FE54D947 ON rpa_process_overview_process_overview (group_id)'); - $this->addSql('CREATE INDEX IDX_437BDF181A935C57 ON rpa_process_overview_process_overview (data_source_id)'); - $this->addSql('CREATE TABLE rpa_process_overview_process_overview_group (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE data_source'); - $this->addSql('DROP TABLE rpa_process_overview_process'); - $this->addSql('DROP TABLE rpa_process_overview_process_overview'); - $this->addSql('DROP TABLE rpa_process_overview_process_overview_group'); - } -} diff --git a/migrations/Version20250926123121.php b/migrations/Version20250926123121.php deleted file mode 100644 index 6be7ff2..0000000 --- a/migrations/Version20250926123121.php +++ /dev/null @@ -1,35 +0,0 @@ -addSql('ALTER TABLE data_source ADD COLUMN url VARCHAR(255) NOT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TEMPORARY TABLE __temp__data_source AS SELECT id, label, options FROM data_source'); - $this->addSql('DROP TABLE data_source'); - $this->addSql('CREATE TABLE data_source (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB NOT NULL)'); - $this->addSql('INSERT INTO data_source (id, label, options) SELECT id, label, options FROM __temp__data_source'); - $this->addSql('DROP TABLE __temp__data_source'); - } -} diff --git a/migrations/Version20250926123652.php b/migrations/Version20250926123652.php deleted file mode 100644 index 6257e8b..0000000 --- a/migrations/Version20250926123652.php +++ /dev/null @@ -1,39 +0,0 @@ -addSql('CREATE TEMPORARY TABLE __temp__data_source AS SELECT id, label, options, url FROM data_source'); - $this->addSql('DROP TABLE data_source'); - $this->addSql('CREATE TABLE data_source (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB DEFAULT NULL, url VARCHAR(255) NOT NULL)'); - $this->addSql('INSERT INTO data_source (id, label, options, url) SELECT id, label, options, url FROM __temp__data_source'); - $this->addSql('DROP TABLE __temp__data_source'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TEMPORARY TABLE __temp__data_source AS SELECT id, label, options, url FROM data_source'); - $this->addSql('DROP TABLE data_source'); - $this->addSql('CREATE TABLE data_source (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB NOT NULL, url VARCHAR(255) NOT NULL)'); - $this->addSql('INSERT INTO data_source (id, label, options, url) SELECT id, label, options, url FROM __temp__data_source'); - $this->addSql('DROP TABLE __temp__data_source'); - } -} diff --git a/migrations/Version20251001122515.php b/migrations/Version20251001122515.php deleted file mode 100644 index 165de4b..0000000 --- a/migrations/Version20251001122515.php +++ /dev/null @@ -1,32 +0,0 @@ -addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles CLOB NOT NULL, password VARCHAR(255) NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL)'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON user (email)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE user'); - } -} diff --git a/migrations/Version20251001123027.php b/migrations/Version20251001123027.php deleted file mode 100644 index 8af73f0..0000000 --- a/migrations/Version20251001123027.php +++ /dev/null @@ -1,58 +0,0 @@ -addSql('ALTER TABLE data_source ADD COLUMN created_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE data_source ADD COLUMN updated_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE data_source ADD COLUMN created_at DATETIME NOT NULL'); - $this->addSql('ALTER TABLE data_source ADD COLUMN updated_at DATETIME NOT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview ADD COLUMN created_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview ADD COLUMN updated_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview ADD COLUMN created_at DATETIME NOT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview ADD COLUMN updated_at DATETIME NOT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview_group ADD COLUMN created_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview_group ADD COLUMN updated_by VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview_group ADD COLUMN created_at DATETIME NOT NULL'); - $this->addSql('ALTER TABLE rpa_process_overview_process_overview_group ADD COLUMN updated_at DATETIME NOT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TEMPORARY TABLE __temp__data_source AS SELECT id, label, options, url FROM data_source'); - $this->addSql('DROP TABLE data_source'); - $this->addSql('CREATE TABLE data_source (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB DEFAULT NULL, url VARCHAR(255) NOT NULL)'); - $this->addSql('INSERT INTO data_source (id, label, options, url) SELECT id, label, options, url FROM __temp__data_source'); - $this->addSql('DROP TABLE __temp__data_source'); - $this->addSql('CREATE TEMPORARY TABLE __temp__rpa_process_overview_process_overview AS SELECT id, label, options, process_id, group_id, data_source_id FROM rpa_process_overview_process_overview'); - $this->addSql('DROP TABLE rpa_process_overview_process_overview'); - $this->addSql('CREATE TABLE rpa_process_overview_process_overview (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options CLOB DEFAULT NULL, process_id VARCHAR(255) DEFAULT NULL, group_id INTEGER NOT NULL, data_source_id INTEGER NOT NULL, CONSTRAINT FK_437BDF18FE54D947 FOREIGN KEY (group_id) REFERENCES rpa_process_overview_process_overview_group (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_437BDF181A935C57 FOREIGN KEY (data_source_id) REFERENCES data_source (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); - $this->addSql('INSERT INTO rpa_process_overview_process_overview (id, label, options, process_id, group_id, data_source_id) SELECT id, label, options, process_id, group_id, data_source_id FROM __temp__rpa_process_overview_process_overview'); - $this->addSql('DROP TABLE __temp__rpa_process_overview_process_overview'); - $this->addSql('CREATE INDEX IDX_437BDF18FE54D947 ON rpa_process_overview_process_overview (group_id)'); - $this->addSql('CREATE INDEX IDX_437BDF181A935C57 ON rpa_process_overview_process_overview (data_source_id)'); - $this->addSql('CREATE TEMPORARY TABLE __temp__rpa_process_overview_process_overview_group AS SELECT id, label FROM rpa_process_overview_process_overview_group'); - $this->addSql('DROP TABLE rpa_process_overview_process_overview_group'); - $this->addSql('CREATE TABLE rpa_process_overview_process_overview_group (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, label VARCHAR(255) NOT NULL)'); - $this->addSql('INSERT INTO rpa_process_overview_process_overview_group (id, label) SELECT id, label FROM __temp__rpa_process_overview_process_overview_group'); - $this->addSql('DROP TABLE __temp__rpa_process_overview_process_overview_group'); - } -} diff --git a/migrations/Version20251003082431.php b/migrations/Version20251003082431.php deleted file mode 100644 index 40aee35..0000000 --- a/migrations/Version20251003082431.php +++ /dev/null @@ -1,36 +0,0 @@ -addSql('CREATE TEMPORARY TABLE __temp__user AS SELECT id, email, roles, created_by, updated_by, created_at, updated_at FROM user'); - $this->addSql('DROP TABLE user'); - $this->addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles CLOB NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL)'); - $this->addSql('INSERT INTO user (id, email, roles, created_by, updated_by, created_at, updated_at) SELECT id, email, roles, created_by, updated_by, created_at, updated_at FROM __temp__user'); - $this->addSql('DROP TABLE __temp__user'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON user (email)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE user ADD COLUMN password VARCHAR(255) NOT NULL'); - } -} diff --git a/migrations/Version20251022093419.php b/migrations/Version20251022093419.php new file mode 100644 index 0000000..a1b4486 --- /dev/null +++ b/migrations/Version20251022093419.php @@ -0,0 +1,41 @@ +addSql('CREATE TABLE data_source (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options LONGTEXT DEFAULT NULL, url VARCHAR(255) NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8'); + $this->addSql('CREATE TABLE process_overview (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, options LONGTEXT DEFAULT NULL, process_id VARCHAR(255) DEFAULT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, group_id INT NOT NULL, data_source_id INT NOT NULL, INDEX IDX_11328F3AFE54D947 (group_id), INDEX IDX_11328F3A1A935C57 (data_source_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8'); + $this->addSql('CREATE TABLE process_overview_group (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8'); + $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL (email), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8'); + $this->addSql('ALTER TABLE process_overview ADD CONSTRAINT FK_11328F3AFE54D947 FOREIGN KEY (group_id) REFERENCES process_overview_group (id)'); + $this->addSql('ALTER TABLE process_overview ADD CONSTRAINT FK_11328F3A1A935C57 FOREIGN KEY (data_source_id) REFERENCES data_source (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE process_overview DROP FOREIGN KEY FK_11328F3AFE54D947'); + $this->addSql('ALTER TABLE process_overview DROP FOREIGN KEY FK_11328F3A1A935C57'); + $this->addSql('DROP TABLE data_source'); + $this->addSql('DROP TABLE process_overview'); + $this->addSql('DROP TABLE process_overview_group'); + $this->addSql('DROP TABLE user'); + } +} diff --git a/src/Entity/ProcessOverview.php b/src/Entity/ProcessOverview.php index c0a8d4e..e9d1540 100644 --- a/src/Entity/ProcessOverview.php +++ b/src/Entity/ProcessOverview.php @@ -10,7 +10,6 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; #[ORM\Entity(repositoryClass: ProcessOverviewRepository::class)] -#[ORM\Table(name: 'rpa_process_overview_process_overview')] #[ORM\HasLifecycleCallbacks] class ProcessOverview { diff --git a/src/Entity/ProcessOverviewGroup.php b/src/Entity/ProcessOverviewGroup.php index 9792716..2963575 100644 --- a/src/Entity/ProcessOverviewGroup.php +++ b/src/Entity/ProcessOverviewGroup.php @@ -10,7 +10,6 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; #[ORM\Entity(repositoryClass: ProcessOverviewGroupRepository::class)] -#[ORM\Table(name: 'rpa_process_overview_process_overview_group')] class ProcessOverviewGroup { use BlameableEntity; From d43dbe6da3c8479e78893c7956a5de4598ce4a7b Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 11:38:55 +0200 Subject: [PATCH 09/10] Updated process details template --- .../admin/crud/process_overview/options_details.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/admin/crud/process_overview/options_details.html.twig b/templates/admin/crud/process_overview/options_details.html.twig index adfdf97..a6d7cac 100644 --- a/templates/admin/crud/process_overview/options_details.html.twig +++ b/templates/admin/crud/process_overview/options_details.html.twig @@ -1,8 +1,8 @@
{{ 'Details for {process}'|trans({process: process.name}) }} - {% set run_metadata_schema = process.meta.run_metadata_schema|default(null) %} - {% if run_metadata_schema %} + {% set meta = process.meta|default(null) %} + {% if meta %}

{{ 'Metadata'|trans }}

@@ -11,7 +11,7 @@ {% set metadata_columns = [] %}
    - {% for name, type in run_metadata_schema %} + {% for name, type in meta %}
  • {{ name }} ({{ type }})
  • {% set metadata_columns = metadata_columns|merge([{ label: 'The label for "%name%"'|replace({'%name%': name}), From 9ea27571facb556f19f92cd6c6f212d753a0eb79 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Wed, 22 Oct 2025 11:39:42 +0200 Subject: [PATCH 10/10] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e97bf01..cb32252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* [PR-31](https://github.com/itk-dev/rpa-process-overview/pull/31) + * Used Mysql database. + * Cleaned up entities. * [PR-30](https://github.com/itk-dev/rpa-process-overview/pull/30) Add pagination * [PR-27](https://github.com/itk-dev/rpa-process-overview/pull/27)