Skip to content

Commit

Permalink
feat: leagacy edit asset (part II)
Browse files Browse the repository at this point in the history
  • Loading branch information
illfixit committed Aug 5, 2024
1 parent 58dd027 commit a65b24c
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {BehaviorSubject, Subject} from 'rxjs';
import {filter, switchMap} from 'rxjs/operators';
import {OnAssetEditClickFn} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog-data';
Expand Down Expand Up @@ -30,7 +29,6 @@ export class AssetPageComponent implements OnInit, OnDestroy {
private assetDetailDialogDataService: AssetDetailDialogDataService,
private assetDetailDialogService: AssetDetailDialogService,
private assetEditDialogService: AssetEditDialogService,
private router: Router,
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -60,7 +58,7 @@ export class AssetPageComponent implements OnInit, OnDestroy {

onAssetClick(asset: UiAssetMapped) {
const onAssetEditClick: OnAssetEditClickFn = (asset, onAssetUpdated) => {
this.router.navigate(['/edit-asset', asset.assetId]);
this.onEdit(asset);
};

const buildDialogData = (asset: UiAssetMapped) =>
Expand All @@ -80,7 +78,16 @@ export class AssetPageComponent implements OnInit, OnDestroy {
.showCreateDialog(this.ngOnDestroy$)
.subscribe((result) => {
if (result?.refreshedList) {
// this.assetListUpdater$.next(result.refreshedList);
this.refresh();
}
});
}

onEdit(asset: UiAssetMapped) {
this.assetEditDialogService
.showEditDialog(asset, this.ngOnDestroy$)
.subscribe((result) => {
if (result?.refreshedList) {
this.refresh();
}
});
Expand Down

0 comments on commit a65b24c

Please sign in to comment.