mcgilman commented on code in PR #9221: URL: https://github.com/apache/nifi/pull/9221#discussion_r1739209722
########## nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/content-viewer/feature/content-viewer.component.ts: ########## @@ -0,0 +1,273 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Store } from '@ngrx/store'; +import { NiFiState } from '../../../state'; +import { loadContentViewerOptions, resetContentViewerOptions } from '../state/viewer-options/viewer-options.actions'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { selectBundledViewerOptions, selectViewerOptions } from '../state/viewer-options/viewer-options.selectors'; +import { ContentViewer, HEX_VIEWER_URL, SupportedMimeTypes } from '../state/viewer-options'; +import { isDefinedAndNotNull, SelectGroup, SelectOption, selectQueryParams } from '@nifi/shared'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { concatLatestFrom } from '@ngrx/operators'; +import { navigateToBundledContentViewer, resetContent, setRef } from '../state/content/content.actions'; +import { MatSelectChange } from '@angular/material/select'; +import { loadAbout } from '../../../state/about/about.actions'; +import { selectAbout } from '../../../state/about/about.selectors'; +import { filter, map, switchMap, take } from 'rxjs'; +import { navigateToExternalViewer } from '../state/external-viewer/external-viewer.actions'; + +@Component({ + selector: 'content-viewer', + templateUrl: './content-viewer.component.html', + styleUrls: ['./content-viewer.component.scss'] +}) +export class ContentViewerComponent implements OnInit, OnDestroy { + viewerForm: FormGroup; + viewAsOptions: SelectGroup[] = []; + + private supportedMimeTypeId = 0; + private supportedMimeTypeLookup: Map<number, SupportedMimeTypes> = new Map<number, SupportedMimeTypes>(); + private supportedMimeTypeContentViewerLookup: Map<number, ContentViewer> = new Map<number, ContentViewer>(); + private mimeTypeDisplayNameLookup: Map<number, string> = new Map<number, string>(); + private mimeTypeIdsSupportedByBundledUis: Set<number> = new Set<number>(); Review Comment: Sure makes sense but given how we check if a given viewer is embedded/bundled that likely makes sense to keep as a separate collection. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
