Skip to content

Commit

Permalink
Merge pull request #1016 from ds-wizard/hotfix/4.0.3
Browse files Browse the repository at this point in the history
Hotfix 4.0.3
  • Loading branch information
janslifka committed Dec 1, 2023
2 parents 49c28ad + 917af85 commit e0d6674
Show file tree
Hide file tree
Showing 24 changed files with 155 additions and 18 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Zip

on:
push:
pull_request:

jobs:
zip:
name: Build Zip
runs-on: ubuntu-latest

strategy:
matrix:
component: ['registry', 'wizard']

env:
NODE_VERSION: 20

steps:
- name: '[setup] Checkout Project'
uses: actions/checkout@v4

- name: '[setup] Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: '[app] Install'
run: npm ci

- name: '[app] Review'
run: npm run review

- name: '[app] Build'
run: npm run build:${{ matrix.component }}

- name: '[release] Create artifact'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.component }}
path: dist/engine-${{ matrix.component }}
2 changes: 1 addition & 1 deletion engine-registry/docker/nginx/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# create config
config=/usr/share/nginx/html/config.js
echo -n "window.registry={apiUrl:'"$API_URL"'" > ${config}
echo -n "window.app={apiUrl:'"$API_URL"'" > ${config}

if [[ ! -z "$APP_TITLE" ]]; then
echo -n ",appTitle:'"$APP_TITLE"'" >>${config}
Expand Down
Binary file removed engine-registry/favicon.ico
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions engine-registry/img/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/wizard/img/favicon/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added engine-registry/img/favicon/favicon-16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/favicon-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/favicon.ico
Binary file not shown.
Binary file added engine-registry/img/favicon/mstile-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/mstile-150x150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/mstile-310x150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/mstile-310x310.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added engine-registry/img/favicon/mstile-70x70.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions engine-registry/img/favicon/safari-pinned-tab.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions engine-registry/img/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/wizard/img/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/wizard/img/favicon/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
8 changes: 8 additions & 0 deletions engine-registry/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<html>
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon-16x16.png">
<link rel="manifest" href="/img/favicon/site.webmanifest">
<link rel="mask-icon" href="/img/favicon/safari-pinned-tab.svg">
<link rel="shortcut icon" href="/img/favicon/favicon.ico">
<meta name="msapplication-config" content="/wizard/img/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script src="/config.js"></script>
<style>@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fa-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.Loading__Loader{height:100vh;padding-top:40vh;text-align:center;color:#adb5bd;opacity:0;animation:fadeIn ease-in 1;animation-duration:1s;animation-delay:.4s;animation-fill-mode:forwards}.Loading__Loader__Spinner{animation:fa-spin 2s infinite linear;width:60px}</style>
</head>
Expand Down
4 changes: 2 additions & 2 deletions engine-registry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ axiosRetry(axios, {
})

function apiUrl() {
if (window.registry && window.registry['apiUrl']) return window.registry['apiUrl']
if (window.app && window.app['apiUrl']) return window.app['apiUrl']
return 'http://localhost:3000'
}

function appTitle() {
if (window.registry && window.registry['appTitle']) return window.registry['appTitle']
if (window.app && window.app['appTitle']) return window.app['appTitle']
return null
}

Expand Down
2 changes: 1 addition & 1 deletion engine-wizard/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sed -i "s/{defaultIllustrationsColor}/$DEFAULT_ILLUSTRATIONS_COLOR/g" $file

# create config
config=/usr/share/nginx/html/wizard/config.js
echo -n "window.wizard={apiUrl:'"$API_URL"'" >${config}
echo -n "window.app={apiUrl:'"$API_URL"'" >${config}
if [[ ! -z "$PROVISIONING_URL" ]]; then
echo -n ",provisioningUrl:'"$PROVISIONING_URL"'" >>${config}
fi
Expand Down
7 changes: 6 additions & 1 deletion engine-wizard/elm/Wizard/Common/Menu/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ viewLogo model =
let
logoText =
span [ class "logo-full", dataCy "nav_app-title-short" ]
[ span [] [ text <| LookAndFeelConfig.getAppTitleShort model.appState.config.lookAndFeel ]
[ text <| LookAndFeelConfig.getAppTitleShort model.appState.config.lookAndFeel
]
in
if List.isEmpty model.appState.config.modules then
Expand Down Expand Up @@ -325,6 +325,11 @@ viewLogo model =
div [ id itemId, class "logo logo-app-switcher", mouseenter, mouseleave ]
[ img [ class "logo-img", src (LookAndFeelConfig.getLogoUrl model.appState.config.lookAndFeel) ] []
, logoText
, span [ class "switcher-icon ms-1 me-2 d-flex text-secondary" ]
[ fa "fas fa-ellipsis-v"
, fa "fas fa-ellipsis-v"
, fa "fas fa-ellipsis-v"
]
, div ([ class "app-switcher-menu", class submenuClass ] ++ submenuStyle)
[ ul []
(switchToHeading
Expand Down
15 changes: 7 additions & 8 deletions engine-wizard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,27 @@ function getPdfSupport() {


function defaultApiUrl() {
if (window.wizard && window.wizard['apiUrl']) return window.wizard['apiUrl']
return 'http://localhost:3000'
if (window.app && window.app['apiUrl']) return window.app['apiUrl']
return window.location.origin + '/wizard-api'
}

function configUrl(apiUrl) {
const clientUrl = (window.wizard && window.wizard['clientUrl']) || (window.location.origin + '/wizard')
const clientUrl = (window.app && window.app['clientUrl']) || (window.location.origin + '/wizard')
return (apiUrl || defaultApiUrl()) + '/configs/bootstrap?clientUrl=' + encodeURIComponent(clientUrl)
}

function localeUrl(apiUrl) {
const locale = localStorage.locale ? JSON.parse(localStorage.locale) : navigator.language
const clientUrl = (window.wizard && window.wizard['clientUrl']) || (window.location.origin + '/wizard')
return (apiUrl || defaultApiUrl()) + '/configs/locales/' + locale + '?clientUrl=' + encodeURIComponent(clientUrl)
return (apiUrl || defaultApiUrl()) + '/configs/locales/' + locale + '?clientUrl=' + encodeURIComponent(clientUrl())
}

function provisioningUrl() {
if (window.wizard && window.wizard['provisioningUrl']) return window.wizard['provisioningUrl']
if (window.app && window.app['provisioningUrl']) return window.app['provisioningUrl']
return false
}

function localProvisioning() {
if (window.wizard && window.wizard['provisioning']) return window.wizard['provisioning']
if (window.app && window.app['provisioning']) return window.app['provisioning']
return null
}

Expand All @@ -87,7 +86,7 @@ function bootstrapErrorHTML(errorCode) {
}

function clientUrl() {
return window.location.protocol + '//' + window.location.host
return (window.app && window.app['clientUrl']) || (window.location.origin + '/wizard')
}

function getApiUrl(config) {
Expand Down
13 changes: 9 additions & 4 deletions engine-wizard/scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ body {

.logo-full {
width: 100%;
display: flex;
display: inline-block;
justify-content: space-between;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: $navbar-brand-font-size;
}

.switcher-icon {
.side-navigation-collapsed & {
display: none !important;
}
}

&-app-switcher {
cursor: pointer;

Expand Down Expand Up @@ -551,9 +558,7 @@ body {

.logo {
.logo-full {
span {
display: none;
}
display: none;
}
}

Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ module.exports = {
new CopyWebpackPlugin({
patterns: [
{from: `${component}/img`, to: 'img'},
{from: `${component}/favicon.ico`, to: 'favicon.ico', noErrorOnMissing: true},
{from: `${component}/robots.txt`, to: 'robots.txt', noErrorOnMissing: true}
]
}),
Expand Down

0 comments on commit e0d6674

Please sign in to comment.