Skip to content

Commit

Permalink
Merge branch 'main' into fix/trivy-action-rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
tmberthold authored Oct 9, 2024
2 parents 6d5d81a + 1c33375 commit 2acc577
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).
#### Patch

- Added documentation for roles and rights ([#334](https://github.com/sovity/authority-portal/issues/334))
- Fixed My Organization page not updated when switching between environments ([#255](https://github.com/sovity/authority-portal/issues/255))

### Known issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {Router} from '@angular/router';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
import {MemberInfo} from '@sovity.de/authority-portal-client';
import {GlobalStateUtils} from 'src/app/core/global-state/global-state-utils';
import {BreadcrumbService} from '../../../shared/common/portal-layout/breadcrumb/breadcrumb.service';
import {Reset} from './state/control-center-organization-members-page-action';
import {
Expand All @@ -37,11 +38,13 @@ export class ControlCenterOrganizationMembersPageComponent
private store: Store,
private router: Router,
private breadcrumbService: BreadcrumbService,
private globalStateUtils: GlobalStateUtils,
) {}

ngOnInit(): void {
this.refresh();
this.startListeningToState();
this.startRefreshingOnEnvChange();
}

refresh(): void {
Expand Down Expand Up @@ -69,6 +72,15 @@ export class ControlCenterOrganizationMembersPageComponent
this.router.navigate(['control-center/users-and-roles', user.userId]);
}

startRefreshingOnEnvChange() {
this.globalStateUtils.onDeploymentEnvironmentChangeSkipFirst({
ngOnDestroy$: this.ngOnDestroy$,
onChanged: () => {
this.refresh();
},
});
}

ngOnDestroy$ = new Subject();
ngOnDestroy(): void {
this.ngOnDestroy$.next(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
import {GlobalStateUtils} from 'src/app/core/global-state/global-state-utils';
import {Reset} from '../state/control-center-organization-profile-page-action';
import {
ControlCenterOrganizationProfilePageState,
Expand All @@ -30,11 +31,15 @@ export class ControlCenterOrganizationProfilePageComponent
state: ControlCenterOrganizationProfilePageState =
DEFAULT_CONTROL_CENTER_ORGANIZATION_PROFILE_PAGE_STATE;

constructor(private store: Store) {}
constructor(
private store: Store,
private globalStateUtils: GlobalStateUtils,
) {}

ngOnInit(): void {
this.refresh();
this.startListeningToState();
this.startRefreshingOnEnvChange();
}

refresh(): void {
Expand All @@ -52,6 +57,15 @@ export class ControlCenterOrganizationProfilePageComponent
});
}

startRefreshingOnEnvChange() {
this.globalStateUtils.onDeploymentEnvironmentChangeSkipFirst({
ngOnDestroy$: this.ngOnDestroy$,
onChanged: () => {
this.refresh();
},
});
}

ngOnDestroy$ = new Subject();
ngOnDestroy(): void {
this.ngOnDestroy$.next(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Subject, takeUntil} from 'rxjs';
import {Store} from '@ngxs/store';
import {GlobalStateUtils} from 'src/app/core/global-state/global-state-utils';
import {Reset} from '../state/control-center-user-profile-page-action';
import {
ControlCenterUserProfilePageState,
Expand All @@ -30,11 +31,15 @@ export class ControlCenterUserProfilePageComponent
state: ControlCenterUserProfilePageState =
DEFAULT_CONTROL_CENTER_USER_PROFILE_PAGE_STATE;

constructor(private store: Store) {}
constructor(
private store: Store,
private globalStateUtils: GlobalStateUtils,
) {}

ngOnInit(): void {
this.refresh();
this.startListeningToState();
this.startRefreshingOnEnvChange();
}

refresh(): void {
Expand All @@ -52,6 +57,15 @@ export class ControlCenterUserProfilePageComponent
});
}

startRefreshingOnEnvChange() {
this.globalStateUtils.onDeploymentEnvironmentChangeSkipFirst({
ngOnDestroy$: this.ngOnDestroy$,
onChanged: () => {
this.refresh();
},
});
}

ngOnDestroy$ = new Subject();
ngOnDestroy(): void {
this.ngOnDestroy$.next(null);
Expand Down

0 comments on commit 2acc577

Please sign in to comment.