From 9f88a58a3033284d6b3f8f9af246cd321ece504e Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 19 Jun 2023 11:24:13 +0300 Subject: [PATCH 1/2] add checkForObsoleteVersion when creating the css for the dashboards --- server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.ts b/server.ts index 69d89c0..0ead7a0 100644 --- a/server.ts +++ b/server.ts @@ -11,7 +11,7 @@ import {existsSync} from 'fs'; import {REQUEST, RESPONSE} from "./src/app/openaireLibrary/utils/tokens"; import {isArray} from "util"; import {properties} from "./src/environments/environment"; -import {Layout} from "./src/app/openaireLibrary/connect/community/CustomizationOptions"; +import {CustomizationOptions, Layout} from "./src/app/openaireLibrary/connect/community/CustomizationOptions"; import {Response} from "express"; const fs = require('fs'); @@ -79,7 +79,7 @@ function buildAll(res: Response = null) { axios.get(layoutsURL).then(response => { if (response.data && Array.isArray(response.data) && response.data.length > 0) { response.data.forEach((layout: Layout) => { - let variables = Layout.getVariables(layout.layoutOptions); + let variables = Layout.getVariables(CustomizationOptions.checkForObsoleteVersion(layout.layoutOptions, layout.portalPid)); buildCss(layout.portalPid, layout.date ? layout.date : null, variables); }); if (res) { @@ -185,7 +185,7 @@ export function app() { }); server.post('/build-css/:id/:suffix', jsonParser,(req, res) => { - let variables = Layout.getVariables(req.body); + let variables = Layout.getVariables(CustomizationOptions.checkForObsoleteVersion(req.body, req.params.id)); if (variables) { buildCss(req.params.id , req.params.suffix, variables); res.status(200).send({ @@ -198,7 +198,7 @@ export function app() { }); server.post('/build-css/preview/:id/:suffix', jsonParser, (req, res) => { - let variables = Layout.getVariables(req.body); + let variables = Layout.getVariables(CustomizationOptions.checkForObsoleteVersion(req.body, req.params.id)); if (variables) { buildCss(req.params.id, req.params.suffix, variables); res.status(200).send({code: 200, message: 'CSS build for ' + req.params.id + ' layout was successful'}); From e3f88bdfd9fef45b723efa0fcedcf5dcf86f9f12 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Jun 2023 14:55:21 +0300 Subject: [PATCH 2/2] Update library --- src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index bb8f196..db55273 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit bb8f196abb5054af89342284729f28a8e659076c +Subproject commit db55273b685a7f0fc6ca7e79cd20d7cf68d6747a