Skip to content

Commit e6d1353

Browse files
committed
Refines constellation scope migration and integrates Markdown editor
Completes the transition of scope management from Observatory to Constellation by updating HTMX endpoints and UI fragment paths. Enhances the constellation form with an EasyMDE Markdown editor for portal prompts and streamlines Maven configuration by removing the build cache extension and adopting the Spring Data BOM.
1 parent 5677c1d commit e6d1353

9 files changed

Lines changed: 24 additions & 99 deletions

File tree

.mvn/extensions.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
33

4-
<extension>
5-
<groupId>org.apache.maven.extensions</groupId>
6-
<artifactId>maven-build-cache-extension</artifactId>
7-
<version>1.0.1</version>
8-
</extension>
9-
104
</extensions>

pom.xml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565

6666
<!-- Spring -->
6767
<spring-boot.version>3.5.5</spring-boot.version>
68+
<spring-data-bom.version>2024.1.5</spring-data-bom.version>
6869
<thymeleaf-layout-dialect.version>3.4.0</thymeleaf-layout-dialect.version>
6970
<htmx-spring-boot-thymeleaf.version>4.0.1</htmx-spring-boot-thymeleaf.version>
7071

@@ -133,6 +134,13 @@
133134
<type>pom</type>
134135
<scope>import</scope>
135136
</dependency>
137+
<dependency>
138+
<groupId>org.springframework.data</groupId>
139+
<artifactId>spring-data-bom</artifactId>
140+
<version>${spring-data-bom.version}</version>
141+
<type>pom</type>
142+
<scope>import</scope>
143+
</dependency>
136144
<dependency>
137145
<groupId>nz.net.ultraq.thymeleaf</groupId>
138146
<artifactId>thymeleaf-layout-dialect</artifactId>
@@ -280,18 +288,6 @@
280288
<groupId>org.springframework.boot</groupId>
281289
<artifactId>spring-boot-starter-actuator</artifactId>
282290
</dependency>
283-
284-
<dependency>
285-
<groupId>org.springframework.data</groupId>
286-
<artifactId>spring-data-commons</artifactId>
287-
<version>2.1.10.RELEASE</version>
288-
</dependency>
289-
290-
<dependency>
291-
<groupId>org.springframework.data</groupId>
292-
<artifactId>spring-data-commons</artifactId>
293-
<version>2.1.10.RELEASE</version>
294-
</dependency>
295291
</dependencies>
296292

297293
<build>

src/main/java/dev/ikm/server/cosmos/constellation/ConstellationController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public FragmentsRendering getSearchResults(
9898
Model model) {
9999
constellationService.search(query, pageable)
100100
.ifPresent(searchResults -> model.addAttribute("scopeSearchResultsPage", searchResults));
101-
return FragmentsRendering.with("fragments/observatory/observatory-scope-search :: search-results-list").build();
101+
return FragmentsRendering.with("fragments/constellation/constellation-scope-search :: search-results-list").build();
102102
}
103103

104104
@HxRequest
@@ -109,7 +109,7 @@ public FragmentsRendering getTraverse(
109109
constellationService.buildScopeNode(scope).ifPresent(scopeNode -> model.addAttribute("scope", scopeNode));
110110
constellationService.retrieveChildren(scope).ifPresent(children -> model.addAttribute("children", children));
111111
constellationService.retrieveParents(scope).ifPresent(parents -> model.addAttribute("parents", parents));
112-
return FragmentsRendering.with("fragments/observatory/observatory-scope-tree :: scope-tree").build();
112+
return FragmentsRendering.with("fragments/constellation/constellation-scope-tree :: scope-tree").build();
113113
}
114114

115115
@HxRequest
@@ -120,7 +120,7 @@ public FragmentsRendering addScope(
120120
model.addAttribute("item", scope);
121121
constellationService.retrieveDescendantCount(scope)
122122
.ifPresent(count -> model.addAttribute("descendantCount", count));
123-
return FragmentsRendering.with("fragments/observatory/observatory-scope-list-item :: scope-list-item").build();
123+
return FragmentsRendering.with("fragments/constellation/constellation-scope-list-item :: scope-list-item").build();
124124
}
125125

126126
@HxRequest

src/main/resources/templates/fragments/constellation/constellation-form.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</head>
77

88
<body>
9-
<form th:fragment="constellation-form" x-data @htmx:after-request="if($event.detail.successful) $el.reset()"
9+
<form th:fragment="constellation-form" x-data="{ easymde: null }" @htmx:after-request="if($event.detail.successful) { $el.reset(); if (easymde) easymde.value(''); }"
1010
action="#" th:action="@{/constellation}" th:object="${constellationForm}" method="post" hx-post="/constellation"
1111
hx-target="#constellation-table-body" hx-swap="afterbegin" hx-trigger="submit">
1212
<div class="mb-3">
@@ -16,8 +16,8 @@
1616
</div>
1717
<div class="mb-3">
1818
<label for="portalPromptInput">Portal Prompt</label>
19-
<input th:field="*{portalPrompt}" type="text" class="form-control" id="portalPromptInput"
20-
placeholder="Optional prompt for the constellation's portal" autocomplete="off">
19+
<textarea th:field="*{portalPrompt}" class="form-control" id="portalPromptInput" x-init="easymde = new EasyMDE({ element: $el, forceSync: true, spellChecker: false, minHeight: '100px' })"
20+
placeholder="Optional prompt for the constellation's portal" rows="3"></textarea>
2121
</div>
2222
<div class="mb-3">
2323
<label for="includedScopesSelect">Included Scopes</label>
@@ -48,7 +48,7 @@
4848
<div class="col-md-4">
4949
<div id="scope-tree-container">
5050
<th:block
51-
th:replace="~{fragments/observatory/observatory-scope-tree :: scope-tree(scope=${scope}, children=${children})}">
51+
th:replace="~{fragments/constellation/constellation-scope-tree :: scope-tree(scope=${scope}, children=${children})}">
5252
</th:block>
5353
</div>
5454
</div>

src/main/resources/templates/fragments/constellation/constellation-scope-search.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<li th:each="result : ${scopeSearchResultsPage.content}"
1212
class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
1313
th:data-nid="${result.id.nid}"
14-
hx-get="/observatory/scope/traverse"
14+
hx-get="/constellation/scope/traverse"
1515
hx-vals="js:{nid: this.dataset.nid}"
1616
hx-target="#scope-tree-container"
1717
hx-swap="innerHTML"
@@ -23,7 +23,7 @@
2323
<!-- If there is a next page, render the 'Load More' button -->
2424
<li th:if="${!scopeSearchResultsPage.last}" class="list-group-item p-0">
2525
<button class="btn btn-outline-secondary w-100 border-0"
26-
th:hx-get="@{/observatory/scope/search(query=${query}, page=${scopeSearchResultsPage.number + 1})}"
26+
th:hx-get="@{/constellation/scope/search(query=${query}, page=${scopeSearchResultsPage.number + 1})}"
2727
hx-swap="outerHTML"
2828
hx-target="closest li"
2929
hx-indicator="#scope-activity-indicator">Load More...</button> </li>

src/main/resources/templates/fragments/constellation/constellation-scope-tree.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- Clickable area for navigation -->
1212
<div class="flex-grow-1 text-primary" style="cursor: pointer;"
1313
th:data-nid="${parent.facade.id.nid}"
14-
hx-get="/observatory/scope/traverse"
14+
hx-get="/constellation/scope/traverse"
1515
hx-vals="js:{nid: this.dataset.nid}"
1616
hx-target="#scope-tree-container"
1717
hx-swap="innerHTML"
@@ -28,7 +28,7 @@
2828
<ul class="dropdown-menu">
2929
<li>
3030
<button class="dropdown-item"
31-
th:attr="hx-post=@{/observatory/scope/add(nid=${parent.facade.id.nid})}"
31+
th:attr="hx-post=@{/constellation/scope/add(nid=${parent.facade.id.nid})}"
3232
hx-target="#includedScopeContainer"
3333
hx-swap="beforeend">
3434
<i class="bi bi-plus-circle me-2"></i>Add Scope
@@ -53,7 +53,7 @@
5353
<ul class="dropdown-menu">
5454
<li>
5555
<button class="dropdown-item"
56-
th:attr="hx-post=@{/observatory/scope/add(nid=${scope.facade.id.nid})}"
56+
th:attr="hx-post=@{/constellation/scope/add(nid=${scope.facade.id.nid})}"
5757
hx-target="#includedScopeContainer"
5858
hx-swap="beforeend">
5959
<i class="bi bi-plus-circle me-2"></i>Add Scope
@@ -67,7 +67,7 @@
6767
<!-- Clickable area for navigation -->
6868
<div class="flex-grow-1" style="cursor: pointer;" th:classappend="${!child.isLeaf ? 'text-primary' : 'text-secondary'}"
6969
th:data-nid="${child.facade.id.nid}"
70-
hx-get="/observatory/scope/traverse"
70+
hx-get="/constellation/scope/traverse"
7171
hx-vals="js:{nid: this.dataset.nid}"
7272
hx-target="#scope-tree-container"
7373
hx-swap="innerHTML"
@@ -84,7 +84,7 @@
8484
<ul class="dropdown-menu">
8585
<li>
8686
<button class="dropdown-item"
87-
th:attr="hx-post=@{/observatory/scope/add(nid=${child.facade.id.nid})}"
87+
th:attr="hx-post=@{/constellation/scope/add(nid=${child.facade.id.nid})}"
8888
hx-target="#includedScopeContainer"
8989
hx-swap="beforeend">
9090
<i class="bi bi-plus-circle me-2"></i>Add Scope

src/main/resources/templates/fragments/observatory/observatory-manage.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<th scope="col">Language</th>
1111
<th scope="col">Navigation</th>
1212
<th scope="col">Modules</th>
13-
<th scope="col">Scopes</th>
1413
<th scope="col" class="text-center">Actions</th>
1514
</tr>
1615
</thead>

src/main/resources/templates/layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.15.1/dist/cdn.min.js"></script>
2424
<script src="//cdn.jsdelivr.net/npm/force-graph"></script>
2525
<script src="https://cdn.jsdelivr.net/npm/quercus.js@0.4.4/src/treeview.min.js"></script>
26+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
27+
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
2628
</head>
2729
<body class="d-flex flex-column h-100" hx-ext="morph">
2830
<header>

src/main/resources/templates/observatory.html

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

0 commit comments

Comments
 (0)