diff --git a/Dockerfile b/Dockerfile index 30b4676..fcec803 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,20 @@ -ARG PRODUCTION=false FROM node:lts as build +ARG PRODUCTION=false WORKDIR /usr/src/app RUN sh -c '[ -z "$http_proxy" ] || ( npm config set proxy $http_proxy; npm config set https-proxy $http_proxy )' COPY package.json package-lock.json ./ RUN npm install -COPY ./angular.json ./tsconfig.json ./tsconfig.app.json ./tsconfig.spec.json ./ +COPY ./angular.json ./tsconfig.json ./tsconfig.app.json ./tsconfig.spec.json ./messages*.xlf ./ COPY ./src ./src -RUN sh -c 'if [ "${PRODUCTION}" = true ]; then npm run build:prod; else npm run build; fi' +RUN if [ "${PRODUCTION}" = true ];then \ + npm run build:prod; \ + else \ + npm run build; \ + fi; FROM nginx:stable-alpine ENV NGINX_PORT=80 NGINX_DEPLOYMENT_CONTEXT=/ -COPY nginx.conf /etc/nginx/templates/nginx.conf.template +COPY nginx.conf /etc/nginx/nginx.conf +# fixed unshown font icons with mime.types file and ngnix.conf > location ~* .(js|css|ttf|ttc|otf|eot|woff|woff2)$ {... +COPY mime.types /etc/nginx/mime.types COPY --from=build /usr/src/app/dist/* /usr/share/nginx/html/ diff --git a/angular.json b/angular.json index eb70dda..5bb8ac1 100644 --- a/angular.json +++ b/angular.json @@ -9,6 +9,14 @@ "root": "", "sourceRoot": "src", "prefix": "app", + "i18n": { + "sourceLocale": "en-US", + "locales": { + "de": { + "translation": "./messages.de.xlf" + } + } + }, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", @@ -38,7 +46,7 @@ { "type": "initial", "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumError": "2mb" }, { "type": "anyComponentStyle", @@ -52,7 +60,8 @@ "with": "src/environments/environment.prod.ts" } ], - "outputHashing": "all" + "outputHashing": "all", + "localize": ["de"] }, "development": { "buildOptimizer": false, @@ -60,7 +69,8 @@ "vendorChunk": true, "extractLicenses": false, "sourceMap": true, - "namedChunks": true + "namedChunks": true, + "localize": ["de"] } }, "defaultConfiguration": "production" diff --git a/messages.de.xlf b/messages.de.xlf new file mode 100644 index 0000000..2777cd5 --- /dev/null +++ b/messages.de.xlf @@ -0,0 +1,128 @@ + + + + + + from: + von: + + projects/lens-core/src/lib/components/criteria-catalogue/components/date-condition-builder/date-condition-builder.component.html + 2 + + + + to: + bis: + + projects/lens-core/src/lib/components/criteria-catalogue/components/date-condition-builder/date-condition-builder.component.html + 12 + + + + equals: + gleich: + + projects/lens-core/src/lib/components/criteria-catalogue/components/number-condition-builder/number-condition-builder.component.html + 2 + + + + from: + von: + + projects/lens-core/src/lib/components/criteria-catalogue/components/number-condition-builder/number-condition-builder.component.html + 10 + + + + to: + bis: + + projects/lens-core/src/lib/components/criteria-catalogue/components/number-condition-builder/number-condition-builder.component.html + 19 + + + + Ask sites to negotiate + Daten bei Standorten anfragen + + projects/lens-core/src/lib/components/negotiate-button/negotiate-button.component.html + 10,11 + + indication for the user that clicking this button will start negotiation with multiple sites + + + Search has been modified! + Diagramme repräsentieren nicht mehr die aktuelle Suche! + + projects/lens-core/src/lib/components/negotiate-button/negotiate-button.component.html + 20 + + warn the user that search parameters are modified + + + Sites + Standorte + + projects/lens-core/src/lib/components/result-table/result-table.component.html + 8 + + column header for the name of a site + + + Patients + Patienten + + projects/lens-core/src/lib/components/result-table/result-table.component.html + 9 + + column header for the number of patients + + + Specimen + Bioproben + + projects/lens-core/src/lib/components/result-table/result-table.component.html + 10 + + column header for the number of specimen + + + [type your search criteria here] + [Hier Suchkriterien eingeben] + + projects/lens-core/src/lib/components/search-bar/search-bar.component.html + 5 + + placeholder for users search request + + + Click here to view your detailed query. + Hier klicken um die detaillierte Suchanfrage anzuzeigen + + projects/lens-core/src/lib/components/search-bar/search-bar.component.html + 39,37 + + hint the user that clicking this button will show the detailed query + + + Search + Suchen + + projects/lens-core/src/lib/components/search-bar/search-bar.component.html + 51 + + text for the search button + + + Clear + Löschen + + projects/lens-core/src/lib/components/search-bar/search-bar.component.html + 58 + + text for the clear button + + + + diff --git a/mime.types b/mime.types new file mode 100644 index 0000000..8abaf39 --- /dev/null +++ b/mime.types @@ -0,0 +1,100 @@ +types { + text/html html htm shtml; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/svg+xml svg svgz; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/webp webp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + + font/woff woff; + + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.oasis.opendocument.graphics odg; + application/vnd.oasis.opendocument.presentation odp; + application/vnd.oasis.opendocument.spreadsheet ods; + application/vnd.oasis.opendocument.text odt; + application/vnd.openxmlformats-officedocument.presentationml.presentation + pptx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + xlsx; + application/vnd.openxmlformats-officedocument.wordprocessingml.document + docx; + application/vnd.wap.wmlc wmlc; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; + + application/x-font-ttf ttc; + application/x-font-otf otf; + application/font-woff2 woff2; + font/ttf ttf; +} diff --git a/nginx.conf b/nginx.conf index c88e2c4..05435db 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,13 +1,68 @@ -server { +worker_processes 1; - listen ${NGINX_PORT}; - listen [::]:${NGINX_PORT}; - server_name ${NGINX_SERVER_NAME}; +events { + worker_connections 1024; +} - root /usr/share/nginx/html; - index index.html; - location ${NGINX_DEPLOYMENT_CONTEXT} { - try_files $uri $uri/ /index.html; - } +http { + server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html index.htm; + include /etc/nginx/mime.types; + + gzip on; + gzip_min_length 1000; + gzip_proxied expired no-cache no-store private auth; + gzip_types + text/css + text/plain + text/javascript + application/javascript + application/json + application/x-javascript + application/xml + application/xml+rss + application/xhtml+xml + application/x-font-ttf + application/x-font-opentype + application/vnd.ms-fontobject + image/svg+xml + image/x-icon + application/rss+xml + application/atom_xml; + + location /de/ { + alias /usr/share/nginx/html/de/; + try_files $uri$args $uri$args/ /de/index.html; + } + location /en/ { + alias /usr/share/nginx/html/en/; + try_files $uri$args $uri$args/ /en/index.html; + } + set $first_language $http_accept_language; + if ($http_accept_language ~* '^(.+?),') { + set $first_language $1; + } + + set $language_suffix 'de'; + if ($first_language ~* 'de') { + set $language_suffix 'de'; + } + if ($first_language ~* 'en') { + set $language_suffix 'en'; + } + + location / { + rewrite ^/$ http://localhost/$language_suffix/index.html permanent; + } + + location ~* .(js|css|ttf|ttc|otf|eot|woff|woff2)$ { + add_header access-control-allow-origin "*"; + expires max; + } + } } diff --git a/src/app/app.component.html b/src/app/app.component.html index c672a73..6257d01 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,5 +1,5 @@
- + Clinical Communication Platform (CCP)
@@ -9,6 +9,6 @@
Made with ♥ and samply/lens-core.
- +
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index f2efbf8..eacb10d 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -14,7 +14,7 @@ export const environment = { [ new Beam( 'broker.ccp-it.dktk.dkfz.de', - new URL("https://backend.data.dktk.dkfz.de/prod"), + new URL("https://backend.data.dktk.dkfz.de/prod/"), ["mannheim", "freiburg", "muenchen-tum"] ) ], diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f0fcbc9..8c73d14 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -18,7 +18,7 @@ export const environment = { [ new Beam( 'dev.broker.ccp-it.dktk.dkfz.de', - new URL("https://backend.demo.lens.samply.de/test"), + new URL("https://backend.demo.lens.samply.de/test/"), [ "berlin", "bonn", @@ -35,7 +35,7 @@ export const environment = { // NOTE: This is a temporary workaround while switching the sites to the production system new Beam( 'broker.ccp-it.dktk.dkfz.de', - new URL("https://backend.demo.lens.samply.de/prod"), + new URL("https://backend.demo.lens.samply.de/prod/"), [ "mannheim", "freiburg",