Skip to content

Commit

Permalink
Merge branch 'main' into clean-up-account-service
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn authored Jan 10, 2024
2 parents 7ca412a + 6c293b8 commit e64bd4d
Show file tree
Hide file tree
Showing 62 changed files with 13,061 additions and 240 deletions.
8 changes: 6 additions & 2 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ COPY package*.json ./

# If you are building your code for production
# RUN npm install --only=production
RUN npm install

RUN \
npm config list && \
npm config delete proxy && \
npm install --loglevel silly

# Bundle app source
COPY . .

RUN npm run build

FROM nginx
FROM nginx:1.24.0-bullseye

RUN \
apt-get update && \
Expand Down
85 changes: 82 additions & 3 deletions ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@
"newProjectRoot": "projects",
"projects": {
"ui": {
"i18n": {
"sourceLocale": { "code": "en", "baseHref": "en/../" },
"locales": {
"cs": {
"translation": "src/i18n/messages.cs.xlf",
"baseHref": "cs/../"
},
"es": {
"translation": "src/i18n/messages.es.xlf",
"baseHref": "es/../"
},
"fr": {
"translation": "src/i18n/messages.fr.xlf",
"baseHref": "fr/../"
},
"it": {
"translation": "src/i18n/messages.it.xlf",
"baseHref": "it/../"
},
"ja": {
"translation": "src/i18n/messages.ja.xlf",
"baseHref": "ja/../"
},
"ko": {
"translation": "src/i18n/messages.ko.xlf",
"baseHref": "ko/../"
},
"pt": {
"translation": "src/i18n/messages.pt.xlf",
"baseHref": "pt/../"
},
"ru": {
"translation": "src/i18n/messages.ru.xlf",
"baseHref": "ru/../"
},
"zh-CN": {
"translation": "src/i18n/messages.zh-CN.xlf",
"baseHref": "zh-CN/../"
},
"zh-TW": {
"translation": "src/i18n/messages.zh-TW.xlf",
"baseHref": "zh-TW/../"
}
}
},
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
Expand All @@ -17,13 +62,31 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"localize": [
"en",
"fr",
"es",
"cs",
"it",
"ja",
"ko",
"pt",
"ru",
"zh-CN",
"zh-TW"
],
"outputPath": "dist/",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets", "src/content/images"],
"assets": [
"src/favicon.ico",
"src/assets",
"src/content/images",
"src/content/css"
],
"styles": ["src/content/scss/global.scss"],
"scripts": []
},
Expand All @@ -50,6 +113,7 @@
"outputHashing": "all"
},
"development": {
"localize": ["en"],
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
Expand Down Expand Up @@ -77,9 +141,24 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"builder": "ng-extract-i18n-merge:ng-extract-i18n-merge",
"options": {
"browserTarget": "ui:build"
"includeContext": true,
"browserTarget": "ui:build",
"format": "xlf",
"outputPath": "src/i18n",
"targetFiles": [
"messages.cs.xlf",
"messages.es.xlf",
"messages.fr.xlf",
"messages.it.xlf",
"messages.ja.xlf",
"messages.ko.xlf",
"messages.pt.xlf",
"messages.ru.xlf",
"messages.zh-CN.xlf",
"messages.zh-TW.xlf"
]
}
},
"test": {
Expand Down
29 changes: 18 additions & 11 deletions ui/container-files/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ server {

#access_log /var/log/nginx/host.access.log main;

# Fallback to default language if no preference defined by browser
if ($accept_language ~ "^$") {
set $accept_language "en";
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
rewrite ^/ui/(.*) /$1 break;
try_files $uri $uri/ /index.html;
}

# JT. Uncomment the error_page directive below to use the orcid 404 error page in /404
#error_page 404 ../404;
location ~ ^/ui/(.*) {
# Redirect requests for `/ui/(.*)` to the Angular application in the preferred language of the browser
# For reference on multi language support see: https://angular.io/guide/i18n-common-deploy#configure-a-server
rewrite ^/ui/(.*)$ /$accept_language/$1 break;

# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# Configure a fallback route in the NGinX server to serve the index.html when requests arrive for `/ui/login`
# Requires static html content to have a `base-href=./` entry
try_files $uri $uri/ /$accept_language/index.html?$args;

# Or use the following line instead
# auto-index on;
}

}

}

23 changes: 20 additions & 3 deletions ui/container-files/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
Expand All @@ -27,5 +25,24 @@ http {

#gzip on;

# Browser preferred language detection (does NOT require AcceptLanguageModule)
# For reference on multi language support see: https://angular.io/guide/i18n-common-deploy#configure-a-server
map $http_accept_language $accept_language {
default en;
~*^cs cs;
~*^de de;
~*^es es;
~*^fr fr;
~*^it it;
~*^ja ja;
~*^ko ko;
~*^pt pt;
~*^ru ru;
~*^ui ui;
~*^zh-CN zh-CN;
~*^zh-TW zh-TW;
}

include /etc/nginx/conf.d/*.conf;
}

}
Loading

0 comments on commit e64bd4d

Please sign in to comment.