added more info to app

This commit is contained in:
henkej
2026-01-16 14:13:42 +01:00
parent 0b7cde7ad0
commit a4e32c0d0e
4 changed files with 38 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ public class AppController extends CommonController {
model.addAttribute("app", service.getApp(pkApp));
model.addAttribute("workpackages", service.getWorkpackages());
model.addAttribute("linked", service.getWorkpackageApps(pkApp));
model.addAttribute("bundleMap", service.getBundleMap());
return "/projectmanagement/app/assign";
}

View File

@@ -1,10 +1,13 @@
package de.jottyfan.timetrack.modules.projectmanagement;
import static de.jottyfan.timetrack.db.project.Tables.T_APP;
import static de.jottyfan.timetrack.db.project.Tables.T_BUNDLE;
import static de.jottyfan.timetrack.db.project.Tables.T_WORKPACKAGE;
import static de.jottyfan.timetrack.db.project.Tables.T_WORKPACKAGE_APP;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jooq.DSLContext;
import org.jooq.DeleteConditionStep;
@@ -16,6 +19,7 @@ import org.jooq.impl.DSL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import de.jottyfan.timetrack.db.project.tables.records.TBundleRecord;
import de.jottyfan.timetrack.db.project.tables.records.TWorkpackageAppRecord;
import de.jottyfan.timetrack.modules.projectmanagement.model.AppBean;
import de.jottyfan.timetrack.modules.projectmanagement.model.WorkpackageAppBean;
@@ -128,4 +132,15 @@ public class AppRepository {
sql2.execute();
}
}
/**
* get the bundle map; the key is the ID of the bundle
*
* @return a map; an empty map at least
*/
public Map<Integer, TBundleRecord> getBundleMap() {
Map<Integer, TBundleRecord> map = new HashMap<>();
jooq.selectFrom(T_BUNDLE).fetchInto(TBundleRecord.class).forEach(b -> map.put(b.getPkBundle(), b));
return map;
}
}

View File

@@ -1,10 +1,12 @@
package de.jottyfan.timetrack.modules.projectmanagement;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.jottyfan.timetrack.db.project.tables.records.TBundleRecord;
import de.jottyfan.timetrack.modules.projectmanagement.model.AppBean;
import de.jottyfan.timetrack.modules.projectmanagement.model.WorkpackageAppBean;
import de.jottyfan.timetrack.modules.projectmanagement.model.WorkpackageBean;
@@ -39,4 +41,8 @@ public class AppService {
repository.toggleWorkpackageAppLinkage(pkWorkpackage, pkApp);
}
public Map<Integer, TBundleRecord> getBundleMap() {
return repository.getBundleMap();
}
}

View File

@@ -10,8 +10,21 @@
</ul>
<main layout:fragment="content">
<div class="row">
<div class="col">
<div th:text="${app.name}"></div>
<div class="col-2">Name</div>
<div class="col-10" th:text="${app.name}"></div>
<div class="col-2">Beschreibung</div>
<div class="col-10" th:text="${app.description}"></div>
<div class="col-2">Basisfunktion</div>
<div class="col-10" th:text="${app.basicFunctionality}"></div>
<div class="col-2">URL der Entwicklung</div>
<div class="col-10" th:text="${app.repositoryUrl}"></div>
<div class="col-2" th:if="${app.fkReplacedByApp}">Ersetzt durch andere App</div>
<div class="col-10" th:if="${app.fkReplacedByApp}">
<a th:href="@{/projectmanagement/app/{id}/assign(id=${app.fkReplacedByApp})}" th:text="${app.fkReplacedByApp}"></a>
</div>
<div class="col-2">Bundle</div>
<div class="col-10" th:text="${bundleMap.get(app.fkBundle).name}"></div>
<div class="col-12">
<div th:each="p : ${workpackages}">
<input type="checkbox" th:checked="${p.isIn(linked)}" /> <span th:text="${p.name}"></span> <a
th:href="@{/projectmanagement/workpackage/{w}/app/{a}/toggle(w=${p.pkWorkpackage},a=${app.pkApp})}" class="btn btn-outline-secondary">umschalten</a>