feat: 搜索页图片预览 & 文档列表显示文档类型 #96
@ -12,6 +12,7 @@ describe('converters', () => {
|
|||||||
summary: 'High efficiency',
|
summary: 'High efficiency',
|
||||||
description: 'Detailed description',
|
description: 'Detailed description',
|
||||||
type: 'pump',
|
type: 'pump',
|
||||||
|
cover: 'rand-om__-uuid-1234',
|
||||||
};
|
};
|
||||||
const result = converters.products(item);
|
const result = converters.products(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
@ -19,6 +20,7 @@ describe('converters', () => {
|
|||||||
type: 'product',
|
type: 'product',
|
||||||
title: 'Hydraulic Pump',
|
title: 'Hydraulic Pump',
|
||||||
summary: 'High efficiency',
|
summary: 'High efficiency',
|
||||||
|
thumbnail: '/api/assets/rand-om__-uuid-1234',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -29,6 +31,7 @@ describe('converters', () => {
|
|||||||
summary: 'Effective solution',
|
summary: 'Effective solution',
|
||||||
content: 'Detailed content',
|
content: 'Detailed content',
|
||||||
type: 'Type A',
|
type: 'Type A',
|
||||||
|
cover: 'rand-om__-uuid-5678',
|
||||||
};
|
};
|
||||||
const result = converters.solutions(item);
|
const result = converters.solutions(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
@ -36,6 +39,7 @@ describe('converters', () => {
|
|||||||
type: 'solution',
|
type: 'solution',
|
||||||
title: 'Solution A',
|
title: 'Solution A',
|
||||||
summary: 'Effective solution',
|
summary: 'Effective solution',
|
||||||
|
thumbnail: '/api/assets/rand-om__-uuid-5678',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -8,16 +8,16 @@ export const converters: {
|
|||||||
id: item.id,
|
id: item.id,
|
||||||
type: 'product',
|
type: 'product',
|
||||||
title: item.name,
|
title: item.name,
|
||||||
summary: item.summary,
|
summary: item?.summary ?? '',
|
||||||
thumbnail: `/api/assets/${item.cover}`,
|
thumbnail: item?.cover ? `/api/assets/${item.cover}` : undefined,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({
|
solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
type: 'solution',
|
type: 'solution',
|
||||||
title: item.title,
|
title: item.title,
|
||||||
summary: item.summary,
|
summary: item?.summary ?? '',
|
||||||
thumbnail: `/api/assets/${item.cover}`,
|
thumbnail: item?.cover ? `/api/assets/${item.cover}` : undefined,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
questions: (item: MeiliIndexMap['questions']): SearchItemView => ({
|
questions: (item: MeiliIndexMap['questions']): SearchItemView => ({
|
||||||
|
|||||||
@ -9,16 +9,16 @@ export interface MeiliProductIndex {
|
|||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
/** 产品简介 **/
|
/** 产品简介 **/
|
||||||
summary: string;
|
summary?: string;
|
||||||
|
|
||||||
/** 产品详情 **/
|
/** 产品详情 **/
|
||||||
description: string;
|
description?: string;
|
||||||
|
|
||||||
/** 产品类型 **/
|
/** 产品类型 **/
|
||||||
type: string;
|
type?: string;
|
||||||
|
|
||||||
/** 产品缩略图 **/
|
/** 产品缩略图 **/
|
||||||
cover: string;
|
cover?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,16 +32,16 @@ export interface MeiliSolutionIndex {
|
|||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
/** 解决方案摘要 **/
|
/** 解决方案摘要 **/
|
||||||
summary: string;
|
summary?: string;
|
||||||
|
|
||||||
/** 解决方案内容 **/
|
/** 解决方案内容 **/
|
||||||
content: string;
|
content?: string;
|
||||||
|
|
||||||
/** 解决方案类型 **/
|
/** 解决方案类型 **/
|
||||||
type: string;
|
type?: string;
|
||||||
|
|
||||||
/** 解决方案缩略图 **/
|
/** 解决方案缩略图 **/
|
||||||
cover: string;
|
cover?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,7 @@ export interface MeiliQuestionIndex {
|
|||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
/** 问题内容 **/
|
/** 问题内容 **/
|
||||||
content: string;
|
content?: string;
|
||||||
|
|
||||||
/** 相关产品 **/
|
/** 相关产品 **/
|
||||||
products: string[];
|
products: string[];
|
||||||
|
|||||||
Reference in New Issue
Block a user