Skip to content

Commit

Permalink
fix: resource is not reloaded after label update (#DEV-3607) (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmastnt committed May 16, 2024
1 parent 381d4f2 commit 3a8799d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 10 additions & 5 deletions apps/dsp-app/src/app/workspace/resource/resource.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
ReadResourceSequence,
ReadStillImageFileValue,
ReadTextFileValue,
ReadUser,
ResourceClassDefinitionWithPropertyDefinition,
SystemPropertyDefinition,
} from '@dasch-swiss/dsp-js';
Expand All @@ -30,7 +29,11 @@ import {
ResourceService,
} from '@dasch-swiss/vre/shared/app-common';
import { DspApiConnectionToken, DspDialogConfig, RouteConstants } from '@dasch-swiss/vre/shared/app-config';
import { ProjectService } from '@dasch-swiss/vre/shared/app-helper-services';
import {
Events as CommsEvents,
ComponentCommunicationEventService,
ProjectService,
} from '@dasch-swiss/vre/shared/app-helper-services';
import { NotificationService } from '@dasch-swiss/vre/shared/app-notification';
import {
EditResourceLabelDialogComponent,
Expand All @@ -43,8 +46,8 @@ import {
ResourceSelectors,
UserSelectors,
} from '@dasch-swiss/vre/shared/app-state';
import { Actions, ofActionSuccessful, Store } from '@ngxs/store';
import { combineLatest, Observable, Subject, Subscription } from 'rxjs';
import { Actions, Store, ofActionSuccessful } from '@ngxs/store';
import { Observable, Subject, Subscription, combineLatest } from 'rxjs';
import { filter, map, switchMap, take, takeUntil, tap } from 'rxjs/operators';
import { FileRepresentation, RepresentationConstants } from './representation/file-representation';
import { Region, StillImageComponent } from './representation/still-image/still-image.component';
Expand Down Expand Up @@ -134,7 +137,8 @@ export class ResourceComponent implements OnChanges, OnInit, OnDestroy {
private _cdr: ChangeDetectorRef,
private _store: Store,
private _actions$: Actions,
private _dialog: MatDialog
private _dialog: MatDialog,
private _componentCommsService: ComponentCommunicationEventService
) {
this._route.params.subscribe(params => {
const projectCode = params.project;
Expand All @@ -150,6 +154,7 @@ export class ResourceComponent implements OnChanges, OnInit, OnDestroy {
this._titleService.setTitle('Resource view');
});

this._componentCommsService.on(CommsEvents.resourceChanged, () => this._initResource(this.resourceIri));
this.valueOperationEventSubscriptions.push(
this._valueOperationEventService.on(Events.FileValueUpdated, (newFileValue: UpdatedFileEventValue) => {
if (newFileValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class EditResourceLabelDialogComponent {
})
)
.subscribe(() => {
window.location.reload();
this._dialogRef.close(true);
});
}
Expand Down

0 comments on commit 3a8799d

Please sign in to comment.