Compare commits
2 Commits
improvemen
...
bugfix/wik
| Author | SHA1 | Date | |
|---|---|---|---|
| eb4a983d11 | |||
| d7c32ef69a |
@@ -17,7 +17,7 @@ public class Project implements Mappable {
|
||||
private final Map<Long,Member> members;
|
||||
private final Collection<Status> allowedStates;
|
||||
private boolean showClosed;
|
||||
private final Long companyId;
|
||||
private Long companyId;
|
||||
private int status;
|
||||
private String name;
|
||||
private final long id;
|
||||
@@ -96,6 +96,7 @@ public class Project implements Mappable {
|
||||
public Project patch(JSONObject json) {
|
||||
for (var key : json.keySet()){
|
||||
switch (key){
|
||||
case COMPANY_ID: companyId = json.getLong(COMPANY_ID); break;
|
||||
case DESCRIPTION: description = json.getString(key); break;
|
||||
case NAME: name = json.getString(key); break;
|
||||
case SHOW_CLOSED: showClosed = json.getBoolean(SHOW_CLOSED); break;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte';
|
||||
|
||||
import CompanySelector from '../../Components/CompanySelector.svelte';
|
||||
import LineEditor from '../../Components/LineEditor.svelte';
|
||||
import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
|
||||
import PermissionEditor from '../../Components/PermissionEditor.svelte';
|
||||
@@ -211,6 +212,11 @@
|
||||
{#if project.company}
|
||||
<div>{t('company')}</div>
|
||||
<div class="company">{project.company.name}</div>
|
||||
{:else}
|
||||
{#if showSettings}
|
||||
<div>{t('company')}</div>
|
||||
<span><CompanySelector caption={t('select_company')} onselect={c => update({company_id:c.id})} /></span>
|
||||
{/if}
|
||||
{/if}
|
||||
<div>{t('context')}</div>
|
||||
<div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { useTinyRouter } from 'svelte-tiny-router';
|
||||
import { api, eventStream } from '../../urls.svelte';
|
||||
import { api, eventStream, get } from '../../urls.svelte';
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte';
|
||||
import { user } from '../../user.svelte';
|
||||
@@ -48,8 +48,13 @@
|
||||
});
|
||||
if (res.ok){
|
||||
let json = await res.json();
|
||||
router.navigate(`/wiki/${page.id}/view`);
|
||||
yikes();
|
||||
let target = `/wiki/${page.id}/view`;
|
||||
if (window.location.pathname == target) {
|
||||
loadPage();
|
||||
} else {
|
||||
router.navigate(target);
|
||||
yikes();
|
||||
}
|
||||
} else {
|
||||
error(res);
|
||||
}
|
||||
@@ -100,7 +105,7 @@
|
||||
let path = `wiki/page/${key}`;
|
||||
if (version) path += `/version/${version}`;
|
||||
const url = api(path);
|
||||
const res = await fetch(url,{credentials:'include'});
|
||||
const res = await get(url);
|
||||
loadJson(res);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ CREATE TABLE IF NOT EXISTS {0} (
|
||||
}
|
||||
if (prj.isDirty()){
|
||||
update(TABLE_PROJECTS).set(NAME, DESCRIPTION, STATUS, COMPANY_ID, SHOW_CLOSED).where(ID,equal(prj.id())).prepare(db)
|
||||
.apply(prj.name(),prj.description(),prj.status(),prj.companyId(),prj.showClosed())
|
||||
.apply(prj.name(),prj.description(),prj.status(),prj.companyId().orElse(null),prj.showClosed())
|
||||
.execute();
|
||||
prj.clean();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user