Skip to content

Commit cac0222

Browse files
Merge pull request #34 from itk-dev/feature/cleanup-2025-10-23
Cleaned up and fixed issues
2 parents 38ddeb9 + a4df5f8 commit cac0222

File tree

7 files changed

+50
-17
lines changed

7 files changed

+50
-17
lines changed

Taskfile.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ tasks:
108108
desc: Load app fixtures
109109
prompt: This will reset your database. Continue?
110110
cmds:
111+
# Reset database (and IDs!) by migrating down and up.
112+
- task: console
113+
vars:
114+
TASK_ARGS: doctrine:migrations:migrate first --no-interaction
115+
- task: console
116+
vars:
117+
TASK_ARGS: doctrine:migrations:migrate --no-interaction
111118
- task: console
112119
vars:
113120
TASK_ARGS: hautelook:fixtures:load --no-interaction
@@ -182,6 +189,7 @@ tasks:
182189
- git -C api checkout .
183190
- git -C api checkout main
184191
- git -C api pull
192+
- git -C api log --oneline -10
185193
# Check that our patch can be applied.
186194
- git -C api apply --check < patches/Process_Dashboard_API.patch
187195

@@ -221,6 +229,7 @@ tasks:
221229
- /api/v1/auth/me
222230
- /api/v1/processes/
223231
- /api/v1/processes/1
232+
- /api/v1/runs/?process_id=1&run_status=failed
224233
task: api:get
225234
vars:
226235
API_PATH: "{{.ITEM}}"

fixtures/process_overview.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ App\Entity\DataSource:
33
label: API mock
44
url: http://api:8000
55
options: |-
6-
auth:
7-
header:
6+
client_options:
7+
headers:
88
x-api-key: a-not-so-secret-key
99
1010
data_source_api_2:
1111
label: API mock (the same, but another)
1212
url: http://api:8000
1313
options: |-
14-
auth:
15-
header:
14+
client_options:
15+
headers:
1616
x-api-key: a-not-so-secret-key
17+
verify_peer: false
18+
verify_host: false
1719
1820
App\Entity\ProcessOverviewGroup:
1921
process_overview_group_1:
@@ -42,7 +44,7 @@ App\Entity\ProcessOverview:
4244
# data: meta.klinik
4345
data:
4446
default_query:
45-
status: failed
47+
run_status: failed
4648
page_size: 7
4749
search:
4850
minimum_search_query_length: 3
@@ -77,11 +79,13 @@ App\Entity\ProcessOverview:
7779
- label: Name
7880
data: meta.name
7981
data:
82+
title: Failed processes
8083
default_query:
81-
status: failed
84+
run_status: failed
8285
page_size: 3
8386
search:
8487
minimum_search_query_length: 2
88+
8589
process_overview_4:
8690
label: En anden proces (pending)
8791
group: "@process_overview_group_2"
@@ -94,8 +98,28 @@ App\Entity\ProcessOverview:
9498
- label: Name
9599
data: meta.name
96100
data:
101+
title: Pending processes
102+
default_query:
103+
run_status: pending
104+
page_size: 5
105+
search:
106+
minimum_search_query_length: 3
107+
108+
process_overview_5:
109+
label: En anden proces (completed)
110+
group: "@process_overview_group_2"
111+
dataSource: "@data_source_api_2"
112+
processId: 3
113+
options: |-
114+
metadata_columns:
115+
- label: Barn
116+
data: meta.cpr
117+
- label: Name
118+
data: meta.name
119+
data:
120+
title: Completed processes
97121
default_query:
98-
status: pending
122+
run_status: completed
99123
page_size: 5
100124
search:
101125
minimum_search_query_length: 3

scripts/api/fixtures.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ def create_data(self, seed: int = 19750523) -> None:
4343
number_of_processes = fake.pyint(50, 200)
4444
for _ in range(number_of_processes):
4545
meta = {
46-
"cpr": "string",
47-
"name": "string",
48-
"branch": "string",
46+
"description": fake.sentence(5),
47+
"run_metadata_schema": {
48+
"cpr": "string",
49+
"name": "string",
50+
"branch": "string",
51+
}
4952
}
5053
process = Process(
5154
name=fake.sentence(4),

src/DataSourceHelper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ private function buildOptions(DataSource $dataSource): array
8282
$options = [];
8383

8484
$dataSourceOptions = $this->getOptions($dataSource);
85-
if ($header = ($dataSourceOptions['auth']['header'] ?? null)) {
86-
foreach ($header as $name => $value) {
87-
$options['headers'][$name] = $value;
88-
}
85+
if ($clientOptions = ($dataSourceOptions['client_options'] ?? null)) {
86+
$options += $clientOptions;
8987
}
9088

9189
return $options;

src/ProcessOverviewHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function (array $step) use ($overview) {
122122
'data' => [
123123
'columns' => array_merge($metadataColumns, $stepColumns),
124124
'rows' => $rows,
125-
'data' => $data,
126125
],
127126
'links' => $links,
128127
'meta' => $meta,

templates/admin/crud/process_overview/options_details.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<fieldset class="process-details">
22
<legend>{{ 'Details for {process}'|trans({process: process.name}) }}</legend>
33

4-
{% set meta = process.meta|default(null) %}
4+
{% set meta = process.meta.run_metadata_schema|default(null) %}
55
{% if meta %}
66
<section class="meta">
77
<header>

0 commit comments

Comments
 (0)