12 changed files with 180 additions and 48 deletions
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
<script> |
||||
import { t } from '../../translations.svelte.js'; |
||||
import { onMount } from 'svelte'; |
||||
|
||||
let { id } = $props(); |
||||
let project = $state(null); |
||||
let error = $state(null); |
||||
async function loadProject(){ |
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/project/${id}`; |
||||
const resp = await fetch(url,{credentials:'include'}); |
||||
if (resp.ok){ |
||||
project = await resp.json(); |
||||
error = null; |
||||
} else { |
||||
error = await resp.text(); |
||||
} |
||||
} |
||||
|
||||
|
||||
onMount(loadProject); |
||||
</script> |
||||
|
||||
{#if error} |
||||
<span class="error">{error}</span> |
||||
{/if} |
||||
|
||||
{#if project} |
||||
<table> |
||||
<tbody> |
||||
<tr> |
||||
<th>{t('project')}</th> |
||||
<td>{project.name}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('context')}</th> |
||||
<td> |
||||
<button>{t('files')}</button> |
||||
<button>{t('models')}</button> |
||||
<button>{t('times')}</button> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('description')}</th> |
||||
<td>{@html project.description.rendered}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('estimated_time')}</th> |
||||
<td class="error">TODO</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('tasks')}</th> |
||||
<td class="error">TODO</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('members')}</th> |
||||
<td> |
||||
<ul> |
||||
{#each Object.entries(project.members) as [uid,member]} |
||||
<li>{member.user.name}: {t('permission.'+member.permission)}</li> |
||||
{/each} |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
{/if} |
||||
@ -1,14 +1,15 @@
@@ -1,14 +1,15 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.project; |
||||
|
||||
import de.srsoftware.umbrella.core.api.UserService; |
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException; |
||||
import de.srsoftware.umbrella.core.model.Project; |
||||
import java.util.Map; |
||||
|
||||
public interface ProjectDb { |
||||
Map<Long, Project> ofCompany(long companyId, boolean includeClosed, UserService userService) throws UmbrellaException; |
||||
Map<Long, Project> ofUser(long userId, boolean includeClosed, UserService userService) throws UmbrellaException; |
||||
Map<Long, Project> ofCompany(long companyId, boolean includeClosed) throws UmbrellaException; |
||||
Map<Long, Project> ofUser(long userId, boolean includeClosed) throws UmbrellaException; |
||||
|
||||
Project save(Project prj) throws UmbrellaException; |
||||
|
||||
Project load(long projectId) throws UmbrellaException; |
||||
} |
||||
|
||||
Loading…
Reference in new issue