Compare commits

...

8 Commits

Author SHA1 Message Date
66b180ebca QLFW-44: тесты ссылок на магазины
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 0с
peppa/build build: success за 40с
ci / checks (pull_request) Successful in 1m16s
deploy / deploy (pull_request) Successful in 2m6s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:49:53 +05:00
c372aba83d QLFW-44: тесты ссылок Marwin и Flip.kz
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:49:52 +05:00
88d9b1fc6a QLFW-44: адрес Marwin
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:49:52 +05:00
9b2e888b84 QLFW-44: память проекта
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:49:52 +05:00
3226ce7e4d QLFW-44: ссылки на Flip.kz и Marwin в «Где купить книгу»
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:49:49 +05:00
c7d71d45f0 Merge pull request 'QLFW-52: «О фонде» без пометок и повторов' (#33) from task/qlfw-52 into main
All checks were successful
deploy / deploy (push) Successful in 25s
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 1с
peppa/build build: success за 49с
ci / checks (push) Successful in 1m45s
2026-11-17 18:48:50 +05:00
3236475a60 QLFW-52: память проекта и архив change
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 1с
peppa/build build: success за 43с
ci / checks (pull_request) Successful in 1m23s
deploy / deploy (pull_request) Successful in 16s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:43:06 +05:00
ee1f75fbfd QLFW-52: «О фонде» без пометок и повторов
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 18:43:06 +05:00
18 changed files with 120 additions and 33 deletions

View File

@ -14,6 +14,8 @@
- QLFW-9: базовые тексты главной и книги — src/i18n/{ru,kk,en}.ts; Payload сохраняет приоритет, fallbackLocale отключён. Почта и URL Flip — src/lib/home-model.ts.
- QLFW-11: по выбору PM связь — видимая почта и Instagram https://www.instagram.com/serkebayev_book/; без формы показываем обычную ссылку на политику, PrivacyNote оставляем только для форм. SMTP не требуется.
- QLFW-5: отдельные разделы /[locale]/about, /projects, /contacts, /news и /news/[id]; тексты sections в ru/kk/en. News: body/sourceUrl локализованы, imageUrl общий; без перевода заголовка материал скрыт, пустой /news = 404. Контакты без формы по QLFW-11.
- QLFW-52: люди и партнёры страницы «О фонде» — src/lib/about-model.ts (по языкам, пока пусто); блок виден только при непустом списке.
- QLFW-44: ссылки магазинов в BookWhere — карта storeUrls; Flip.kz = bookUrl, Marwin = marwinUrl (src/lib/home-model.ts, пусто → просто название); при пустом адресе ссылка не показывается.
## Грабли
- QLFW-32: страница книги уже была готова (QLFW-8); локальный main может отставать — worktree делать от origin/main после git fetch.

View File

@ -0,0 +1 @@
Данные людей и партнёров — типизированный файл src/lib/about-model.ts по языкам (пока пустой): без миграций БД; блок появляется, когда добавлена запись. Решение агента.

View File

@ -0,0 +1,6 @@
## Why
На странице «О фонде» видны пометки «Нужно уточнить», а «Цели» пересказывают «Миссию».
## What Changes
- Блоки «Учредитель», «Руководство», «Попечительский совет», «Партнёры» показываются только при наличии данных (src/lib/about-model.ts).
- Новый текст «Целей» на ru/kk/en.

View File

@ -0,0 +1,13 @@
## ADDED Requirements
### Requirement: Страница «О фонде» без служебных пометок
Блоки с людьми и партнёрами SHALL показываться только при наличии данных.
#### Scenario: Данных нет
- **GIVEN** фонд не передал сведения о руководстве и партнёрах
- **WHEN** посетитель открывает «О фонде»
- **THEN** блоков «Учредитель», «Руководство», «Попечительский совет», «Партнёры» и пометки «Нужно уточнить» нет
#### Scenario: Данные появились
- **GIVEN** в списке учредителя есть запись
- **WHEN** посетитель открывает «О фонде»
- **THEN** виден блок «Учредитель» с этим именем

View File

@ -0,0 +1,3 @@
- [x] Скрыть пустые блоки, добавить «Партнёры»
- [x] Переписать «Цели» на ru/kk/en
- [x] Тесты

View File

@ -0,0 +1,4 @@
## Why
Marwin и Flip.kz в «Где купить книгу» были просто словами.
## What
Flip.kz — ссылка (новая вкладка) на страницу книги на всех языках. Marwin — ссылка на страницу книги (`marwinUrl` в home-model; если пуст — показывается название). Фраза про наличие и стоимость не менялась.

View File

@ -0,0 +1 @@
- [x] ссылки, тест

View File

@ -0,0 +1,19 @@
# about Specification
## Purpose
TBD - created by archiving change qlfw-52-about-cleanup. Update Purpose after archive.
## Requirements
### Requirement: Страница «О фонде» без служебных пометок
Блоки с людьми и партнёрами SHALL показываться только при наличии данных.
#### Scenario: Данных нет
- **GIVEN** фонд не передал сведения о руководстве и партнёрах
- **WHEN** посетитель открывает «О фонде»
- **THEN** блоков «Учредитель», «Руководство», «Попечительский совет», «Партнёры» и пометки «Нужно уточнить» нет
#### Scenario: Данные появились
- **GIVEN** в списке учредителя есть запись
- **WHEN** посетитель открывает «О фонде»
- **THEN** виден блок «Учредитель» с этим именем

View File

@ -3,7 +3,7 @@ import { getDict, isLocale, locales } from '@/i18n'
import { loadContent, loadLegal } from '@/lib/content'
import { buildHomeModel } from '@/lib/home-model'
import { SectionPage } from '@/components/SectionPage'
import { Tbc } from '@/components/Tbc'
import { aboutPeople } from '@/lib/about-model'
export const dynamic = 'force-dynamic'
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) {
@ -18,12 +18,19 @@ export default async function Page({ params }: { params: Promise<{ locale: strin
const t = getDict(locale)
const { home, news } = await loadContent(locale)
const m = buildHomeModel(home, news, t)
const data = aboutPeople[locale]
const people = [
{ label: t.sections.founder, items: data.founder },
{ label: t.sections.leadership, items: data.leadership },
{ label: t.sections.board, items: data.board },
].filter(b => b.items.length > 0)
return <SectionPage legal={await loadLegal(locale)} t={t} locale={locale} path="/about" title={t.sections.about} showNews={m.news.length > 0}>
<section><h2 className="font-serif text-2xl">{t.mission.title}</h2><p className="mt-4 max-w-3xl text-lg">{m.mission.text}</p></section>
<section className="mt-12"><h2 className="font-serif text-2xl">{t.sections.goals}</h2><p className="mt-4 max-w-3xl">{t.sections.goalText}</p></section>
<section id="directions" className="mt-12 scroll-mt-8"><h2 className="font-serif text-2xl">{t.directions.title}</h2>
<ul className="mt-6 grid gap-6 sm:grid-cols-2">{m.directions.map(d => <li key={d.title} className="border border-line p-6"><h3 className="font-serif text-xl">{d.title}</h3><p className="mt-3">{d.text ?? t.tbc}</p></li>)}</ul>
<ul className="mt-6 grid gap-6 sm:grid-cols-2">{m.directions.map(d => <li key={d.title} className="border border-line p-6"><h3 className="font-serif text-xl">{d.title}</h3><p className="mt-3">{d.text}</p></li>)}</ul>
</section>
<div className="mt-12 grid gap-6 sm:grid-cols-3">{[t.sections.founder,t.sections.leadership,t.sections.board].map(label => <section key={label}><h2 className="mb-4 font-serif text-2xl">{label}</h2><Tbc label={t.tbc} /></section>)}</div>
{people.length > 0 && <div className="mt-12 grid gap-6 sm:grid-cols-3">{people.map(b => <section key={b.label}><h2 className="mb-4 font-serif text-2xl">{b.label}</h2><ul className="space-y-2">{b.items.map(p => <li key={p.name}><span className="font-medium">{p.name}</span>{p.role ? <span className="block text-sm text-muted">{p.role}</span> : null}</li>)}</ul></section>)}</div>}
{data.partners.length > 0 && <section className="mt-12"><h2 className="font-serif text-2xl">{t.sections.partners}</h2><ul className="mt-4 space-y-2">{data.partners.map(p => <li key={p.name}>{p.url ? <a className="underline" href={p.url}>{p.name}</a> : p.name}</li>)}</ul></section>}
</SectionPage>
}

View File

@ -1,5 +1,8 @@
import React from 'react'
import type { Dict } from '@/i18n'
import { bookUrl, marwinUrl } from '@/lib/home-model'
const storeUrls: Record<string, string> = { Marwin: marwinUrl, 'Flip.kz': bookUrl }
export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
const buy = t.buy
@ -7,16 +10,19 @@ export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
return (
<div className="mt-8">
<h4 className="font-serif text-xl sm:text-2xl">{t.get}</h4>
{(
<>
<p className="mt-3 text-muted">{buy.intro}</p>
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
{buy.platforms.map((p) => <li key={p}>{p}</li>)}
</ul>
<p className="mt-3 text-muted">{buy.stores}</p>
<p className="mt-3 text-muted">{buy.note}</p>
</>
)}
<p className="mt-3 text-muted">{buy.intro}</p>
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
{buy.platforms.map((p) => {
const href = storeUrls[p]
return (
<li key={p}>
{href ? <a href={href} target="_blank" rel="noopener noreferrer" className="underline">{p}</a> : p}
</li>
)
})}
</ul>
<p className="mt-3 text-muted">{buy.stores}</p>
<p className="mt-3 text-muted">{buy.note}</p>
</div>
)
}

View File

@ -2,28 +2,33 @@ import { createElement } from 'react'
import { renderToStaticMarkup } from 'react-dom/server'
import { describe, expect, it } from 'vitest'
import { getDict } from '@/i18n'
import { bookUrl, marwinUrl } from '@/lib/home-model'
import { BookWhere } from './BookWhere'
const render = (l: 'ru' | 'kk' | 'en') => {
const d = getDict(l)
return renderToStaticMarkup(createElement(BookWhere, { t: d.book, tbc: d.tbc }))
}
const link = (href: string, name: string) =>
`<a href="${href.replace(/&/g, '&amp;')}" target="_blank" rel="noopener noreferrer" class="underline">${name}</a>`
describe('Сценарий: где купить книгу', () => {
it('русский текст целиком, площадки списком без ссылок', () => {
const html = render('ru')
expect(html).toContain('Где купить книгу')
expect(html).toContain('можно приобрести онлайн на платформах:')
expect(html).toContain('<li>Marwin</li><li>Flip.kz</li>')
expect(html).toContain('<p class="mt-3 text-muted">Наличие и стоимость книги уточняйте непосредственно у продавцов.</p>')
expect(html).not.toContain('<a')
})
it.each(['kk', 'en'] as const)('язык %s: те же магазины, без пометок', (l) => {
it.each(['ru', 'kk', 'en'] as const)('язык %s: Marwin и Flip.kz — ссылки в новой вкладке, без пометок', (l) => {
const html = render(l)
expect(html).toContain('<li>Marwin</li><li>Flip.kz</li>')
expect(html).toContain(link(marwinUrl, 'Marwin'))
expect(html).toContain(link(bookUrl, 'Flip.kz'))
expect(html).toContain('Эрудит')
expect(html).toContain('Книжный мир')
expect(html).not.toContain(getDict(l).tbc)
expect(html).not.toContain('<a')
})
it('русский текст: подпись и фраза про наличие на месте', () => {
const html = render('ru')
expect(html).toContain('Где купить книгу')
expect(html).toContain('Наличие и стоимость книги уточняйте непосредственно у продавцов.')
})
it('без адреса магазина ссылка не показывается, название остаётся', () => {
const d = getDict('ru')
const html = renderToStaticMarkup(createElement(BookWhere, { t: { ...d.book, buy: { ...d.book.buy!, platforms: ['Неизвестный'] } } }))
expect(html).toContain('<li>Неизвестный</li>')
})
})

View File

@ -1,7 +1,7 @@
import type { Dict } from './types'
export const en: Dict = {
sections: {"about": "About the foundation", "contacts": "Contacts", "goals": "Goals", "goalText": "Preserve the legacy of outstanding cultural figures and artists, pass it on to new generations, and support cultural and educational initiatives.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "read": "Read", "source": "Source", "review": "Translation awaiting review."},
sections: {"about": "About the foundation", "contacts": "Contacts", "partners": "Partners", "goals": "Goals", "goalText": "Collect and organise archives, manuscripts and recordings; publish books and music collections; make the legacy available to a wide audience in digital form; support young musicians and researchers; build ties with cultural organisations abroad.", "founder": "Founder", "leadership": "Leadership", "board": "Board of trustees", "read": "Read", "source": "Source", "review": "Translation awaiting review."},
siteName: 'Qazaq Legacy Foundation',
metaTitle: 'Qazaq Legacy Foundation — a private foundation for Kazakhstan’s heritage',
metaDescription:

View File

@ -1,7 +1,7 @@
import type { Dict } from './types'
export const kk: Dict = {
sections: {"about": "Қор туралы", "contacts": "Байланыс", "goals": "Мақсаттар", "goalText": "Мәдениет пен өнердің көрнекті қайраткерлерінің мұрасын сақтау, оны жаңа ұрпаққа жеткізу және мәдени-ағартушылық бастамаларды қолдау.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "read": "Оқу", "source": "Дереккөз", "review": "Аударманы тексеру қажет."},
sections: {"about": "Қор туралы", "contacts": "Байланыс", "partners": "Серіктестер", "goals": "Мақсаттар", "goalText": "Мұрағаттарды, қолжазбалар мен жазбаларды жинап, жүйелеу; кітаптар мен музыкалық жинақтар шығару; мұраны кең аудиторияға цифрлық түрде ұсыну; жас музыканттар мен зерттеушілерге қолдау көрсету; шетелдік мәдени ұйымдармен байланыс орнату.", "founder": "Құрылтайшы", "leadership": "Басшылық", "board": "Қамқоршылық кеңес", "read": "Оқу", "source": "Дереккөз", "review": "Аударманы тексеру қажет."},
siteName: 'Qazaq Legacy Foundation',
metaTitle: 'Qazaq Legacy Foundation — Қазақстан мұрасының жеке қоры',
metaDescription:

View File

@ -1,7 +1,7 @@
import type { Dict } from './types'
export const ru: Dict = {
sections: {"about": "О фонде", "contacts": "Контакты", "goals": "Цели", "goalText": "Сохранять наследие выдающихся деятелей культуры и искусства, передавать его новым поколениям и поддерживать культурные и просветительские инициативы.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "read": "Читать", "source": "Источник", "review": ""},
sections: {"about": "О фонде", "contacts": "Контакты", "partners": "Партнёры", "goals": "Цели", "goalText": "Собирать и систематизировать архивы, рукописи и записи; издавать книги и музыкальные сборники; открывать наследие широкой аудитории в цифровом виде; помогать молодым музыкантам и исследователям; выстраивать связи с зарубежными культурными организациями.", "founder": "Учредитель", "leadership": "Руководство", "board": "Попечительский совет", "read": "Читать", "source": "Источник", "review": ""},
siteName: 'Qazaq Legacy Foundation',
metaTitle: 'Qazaq Legacy Foundation — частный фонд наследия Казахстана',
metaDescription:

View File

@ -2,7 +2,7 @@ export const locales = ['ru', 'kk', 'en'] as const
export type Locale = (typeof locales)[number]
export type Dict = {
sections: { about: string; contacts: string; goals: string; goalText: string; founder: string; leadership: string; board: string; read: string; source: string; review: string }
sections: { about: string; contacts: string; partners: string; goals: string; goalText: string; founder: string; leadership: string; board: string; read: string; source: string; review: string }
siteName: string
metaTitle: string
metaDescription: string

15
src/lib/about-model.ts Normal file
View File

@ -0,0 +1,15 @@
import type { Locale } from '@/i18n'
export type AboutPerson = { name: string; role?: string }
export type AboutPartner = { name: string; url?: string }
export type AboutPeople = { founder: AboutPerson[]; leadership: AboutPerson[]; board: AboutPerson[]; partners: AboutPartner[] }
/**
* Данные страницы «О фонде». Пока фонд не передал сведения, списки пусты, и блоки не показываются.
* Как только в список на нужном языке добавят запись, блок появится сам.
*/
export const aboutPeople: Record<Locale, AboutPeople> = {
ru: { founder: [], leadership: [], board: [], partners: [] },
kk: { founder: [], leadership: [], board: [], partners: [] },
en: { founder: [], leadership: [], board: [], partners: [] },
}

View File

@ -18,14 +18,17 @@ vi.mock('./content', () => ({
describe('Разделы и языки', () => {
for (const locale of locales) {
const params = Promise.resolve({ locale })
it(`Нет сведений о руководстве: явные пометки, партнёры скрыты — ${locale}`, async () => {
it(`Нет сведений о руководстве: блоки и пометки скрыты, цели не повторяют миссию — ${locale}`, async () => {
const html = renderToStaticMarkup(await About({ params }))
const t = getDict(locale)
expect(html).toContain(t.sections.founder)
expect(html).toContain(t.sections.board)
expect(html).toContain(t.tbc)
expect(html).not.toContain(t.sections.founder)
expect(html).not.toContain(t.sections.leadership)
expect(html).not.toContain(t.sections.board)
expect(html).not.toContain(t.sections.partners)
expect(html).not.toContain(t.tbc)
expect(html).toContain(t.mission.text)
expect(html).not.toContain('partners')
expect(html).toContain(t.sections.goalText)
expect(t.mission.text).not.toContain(t.sections.goalText)
})
it(`Переключение языка каталога сохраняет путь — ${locale}`, async () => {
const html = renderToStaticMarkup(await Projects({ params }))

View File

@ -21,6 +21,8 @@ export type HomeModel = {
}
export const foundationEmail = 'qazaqlegacy@gmail.com'
// Адрес книги на Marwin; если пусто — ссылка не показывается.
export const marwinUrl = 'https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988'
export const bookUrl = 'https://www.flip.kz/catalog?prod=6364653&utm_source=ig&utm_medium=social&utm_content=link_in_bio'
const clean = (v?: string | null) => (v && v.trim() ? v.trim() : null)