Publish frozen exercise releases and report whether they stay offerable.
Deploy Development / deploy (push) Successful in 1m12s
Test Suite / pytest-backend (push) Failing after 30s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 16s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 7m42s
Deploy Development / deploy (push) Successful in 1m12s
Test Suite / pytest-backend (push) Failing after 30s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 16s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 7m42s
Recipients can ask whether a released exercise is still offerable. Archiving or removing the source stops new offers; the frozen copy stays fetchable until withdrawal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b537750671
commit
fe3633ba8b
21 files changed
+3862
-12
No files matched your search
@@ -59,6 +59,7 @@ const MediaWikiImportPage = lazyWithRetry(() => import('./pages/MediaWikiImportP
|
||||
const AdminUsersPage = lazyWithRetry(() => import('./pages/AdminUsersPage'))
|
||||
const AdminClubCreationRequestsPage = lazyWithRetry(() => import('./pages/AdminClubCreationRequestsPage'))
|
||||
const AdminRightsPage = lazyWithRetry(() => import('./pages/AdminRightsPage'))
|
||||
const AdminDistributionPage = lazyWithRetry(() => import('./pages/AdminDistributionPage'))
|
||||
const MediaLibraryPage = lazyWithRetry(() => import('./pages/MediaLibraryPage'))
|
||||
const LegalPage = lazyWithRetry(() => import('./pages/LegalPage'))
|
||||
const AdminLegalDocumentsPage = lazyWithRetry(() => import('./pages/AdminLegalDocumentsPage'))
|
||||
@@ -323,6 +324,14 @@ const appRouter = createBrowserRouter([
|
||||
</PlatformAdminRoute>
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'admin/distribution',
|
||||
element: (
|
||||
<PlatformAdminRoute>
|
||||
<AdminDistributionPage />
|
||||
</PlatformAdminRoute>
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'admin/rights',
|
||||
element: (
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
import { request } from './client.js'
|
||||
|
||||
export function getExerciseDistribution(exerciseId) {
|
||||
return request(`/api/exercises/${exerciseId}/distribution`)
|
||||
}
|
||||
|
||||
export function createDistributionDraft(exerciseId, body) {
|
||||
return request(`/api/exercises/${exerciseId}/distribution/drafts`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateDistributionDraft(exerciseId, draftId, cut) {
|
||||
return request(`/api/exercises/${exerciseId}/distribution/drafts/${draftId}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ cut }),
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmDistributionDraft(exerciseId, draftId) {
|
||||
return request(`/api/exercises/${exerciseId}/distribution/drafts/${draftId}/confirm`, {
|
||||
method: 'POST',
|
||||
body: '{}',
|
||||
})
|
||||
}
|
||||
|
||||
export function withdrawDistributionRelease(releaseId, reasonCode) {
|
||||
return request(`/api/distribution/releases/${releaseId}/withdraw`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ reason_code: reasonCode }),
|
||||
})
|
||||
}
|
||||
|
||||
export function retireDistributionRelease(releaseId) {
|
||||
return request(`/api/distribution/releases/${releaseId}/retire`, { method: 'POST', body: '{}' })
|
||||
}
|
||||
|
||||
export function createDistributionPublisher(body) {
|
||||
return request('/api/distribution/admin/publishers', { method: 'POST', body: JSON.stringify(body) })
|
||||
}
|
||||
|
||||
export function createDistributionRecipient(body) {
|
||||
return request('/api/distribution/admin/recipients', { method: 'POST', body: JSON.stringify(body) })
|
||||
}
|
||||
|
||||
export function createDistributionRelationship(body) {
|
||||
return request('/api/distribution/admin/relationships', { method: 'POST', body: JSON.stringify(body) })
|
||||
}
|
||||
|
||||
export function createDistributionBinding(body) {
|
||||
return request('/api/distribution/admin/bindings', { method: 'POST', body: JSON.stringify(body) })
|
||||
}
|
||||
|
||||
export function issueDistributionKey(bindingId, expiresAt) {
|
||||
return request(`/api/distribution/admin/bindings/${bindingId}/keys`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ expires_at: expiresAt || null }),
|
||||
})
|
||||
}
|
||||
|
||||
export function assignDistributionReleaser(publisherId, profileId) {
|
||||
return request(`/api/distribution/admin/publishers/${publisherId}/releasers`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ profile_id: profileId }),
|
||||
})
|
||||
}
|
||||
|
||||
export function assignDistributionExercise(publisherId, exerciseId) {
|
||||
return request(`/api/distribution/admin/publishers/${publisherId}/exercises`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ exercise_id: exerciseId }),
|
||||
})
|
||||
}
|
||||
|
||||
export function getDistributionBacklog() {
|
||||
return request('/api/distribution/admin/backlog')
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import { TreePine, FolderTree, Download, Grid3x3, Users, Scale, Sparkles, Bot, Wand2, Activity, Building2, Shield } from 'lucide-react'
|
||||
import { TreePine, FolderTree, Download, Grid3x3, Users, Scale, Sparkles, Bot, Wand2, Activity, Building2, Shield, Share2 } from 'lucide-react'
|
||||
|
||||
/**
|
||||
* Admin-Seiten-Navigation (horizontal) — nur für Super-Admins (globaler Portal-Mandant).
|
||||
@@ -18,6 +18,7 @@ export default function AdminPageNav() {
|
||||
{ to: '/admin/ai-prompts', label: 'KI Prompts', icon: Sparkles },
|
||||
{ to: '/admin/openrouter', label: 'KI-Modell', icon: Bot },
|
||||
{ to: '/admin/exercise-enrichment', label: 'Übungs-Anreicherung', icon: Wand2 },
|
||||
{ to: '/admin/distribution', label: 'Distribution', icon: Share2 },
|
||||
]
|
||||
|
||||
return (
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import {
|
||||
confirmDistributionDraft,
|
||||
createDistributionDraft,
|
||||
getExerciseDistribution,
|
||||
retireDistributionRelease,
|
||||
updateDistributionDraft,
|
||||
withdrawDistributionRelease,
|
||||
} from '../../api/distribution'
|
||||
|
||||
const ACTIONS = [
|
||||
'store',
|
||||
'render',
|
||||
'stream',
|
||||
'download',
|
||||
'print',
|
||||
'course_display',
|
||||
'commercial_course_use',
|
||||
'adapt',
|
||||
'public_preview',
|
||||
'grant_customer_use',
|
||||
]
|
||||
|
||||
const REASONS = [
|
||||
['rights', 'Rechte'],
|
||||
['safety', 'Sicherheit'],
|
||||
['privacy', 'Privatsphäre'],
|
||||
['expired', 'Frist'],
|
||||
['editorial_error', 'Redaktionsfehler'],
|
||||
]
|
||||
|
||||
export default function ExerciseDistributionPanel({ exerciseId }) {
|
||||
const [overview, setOverview] = useState(null)
|
||||
const [error, setError] = useState('')
|
||||
const [publisherId, setPublisherId] = useState('')
|
||||
const [recipientId, setRecipientId] = useState('')
|
||||
const [draft, setDraft] = useState(null)
|
||||
const [evidence, setEvidence] = useState('nachweis')
|
||||
const [actions, setActions] = useState(['store', 'render'])
|
||||
const [retirePrevious, setRetirePrevious] = useState(true)
|
||||
const [reason, setReason] = useState('rights')
|
||||
const [busy, setBusy] = useState(false)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
const data = await getExerciseDistribution(exerciseId)
|
||||
setOverview(data)
|
||||
setError('')
|
||||
} catch (err) {
|
||||
setError(err.message || 'Distribution konnte nicht geladen werden.')
|
||||
}
|
||||
}, [exerciseId])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
function toggleAction(action) {
|
||||
setActions((current) =>
|
||||
current.includes(action) ? current.filter((item) => item !== action) : [...current, action]
|
||||
)
|
||||
}
|
||||
|
||||
function withRights(cut) {
|
||||
const rightsId = 'rights-main'
|
||||
const next = {
|
||||
...cut,
|
||||
editorial_rights_id: rightsId,
|
||||
rights: [
|
||||
{
|
||||
id: rightsId,
|
||||
evidence_ref: evidence.trim(),
|
||||
actions,
|
||||
territories: ['DE'],
|
||||
valid_from: new Date(Date.now() - 60000).toISOString().replace(/\.\d{3}Z$/, 'Z'),
|
||||
valid_until: null,
|
||||
note: '',
|
||||
},
|
||||
],
|
||||
parts: (cut.parts || []).map((part) => ({ ...part, rights_id: rightsId })),
|
||||
assets: (cut.assets || []).map((asset) => ({ ...asset, rights_id: rightsId })),
|
||||
}
|
||||
return next
|
||||
}
|
||||
|
||||
async function prepare() {
|
||||
setBusy(true)
|
||||
setError('')
|
||||
try {
|
||||
const created = await createDistributionDraft(exerciseId, {
|
||||
publisher_id: publisherId.trim(),
|
||||
recipient_id: recipientId.trim(),
|
||||
})
|
||||
const cut = withRights(created.cut)
|
||||
const updated = await updateDistributionDraft(exerciseId, created.draft_id, cut)
|
||||
setDraft(updated)
|
||||
} catch (err) {
|
||||
setError(err.message || 'Vorschau fehlgeschlagen.')
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function confirm() {
|
||||
if (!draft) return
|
||||
setBusy(true)
|
||||
setError('')
|
||||
try {
|
||||
const cut = withRights(draft.cut)
|
||||
await updateDistributionDraft(exerciseId, draft.draft_id, cut)
|
||||
const result = await confirmDistributionDraft(exerciseId, draft.draft_id)
|
||||
if (retirePrevious && overview?.releases?.length && !result.replayed) {
|
||||
const previous = [...overview.releases]
|
||||
.reverse()
|
||||
.find((item) => item.recipient_id === recipientId.trim() && !item.fetch_blocked)
|
||||
if (previous) {
|
||||
await retireDistributionRelease(previous.release_id)
|
||||
}
|
||||
}
|
||||
setDraft(null)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message || 'Freigabe fehlgeschlagen.')
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function withdraw(releaseId) {
|
||||
setBusy(true)
|
||||
setError('')
|
||||
try {
|
||||
await withdrawDistributionRelease(releaseId, reason)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message || 'Rückzug fehlgeschlagen.')
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
if (!overview) {
|
||||
return <section className="card">Distribution wird geladen …</section>
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card" style={{ marginBottom: 16 }}>
|
||||
<h2 style={{ marginTop: 0 }}>Externe Freigabe</h2>
|
||||
{!overview.enabled ? (
|
||||
<p>Die Distribution ist auf dieser Instanz nicht aktiv. Bearbeitung und Planung bleiben davon unberührt.</p>
|
||||
) : (
|
||||
<>
|
||||
<p>
|
||||
Private Übungen gibt die Person frei, der sie gehören. Vereinsübungen gibt ein Vereinsadmin dieses Vereins frei.
|
||||
Globale Übungen gibt nur ein Superadmin frei.
|
||||
</p>
|
||||
{overview.release_block ? <p>{overview.release_block}</p> : null}
|
||||
<div className="form-row">
|
||||
<label className="form-label">
|
||||
Herausgeber
|
||||
<input className="form-input" value={publisherId} onChange={(event) => setPublisherId(event.target.value)} placeholder="UUID" />
|
||||
</label>
|
||||
<label className="form-label">
|
||||
Empfänger
|
||||
<input className="form-input" value={recipientId} onChange={(event) => setRecipientId(event.target.value)} placeholder="UUID" />
|
||||
</label>
|
||||
</div>
|
||||
{overview.publishers?.length ? (
|
||||
<ul>
|
||||
{overview.publishers.map((publisher) => (
|
||||
<li key={publisher.id}>
|
||||
<button type="button" className="btn btn-secondary" onClick={() => setPublisherId(publisher.id)}>
|
||||
{publisher.name} ({publisher.kind})
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
<fieldset>
|
||||
<legend>Nutzungsumfang</legend>
|
||||
{ACTIONS.map((action) => (
|
||||
<label key={action} style={{ display: 'inline-flex', gap: 6, marginRight: 12 }}>
|
||||
<input type="checkbox" checked={actions.includes(action)} onChange={() => toggleAction(action)} />
|
||||
{action}
|
||||
</label>
|
||||
))}
|
||||
</fieldset>
|
||||
<label className="form-label">
|
||||
Nachweisreferenz
|
||||
<input className="form-input" value={evidence} onChange={(event) => setEvidence(event.target.value)} />
|
||||
</label>
|
||||
<label style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
|
||||
<input type="checkbox" checked={retirePrevious} onChange={(event) => setRetirePrevious(event.target.checked)} />
|
||||
Bisherige Fassung für neue Pläne ablösen
|
||||
</label>
|
||||
<div style={{ display: 'flex', gap: 8, marginTop: 8 }}>
|
||||
<button type="button" className="btn btn-secondary" disabled={busy || !overview.may_release} onClick={prepare}>
|
||||
Vorschau
|
||||
</button>
|
||||
<button type="button" className="btn btn-primary" disabled={busy || !draft || !overview.may_release} onClick={confirm}>
|
||||
Verbindlich freigeben
|
||||
</button>
|
||||
</div>
|
||||
{draft ? (
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<strong>Vorschau</strong>
|
||||
{draft.blockers?.length ? (
|
||||
<ul>
|
||||
{draft.blockers.map((item) => (
|
||||
<li key={item}>{item}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p>Keine blockierenden Punkte.</p>
|
||||
)}
|
||||
<ul>
|
||||
{(draft.cut?.parts || []).map((part) => (
|
||||
<li key={part.key}>
|
||||
{part.role}: {part.text}
|
||||
</li>
|
||||
))}
|
||||
{(draft.cut?.assets || []).map((asset) => (
|
||||
<li key={asset.media_id}>
|
||||
Medium {asset.role} {asset.label || ''}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
{overview.releases?.length ? (
|
||||
<>
|
||||
<h3>Freigegebene Fassungen</h3>
|
||||
<label className="form-label">
|
||||
Grundklasse für Rückzug
|
||||
<select className="form-input" value={reason} onChange={(event) => setReason(event.target.value)}>
|
||||
{REASONS.map(([value, label]) => (
|
||||
<option key={value} value={value}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<ul>
|
||||
{overview.releases.map((release) => (
|
||||
<li key={release.release_id}>
|
||||
{release.recipient_name} · Revision {release.revision} · {release.fetch_blocked ? 'zurückgezogen' : 'abrufbar'}
|
||||
{overview.enabled && !release.fetch_blocked ? (
|
||||
<button type="button" className="btn btn-secondary" style={{ marginLeft: 8 }} disabled={busy} onClick={() => withdraw(release.release_id)}>
|
||||
Zurückziehen
|
||||
</button>
|
||||
) : null}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
{error ? <p role="alert">{error}</p> : null}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import { GripVertical, FileText, BookOpen, Tags, Layers, GitBranch, Image as Ima
|
||||
import UnsavedChangesPrompt from '../UnsavedChangesPrompt'
|
||||
import PageFormEditorChrome from '../PageFormEditorChrome'
|
||||
import { ExerciseFormTabBar, ExerciseFormPanel } from './ExerciseFormLayout'
|
||||
import ExerciseDistributionPanel from './ExerciseDistributionPanel'
|
||||
import { useNavReturn } from '../../hooks/useNavReturn'
|
||||
import {
|
||||
EXERCISES_LIST_PATH,
|
||||
@@ -1611,6 +1612,8 @@ function ExerciseFormPageRoot() {
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{isEdit && exerciseId ? <ExerciseDistributionPanel exerciseId={exerciseId} /> : null}
|
||||
|
||||
<div className="card exercise-form-edit">
|
||||
<form id="exercise-form" onSubmit={handleSubmit}>
|
||||
<ExerciseFormTabBar
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import AdminPageNav from '../components/AdminPageNav'
|
||||
import {
|
||||
assignDistributionExercise,
|
||||
assignDistributionReleaser,
|
||||
createDistributionBinding,
|
||||
createDistributionPublisher,
|
||||
createDistributionRecipient,
|
||||
createDistributionRelationship,
|
||||
getDistributionBacklog,
|
||||
issueDistributionKey,
|
||||
} from '../api/distribution'
|
||||
|
||||
export default function AdminDistributionPage() {
|
||||
const [message, setMessage] = useState('')
|
||||
const [error, setError] = useState('')
|
||||
const [token, setToken] = useState('')
|
||||
const [backlog, setBacklog] = useState(null)
|
||||
const [publisherName, setPublisherName] = useState('')
|
||||
const [kind, setKind] = useState('platform')
|
||||
const [clubId, setClubId] = useState('')
|
||||
const [recipientName, setRecipientName] = useState('')
|
||||
const [publisherId, setPublisherId] = useState('')
|
||||
const [recipientId, setRecipientId] = useState('')
|
||||
const [bindingName, setBindingName] = useState('Anbindung')
|
||||
const [bindingId, setBindingId] = useState('')
|
||||
const [profileId, setProfileId] = useState('')
|
||||
const [exerciseId, setExerciseId] = useState('')
|
||||
|
||||
useEffect(() => {
|
||||
getDistributionBacklog()
|
||||
.then((data) => setBacklog(data.count))
|
||||
.catch(() => setBacklog(null))
|
||||
}, [])
|
||||
|
||||
async function run(action) {
|
||||
setError('')
|
||||
setMessage('')
|
||||
setToken('')
|
||||
try {
|
||||
const result = await action()
|
||||
setMessage(result?.id ? `Angelegt: ${result.id}` : 'Gespeichert.')
|
||||
return result
|
||||
} catch (err) {
|
||||
setError(err.message || 'Speichern fehlgeschlagen.')
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ padding: 16 }}>
|
||||
<AdminPageNav />
|
||||
<h1>Distribution</h1>
|
||||
<p>Herausgeber, Empfänger und Schlüssel richtet der Betrieb ein. Der Schlüssel wird nur einmal angezeigt.</p>
|
||||
<p>Ausstehende Fristabläufe: {backlog === null ? '—' : backlog}</p>
|
||||
{message ? <p>{message}</p> : null}
|
||||
{error ? <p role="alert">{error}</p> : null}
|
||||
{token ? (
|
||||
<p>
|
||||
Schlüssel: <code>{token}</code>
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<section className="card">
|
||||
<h2>Herausgeber</h2>
|
||||
<label className="form-label">
|
||||
Name
|
||||
<input className="form-input" value={publisherName} onChange={(event) => setPublisherName(event.target.value)} />
|
||||
</label>
|
||||
<label className="form-label">
|
||||
Bestand
|
||||
<select className="form-input" value={kind} onChange={(event) => setKind(event.target.value)}>
|
||||
<option value="platform">Plattformbestand</option>
|
||||
<option value="own">Eigener Bestand</option>
|
||||
<option value="club">Vereinsbestand</option>
|
||||
</select>
|
||||
</label>
|
||||
{kind === 'club' ? (
|
||||
<label className="form-label">
|
||||
Verein
|
||||
<input className="form-input" value={clubId} onChange={(event) => setClubId(event.target.value)} />
|
||||
</label>
|
||||
) : null}
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
onClick={() =>
|
||||
run(() =>
|
||||
createDistributionPublisher({
|
||||
name: publisherName,
|
||||
kind,
|
||||
club_id: kind === 'club' ? Number(clubId) : null,
|
||||
})
|
||||
).then((result) => result?.id && setPublisherId(result.id))
|
||||
}
|
||||
>
|
||||
Herausgeber anlegen
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section className="card">
|
||||
<h2>Empfänger und Anbindung</h2>
|
||||
<label className="form-label">
|
||||
Empfängername
|
||||
<input className="form-input" value={recipientName} onChange={(event) => setRecipientName(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
onClick={() =>
|
||||
run(() => createDistributionRecipient({ name: recipientName })).then((result) => result?.id && setRecipientId(result.id))
|
||||
}
|
||||
>
|
||||
Empfänger anlegen
|
||||
</button>
|
||||
<label className="form-label">
|
||||
Herausgeber-ID
|
||||
<input className="form-input" value={publisherId} onChange={(event) => setPublisherId(event.target.value)} />
|
||||
</label>
|
||||
<label className="form-label">
|
||||
Empfänger-ID
|
||||
<input className="form-input" value={recipientId} onChange={(event) => setRecipientId(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => run(() => createDistributionRelationship({ publisher_id: publisherId, recipient_id: recipientId }))}
|
||||
>
|
||||
Beziehung zulassen
|
||||
</button>
|
||||
<label className="form-label">
|
||||
Name der Anbindung
|
||||
<input className="form-input" value={bindingName} onChange={(event) => setBindingName(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() =>
|
||||
run(() => createDistributionBinding({ recipient_id: recipientId, name: bindingName })).then(
|
||||
(result) => result?.id && setBindingId(result.id)
|
||||
)
|
||||
}
|
||||
>
|
||||
Anbindung anlegen
|
||||
</button>
|
||||
<label className="form-label">
|
||||
Anbindungs-ID
|
||||
<input className="form-input" value={bindingId} onChange={(event) => setBindingId(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
onClick={async () => {
|
||||
setError('')
|
||||
try {
|
||||
const result = await issueDistributionKey(bindingId)
|
||||
setToken(result.token)
|
||||
setMessage('Schlüssel erzeugt. Bitte jetzt sichern.')
|
||||
} catch (err) {
|
||||
setError(err.message || 'Schlüssel fehlgeschlagen.')
|
||||
}
|
||||
}}
|
||||
>
|
||||
Schlüssel erzeugen
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section className="card">
|
||||
<h2>Zuordnung</h2>
|
||||
<label className="form-label">
|
||||
Profil-ID der freigabeberechtigten Person
|
||||
<input className="form-input" value={profileId} onChange={(event) => setProfileId(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => run(() => assignDistributionReleaser(publisherId, Number(profileId)))}
|
||||
>
|
||||
Freigabebefugnis zuweisen
|
||||
</button>
|
||||
<label className="form-label">
|
||||
Übungs-ID
|
||||
<input className="form-input" value={exerciseId} onChange={(event) => setExerciseId(event.target.value)} />
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => run(() => assignDistributionExercise(publisherId, Number(exerciseId)))}
|
||||
>
|
||||
Übung dem Herausgeber zuordnen
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { request, ACTIVE_CLUB_STORAGE_KEY, requestText } from '../api/client.js'
|
||||
import * as distributionApi from '../api/distribution.js'
|
||||
import * as exercises from '../api/exercises.js'
|
||||
import * as planning from '../api/planning.js'
|
||||
import * as skillProfiles from '../api/skillProfiles.js'
|
||||
@@ -13,6 +14,7 @@ export { ACTIVE_CLUB_STORAGE_KEY }
|
||||
export * from '../api/exercises.js'
|
||||
export * from '../api/planning.js'
|
||||
export * from '../api/skillProfiles.js'
|
||||
export * from '../api/distribution.js'
|
||||
|
||||
// ============================================================================
|
||||
// Auth
|
||||
@@ -1320,6 +1322,8 @@ export const api = {
|
||||
request(`/api/content-reports/${id}`, { method: 'PATCH', body: JSON.stringify(body) }),
|
||||
setLegalHoldFromReport: (id, body) =>
|
||||
request(`/api/content-reports/${id}/legal-hold`, { method: 'POST', body: JSON.stringify(body) }),
|
||||
|
||||
...distributionApi,
|
||||
}
|
||||
|
||||
export default api
|
||||
Reference in new issue
Block a user