Adds the Offerings module and retargets the CI/CD pipeline to Api.SlpSoftware
Continuous Integration / config (pull_request) Successful in 12s
Continuous Integration / changes (pull_request) Successful in 22s
Continuous Integration / backend-build (pull_request) Successful in 5m53s
Continuous Integration / vulnerability-scan (pull_request) Successful in 5m46s
Continuous Integration / frontend-prepare (pull_request) Successful in 1m54s
Continuous Integration / backend-test (pull_request) Successful in 7m37s
Continuous Integration / frontend-build (pull_request) Successful in 2m14s
Continuous Integration / frontend-test (pull_request) Successful in 4m59s
Continuous Integration / frontend-lint (pull_request) Successful in 2m2s
Continuous Integration / publish-production (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / publish-test (pull_request) Successful in 7m34s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / config (pull_request) Successful in 12s
Continuous Integration / changes (pull_request) Successful in 22s
Continuous Integration / backend-build (pull_request) Successful in 5m53s
Continuous Integration / vulnerability-scan (pull_request) Successful in 5m46s
Continuous Integration / frontend-prepare (pull_request) Successful in 1m54s
Continuous Integration / backend-test (pull_request) Successful in 7m37s
Continuous Integration / frontend-build (pull_request) Successful in 2m14s
Continuous Integration / frontend-test (pull_request) Successful in 4m59s
Continuous Integration / frontend-lint (pull_request) Successful in 2m2s
Continuous Integration / publish-production (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / publish-test (pull_request) Successful in 7m34s
Continuous Integration / deploy-test (pull_request) Skipped
Implements Unit 2 "Offerings" (backend module, admin CRUD UI with drag-and-drop reordering, public GET /api/v1/offerings endpoint) and executes the feature's D-15 CI/CD cutover, switching the deploy pipeline's build/publish target from SlpModularCms.Api to SlpModularCms.Api.SlpSoftware. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWyStNL2ZsjrS7FLd7xvvN
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from '@tanstack/react-router';
|
||||
import { Package } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { OfferingsList } from '../components/OfferingsList';
|
||||
import { DeleteOfferingDialog } from '../components/DeleteOfferingDialog';
|
||||
import { useOfferings } from '../services/useOfferings';
|
||||
import { useDeleteOffering } from '../services/useDeleteOffering';
|
||||
import type { OfferingAdminDto } from '../services/types';
|
||||
|
||||
export function OfferingsListPage() {
|
||||
const { t } = useTranslation();
|
||||
const [offeringPendingDelete, setOfferingPendingDelete] = useState<OfferingAdminDto | null>(null);
|
||||
const { data: offerings, isPending, isError } = useOfferings();
|
||||
const deleteOffering = useDeleteOffering({
|
||||
onSuccess: () => setOfferingPendingDelete(null),
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-4 p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-2xl font-semibold" data-testid="offerings-title">
|
||||
{t('offerings.title')}
|
||||
</h1>
|
||||
<Button asChild data-testid="offerings-add-button">
|
||||
<Link to="/offerings/new">{t('offerings.addButton')}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{isPending && <p className="text-sm text-muted-foreground">{t('common.loading')}</p>}
|
||||
|
||||
{isError && <p className="text-sm text-destructive">{t('errors.generic')}</p>}
|
||||
|
||||
{!isPending && !isError && offerings?.length === 0 && (
|
||||
<div
|
||||
className="flex flex-col items-center justify-center py-16 text-center space-y-4"
|
||||
data-testid="offerings-empty-state"
|
||||
>
|
||||
<Package className="size-12 text-muted-foreground" />
|
||||
<h2 className="text-xl font-semibold">{t('offerings.emptyState.heading')}</h2>
|
||||
<p className="text-muted-foreground max-w-sm">{t('offerings.emptyState.description')}</p>
|
||||
<Button asChild data-testid="offerings-empty-add-button">
|
||||
<Link to="/offerings/new">{t('offerings.addButton')}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isPending && !isError && offerings && offerings.length > 0 && (
|
||||
<OfferingsList offerings={offerings} onDeleteRequested={setOfferingPendingDelete} />
|
||||
)}
|
||||
|
||||
<DeleteOfferingDialog
|
||||
offering={offeringPendingDelete}
|
||||
isDeleting={deleteOffering.isPending}
|
||||
onConfirm={() => {
|
||||
if (offeringPendingDelete) deleteOffering.mutate(offeringPendingDelete.id);
|
||||
}}
|
||||
onCancel={() => setOfferingPendingDelete(null)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user