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: organization list not refreshing on environment change #266

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).
- Already registered connectors will be updated automatically, this process can take up to 24 hours
- Added a message when the CaaS request feature is not available
- Catalog: Removed dataspace filter when only one dataspace is known
- Organization list: Data offer and connector counts now show the correct numbers according to the active environment

### Known issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
SlideOverAction,
SlideOverConfig,
} from 'src/app/shared/common/slide-over/slide-over.model';
import {GlobalStateUtils} from '../../../core/global-state/global-state-utils';
import {AuthorityOrganizationDetailPageComponent} from '../../authority-organization-detail-page/authority-organization-detail-page/authority-organization-detail-page.component';
import {AuthorityInviteNewOrganizationComponent} from '../authority-invite-new-organization/authority-invite-new-organization.component';
import {
Expand Down Expand Up @@ -71,13 +72,15 @@ export class AuthorityOrganizationListPageComponent
private store: Store,
public dialog: MatDialog,
private slideOverService: SlideOverService,
private globalStateUtils: GlobalStateUtils,
) {}

ngOnInit() {
this.initializeHeaderBar();
this.initializeFilterBar();
this.refresh();
this.startListeningToState();
this.startRefreshingOnEnvChange();
}

initializeHeaderBar() {
Expand Down Expand Up @@ -128,6 +131,15 @@ export class AuthorityOrganizationListPageComponent
});
}

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

openDetailPage(organization: OrganizationOverviewEntryDto) {
this.slideOverConfig = {
childComponentInput: {
Expand Down
Loading