remove old unused ´view´ and ´tatorte´ views
This commit is contained in:
@@ -1,37 +0,0 @@
|
|||||||
import { client } from '$lib/minio';
|
|
||||||
import { fail } from '@sveltejs/kit';
|
|
||||||
|
|
||||||
import vorgangNumberOccupied from '$lib/helper/vorgangNumberOccupied.js';
|
|
||||||
|
|
||||||
/** @type {import('./$types').Actions} */
|
|
||||||
export const actions = {
|
|
||||||
default: async ({ request }: {request: Request}) => {
|
|
||||||
const data = await request.formData();
|
|
||||||
const vorgangNumber = data.get('vorgangNumber');
|
|
||||||
const description = data.get('description');
|
|
||||||
|
|
||||||
if (!vorgangNumber) {
|
|
||||||
return fail(400, {
|
|
||||||
vorgangNumber,
|
|
||||||
description,
|
|
||||||
error: { vorgangNumber: 'Es muss eine Vorgangsnummer vorhanden sein.' }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await vorgangNumberOccupied(`${vorgangNumber}`)) {
|
|
||||||
return fail(400, {
|
|
||||||
vorgangNumber,
|
|
||||||
description,
|
|
||||||
error: { vorgangNumber: 'Die Vorgangsnummer wurde im System bereits angelegt.' }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = `${JSON.stringify({ vorgangNumber, description, version: 1 })}\n`;
|
|
||||||
|
|
||||||
await client.putObject('tatort', `${vorgangNumber}/config.json`, config, undefined, {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
});
|
|
||||||
|
|
||||||
return { success: true };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import Alert from '$lib/components/Alert.svelte';
|
|
||||||
import Button from '$lib/components/Button.svelte';
|
|
||||||
import Modal from '$lib/components/Modal/Modal.svelte';
|
|
||||||
import ModalTitle from '$lib/components/Modal/ModalTitle.svelte';
|
|
||||||
import ModalContent from '$lib/components/Modal/ModalContent.svelte';
|
|
||||||
import ModalFooter from '$lib/components/Modal/ModalFooter.svelte';
|
|
||||||
import Exclamation from '$lib/icons/Exclamation.svelte';
|
|
||||||
|
|
||||||
export let form;
|
|
||||||
|
|
||||||
let open = false;
|
|
||||||
$: open = form?.success ?? false;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="mx-auto max-w-2xl">
|
|
||||||
<div class="flex flex-col items-center justify-center w-full">
|
|
||||||
<h1 class="text-xl">Neuer Vorgang</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="POST">
|
|
||||||
<div class="space-y-12">
|
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
|
||||||
<p class="mt-8 text-sm leading-6 text-gray-600">
|
|
||||||
This information will be displayed publicly so be careful what you share.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8">
|
|
||||||
<div>
|
|
||||||
<label for="vorgangNumber" class="block text-sm font-medium leading-6 text-gray-900"
|
|
||||||
><span class="flex"
|
|
||||||
>{#if form?.error?.vorgangNumber}
|
|
||||||
<span class="inline-block mr-1"><Exclamation /></span>
|
|
||||||
{/if} Vorgangs-Nr.</span
|
|
||||||
></label
|
|
||||||
>
|
|
||||||
<div class="mt-2">
|
|
||||||
<div
|
|
||||||
class="flex rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-600"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
value={form?.vorgangNumber ?? ''}
|
|
||||||
type="text"
|
|
||||||
name="vorgangNumber"
|
|
||||||
id="vorgangNumber"
|
|
||||||
class="block flex-1 border-0 bg-transparent py-1.5 pl-1 text-gray-900 placeholder:text-gray-400 focus:ring-0 text-sm leading-6"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{#if form?.error?.vorgangNumber}
|
|
||||||
<p class="block text-sm leading-6 text-red-900 mt-2">{form.error.vorgangNumber}</p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label for="description" class="block text-sm font-medium leading-6 text-gray-900"
|
|
||||||
><span class="flex"
|
|
||||||
>{#if form?.description}
|
|
||||||
<span class="inline-block mr-1"><Exclamation /></span>
|
|
||||||
{/if} Beschreibung</span
|
|
||||||
></label
|
|
||||||
>
|
|
||||||
<div class="mt-2">
|
|
||||||
<textarea
|
|
||||||
value={form?.description?.toString() ?? ''}
|
|
||||||
id="description"
|
|
||||||
name="description"
|
|
||||||
rows="3"
|
|
||||||
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
|
|
||||||
></textarea>
|
|
||||||
</div>
|
|
||||||
{#if form?.error}
|
|
||||||
<p class="block text-sm leading-6 text-red-900 mt-2">{form.description}</p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label for="vorgang-token">
|
|
||||||
<span >Zugangstoken (optional) </span>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div class="mt-2">
|
|
||||||
<div
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="vorgang-token"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
|
||||||
<button type="button" class="text-sm font-semibold leading-6 text-gray-900">Cancel</button>
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
class="rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
|
|
||||||
>Save</Button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<Modal {open}
|
|
||||||
><ModalTitle>vorgang anlegen</ModalTitle><ModalContent>
|
|
||||||
{#if form?.success}
|
|
||||||
<Alert class="w-full">Vorgang erfolgreich angelegt</Alert>
|
|
||||||
{:else}
|
|
||||||
<Alert class="w-full" type="error">Fehler beim Upload</Alert>
|
|
||||||
{/if}
|
|
||||||
</ModalContent>
|
|
||||||
<ModalFooter><Button on:click={() => (open = false)}>Ok</Button></ModalFooter>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
|
||||||
|
|
||||||
export const actions = {
|
|
||||||
default: async ({request}: {request: Request}) => {
|
|
||||||
const data = await request.formData();
|
|
||||||
const vorgangId = data.get('vorgang-id');
|
|
||||||
const vorgangToken = data.get('vorgang-token');
|
|
||||||
|
|
||||||
if( vorgangId && vorgangToken) throw redirect(303, `/list/${vorgangId}?token=${vorgangToken}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import BaseInputField from '$lib/components/BaseInputField.svelte';
|
|
||||||
import Button from '$lib/components/Button.svelte';
|
|
||||||
import ArrowRight from '$lib/icons/Arrow-right.svelte';
|
|
||||||
|
|
||||||
export let form;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="mx-auto max-w-2xl">
|
|
||||||
<div class="flex flex-col items-center justify-center w-full">
|
|
||||||
<h1 class="text-xl">Vorgang ansehen</h1>
|
|
||||||
</div>
|
|
||||||
<p class="mt-8 mb-8 text-sm leading-6 text-gray-600">
|
|
||||||
Anhand der Vorgangsnummer werden Sie zu den Dateien des Vorgangs weitergeleitet und können sich
|
|
||||||
den Vorgang dann ansehen.
|
|
||||||
</p>
|
|
||||||
<form method="POST">
|
|
||||||
<BaseInputField
|
|
||||||
id="vorgang-id"
|
|
||||||
name="vorgang-id"
|
|
||||||
label="Vorgangskennung"
|
|
||||||
type="text"
|
|
||||||
value={form?.vorgangId}
|
|
||||||
/>
|
|
||||||
<div class="mt-5">
|
|
||||||
<BaseInputField
|
|
||||||
id="vorgang-token"
|
|
||||||
name="vorgang-token"
|
|
||||||
label="Zugangstoken"
|
|
||||||
type="text"
|
|
||||||
value={form?.vorgangToken}
|
|
||||||
error={form?.error?.message}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-end pt-4">
|
|
||||||
<Button type="submit"><ArrowRight /></Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
Reference in New Issue
Block a user