Skip to content

Commit 13ccc0e

Browse files
authored
Merge pull request #1388 from qbicsoftware/development
Create Release
2 parents da44a0c + 866416f commit 13ccc0e

File tree

55 files changed

+5998
-3282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5998
-3282
lines changed

.github/workflows/build_package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build Maven Package
22

33
on:
4+
pull_request:
45
push:
56
branches:
67
- '**'

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
branches: [ main, master, development, release/*, hotfix/* ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main, master ]
19+
branches: [ main, master, development ]
2020
schedule:
2121
- cron: '21 1 * * 4'
2222

.github/workflows/run_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Run Maven Tests
22

33
on:
4+
pull_request:
45
push:
56
branches:
67
- '**'

AGENTS.md

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package life.qbic.application.commons.time;
2+
3+
import java.time.ZoneId;
4+
import java.time.format.DateTimeFormatter;
5+
import org.springframework.lang.NonNull;
6+
7+
/**
8+
* Defines canonical date/time formats used consistently across the application.
9+
*
10+
* <p>This type acts as a cross-layer contract between:
11+
* <ul>
12+
* <li>UI rendering (via {@link #asJavaFormatter(DateTimeFormat, ZoneId)})</li>
13+
* <li>Database-side filtering (via {@link #asMariaDbDatabasePattern(DateTimeFormat)})</li>
14+
* </ul>
15+
*
16+
* <p>The goal is to ensure that textual date representations shown to the user
17+
* exactly match the representations used for textual filtering in the database,
18+
* allowing users to search for values as displayed.
19+
*
20+
* <p>Each format therefore provides both:
21+
* <ul>
22+
* <li>A {@link DateTimeFormatter} correctly configured with the corresponding pattern</li>
23+
* <li>A MariaDB <a href="https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date_format">{@code DATE_FORMAT}</a> pattern to be used with correctly zoned dates</li>
24+
* </ul>
25+
*/
26+
27+
public enum DateTimeFormat {
28+
29+
30+
/**
31+
* A simple to read, textual date representation. E.g. {@code Wednesday, 11 February 2026}
32+
* <p>
33+
* Format: {@code <weekday_name>, <day> <month_name> <year>}}
34+
*/
35+
SIMPLE_DATE,
36+
/**
37+
* A simple to read, textual date-time representation. E.g.
38+
* {@code Wednesday, 11 February 2026 11:12:10}
39+
* <p>
40+
* Format: {@code <weekday_name>, <day> <month_name> <year>
41+
* <hour>:<minute>:<seconds>}}
42+
*/
43+
SIMPLE_DATE_TIME,
44+
/**
45+
* The ISO-8601 date format without an offset, such as '2011-12-03'.
46+
* <p>
47+
* Format: {@code <year>-<month>-<day>}
48+
*/
49+
ISO_LOCAL_DATE,
50+
/**
51+
* The ISO-8601 date-time format without an offset, such as '2011-12-03T10:15:30'.
52+
* <p>
53+
* Format: {@code <year>-<month>-<day>T<hour>:<minute>:<second>}
54+
*/
55+
ISO_LOCAL_DATE_TIME,
56+
/**
57+
* The ISO-8601 date-time format without an offset. Date and time are separated by a space instead of T, such as '2011-12-03 10:15:30'.
58+
* <p>
59+
* Format: {@code <year>-<month>-<day> <hour>:<minute>:<second>}
60+
*/
61+
ISO_LOCAL_DATE_TIME_WHITESPACE_SEPARATED;
62+
63+
/**
64+
* Creates a {@link DateTimeFormatter} for rendering Instants in the UI.
65+
*
66+
* <p>The formatter must produce a textual representation equivalent to thee
67+
* * MariaDB {@code DATE_FORMAT} pattern returned by {@link #asMariaDbDatabasePattern(DateTimeFormat)},
68+
* so that user-entered search terms match the displayed values.
69+
*
70+
* @return formatter matching the database-side date representation
71+
*/
72+
73+
@NonNull
74+
public static DateTimeFormatter asJavaFormatter(@NonNull DateTimeFormat format, ZoneId zoneId) {
75+
return switch (format) {
76+
case ISO_LOCAL_DATE -> DateTimeFormatter.ISO_LOCAL_DATE.withZone(zoneId);
77+
case ISO_LOCAL_DATE_TIME -> DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(zoneId);
78+
case ISO_LOCAL_DATE_TIME_WHITESPACE_SEPARATED -> DateTimeFormatter.ofPattern(
79+
"yyyy-MM-dd HH:mm").withZone(zoneId);
80+
case SIMPLE_DATE -> DateTimeFormatter.ofPattern("EEEE, dd LLLL yyyy").withZone(zoneId);
81+
case SIMPLE_DATE_TIME -> DateTimeFormatter.ofPattern("EEEE, dd LLLL yyyy HH:mm:ss").withZone(
82+
zoneId);
83+
};
84+
}
85+
86+
/**
87+
* Returns the MariaDB <a href="https://mariadb.com/docs/server/reference/sql-functions/date-time-functions/date_format">{@code DATE_FORMAT}</a> pattern corresponding to the UI format.
88+
*
89+
* <p>This pattern is used in JPA Specifications to transform Instants into
90+
* textual representations that align with the UI rendering format.
91+
*
92+
* @return MariaDB date format pattern
93+
*/
94+
@NonNull
95+
public static String asMariaDbDatabasePattern(@NonNull DateTimeFormat format) {
96+
return switch (format) {
97+
case SIMPLE_DATE -> "%W, %d %M %Y";
98+
case SIMPLE_DATE_TIME -> "%W, %d %M %Y %T";
99+
case ISO_LOCAL_DATE -> "%Y-%m-%d";
100+
case ISO_LOCAL_DATE_TIME -> "%Y-%m-%dT%T";
101+
case ISO_LOCAL_DATE_TIME_WHITESPACE_SEPARATED -> "%Y-%m-%d %T";
102+
};
103+
}
104+
}

datamanager-app/frontend/themes/datamanager/components/grid-templates.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
}
4343

4444
.main.measurement {
45-
grid-template-columns: minmax(max-content, 70%) minmax(max-content, 30%);
46-
grid-template-rows: minmax(max-content, 25%) minmax(max-content, 70%);
45+
grid-template-columns: 100%;
46+
grid-template-rows: minmax(min-content, 10%) minmax(90%, 100%);
4747
grid-template-areas:
48-
". measurementtemplatelist"
49-
"measurementdetails measurementdetails";
48+
"."
49+
"measurementdetails";
5050
}
5151

5252
.main.project {
@@ -94,9 +94,8 @@
9494
grid-template-columns: minmax(min-content, 1fr);
9595
grid-template-areas:
9696
"."
97-
"measurementtemplatelist"
9897
"measurementdetails";
99-
grid-template-rows: minmax(min-content, 20%) minmax(min-content, 20%) minmax(min-content, 60%);
98+
grid-template-rows: minmax(min-content, 10%) minmax(90%, 100%);
10099
}
101100

102101
.main.project {

datamanager-app/frontend/themes/datamanager/components/main.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@
161161
align-items: center;
162162
}
163163

164-
.main.measurement .measurement-template-list-component {
165-
grid-area: measurementtemplatelist;
166-
}
167-
168164

169165
.main.measurement .measurement-details-component {
170166
grid-area: measurementdetails

datamanager-app/frontend/themes/datamanager/components/page-area.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
}
124124

125125
.measurement-details-component {
126-
height: 100%;
127126
justify-content: center;
128127
align-items: center;
129128
}

datamanager-app/src/main/java/life/qbic/datamanager/AppConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ public MeasurementCreatedPolicy measurementCreatedPolicy(
287287

288288
@Bean
289289
public MeasurementUpdatedPolicy measurementUpdatedPolicy(
290-
MeasurementLookupService measurementLookupService,
291290
ProjectInformationService projectInformationService, JobScheduler jobScheduler) {
292291
var updateProjectUponMeasurementUpdate = new UpdateProjectUponMeasurementUpdate(
293-
measurementLookupService, projectInformationService, jobScheduler);
292+
projectInformationService,
293+
jobScheduler);
294294
return new MeasurementUpdatedPolicy(updateProjectUponMeasurementUpdate);
295295
}
296296

datamanager-app/src/main/java/life/qbic/datamanager/views/Context.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.StringJoiner;
88
import life.qbic.projectmanagement.domain.model.experiment.ExperimentId;
99
import life.qbic.projectmanagement.domain.model.project.ProjectId;
10-
import org.springframework.lang.NonNull;
1110

1211
/**
1312
* The current context information
@@ -118,6 +117,7 @@ public String toString() {
118117
return new StringJoiner(", ", Context.class.getSimpleName() + "[", "]")
119118
.add("projectId=" + projectId)
120119
.add("experimentId=" + experimentId)
120+
.add("projectCode=" + projectCode)
121121
.toString();
122122
}
123123
}

0 commit comments

Comments
 (0)