23 lines
1.3 KiB
TypeScript
23 lines
1.3 KiB
TypeScript
// Conformance-only composition: render the owning module, never a test copy.
|
|
import FilesPage from "../../../govoplan-files/webui/src/features/files/FilesPage";
|
|
import { generatedTranslations } from "../../../govoplan-files/webui/src/i18n/generatedTranslations";
|
|
import "../../../govoplan-files/webui/src/styles/file-manager.css";
|
|
import { PlatformLanguageProvider } from "../src/i18n/LanguageContext";
|
|
import type { AuthInfo } from "../src/types";
|
|
|
|
const fixtureAuth: AuthInfo = {
|
|
user: { id: "fixture-user", account_id: "fixture-account", email: "fixture@example.test" },
|
|
tenant: { id: "fixture-tenant", name: "Fixture", slug: "fixture" },
|
|
scopes: ["files:file:read", "files:file:download", "files:file:upload"],
|
|
roles: [], groups: [], profile_loaded: true, roles_loaded: true, groups_loaded: true
|
|
};
|
|
|
|
export default function ManagedArchiveScenario({ language = "en", downloadAllowed = true }: { language?: string; downloadAllowed?: boolean }) {
|
|
const auth = downloadAllowed ? fixtureAuth : {
|
|
...fixtureAuth, scopes: fixtureAuth.scopes.filter((scope) => scope !== "files:file:download")
|
|
};
|
|
return <PlatformLanguageProvider preferredLanguageCode={language} moduleTranslations={[generatedTranslations]}>
|
|
<FilesPage settings={{ apiBaseUrl: "", apiKey: "", accessToken: "" }} auth={auth} />
|
|
</PlatformLanguageProvider>;
|
|
}
|