add checkForObsoleteVersion when creating the css for the dashboards
This commit is contained in:
parent
b20d0f0039
commit
9f88a58a30
|
@ -11,7 +11,7 @@ import {existsSync} from 'fs';
|
||||||
import {REQUEST, RESPONSE} from "./src/app/openaireLibrary/utils/tokens";
|
import {REQUEST, RESPONSE} from "./src/app/openaireLibrary/utils/tokens";
|
||||||
import {isArray} from "util";
|
import {isArray} from "util";
|
||||||
import {properties} from "./src/environments/environment";
|
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";
|
import {Response} from "express";
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
@ -79,7 +79,7 @@ function buildAll(res: Response = null) {
|
||||||
axios.get(layoutsURL).then(response => {
|
axios.get(layoutsURL).then(response => {
|
||||||
if (response.data && Array.isArray(response.data) && response.data.length > 0) {
|
if (response.data && Array.isArray(response.data) && response.data.length > 0) {
|
||||||
response.data.forEach((layout: Layout) => {
|
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);
|
buildCss(layout.portalPid, layout.date ? layout.date : null, variables);
|
||||||
});
|
});
|
||||||
if (res) {
|
if (res) {
|
||||||
|
@ -185,7 +185,7 @@ export function app() {
|
||||||
});
|
});
|
||||||
|
|
||||||
server.post('/build-css/:id/:suffix', jsonParser,(req, res) => {
|
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) {
|
if (variables) {
|
||||||
buildCss(req.params.id , req.params.suffix, variables);
|
buildCss(req.params.id , req.params.suffix, variables);
|
||||||
res.status(200).send({
|
res.status(200).send({
|
||||||
|
@ -198,7 +198,7 @@ export function app() {
|
||||||
});
|
});
|
||||||
|
|
||||||
server.post('/build-css/preview/:id/:suffix', jsonParser, (req, res) => {
|
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) {
|
if (variables) {
|
||||||
buildCss(req.params.id, req.params.suffix, 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'});
|
res.status(200).send({code: 200, message: 'CSS build for ' + req.params.id + ' layout was successful'});
|
||||||
|
|
Loading…
Reference in New Issue