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

fix app title logic #371

Merged
merged 11 commits into from
Nov 25, 2024
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).
- Fixed Confirm and Delete buttons' behavior in confirmation modals ([#304](https://github.com/sovity/authority-portal/issues/304))
- Fixed final step not showing when registering a central component ([#305](https://github.com/sovity/authority-portal/issues/305))
- Fixed My Organization page not updated when switching between environments ([#255](https://github.com/sovity/authority-portal/issues/255))
- Fixed Website title not updating in some scenarios [#237](https://github.com/sovity/authority-portal/issues/237)

### Known issues

Expand Down Expand Up @@ -255,7 +256,7 @@ MDS 2.2 intermediate release

- All brokers can be undeployed including their databases.
- Keycloak
- Keycloak IAM must be updated to version `24.0.4`. Follow the [Keycloak upgrade guide](https://www.keycloak.org/docs/24.0.0/upgrading/) for more information.
- Keycloak IAM must be updated to version `24.0.4`. Follow the [Keycloak upgrade guide](https://www.keycloak.org/docs/24.0.5/upgrading/index.html) for more information.
- Portal Backend

- Following environment variables have been added and **must be configured** for each environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Subject, interval} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
import {Store} from '@ngxs/store';
Expand Down Expand Up @@ -60,7 +61,10 @@ export class AuthorityConnectorListPageComponent implements OnInit, OnDestroy {
private store: Store,
private globalStateUtils: GlobalStateUtils,
private slideOverService: SlideOverService,
) {}
private titleService: Title,
) {
this.titleService.setTitle('All Connectors');
}

ngOnInit() {
this.initializeHeaderBar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {Title} from '@angular/platform-browser';
import {Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
import {Store} from '@ngxs/store';
Expand Down Expand Up @@ -73,7 +74,10 @@ export class AuthorityOrganizationListPageComponent
public dialog: MatDialog,
private slideOverService: SlideOverService,
private globalStateUtils: GlobalStateUtils,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Participant Management');
}

ngOnInit() {
this.initializeHeaderBar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@angular/core';
import {FormControl} from '@angular/forms';
import {PageEvent} from '@angular/material/paginator';
import {Title} from '@angular/platform-browser';
import {ActivatedRoute, Router} from '@angular/router';
import {Subject, distinctUntilChanged, of, switchMap, tap} from 'rxjs';
import {finalize, map, take, takeUntil} from 'rxjs/operators';
Expand Down Expand Up @@ -66,6 +67,8 @@ export class CatalogPageComponent implements OnInit, OnDestroy {
// only tracked to prevent the component from resetting
expandedFilterId = '';

catalogType = this.route.snapshot.data.catalogType;

catalogSpelling = this.activeFeatureSet.usesBritishCatalogue()
? 'Catalogue'
: 'Catalog';
Expand All @@ -78,7 +81,10 @@ export class CatalogPageComponent implements OnInit, OnDestroy {
private globalStateUtils: GlobalStateUtils,
private deploymentEnvironmentUrlSyncService: DeploymentEnvironmentUrlSyncService,
private activeFeatureSet: ActiveFeatureSet,
) {}
private titleService: Title,
) {
this.setTitle();
}

ngOnInit(): void {
this.deploymentEnvironmentUrlSyncService.updateFromUrlOnce(
Expand Down Expand Up @@ -181,6 +187,7 @@ export class CatalogPageComponent implements OnInit, OnDestroy {
.pipe(
finalize(() => {
this.changeUrlToCatalogRoot();
this.setTitle();
}),
)
.subscribe();
Expand Down Expand Up @@ -270,4 +277,10 @@ export class CatalogPageComponent implements OnInit, OnDestroy {
headerActions: [],
};
}

private setTitle() {
this.catalogType === 'my-data-offers'
? this.titleService.setTitle('My Data Offers')
: this.titleService.setTitle(this.catalogSpelling);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
import {Component, HostBinding, OnDestroy, OnInit} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {Title} from '@angular/platform-browser';
import {Router} from '@angular/router';
import {Subject} from 'rxjs';
import {filter, takeUntil} from 'rxjs/operators';
Expand Down Expand Up @@ -54,7 +55,10 @@ export class CentralComponentListPageComponent implements OnInit, OnDestroy {
private globalStateUtils: GlobalStateUtils,
private router: Router,
private dialog: MatDialog,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Central Components');
}

ngOnInit() {
this.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {ActivatedRoute} from '@angular/router';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
Expand All @@ -32,7 +33,13 @@ export class ControlCenterOrganizationMemberDetailPageComponent
state: ControlCenterOrganizationMemberDetailPageState =
DEFAULT_CONTROL_CENTER_ORGANIZATION_MEMBER_DETAIL_PAGE_STATE;

constructor(private store: Store, private activatedRoute: ActivatedRoute) {}
constructor(
private store: Store,
private activatedRoute: ActivatedRoute,
private titleService: Title,
) {
this.titleService.setTitle('Member Details');
}

ngOnInit(): void {
this.startRefreshingOnRouteChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Router} from '@angular/router';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
Expand Down Expand Up @@ -39,7 +40,10 @@ export class ControlCenterOrganizationMembersPageComponent
private router: Router,
private breadcrumbService: BreadcrumbService,
private globalStateUtils: GlobalStateUtils,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Users and Roles');
}

ngOnInit(): void {
this.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
import {GlobalStateUtils} from 'src/app/core/global-state/global-state-utils';
Expand All @@ -34,7 +35,10 @@ export class ControlCenterOrganizationProfilePageComponent
constructor(
private store: Store,
private globalStateUtils: GlobalStateUtils,
) {}
private titleService: Title,
) {
this.titleService.setTitle('My Organization');
}

ngOnInit(): void {
this.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
import {GlobalStateUtils} from 'src/app/core/global-state/global-state-utils';
Expand All @@ -34,7 +35,10 @@ export class ControlCenterUserProfilePageComponent
constructor(
private store: Store,
private globalStateUtils: GlobalStateUtils,
) {}
private titleService: Title,
) {
this.titleService.setTitle('My Profile');
}

ngOnInit(): void {
this.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, Inject, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Subject} from 'rxjs';
import {map, switchMap, takeUntil} from 'rxjs/operators';
import {
Expand Down Expand Up @@ -43,7 +44,10 @@ export class DashboardPageComponent implements OnInit, OnDestroy {
@Inject(APP_CONFIG) public appConfig: AppConfig,
private globalStateUtils: GlobalStateUtils,
private apiService: ApiService,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Dashboard');
}

ngOnInit(): void {
this.fetchDashboardPageData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Subject} from 'rxjs';
import {Store} from '@ngxs/store';
import {GlobalState} from 'src/app/core/global-state/global-state';
Expand All @@ -25,7 +26,9 @@ export class LoadingPageComponent implements OnInit, OnDestroy {

private ngOnDestroy$ = new Subject();

constructor(private store: Store) {}
constructor(private store: Store, private titleService: Title) {
this.titleService.setTitle('Error');
}

ngOnInit() {
this.startListeningToGlobalState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
* sovity GmbH - initial implementation
*/
import {Component} from '@angular/core';
import {Title} from '@angular/platform-browser';

@Component({
selector: 'app-page-not-found',
templateUrl: './page-not-found-page.component.html',
})
export class PageNotFoundPageComponent {}
export class PageNotFoundPageComponent {
constructor(private titleService: Title) {
this.titleService.setTitle('404 - Page Not Found');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
* sovity GmbH - initial implementation
*/
import {Component, Inject} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {APP_CONFIG, AppConfig} from 'src/app/core/services/config/app-config';

@Component({
selector: 'app-unauthenticated-page',
templateUrl: './unauthenticated-page.component.html',
})
export class UnauthenticatedPageComponent {
constructor(@Inject(APP_CONFIG) public appConfig: AppConfig) {}
constructor(
@Inject(APP_CONFIG) public appConfig: AppConfig,
private titleService: Title,
) {
this.titleService.setTitle('Unauthenticated');
}

get loginUrl(): string {
const url = new URL(this.appConfig.loginUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Router} from '@angular/router';
import {Subject, interval} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
Expand Down Expand Up @@ -69,7 +70,10 @@ export class ParticipantOwnConnectorListPageComponent
private globalStateUtils: GlobalStateUtils,
private router: Router,
private slideOverService: SlideOverService,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Connectors');
}

ngOnInit() {
this.initializeHeaderBar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import {Component, Inject, OnInit, ViewChild} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {MatStepper} from '@angular/material/stepper';
import {Title} from '@angular/platform-browser';
import {Subject, take, takeUntil} from 'rxjs';
import {filter, map} from 'rxjs/operators';
import {Store} from '@ngxs/store';
Expand Down Expand Up @@ -87,7 +88,10 @@ export class OrganizationOnboardPageComponent implements OnInit {
@Inject(APP_CONFIG) public appConfig: AppConfig,
private store: Store,
private formBuilder: FormBuilder,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Onboarding');
}

ngOnInit(): void {
this.store.dispatch(Reset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, Inject} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {
APP_CONFIG,
AppConfig,
Expand All @@ -21,5 +22,10 @@ import {
templateUrl: './organization-pending-page.component.html',
})
export class OrganizationPendingPageComponent {
constructor(@Inject(APP_CONFIG) public appConfig: AppConfig) {}
constructor(
@Inject(APP_CONFIG) public appConfig: AppConfig,
private titleService: Title,
) {
this.titleService.setTitle('Pending');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
* sovity GmbH - initial implementation
*/
import {Component, Inject} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {APP_CONFIG, AppConfig} from 'src/app/core/services/config/app-config';

@Component({
selector: 'app-organization-rejected-page',
templateUrl: './organization-rejected-page.component.html',
})
export class OrganizationRejectedPageComponent {
constructor(@Inject(APP_CONFIG) public appConfig: AppConfig) {}
constructor(
@Inject(APP_CONFIG) public appConfig: AppConfig,
private titleService: Title,
) {
this.titleService.setTitle('Rejected');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* sovity GmbH - initial implementation
*/
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {Router} from '@angular/router';
import {Subject, interval} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
Expand Down Expand Up @@ -67,7 +68,10 @@ export class SpConnectorListPageComponent implements OnInit, OnDestroy {
private globalStateUtils: GlobalStateUtils,
private router: Router,
private slideOverService: SlideOverService,
) {}
private titleService: Title,
) {
this.titleService.setTitle('Provided Connectors');
}

ngOnInit() {
this.initializeHeaderBar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ export class BreadcrumbComponent implements OnDestroy {
.pipe(takeUntil(this.ngOnDestroy$))
.subscribe((breadcrumb) => {
this.breadcrumb = breadcrumb;
this.titleService.setTitle(
`${
this.activeFeatureSet.usesMdsId()
? 'MDS ' + (breadcrumb[breadcrumb.length - 1].label || 'Portal')
: breadcrumb[breadcrumb.length - 1].label || 'Portal'
}`,
);
});
}

Expand Down
Loading
Loading