Skip to content

Commit 5ddd2f4

Browse files
committed
NIFI-13632: Further simplification of content viewer state.
1 parent 06da4a1 commit 5ddd2f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/content-viewer/feature/content-viewer.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { snackBarError } from '../../../state/error/error.actions';
3636
interface SupportedContentViewer {
3737
supportedMimeTypes: SupportedMimeTypes;
3838
contentViewer: ContentViewer;
39+
bundled: boolean;
3940
}
4041

4142
@Component({
@@ -53,7 +54,6 @@ export class ContentViewerComponent implements OnInit, OnDestroy {
5354
number,
5455
SupportedContentViewer
5556
>();
56-
private mimeTypeIdsSupportedByBundledUis: Set<number> = new Set<number>();
5757

5858
private defaultSupportedMimeTypeId: number | null = null;
5959

@@ -80,7 +80,6 @@ export class ContentViewerComponent implements OnInit, OnDestroy {
8080
)
8181
.subscribe(([externalViewerOptions, bundledViewerOptions]) => {
8282
this.supportedContentViewerLookup.clear();
83-
this.mimeTypeIdsSupportedByBundledUis.clear();
8483

8584
// maps a given content (by display name) to the supported mime type id
8685
// which can be used to look up the corresponding content viewer
@@ -98,7 +97,8 @@ export class ContentViewerComponent implements OnInit, OnDestroy {
9897

9998
this.supportedContentViewerLookup.set(supportedMimeTypeId, {
10099
supportedMimeTypes,
101-
contentViewer
100+
contentViewer,
101+
bundled: false
102102
});
103103
});
104104
});
@@ -117,10 +117,10 @@ export class ContentViewerComponent implements OnInit, OnDestroy {
117117
}
118118
supportedMimeTypeMapping.get(supportedMimeTypes.displayName)?.push(supportedMimeTypeId);
119119

120-
this.mimeTypeIdsSupportedByBundledUis.add(supportedMimeTypeId);
121120
this.supportedContentViewerLookup.set(supportedMimeTypeId, {
122121
supportedMimeTypes,
123-
contentViewer
122+
contentViewer,
123+
bundled: true
124124
});
125125
});
126126
});
@@ -277,7 +277,7 @@ export class ContentViewerComponent implements OnInit, OnDestroy {
277277

278278
this.viewerSelected = true;
279279

280-
if (this.mimeTypeIdsSupportedByBundledUis.has(value)) {
280+
if (supportedContentViewer.bundled) {
281281
this.store.dispatch(
282282
navigateToBundledContentViewer({
283283
route: viewer.uri

0 commit comments

Comments
 (0)