added more info to app
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -109,7 +113,7 @@ public class AppRepository {
|
||||
.where(T_WORKPACKAGE_APP.FK_WORKPACKAGE.eq(pkWorkpackage))
|
||||
.and(T_WORKPACKAGE_APP.FK_APP.eq(pkApp));
|
||||
// @formatter:on
|
||||
Integer pkWorkpackageApp = sql.fetchOne(T_WORKPACKAGE_APP.PK_WORKPACKAGE_APP);
|
||||
Integer pkWorkpackageApp = sql.fetchOne(T_WORKPACKAGE_APP.PK_WORKPACKAGE_APP);
|
||||
if (pkWorkpackageApp == null) {
|
||||
InsertValuesStep2<TWorkpackageAppRecord, Integer, Integer> sql2 = jooq
|
||||
// @formatter:off
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -38,5 +40,9 @@ public class AppService {
|
||||
public void toggleWorkpackageAppLinkage(Integer pkWorkpackage, Integer pkApp) {
|
||||
repository.toggleWorkpackageAppLinkage(pkWorkpackage, pkApp);
|
||||
}
|
||||
|
||||
public Map<Integer, TBundleRecord> getBundleMap() {
|
||||
return repository.getBundleMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user