feat(web): introduce templates

This commit is contained in:
Ali BARIN
2025-02-26 10:40:47 +00:00
parent 69e91fea18
commit 839fda8880
33 changed files with 904 additions and 86 deletions

View File

@@ -11,6 +11,7 @@ export default async (request, response) => {
const configParams = (request) => {
const {
enableTemplates,
enableFooter,
footerBackgroundColor,
footerCopyrightText,
@@ -28,6 +29,7 @@ const configParams = (request) => {
} = request.body;
return {
enableTemplates,
enableFooter,
footerBackgroundColor,
footerCopyrightText,

View File

@@ -35,6 +35,7 @@ describe('PATCH /api/v1/admin/templates/:templateId', () => {
const expectedPayload = await updateTemplateMock({
...refetchedTemplate,
flowData: refetchedTemplate.getFlowDataWithIconUrls(),
name: updatedName,
});

View File

@@ -2,7 +2,7 @@ const adminTemplateSerializer = (template) => {
return {
id: template.id,
name: template.name,
flowData: template.flowData,
flowData: template.getFlowDataWithIconUrls(),
createdAt: template.createdAt.getTime(),
updatedAt: template.updatedAt.getTime(),
};

View File

@@ -13,7 +13,7 @@ describe('adminTemplateSerializer', () => {
const expectedPayload = {
id: template.id,
name: template.name,
flowData: template.flowData,
flowData: template.getFlowDataWithIconUrls(),
createdAt: template.createdAt.getTime(),
updatedAt: template.updatedAt.getTime(),
};

View File

@@ -4,7 +4,7 @@ const createTemplateMock = async (template) => {
name: template.name,
createdAt: template.createdAt.getTime(),
updatedAt: template.updatedAt.getTime(),
flowData: template.flowData,
flowData: template.getFlowDataWithIconUrls(),
};
return {

View File

@@ -4,7 +4,7 @@ const getTemplateMock = async (template) => {
name: template.name,
createdAt: template.createdAt.getTime(),
updatedAt: template.updatedAt.getTime(),
flowData: template.flowData,
flowData: template.getFlowDataWithIconUrls(),
};
return {

View File

@@ -4,7 +4,7 @@ const getTemplatesMock = async (templates) => {
name: template.name,
createdAt: template.createdAt.getTime(),
updatedAt: template.updatedAt.getTime(),
flowData: template.flowData,
flowData: template.getFlowDataWithIconUrls(),
}));
return {