From 056c1932f0cbf918034f8f438bad90a36f80a69b Mon Sep 17 00:00:00 2001 From: amirhossein-haerian Date: Mon, 26 Aug 2024 15:31:25 +0200 Subject: [PATCH 1/3] feat(KUI-1401): upgrade kth/style --- package-lock.json | 8 ++++---- package.json | 2 +- server/views/helpers/index.js | 4 +++- server/views/partials/headerLogotype.handlebars | 5 ++++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15563d1b..ca26ef89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@kth/monitor": "^4.2.1", "@kth/server": "^4.1.0", "@kth/session": "^3.0.9", - "@kth/style": "^0.18.6", + "@kth/style": "^1.3.0", "axios": "^1.6.7", "body-parser": "^1.20.2", "cookie-parser": "^1.4.6", @@ -3345,9 +3345,9 @@ } }, "node_modules/@kth/style": { - "version": "0.18.6", - "resolved": "https://registry.npmjs.org/@kth/style/-/style-0.18.6.tgz", - "integrity": "sha512-BUTL9kilpFAQXLwmevhLZJ9g6VzTWRLyVuzH8kIyR2pNaxH+4WhrObIdl9huWxuJIfYFQy4COPLtyg3M8r5GtA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@kth/style/-/style-1.3.0.tgz", + "integrity": "sha512-/3ObH/f+KeolQoFXBhLRCUxcihDGnc1PDSsqsajtABgy4Q5oF45KB4OW7xL1gFQqyMfJfdU1CJfGSLGSKrFjgw==", "peerDependencies": { "react": "*" } diff --git a/package.json b/package.json index ef09f48d..0f99fbf9 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@kth/monitor": "^4.2.1", "@kth/server": "^4.1.0", "@kth/session": "^3.0.9", - "@kth/style": "^0.18.6", + "@kth/style": "^1.3.0", "axios": "^1.6.7", "body-parser": "^1.20.2", "cookie-parser": "^1.4.6", diff --git a/server/views/helpers/index.js b/server/views/helpers/index.js index cbd93e9e..70be326d 100644 --- a/server/views/helpers/index.js +++ b/server/views/helpers/index.js @@ -1,5 +1,5 @@ 'use strict' - +const handlebars = require('handlebars') const registerHeaderContentHelper = require('@kth/kth-node-web-common/lib/handlebars/helpers/headerContent') const { registerBreadcrumbHelper } = require('@kth/kth-node-web-common/lib/handlebars/helpers/breadcrumbs') const { registerLanguageLinkHelper } = require('@kth/kth-node-web-common/lib/handlebars/helpers/languageLink') @@ -44,3 +44,5 @@ require('@kth/kth-node-web-common/lib/handlebars/helpers/contentedit') const i18n = require('../../../i18n') require('@kth/kth-node-web-common/lib/handlebars/helpers/createI18nHelper')(i18n) require('@kth/kth-node-web-common/lib/handlebars/helpers/safe') + +handlebars.registerHelper('eq', (var1, var2) => var1.toString() === var2.toString()) diff --git a/server/views/partials/headerLogotype.handlebars b/server/views/partials/headerLogotype.handlebars index f9e8d7b7..6239219e 100644 --- a/server/views/partials/headerLogotype.handlebars +++ b/server/views/partials/headerLogotype.handlebars @@ -1,6 +1,9 @@
- Till KTH:s startsida + {{#if (eq theme "external")}} Till KTH:s startsida + {{else}} + Till KTH:s startsida + {{/if}}
\ No newline at end of file From e8f7debb897bf5ae7c6a8b722a054b4552a1de32 Mon Sep 17 00:00:00 2001 From: amirhossein-haerian Date: Tue, 27 Aug 2024 08:54:44 +0200 Subject: [PATCH 2/3] feat(KUI-1401): upgrade kth/style local-navigation --- public/css/_shared.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/css/_shared.scss b/public/css/_shared.scss index e3581ddc..8861cf5b 100644 --- a/public/css/_shared.scss +++ b/public/css/_shared.scss @@ -4,6 +4,15 @@ #app { padding-top: 30px; padding-bottom: 30px; + .kth-local-navigation--mobile { + display: block; + width: auto; + padding: 0; + + @media (min-width: 992px) { + display: none; + } + } & > .row { margin: 0; From a5611439872463c1ab6dcd9d42d1679d6ce81fe3 Mon Sep 17 00:00:00 2001 From: amirhossein-haerian Date: Tue, 27 Aug 2024 20:23:47 +0200 Subject: [PATCH 3/3] feat(KUI-1401): revert local-navigation changes --- package-lock.json | 8 ++++---- package.json | 2 +- public/css/_shared.scss | 9 --------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca26ef89..11cb23b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@kth/monitor": "^4.2.1", "@kth/server": "^4.1.0", "@kth/session": "^3.0.9", - "@kth/style": "^1.3.0", + "@kth/style": "^1.4.2", "axios": "^1.6.7", "body-parser": "^1.20.2", "cookie-parser": "^1.4.6", @@ -3345,9 +3345,9 @@ } }, "node_modules/@kth/style": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@kth/style/-/style-1.3.0.tgz", - "integrity": "sha512-/3ObH/f+KeolQoFXBhLRCUxcihDGnc1PDSsqsajtABgy4Q5oF45KB4OW7xL1gFQqyMfJfdU1CJfGSLGSKrFjgw==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@kth/style/-/style-1.4.2.tgz", + "integrity": "sha512-Z6EhjUVzhw+QITpnFsdLu51xogsgEXQiB1E+hEI2HsaFxTOrxkq6qbnN/uK1WWeTuKfi+A6szaVubPXswWRtyw==", "peerDependencies": { "react": "*" } diff --git a/package.json b/package.json index 0f99fbf9..ed8d39a5 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@kth/monitor": "^4.2.1", "@kth/server": "^4.1.0", "@kth/session": "^3.0.9", - "@kth/style": "^1.3.0", + "@kth/style": "^1.4.2", "axios": "^1.6.7", "body-parser": "^1.20.2", "cookie-parser": "^1.4.6", diff --git a/public/css/_shared.scss b/public/css/_shared.scss index 8861cf5b..e3581ddc 100644 --- a/public/css/_shared.scss +++ b/public/css/_shared.scss @@ -4,15 +4,6 @@ #app { padding-top: 30px; padding-bottom: 30px; - .kth-local-navigation--mobile { - display: block; - width: auto; - padding: 0; - - @media (min-width: 992px) { - display: none; - } - } & > .row { margin: 0;