Skip to content

Commit

Permalink
Merge pull request #198 from swisstopo/feature/asset-#120-versions-nu…
Browse files Browse the repository at this point in the history
…mmer

Feature/asset #120 versions nummer
  • Loading branch information
vej-ananas authored Jul 4, 2024
2 parents 6078e37 + 6ac5e14 commit 78ccd0b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions apps/client-asset-sg/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG APP_VERSION

FROM node:20-alpine as app-builder

ARG APP_VERSION
ENV APP_VERSION=${APP_VERSION}
ENV CYPRESS_INSTALL_BINARY=0

Expand All @@ -11,12 +10,13 @@ WORKDIR /app
COPY . .

RUN npm install
RUN npm pkg set version=${APP_VERSION}
RUN sed -i ''s/0.0.0-local/${APP_VERSION}/g'' apps/client-asset-sg/src/assets/version.json
RUN npx nx build client-asset-sg --configuration=production

# final image build
FROM nginx:mainline-alpine

ARG APP_VERSION
ENV APP_VERSION=${APP_VERSION}

WORKDIR /usr/share/nginx/html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
}

.language-links {
flex: 1 1 auto;
display: flex;
justify-content: flex-end;
margin-right: 24px;
a {
margin-left: 0.5rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ENTER } from '@angular/cdk/keycodes';
import { HttpClient } from '@angular/common/http';
import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { isTruthy } from '@asset-sg/core';
import { Lang } from '@asset-sg/shared';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { flow, pipe } from 'fp-ts/function';
import * as O from 'fp-ts/Option';
import packageInfo from 'package.json';
import queryString from 'query-string';
import { EMPTY, Observable, Subject, debounceTime, filter, map, startWith, switchMap } from 'rxjs';
import { Version } from './version';

@UntilDestroy()
@Component({
Expand All @@ -26,7 +27,7 @@ export class AppBarComponent implements OnInit {

public searchTextKeyDown$ = new Subject<KeyboardEvent>();

public version = packageInfo.version;
public version = '';

public _currentLang$ = this._router.events.pipe(
filter((e): e is NavigationEnd => e instanceof NavigationEnd),
Expand Down Expand Up @@ -75,7 +76,8 @@ export class AppBarComponent implements OnInit {

private _ngOnInit$ = new Subject<void>();

constructor(private _router: Router) {
constructor(private _router: Router, private readonly httpClient: HttpClient) {
this.httpClient.get<Version>('/assets/version.json').subscribe((v) => (this.version = v.version));
this.searchTextChanged = this.searchTextKeyDown$.pipe(
filter((ev) => ev.keyCode === ENTER),
map((ev) => {
Expand Down
6 changes: 6 additions & 0 deletions apps/client-asset-sg/src/app/components/app-bar/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Version {
tag: string;
build: string;
commit: string;
version: string;
}
3 changes: 2 additions & 1 deletion apps/client-asset-sg/src/assets/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"tag": "generated_by_build",
"build": "generated_by_build",
"commit": "generated_by_build"
"commit": "generated_by_build",
"version": "0.0.0-local"
}
5 changes: 1 addition & 4 deletions apps/client-asset-sg/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NumberInput } from '@angular/cdk/coercion';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { PushModule } from '@rx-angular/template/push';
import bezier from 'bezier-easing';
import * as bezier from 'bezier-easing';
import {
BehaviorSubject,
animationFrameScheduler,
Expand Down
5 changes: 1 addition & 4 deletions libs/client-shared/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
Expand Down

0 comments on commit 78ccd0b

Please sign in to comment.