Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/Administration-FE/scripts/check-contract-drift.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const required = [
'publish.v2.ts',
'admin-blogs.v1.ts',
'admin-case-studies.v1.ts',
'admin-client-logos.v1.ts',
'admin-client-testimonials.v1.ts',
];

let failed = false;
Expand Down
4 changes: 4 additions & 0 deletions apps/Administration-FE/scripts/check-i18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const files = [
'components/MediaPreview.tsx',
'components/CategoriesList.tsx',
'components/CategoryForm.tsx',
'components/ClientLogosList.tsx',
'components/ClientLogoForm.tsx',
'components/ClientTestimonialsList.tsx',
'components/ClientTestimonialForm.tsx',
'components/CaseStudiesList.tsx',
'components/CaseStudyForm.tsx',
'components/IndustriesList.tsx',
Expand Down
13 changes: 13 additions & 0 deletions apps/Administration-FE/scripts/generate-client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const authContractsDir =
process.env.CONTRACTS_DIR || join(repoRoot, 'specs/002-auth-rbac/contracts');
const blogsContractsDir = join(repoRoot, 'specs/004-admin-blogs/contracts');
const caseStudiesContractsDir = join(repoRoot, 'specs/005-admin-case-studies/contracts');
const clientLogosContractsDir = join(repoRoot, 'specs/006-admin-client-logos/contracts');
const clientTestimonialsContractsDir = join(
repoRoot,
'specs/007-admin-client-testimonials/contracts',
);

const contractSets = [
{
Expand All @@ -31,6 +36,14 @@ const contractSets = [
dir: caseStudiesContractsDir,
files: ['admin-case-studies.v1.yaml'],
},
{
dir: clientLogosContractsDir,
files: ['admin-client-logos.v1.yaml'],
},
{
dir: clientTestimonialsContractsDir,
files: ['admin-client-testimonials.v1.yaml'],
},
];

mkdirSync(outDir, { recursive: true });
Expand Down
102 changes: 102 additions & 0 deletions apps/Administration-FE/src/components/AdminShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ import BlogsList from './BlogsList';
import BlogForm from './BlogForm';
import CategoriesList from './CategoriesList';
import CategoryForm from './CategoryForm';
import ClientLogosList from './ClientLogosList';
import ClientLogoForm from './ClientLogoForm';
import ClientTestimonialsList from './ClientTestimonialsList';
import ClientTestimonialForm from './ClientTestimonialForm';
import CaseStudiesList from './CaseStudiesList';
import CaseStudyForm from './CaseStudyForm';
import IndustriesList from './IndustriesList';
Expand Down Expand Up @@ -59,6 +63,8 @@ function applyRoute(
setEditingTechnologyId: (id: string | null) => void;
setEditingAuthorId: (id: string | null) => void;
setEditingCategoryId: (id: string | null) => void;
setEditingClientLogoId: (id: string | null) => void;
setEditingClientTestimonialId: (id: string | null) => void;
},
) {
setters.setView(route.view);
Expand All @@ -72,6 +78,10 @@ function applyRoute(
setters.setEditingTechnologyId(route.view === 'technology_form' ? route.editingId : null);
setters.setEditingAuthorId(route.view === 'author_form' ? route.editingId : null);
setters.setEditingCategoryId(route.view === 'category_form' ? route.editingId : null);
setters.setEditingClientLogoId(route.view === 'client_logo_form' ? route.editingId : null);
setters.setEditingClientTestimonialId(
route.view === 'client_testimonial_form' ? route.editingId : null,
);
}

export default function AdminShell() {
Expand Down Expand Up @@ -112,6 +122,16 @@ export default function AdminShell() {
const route = readAdminLocation();
return route.view === 'category_form' ? route.editingId : null;
});
const [editingClientLogoId, setEditingClientLogoId] = useState<string | null>(() => {
const route = readAdminLocation();
return route.view === 'client_logo_form' ? route.editingId : null;
});
const [editingClientTestimonialId, setEditingClientTestimonialId] = useState<string | null>(
() => {
const route = readAdminLocation();
return route.view === 'client_testimonial_form' ? route.editingId : null;
},
);
const [session, setSession] = useState<SessionContext | null>(null);
const [siteSettings, setSiteSettings] = useState<Record<string, unknown> | null>(null);
const [homePage, setHomePage] = useState<Record<string, unknown> | null>(null);
Expand All @@ -132,6 +152,8 @@ export default function AdminShell() {
setEditingTechnologyId,
setEditingAuthorId,
setEditingCategoryId,
setEditingClientLogoId,
setEditingClientTestimonialId,
});
}, []);

Expand Down Expand Up @@ -228,6 +250,14 @@ export default function AdminShell() {
document.title = t('admin.workspace.categories');
return;
}
if (view === 'client_logos' || view === 'client_logo_form') {
document.title = t('admin.workspace.client_logos');
return;
}
if (view === 'client_testimonials' || view === 'client_testimonial_form') {
document.title = t('admin.workspace.client_testimonials');
return;
}
if (view === 'roles') {
document.title = t('admin.workspace.settings');
return;
Expand Down Expand Up @@ -327,6 +357,14 @@ export default function AdminShell() {
openList('categories');
}

function openClientLogos() {
openList('client_logos');
}

function openClientTestimonials() {
openList('client_testimonials');
}

function onNavClick(event: MouseEvent<HTMLAnchorElement>, href: string) {
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) {
return;
Expand Down Expand Up @@ -496,6 +534,36 @@ export default function AdminShell() {
{t('admin.workspace.categories')}
</a>
</li>
<li>
<a
href={adminListHref('client_logos')}
className={view === 'client_logos' || view === 'client_logo_form' ? 'active' : ''}
aria-current={
view === 'client_logos' || view === 'client_logo_form' ? 'page' : undefined
}
onClick={(event) => onNavClick(event, adminListHref('client_logos'))}
>
{t('admin.workspace.client_logos')}
</a>
</li>
<li>
<a
href={adminListHref('client_testimonials')}
className={
view === 'client_testimonials' || view === 'client_testimonial_form'
? 'active'
: ''
}
aria-current={
view === 'client_testimonials' || view === 'client_testimonial_form'
? 'page'
: undefined
}
onClick={(event) => onNavClick(event, adminListHref('client_testimonials'))}
>
{t('admin.workspace.client_testimonials')}
</a>
</li>
{canManageRoles && (
<li>
<a
Expand Down Expand Up @@ -708,6 +776,40 @@ export default function AdminShell() {
}}
/>
)}
{view === 'client_logos' && (
<ClientLogosList
notice={message}
onAdd={() => openForm('client_logos', null)}
onEdit={(id) => openForm('client_logos', id)}
/>
)}
{view === 'client_logo_form' && (
<ClientLogoForm
logoId={editingClientLogoId}
onCancel={openClientLogos}
onSaved={() => {
setMessage(t('admin.client_logos.saved'));
openClientLogos();
}}
/>
)}
{view === 'client_testimonials' && (
<ClientTestimonialsList
notice={message}
onAdd={() => openForm('client_testimonials', null)}
onEdit={(id) => openForm('client_testimonials', id)}
/>
)}
{view === 'client_testimonial_form' && (
<ClientTestimonialForm
testimonialId={editingClientTestimonialId}
onCancel={openClientTestimonials}
onSaved={() => {
setMessage(t('admin.client_testimonials.saved'));
openClientTestimonials();
}}
/>
)}
{view === 'roles' && (
<RolesList
notice={message}
Expand Down
Loading
Loading