Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release #344

Merged
merged 28 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a0e1b7d
Adjust initial map zoom
daniel-va Oct 30, 2024
df60950
Feature: delete asset within edit form
TIL-EBP Oct 24, 2024
0459f26
Merge pull request #319 from swisstopo/feature/assets-293-delete-assets
TIL-EBP Nov 6, 2024
fdaeeed
Merge pull request #324 from swisstopo/feature/assets-296-maximaler-m…
daniel-va Nov 6, 2024
242868b
add disclaimer
TIL-EBP Oct 22, 2024
dbb9376
revert changes with ng deep
TIL-EBP Nov 6, 2024
78a6b4a
Feature 253: only allow workgroup change if asset has no references
TIL-EBP Oct 25, 2024
69c1781
Fix: Parent asset was not properly removed from DB
TIL-EBP Oct 25, 2024
4f1fe37
Refactor: slightly refactor the way the search is triggered within th…
TIL-EBP Oct 25, 2024
7327deb
remove console.log
TIL-EBP Oct 29, 2024
852ef66
pr fixes
TIL-EBP Nov 1, 2024
d3b50f8
move validation to service
TIL-EBP Nov 6, 2024
4590e79
Merge pull request #313 from swisstopo/feature/assets-70-disclaimer
TIL-EBP Nov 6, 2024
517eab7
Merge pull request #321 from swisstopo/feature/assets-253-verweise-in…
TIL-EBP Nov 7, 2024
b2df577
Add new favorite api
daniel-va Oct 28, 2024
5a396b4
Merge pull request #322 from swisstopo/feature/assets-19-favoriten
daniel-va Nov 7, 2024
7aa8669
Working State of routing, not robust
TIL-EBP Nov 11, 2024
1fe5635
Working State of routing
TIL-EBP Nov 11, 2024
20919b2
Cleanup
TIL-EBP Nov 12, 2024
7c8063f
Cleanup
TIL-EBP Nov 12, 2024
8661821
Merge branch 'develop' into hotfix/fix-routing
TIL-EBP Nov 12, 2024
e7f1fcb
Fixes after merge
TIL-EBP Nov 12, 2024
54cad86
Remove circular dependencies
TIL-EBP Nov 13, 2024
88c6dd2
Remove circular dependencies
TIL-EBP Nov 13, 2024
51e5ff0
Add config service
TIL-EBP Nov 13, 2024
ee18eea
Merge pull request #341 from swisstopo/hotfix/fix-routing
vej-ananas Nov 13, 2024
37fa37d
Update CHANGELOG.md
vej-ananas Nov 13, 2024
bcc0c58
Merge pull request #343 from swisstopo/chore/update-changelog
vej-ananas Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@

### Fixed

## v1.7.0

### Added

- Assets können nun als Favoriten markiert und wiedergefunden werden
- Ein disclaimer wird auf der Startseite angezeigt
- Assets können gelöscht werden

### Changed

- Verweise sind nur noch zu Assets in derselben Workgroups möglich
- Die Hintergrundkarte kann weiter herausgezoomt werden

### Fixed

## v1.6.0

### Added

### Changed

### Fixed

- Asset Detailansicht bleibt nicht mehr bestehen nach einem Suchreset

## v1.5.0

### Added
Expand Down
11 changes: 0 additions & 11 deletions apps/client-asset-sg/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
}
]
},
"int": {
"fileReplacements": [
{
"replace": "apps/client-asset-sg/src/environments/environment.ts",
"with": "apps/client-asset-sg/src/environments/environment.int.ts"
}
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand All @@ -68,9 +60,6 @@
"production": {
"buildTarget": "client-asset-sg:build:production"
},
"int": {
"buildTarget": "client-asset-sg:build:int"
},
"development": {
"buildTarget": "client-asset-sg:build:development"
}
Expand Down
14 changes: 12 additions & 2 deletions apps/client-asset-sg/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { HttpClient } from '@angular/common/http';
import { Component, inject } from '@angular/core';
import { AuthService, AuthState, ErrorService } from '@asset-sg/auth';
import { AppPortalService, appSharedStateActions, setCssCustomProperties } from '@asset-sg/client-shared';
import {
AppPortalService,
appSharedStateActions,
AuthService,
AuthState,
ConfigService,
ErrorService,
setCssCustomProperties,
} from '@asset-sg/client-shared';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Store } from '@ngrx/store';
import { WINDOW } from 'ngx-window-token';
import { debounceTime, fromEvent, startWith, switchMap } from 'rxjs';
import { assert } from 'tsafe';
import { environment } from '../environments/environment';
import { AppState } from './state/app-state';

const fullHdWidth = 1920;
Expand All @@ -25,8 +33,10 @@ export class AppComponent {
readonly errorService = inject(ErrorService);
readonly authService = inject(AuthService);
private readonly store = inject(Store<AppState>);
private readonly configService = inject(ConfigService);

constructor() {
this.configService.setHideDisclaimer(environment.hideDisclaimer);
this._httpClient
.get<Record<string, unknown>>('api/oauth-config/config')
.pipe(switchMap(async (config) => await this.authService.initialize(config)))
Expand Down
15 changes: 12 additions & 3 deletions apps/client-asset-sg/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,28 @@ import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import locale_deCH from '@angular/common/locales/de-CH';
import { inject, NgModule } from '@angular/core';
import { MatButton } from '@angular/material/button';
import { MatDialogActions, MatDialogContent } from '@angular/material/dialog';
import { MatDivider } from '@angular/material/divider';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatMenu, MatMenuTrigger } from '@angular/material/menu';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatTooltip } from '@angular/material/tooltip';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { AuthInterceptor, AuthModule, ErrorService } from '@asset-sg/auth';
import {
AdminOnlyDirective,
AlertModule,
AnchorComponent,
assetsPageMatcher,
AuthModule,
ButtonComponent,
CanCreateDirective,
CURRENT_LANG,
currentLangFactory,
ErrorService,
icons,
LanguageSelectorComponent,
TranslateTsLoader,
} from '@asset-sg/client-shared';
import { storeLogger } from '@asset-sg/core';
Expand All @@ -36,13 +40,13 @@ import { LetModule } from '@rx-angular/template/let';
import { PushModule } from '@rx-angular/template/push';

import { environment } from '../environments/environment';

import { adminGuard } from './app-guards';
import { AppComponent } from './app.component';
import { AppBarComponent, MenuBarComponent, NotFoundComponent, RedirectToLangComponent } from './components';
import { MenuBarItemComponent } from './components/menu-bar-item/menu-bar-item.component';
import { SplashScreenComponent } from './components/splash-screen/splash-screen.component';
import { appTranslations } from './i18n';
import { HttpInterceptor } from './services/http.interceptor';
import { AppSharedStateEffects } from './state';
import { appSharedStateReducer } from './state/app-shared.reducer';

Expand All @@ -61,6 +65,7 @@ registerLocaleData(locale_deCH, 'de-CH');
imports: [
CommonModule,
BrowserModule,
AuthModule,
BrowserAnimationsModule,
HttpClientModule,
RouterModule.forRoot([
Expand Down Expand Up @@ -120,11 +125,15 @@ registerLocaleData(locale_deCH, 'de-CH');
MatButton,
MatMenuTrigger,
MatMenu,
LanguageSelectorComponent,
MatDivider,
MatDialogContent,
MatDialogActions,
],
providers: [
provideSvgIcons(icons),
ErrorService,
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: HttpInterceptor, multi: true },
{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'fill', floatLabel: 'auto' } },
{ provide: CURRENT_LANG, useFactory: currentLangFactory },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,7 @@
<div class="spacer"></div>
<span class="version">{{ version }}</span>

<button mat-button type="button" class="language" [matMenuTriggerFor]="languageMenu" *rxLet="currentLang$; let lang">
{{ lang.lang }}

<svg-icon key="arrow-down" class="open" />
<svg-icon key="arrow-up" class="close" />
</button>
<mat-menu #languageMenu="matMenu" backdropClass="languages">
<ng-container *rxLet="languages$; let languages">
@for (language of languages; track language.lang) {
<a
asset-sg-reset
[routerLink]="language.params"
[queryParams]="language.queryParams"
[class.is-active]="language.isActive"
>
<span class="icon">
<svg-icon key="checkmark" />
</span>
<span class="name">
{{ language.lang }}
</span>
</a>
}
</ng-container>
</mat-menu>
<asset-sg-language-selector />

<ng-container *ngIf="(isAnonymous$ | async) === false">
<button mat-button type="button" class="profile" [matMenuTriggerFor]="profileMenu">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,91 +22,6 @@ a.logo {
color: #828e9a;
}

button.language {
text-transform: uppercase;
width: 69px;
height: 36px;
padding: 8px 12px;
border-radius: 4px;
color: #337083;
transition: 150ms ease-in;
transition-property: color, background-color;

& > ::ng-deep .mdc-button__label {
width: 100%;
height: 100%;

display: flex;
justify-content: space-between;
align-items: center;
padding: 0;
}

&:hover,
&[aria-expanded="true"] {
background-color: #adc6cd;
color: #2f4356;
}

svg-icon {
display: flex;
align-items: center;
width: 20px;
height: 20px;
}

svg-icon.close {
display: none;
}

&[aria-expanded="true"] svg-icon {
&.open {
display: none;
}
&.close {
display: flex;
}
}
}

::ng-deep .languages + * .mat-mdc-menu-panel {
text-transform: uppercase;
min-width: 85px;
max-width: 85px;

& > .mat-mdc-menu-content {
display: flex;
flex-direction: column;
padding: 0;
}

a {
color: #1c2834;
text-decoration: none;
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
transition: color 150ms ease-in;
}
a:hover {
background-color: #dfe4e9;
}

a > span.name {
flex-basis: 30%;
}

a > span.icon {
flex-grow: 1;
display: flex;
justify-content: flex-start;
}
a:not(.is-active) > span.icon {
visibility: hidden;
}
}

button.profile {
background-color: #295969;
color: white;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ import {
Output,
ViewChild,
} from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { AuthService } from '@asset-sg/auth';
import { appSharedStateActions, fromAppShared, supportedLangs } from '@asset-sg/client-shared';
import { isNotNull, isTruthy } from '@asset-sg/core';
import { Lang } from '@asset-sg/shared';
import { Router } from '@angular/router';
import { appSharedStateActions, AuthService, fromAppShared } from '@asset-sg/client-shared';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Store } from '@ngrx/store';
import { flow, pipe } from 'fp-ts/function';
import * as O from 'fp-ts/Option';
import queryString from 'query-string';
import { debounceTime, EMPTY, filter, map, Observable, startWith, Subject, switchMap } from 'rxjs';
import { EMPTY, filter, map, Observable, Subject, switchMap } from 'rxjs';
import { AppState } from '../../state/app-state';
import { Version } from './version';

Expand Down Expand Up @@ -49,40 +44,6 @@ export class AppBarComponent implements OnInit {

public readonly user$ = this.authService.getUserProfile$();

public readonly currentLang$ = this.router.events.pipe(
filter((e): e is NavigationEnd => e instanceof NavigationEnd),
map((e) => e.urlAfterRedirects),
startWith(this.router.url),
map(
flow(
(url) => O.of(url.match('^/(\\w\\w)(.*)$')),
O.filter(isTruthy),
O.bindTo('match'),
O.bind('lang', ({ match }) => pipe(Lang.decode(match[1]), O.fromEither)),
O.bind('parsed', ({ match }) => O.of(queryString.parseUrl(match[2]))),
O.map(({ parsed, lang }) => ({
lang,
path: parsed.url,
queryParams: parsed.query,
}))
)
),
map((it) => O.toNullable(it)),
filter(isNotNull)
);

public readonly languages$ = this.currentLang$.pipe(
debounceTime(0),
map((currentLang) =>
supportedLangs.map((lang) => ({
isActive: lang === currentLang.lang,
lang: lang.toUpperCase(),
params: [`/${lang}${currentLang.path}`],
queryParams: currentLang.queryParams,
}))
)
);

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

constructor(private readonly router: Router, private readonly httpClient: HttpClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@
asset-sg-menu-bar-item
icon="assets"
[link]="isActive ? null : [translateService.currentLang]"
[isActive]="isActive && ((isFiltersOpen$ | async) ?? false)"
[isActive]="isActive"
(click)="isActive ? toggleAssetDrawer() : null"
>
menuBar.filters
</li>
<li *ngIf="userExists$ | async" asset-sg-menu-bar-item icon="favourite" disabled>menuBar.favourites</li>
@if (userExists$ | async) {
<li
*rxLet="activeItem === 'favorites'; let isActive"
asset-sg-menu-bar-item
icon="favorite"
[link]="isActive ? null : [translateService.currentLang, 'favorites']"
[isActive]="isActive"
(click)="isActive ? toggleAssetDrawer() : null"
>
menuBar.favourites
</li>
}
<li
*canCreate="AssetEditPolicy"
asset-sg-menu-bar-item
Expand Down
Loading