feat(content): 본문 이미지 목록 썸네일·og:image 폴백 전 티어 구현
공개 이슈 https://github.com/gnuboard/g7/issues/22 — 본문에 삽입한 이미지가 카드/갤러리 목록 썸네일과 공유 미리보기(og:image)에 반영되지 않던 공백을 코어+3모듈+2템플릿에서 해소. - 코어 7.0.9: HtmlImageExtractor(내부 이미지 한정, origin 정규화 SSoT 재사용) + seo.og_image_default 사이트 기본 공유 이미지 설정 + SeoMetaResolver 폴백 체인 - board 1.1.0 / ecommerce 1.2.0 / page 1.1.0: content_thumbnail_url 캐시 컬럼, saving 추출(html 모드 한정·첨부 우선·비밀글 게이트 유지), filter_content_thumbnail 훅, 기존 데이터 백필 업그레이드 스텝 - ecommerce 카테고리 og:image 생산자 신설, page og:description 死키 정정 - sirsoft-basic 1.1.2 og 바인딩 정정, admin_basic 1.0.7 SEO 탭 업로더(+ja 팩 2종) - 검수 중 발견한 text 모드 오캐시 결함은 실패 테스트 선행 후 수정
This commit is contained in:
1 parent
14eb2e39e4
commit
1ba67ca7cf
98 files changed
+4640
-101
No files matched your search
@@ -4,6 +4,16 @@
|
||||
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
|
||||
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
|
||||
|
||||
## [1.1.2] - 2026-08-22
|
||||
|
||||
### Changed
|
||||
|
||||
- sirsoft-page 최소 버전을 1.1.0 으로 상향했습니다 (페이지 공유 이미지 연동).
|
||||
|
||||
### Fixed
|
||||
|
||||
- 페이지 공유 미리보기의 이미지(og:image)와 설명(og:description)이 채워지도록 페이지 표시 화면의 공유 정보 연결을 정비했습니다. (#22 @abc101 님께서 제보해주셨습니다.)
|
||||
|
||||
## [1.1.1] - 2026-08-19
|
||||
|
||||
### Added
|
||||
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* @file search-product-item-list-thumbnail.test.tsx
|
||||
* @description 통합검색 상품 리스트형 아이템 썸네일 키 정정 회귀 (공개 #22 부수 — 별건 P3-A)
|
||||
*
|
||||
* 회귀 배경: `_item_list.json` 이 生産측(SearchProductsListener)이 방출하지 않는
|
||||
* `product.thumbnail` 키를 바인딩해 리스트형 썸네일 src 가 항상 비었다 (카드형은 정상).
|
||||
* 정정: `product.thumbnail_url` 바인딩 + if 가드 + 부재 시 placeholder.
|
||||
*
|
||||
* 검증 방식: 실제 partial JSON 을 iteration 래퍼에 넣어 DynamicRenderer 로 렌더링,
|
||||
* thumbnail_url 존재/부재 두 케이스의 DOM 을 단언한다.
|
||||
*
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
import { createLayoutTest, screen } from '@/core/template-engine/__tests__/utils/layoutTestUtils';
|
||||
import { ComponentRegistry } from '@/core/template-engine/ComponentRegistry';
|
||||
|
||||
import itemListPartial from '../../layouts/partials/search/products/_item_list.json';
|
||||
|
||||
// ========== 테스트용 컴포넌트 ==========
|
||||
|
||||
const TestDiv: React.FC<{ className?: string; children?: React.ReactNode }> = ({ className, children }) => (
|
||||
<div className={className}>{children}</div>
|
||||
);
|
||||
|
||||
const TestSpan: React.FC<{ className?: string; children?: React.ReactNode; text?: string }> = ({ className, children, text }) => (
|
||||
<span className={className}>{children || text}</span>
|
||||
);
|
||||
|
||||
const TestButton: React.FC<{ className?: string; children?: React.ReactNode }> = ({ className, children }) => (
|
||||
<button type="button" className={className}>{children}</button>
|
||||
);
|
||||
|
||||
const TestImg: React.FC<{ src?: string; alt?: string; className?: string }> = ({ src, alt, className }) => (
|
||||
<img data-testid="product-thumb" src={src} alt={alt} className={className} />
|
||||
);
|
||||
|
||||
const TestIcon: React.FC<{ name?: string; className?: string }> = ({ name, className }) => (
|
||||
<i data-testid={`icon-${name}`} className={className} />
|
||||
);
|
||||
|
||||
const TestHtmlContent: React.FC<{ content?: string; className?: string }> = ({ content, className }) => (
|
||||
<div className={className}>{content}</div>
|
||||
);
|
||||
|
||||
const TestFragment: React.FC<{ children?: React.ReactNode }> = ({ children }) => <>{children}</>;
|
||||
|
||||
function setupTestRegistry(): void {
|
||||
const registry = ComponentRegistry.getInstance();
|
||||
(registry as any).registry = {
|
||||
Div: { component: TestDiv, metadata: { name: 'Div', type: 'basic' } },
|
||||
Span: { component: TestSpan, metadata: { name: 'Span', type: 'basic' } },
|
||||
Button: { component: TestButton, metadata: { name: 'Button', type: 'basic' } },
|
||||
Img: { component: TestImg, metadata: { name: 'Img', type: 'basic' } },
|
||||
Icon: { component: TestIcon, metadata: { name: 'Icon', type: 'basic' } },
|
||||
HtmlContent: { component: TestHtmlContent, metadata: { name: 'HtmlContent', type: 'composite' } },
|
||||
// iteration 렌더는 Fragment 래퍼를 요구한다 — 미등록 시 반복 전체가 조용히 빈 출력
|
||||
Fragment: { component: TestFragment, metadata: { name: 'Fragment', type: 'layout' } },
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 실제 partial 을 iteration 래퍼에 넣은 테스트 레이아웃을 만든다.
|
||||
*
|
||||
* @param products 검색 결과 상품 배열 (SearchProductsListener 방출 형태)
|
||||
*/
|
||||
const testLayout = {
|
||||
version: '1.0.0',
|
||||
layout_name: 'test/search-item-list',
|
||||
components: [
|
||||
{
|
||||
type: 'basic',
|
||||
name: 'Div',
|
||||
iteration: {
|
||||
source: 'search_products.data',
|
||||
item_var: 'product',
|
||||
index_var: 'product_index',
|
||||
},
|
||||
children: [itemListPartial],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* 검색 결과 상품 배열을 initialData 컨텍스트로 넘겨 테스트 유틸을 만든다.
|
||||
*
|
||||
* @param products 검색 결과 상품 배열 (SearchProductsListener 방출 형태)
|
||||
*/
|
||||
function createUtils(products: Array<Record<string, unknown>>) {
|
||||
return createLayoutTest(testLayout as any, {
|
||||
componentRegistry: ComponentRegistry.getInstance(),
|
||||
initialData: { search_products: { data: products } },
|
||||
} as any);
|
||||
}
|
||||
|
||||
describe('통합검색 상품 리스트형 썸네일 (partials/search/products/_item_list.json)', () => {
|
||||
let cleanup: (() => void) | null = null;
|
||||
|
||||
afterEach(() => {
|
||||
cleanup?.();
|
||||
cleanup = null;
|
||||
});
|
||||
|
||||
it('thumbnail_url 이 있으면 그 값으로 Img 가 렌더된다 (死키 thumbnail 미의존)', async () => {
|
||||
setupTestRegistry();
|
||||
const utils = createUtils([
|
||||
{
|
||||
id: 1,
|
||||
name: '검색 상품',
|
||||
category_name: '카테고리',
|
||||
thumbnail_url: '/api/plugins/sirsoft-ckeditor5/images/abc123',
|
||||
selling_price_formatted: '10,000원',
|
||||
},
|
||||
]);
|
||||
cleanup = () => utils.cleanup();
|
||||
|
||||
await utils.render();
|
||||
|
||||
const img = screen.getByTestId('product-thumb');
|
||||
expect(img.getAttribute('src')).toBe('/api/plugins/sirsoft-ckeditor5/images/abc123');
|
||||
expect(screen.queryByTestId('icon-image')).toBeNull();
|
||||
});
|
||||
|
||||
it('thumbnail_url 이 없으면 Img 대신 placeholder 아이콘이 렌더된다', async () => {
|
||||
setupTestRegistry();
|
||||
const utils = createUtils([
|
||||
{
|
||||
id: 2,
|
||||
name: '이미지 없는 상품',
|
||||
category_name: '카테고리',
|
||||
thumbnail_url: null,
|
||||
selling_price_formatted: '5,000원',
|
||||
},
|
||||
]);
|
||||
cleanup = () => utils.cleanup();
|
||||
|
||||
await utils.render();
|
||||
|
||||
expect(screen.queryByTestId('product-thumb')).toBeNull();
|
||||
expect(screen.getByTestId('icon-image')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -15,12 +15,14 @@
|
||||
"og": {
|
||||
"type": "website",
|
||||
"title": "{{page.data.title ?? ''}}",
|
||||
"description": "{{page.data.excerpt ?? ''}}"
|
||||
"description": "{{page.data.seo_meta?.description ?? ''}}",
|
||||
"image": "{{page.data.content_thumbnail_url ?? ''}}"
|
||||
},
|
||||
"structured_data": {
|
||||
"@type": "WebPage",
|
||||
"name": "{{page.data.title ?? ''}}",
|
||||
"description": "{{page.data.excerpt ?? ''}}",
|
||||
"description": "{{page.data.seo_meta?.description ?? ''}}",
|
||||
"image": "{{page.data.content_thumbnail_url ?? ''}}",
|
||||
"datePublished": "{{page.data.created_at ?? ''}}",
|
||||
"dateModified": "{{page.data.updated_at ?? ''}}"
|
||||
}
|
||||
@@ -302,7 +304,7 @@
|
||||
"if": "{{!att_item.is_image}}",
|
||||
"props": {
|
||||
"name": "file",
|
||||
"className": "text-gray-400 text-sm flex-shrink-0"
|
||||
"className": "text-gray-400 dark:text-gray-500 text-sm flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,9 +12,25 @@
|
||||
"props": { "className": "w-16 h-16 flex-shrink-0 rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-700" },
|
||||
"children": [
|
||||
{
|
||||
"comment": "생산측(SearchProductsListener)은 thumbnail_url 키를 방출한다 — thumbnail 은 死키였다 (공개 #22 부수 정정)",
|
||||
"type": "basic",
|
||||
"name": "Img",
|
||||
"props": { "src": "{{product.thumbnail}}", "alt": "{{product.name}}", "className": "w-full h-full object-cover" }
|
||||
"if": "{{product.thumbnail_url}}",
|
||||
"props": { "src": "{{product.thumbnail_url}}", "alt": "{{product.name}}", "className": "w-full h-full object-cover" }
|
||||
},
|
||||
{
|
||||
"comment": "이미지가 없는 경우 플레이스홀더 (board 카드형 패턴 축소 미러)",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{!product.thumbnail_url}}",
|
||||
"props": { "className": "w-full h-full flex items-center justify-center bg-gray-200 dark:bg-gray-700" },
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": { "name": "image", "className": "text-gray-400 dark:text-gray-500" }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "sirsoft-basic",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sirsoft-basic",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sirsoft-basic",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"description": "Gnuboard7 Basic User Template Components - Nexibase Style",
|
||||
"type": "module",
|
||||
"main": "dist/components.js",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"ko": "Basic",
|
||||
"en": "Basic"
|
||||
},
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"license": "MIT",
|
||||
"description": {
|
||||
"ko": "그누보드7 기본 사용자 템플릿",
|
||||
@@ -22,12 +22,12 @@
|
||||
"url": "https://sirsoft.com"
|
||||
},
|
||||
"release_date": "2026-01-07",
|
||||
"g7_version": ">=7.0.6",
|
||||
"g7_version": ">=7.0.9",
|
||||
"dependencies": {
|
||||
"modules": {
|
||||
"sirsoft-board": ">=1.0.0",
|
||||
"sirsoft-ecommerce": ">=1.1.0",
|
||||
"sirsoft-page": ">=1.0.0"
|
||||
"sirsoft-page": ">=1.1.0"
|
||||
},
|
||||
"plugins": {
|
||||
"sirsoft-daum_postcode": ">=1.0.0"
|
||||
|
||||
Reference in new issue
Block a user