Skip to content

Commit 4f12f72

Browse files
committed
Refactors scope form to handle multiple coordinate IDs
Updates the `ScopeFormDTO` to accept lists of UUIDs for selected coordinate IDs. This accommodates scenarios where multiple IDs might be relevant. Removes the `StringToCoordinateDTOConverter` and the related `WebConfig` class as they are no longer necessary. Updates the `scope.html` template to correctly handle the new data structure, using a joined string representation of the IDs for the select option values.
1 parent 8899a06 commit 4f12f72

File tree

4 files changed

+6
-55
lines changed

4 files changed

+6
-55
lines changed

src/main/java/dev/ikm/server/cosmos/WebConfig.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/main/java/dev/ikm/server/cosmos/api/coordinate/StringToCoordinateDTOConverter.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/main/java/dev/ikm/server/cosmos/scope/ScopeFormDTO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public record ScopeFormDTO(
1010
List<CoordinateDTO> stampCoordinates,
1111
List<CoordinateDTO> languageCoordinates,
1212
List<CoordinateDTO> navigationCoordinates,
13-
UUID selectedStampCoordinateId,
14-
UUID selectedLanguageCoordinateId,
15-
UUID selectedNavigationCoordinateId
13+
List<UUID> selectedStampCoordinateId,
14+
List<UUID> selectedLanguageCoordinateId,
15+
List<UUID> selectedNavigationCoordinateId
1616
) {
1717
}

src/main/resources/templates/scope.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
aria-label="Floating label select example">
4141
<option
4242
th:each="stampCoordinate : ${scopeForm.stampCoordinates()}"
43-
th:value="${stampCoordinate.id().get(0)}"
43+
th:value="${#strings.listJoin(stampCoordinate.id(), ',')}"
4444
th:text="${stampCoordinate.name()}"></option>
4545
</select>
4646
<label for="stampSelect">Status Time Author Module Path (STAMP)</label>
@@ -52,7 +52,7 @@
5252
id="languageSelect">
5353
<option
5454
th:each="languageCoordinate : ${scopeForm.languageCoordinates()}"
55-
th:value="${languageCoordinate.id().get(0)}"
55+
th:value="${#strings.listJoin(languageCoordinate.id(), ',')}"
5656
th:text="${languageCoordinate.name()}"></option>
5757
</select>
5858
<label for="stampSelect">Language</label>
@@ -64,7 +64,7 @@
6464
id="navigationSelect">
6565
<option
6666
th:each="navigationCoordinate : ${scopeForm.navigationCoordinates()}"
67-
th:value="${navigationCoordinate.id().get(0)}"
67+
th:value="${#strings.listJoin(navigationCoordinate.id(), ',')}"
6868
th:text="${navigationCoordinate.name()}"></option>
6969
</select>
7070
<label for="navigationSelect">Navigation</label>

0 commit comments

Comments
 (0)