Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-07 Thread via GitHub


scottyaslan merged PR #8354:
URL: https://github.com/apache/nifi/pull/8354


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-06 Thread via GitHub


mcgilman commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1930455729

   > Current Nifi has a tooltip on the "Keep Existing Paramter Contexts" option:
   
   Thank you for raising this one. We have a line item in NIFI-12400 for 
introducing info icons though out the application. There are some 
considerations for placement depending on the usage that we'll need to be 
established.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-06 Thread via GitHub


mcgilman commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1930452534

   > Should I be able to stop version control or change version?
   
   Not in this PR. This PR is focused on the Import use case. There are line 
items for the remaining version control use cases in NIFI-12400.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-06 Thread via GitHub


mcgilman commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1930450441

   > So I am not sure what the correct UX is here...
   
   I'll update this PR to render the form validation error to make the 
situation more clear. 


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-06 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1480315690


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/header/new-canvas-item/new-canvas-item.component.scss:
##
@@ -15,23 +15,24 @@
  * limitations under the License.
  */
 
-.icon {
-font-size: 32px;
+.new-canvas-item {

Review Comment:
   OK makes sense and LGTM.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-06 Thread via GitHub


mcgilman commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479984109


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/header/new-canvas-item/new-canvas-item.component.scss:
##
@@ -15,23 +15,24 @@
  * limitations under the License.
  */
 
-.icon {
-font-size: 32px;
+.new-canvas-item {

Review Comment:
   This aligned the style structure from the scss partial. Since 
`new-canvas-item` is the root element it should be functionally equivalent.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479118940


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/header/new-canvas-item/new-canvas-item.component.scss:
##
@@ -15,23 +15,24 @@
  * limitations under the License.
  */
 
-.icon {
-font-size: 32px;
+.new-canvas-item {

Review Comment:
   This is good because it contains the changes to the icon class here but I 
see there other areas that were depending on these styles. Maybe that was 
incorrect and this is more correct?



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479118940


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/header/new-canvas-item/new-canvas-item.component.scss:
##
@@ -15,23 +15,24 @@
  * limitations under the License.
  */
 
-.icon {
-font-size: 32px;
+.new-canvas-item {

Review Comment:
   This is good because it contains the changes to the icon class here but are 
there other areas that were depending on these styles for any `.icon`'s?



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479111499


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/flow/import-from-registry/import-from-registry.component.ts:
##
@@ -0,0 +1,337 @@
+/*
+ * 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, Inject, Input, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
+import { ImportFromRegistryDialogRequest } from '../../../../../state/flow';
+import { Store } from '@ngrx/store';
+import { CanvasState } from '../../../../../state';
+import {
+BucketEntity,
+isDefinedAndNotNull,
+RegistryClientEntity,
+SelectOption,
+TextTipInput,
+VersionedFlow,
+VersionedFlowEntity,
+VersionedFlowSnapshotMetadata,
+VersionedFlowSnapshotMetadataEntity
+} from '../../../../../../../state/shared';
+import { selectSaving } from '../../../../../state/flow/flow.selectors';
+import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgTemplateOutlet } from 
'@angular/common';
+import { ErrorBanner } from 
'../../../../../../../ui/common/error-banner/error-banner.component';
+import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { MatOptionModule } from '@angular/material/core';
+import { MatSelectModule } from '@angular/material/select';
+import { NifiSpinnerDirective } from 
'../../../../../../../ui/common/spinner/nifi-spinner.directive';
+import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators 
} from '@angular/forms';
+import { TextTip } from 
'../../../../../../../ui/common/tooltips/text-tip/text-tip.component';
+import { NifiTooltipDirective } from 
'../../../../../../../ui/common/tooltips/nifi-tooltip.directive';
+import { MatIconModule } from '@angular/material/icon';
+import { Observable, take } from 'rxjs';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatTableDataSource, MatTableModule } from '@angular/material/table';
+import { MatSortModule, Sort } from '@angular/material/sort';
+import { NiFiCommon } from '../../../../../../../service/nifi-common.service';
+import { selectTimeOffset } from 
'../../../../../../../state/flow-configuration/flow-configuration.selectors';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { Client } from '../../../../../../../service/client.service';
+import { importFromRegistry } from '../../../../../state/flow/flow.actions';
+
+@Component({
+selector: 'import-from-registry',
+standalone: true,
+imports: [
+AsyncPipe,
+ErrorBanner,
+MatButtonModule,
+MatDialogModule,
+MatFormFieldModule,
+MatInputModule,
+NgIf,
+NifiSpinnerDirective,
+ReactiveFormsModule,
+MatOptionModule,
+MatSelectModule,
+NgForOf,
+NifiTooltipDirective,
+MatIconModule,
+NgTemplateOutlet,
+JsonPipe,
+MatCheckboxModule,
+MatSortModule,
+MatTableModule
+],
+templateUrl: './import-from-registry.component.html',
+styleUrls: ['./import-from-registry.component.scss']
+})
+export class ImportFromRegistry implements OnInit {
+@Input() getBuckets!: (registryId: string) => Observable;
+@Input() getFlows!: (registryId: string, bucketId: string) => 
Observable;
+@Input() getFlowVersions!: (
+registryId: string,
+bucketId: string,
+flowId: string
+) => Observable;
+
+saving$ = this.store.select(selectSaving);
+timeOffset = 0;
+
+protected readonly TextTip = TextTip;
+
+importFromRegistryForm: FormGroup;
+registryClientOptions: SelectOption[] = [];
+bucketOptions: SelectOption[] = [];
+flowOptions: SelectOption[] = [];
+
+flowLookup: Map = new Map();
+selectedFlowDescription: string | undefined;
+
+sort: Sort = {
+active: 'version',
+direction: 'desc'
+};
+displayedColumns: string[] = 

Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479111499


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/flow/import-from-registry/import-from-registry.component.ts:
##
@@ -0,0 +1,337 @@
+/*
+ * 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, Inject, Input, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
+import { ImportFromRegistryDialogRequest } from '../../../../../state/flow';
+import { Store } from '@ngrx/store';
+import { CanvasState } from '../../../../../state';
+import {
+BucketEntity,
+isDefinedAndNotNull,
+RegistryClientEntity,
+SelectOption,
+TextTipInput,
+VersionedFlow,
+VersionedFlowEntity,
+VersionedFlowSnapshotMetadata,
+VersionedFlowSnapshotMetadataEntity
+} from '../../../../../../../state/shared';
+import { selectSaving } from '../../../../../state/flow/flow.selectors';
+import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgTemplateOutlet } from 
'@angular/common';
+import { ErrorBanner } from 
'../../../../../../../ui/common/error-banner/error-banner.component';
+import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { MatOptionModule } from '@angular/material/core';
+import { MatSelectModule } from '@angular/material/select';
+import { NifiSpinnerDirective } from 
'../../../../../../../ui/common/spinner/nifi-spinner.directive';
+import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators 
} from '@angular/forms';
+import { TextTip } from 
'../../../../../../../ui/common/tooltips/text-tip/text-tip.component';
+import { NifiTooltipDirective } from 
'../../../../../../../ui/common/tooltips/nifi-tooltip.directive';
+import { MatIconModule } from '@angular/material/icon';
+import { Observable, take } from 'rxjs';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatTableDataSource, MatTableModule } from '@angular/material/table';
+import { MatSortModule, Sort } from '@angular/material/sort';
+import { NiFiCommon } from '../../../../../../../service/nifi-common.service';
+import { selectTimeOffset } from 
'../../../../../../../state/flow-configuration/flow-configuration.selectors';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { Client } from '../../../../../../../service/client.service';
+import { importFromRegistry } from '../../../../../state/flow/flow.actions';
+
+@Component({
+selector: 'import-from-registry',
+standalone: true,
+imports: [
+AsyncPipe,
+ErrorBanner,
+MatButtonModule,
+MatDialogModule,
+MatFormFieldModule,
+MatInputModule,
+NgIf,
+NifiSpinnerDirective,
+ReactiveFormsModule,
+MatOptionModule,
+MatSelectModule,
+NgForOf,
+NifiTooltipDirective,
+MatIconModule,
+NgTemplateOutlet,
+JsonPipe,
+MatCheckboxModule,
+MatSortModule,
+MatTableModule
+],
+templateUrl: './import-from-registry.component.html',
+styleUrls: ['./import-from-registry.component.scss']
+})
+export class ImportFromRegistry implements OnInit {
+@Input() getBuckets!: (registryId: string) => Observable;
+@Input() getFlows!: (registryId: string, bucketId: string) => 
Observable;
+@Input() getFlowVersions!: (
+registryId: string,
+bucketId: string,
+flowId: string
+) => Observable;
+
+saving$ = this.store.select(selectSaving);
+timeOffset = 0;
+
+protected readonly TextTip = TextTip;
+
+importFromRegistryForm: FormGroup;
+registryClientOptions: SelectOption[] = [];
+bucketOptions: SelectOption[] = [];
+flowOptions: SelectOption[] = [];
+
+flowLookup: Map = new Map();
+selectedFlowDescription: string | undefined;
+
+sort: Sort = {
+active: 'version',
+direction: 'desc'
+};
+displayedColumns: string[] = 

Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479112991


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts:
##
@@ -587,6 +610,89 @@ export class FlowEffects {
 )
 );
 
+openImportFromRegistryDialog$ = createEffect(
+() =>
+this.actions$.pipe(
+ofType(FlowActions.openImportFromRegistryDialog),
+map((action) => action.request),
+tap((request) => {
+const someRegistries = request.registryClients.some(
+(registryClient: RegistryClientEntity) => 
registryClient.permissions.canRead
+);
+
+if (someRegistries) {
+const dialogReference = 
this.dialog.open(ImportFromRegistry, {
+data: request,
+panelClass: 'medium-dialog'
+});
+
+dialogReference.componentInstance.getBuckets = (
+registryId: string
+): Observable => {
+return 
this.registryService.getBuckets(registryId).pipe(
+take(1),
+map((response) => response.buckets)
+);
+};
+
+dialogReference.componentInstance.getFlows = (
+registryId: string,
+bucketId: string
+): Observable => {
+return this.registryService.getFlows(registryId, 
bucketId).pipe(
+take(1),
+map((response) => response.versionedFlows)
+);
+};
+
+dialogReference.componentInstance.getFlowVersions = (
+registryId: string,
+bucketId: string,
+flowId: string
+): Observable 
=> {
+return 
this.registryService.getFlowVersions(registryId, bucketId, flowId).pipe(
+take(1),
+map((response) => 
response.versionedFlowSnapshotMetadataSet)
+);
+};
+
+dialogReference.afterClosed().subscribe(() => {
+this.store.dispatch(FlowActions.setDragging({ 
dragging: false }));
+});
+} else {
+this.store.dispatch(
+showOkDialog({
+title: 'Import From Registry',
+message: 'No available Registries to import 
Flows from.'

Review Comment:
   ```suggestion
   message: 'In order to import flows from a 
Registry a Registry Client must be configured in Controller Settings.'
   ```



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts:
##
@@ -587,6 +610,89 @@ export class FlowEffects {
 )
 );
 
+openImportFromRegistryDialog$ = createEffect(
+() =>
+this.actions$.pipe(
+ofType(FlowActions.openImportFromRegistryDialog),
+map((action) => action.request),
+tap((request) => {
+const someRegistries = request.registryClients.some(
+(registryClient: RegistryClientEntity) => 
registryClient.permissions.canRead
+);
+
+if (someRegistries) {
+const dialogReference = 
this.dialog.open(ImportFromRegistry, {
+data: request,
+panelClass: 'medium-dialog'
+});
+
+dialogReference.componentInstance.getBuckets = (
+registryId: string
+): Observable => {
+return 
this.registryService.getBuckets(registryId).pipe(
+take(1),
+map((response) => response.buckets)
+);
+};
+
+dialogReference.componentInstance.getFlows = (
+registryId: string,
+bucketId: string
+): Observable => {
+return this.registryService.getFlows(registryId, 
bucketId).pipe(
+take(1),
+

Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479111499


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/flow/import-from-registry/import-from-registry.component.ts:
##
@@ -0,0 +1,337 @@
+/*
+ * 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, Inject, Input, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
+import { ImportFromRegistryDialogRequest } from '../../../../../state/flow';
+import { Store } from '@ngrx/store';
+import { CanvasState } from '../../../../../state';
+import {
+BucketEntity,
+isDefinedAndNotNull,
+RegistryClientEntity,
+SelectOption,
+TextTipInput,
+VersionedFlow,
+VersionedFlowEntity,
+VersionedFlowSnapshotMetadata,
+VersionedFlowSnapshotMetadataEntity
+} from '../../../../../../../state/shared';
+import { selectSaving } from '../../../../../state/flow/flow.selectors';
+import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgTemplateOutlet } from 
'@angular/common';
+import { ErrorBanner } from 
'../../../../../../../ui/common/error-banner/error-banner.component';
+import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { MatOptionModule } from '@angular/material/core';
+import { MatSelectModule } from '@angular/material/select';
+import { NifiSpinnerDirective } from 
'../../../../../../../ui/common/spinner/nifi-spinner.directive';
+import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators 
} from '@angular/forms';
+import { TextTip } from 
'../../../../../../../ui/common/tooltips/text-tip/text-tip.component';
+import { NifiTooltipDirective } from 
'../../../../../../../ui/common/tooltips/nifi-tooltip.directive';
+import { MatIconModule } from '@angular/material/icon';
+import { Observable, take } from 'rxjs';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatTableDataSource, MatTableModule } from '@angular/material/table';
+import { MatSortModule, Sort } from '@angular/material/sort';
+import { NiFiCommon } from '../../../../../../../service/nifi-common.service';
+import { selectTimeOffset } from 
'../../../../../../../state/flow-configuration/flow-configuration.selectors';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { Client } from '../../../../../../../service/client.service';
+import { importFromRegistry } from '../../../../../state/flow/flow.actions';
+
+@Component({
+selector: 'import-from-registry',
+standalone: true,
+imports: [
+AsyncPipe,
+ErrorBanner,
+MatButtonModule,
+MatDialogModule,
+MatFormFieldModule,
+MatInputModule,
+NgIf,
+NifiSpinnerDirective,
+ReactiveFormsModule,
+MatOptionModule,
+MatSelectModule,
+NgForOf,
+NifiTooltipDirective,
+MatIconModule,
+NgTemplateOutlet,
+JsonPipe,
+MatCheckboxModule,
+MatSortModule,
+MatTableModule
+],
+templateUrl: './import-from-registry.component.html',
+styleUrls: ['./import-from-registry.component.scss']
+})
+export class ImportFromRegistry implements OnInit {
+@Input() getBuckets!: (registryId: string) => Observable;
+@Input() getFlows!: (registryId: string, bucketId: string) => 
Observable;
+@Input() getFlowVersions!: (
+registryId: string,
+bucketId: string,
+flowId: string
+) => Observable;
+
+saving$ = this.store.select(selectSaving);
+timeOffset = 0;
+
+protected readonly TextTip = TextTip;
+
+importFromRegistryForm: FormGroup;
+registryClientOptions: SelectOption[] = [];
+bucketOptions: SelectOption[] = [];
+flowOptions: SelectOption[] = [];
+
+flowLookup: Map = new Map();
+selectedFlowDescription: string | undefined;
+
+sort: Sort = {
+active: 'version',
+direction: 'desc'
+};
+displayedColumns: string[] = 

Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on code in PR #8354:
URL: https://github.com/apache/nifi/pull/8354#discussion_r1479111499


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/ui/canvas/items/flow/import-from-registry/import-from-registry.component.ts:
##
@@ -0,0 +1,337 @@
+/*
+ * 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, Inject, Input, OnInit } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
+import { ImportFromRegistryDialogRequest } from '../../../../../state/flow';
+import { Store } from '@ngrx/store';
+import { CanvasState } from '../../../../../state';
+import {
+BucketEntity,
+isDefinedAndNotNull,
+RegistryClientEntity,
+SelectOption,
+TextTipInput,
+VersionedFlow,
+VersionedFlowEntity,
+VersionedFlowSnapshotMetadata,
+VersionedFlowSnapshotMetadataEntity
+} from '../../../../../../../state/shared';
+import { selectSaving } from '../../../../../state/flow/flow.selectors';
+import { AsyncPipe, JsonPipe, NgForOf, NgIf, NgTemplateOutlet } from 
'@angular/common';
+import { ErrorBanner } from 
'../../../../../../../ui/common/error-banner/error-banner.component';
+import { MatButtonModule } from '@angular/material/button';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { MatOptionModule } from '@angular/material/core';
+import { MatSelectModule } from '@angular/material/select';
+import { NifiSpinnerDirective } from 
'../../../../../../../ui/common/spinner/nifi-spinner.directive';
+import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators 
} from '@angular/forms';
+import { TextTip } from 
'../../../../../../../ui/common/tooltips/text-tip/text-tip.component';
+import { NifiTooltipDirective } from 
'../../../../../../../ui/common/tooltips/nifi-tooltip.directive';
+import { MatIconModule } from '@angular/material/icon';
+import { Observable, take } from 'rxjs';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatTableDataSource, MatTableModule } from '@angular/material/table';
+import { MatSortModule, Sort } from '@angular/material/sort';
+import { NiFiCommon } from '../../../../../../../service/nifi-common.service';
+import { selectTimeOffset } from 
'../../../../../../../state/flow-configuration/flow-configuration.selectors';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { Client } from '../../../../../../../service/client.service';
+import { importFromRegistry } from '../../../../../state/flow/flow.actions';
+
+@Component({
+selector: 'import-from-registry',
+standalone: true,
+imports: [
+AsyncPipe,
+ErrorBanner,
+MatButtonModule,
+MatDialogModule,
+MatFormFieldModule,
+MatInputModule,
+NgIf,
+NifiSpinnerDirective,
+ReactiveFormsModule,
+MatOptionModule,
+MatSelectModule,
+NgForOf,
+NifiTooltipDirective,
+MatIconModule,
+NgTemplateOutlet,
+JsonPipe,
+MatCheckboxModule,
+MatSortModule,
+MatTableModule
+],
+templateUrl: './import-from-registry.component.html',
+styleUrls: ['./import-from-registry.component.scss']
+})
+export class ImportFromRegistry implements OnInit {
+@Input() getBuckets!: (registryId: string) => Observable;
+@Input() getFlows!: (registryId: string, bucketId: string) => 
Observable;
+@Input() getFlowVersions!: (
+registryId: string,
+bucketId: string,
+flowId: string
+) => Observable;
+
+saving$ = this.store.select(selectSaving);
+timeOffset = 0;
+
+protected readonly TextTip = TextTip;
+
+importFromRegistryForm: FormGroup;
+registryClientOptions: SelectOption[] = [];
+bucketOptions: SelectOption[] = [];
+flowOptions: SelectOption[] = [];
+
+flowLookup: Map = new Map();
+selectedFlowDescription: string | undefined;
+
+sort: Sort = {
+active: 'version',
+direction: 'desc'
+};
+displayedColumns: string[] = 

Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1928589081

   Current Nifi has a tooltip on the "Keep Existing Paramter Contexts" option:
   
   ![Screenshot 2024-02-05 at 8 03 31 
PM](https://github.com/apache/nifi/assets/6797571/70af5161-24e3-42d0-8df0-f0c9da666f16)
   


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1928587167

   Should I be able to stop version control or change version?
   
   Current NiFi:
   ![Screenshot 2024-02-05 at 8 01 07 
PM](https://github.com/apache/nifi/assets/6797571/eed7b390-74e7-45d1-9ab7-964e0c91da25)
   
   This PR:
   ![Screenshot 2024-02-05 at 8 00 42 
PM](https://github.com/apache/nifi/assets/6797571/284f3bd5-af26-42a5-9748-8c792d20a63e)
   
   


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1928583362

   I think there is a small issue when no flows have been published to the 
registry:
   
   ![Kapture 2024-02-05 at 19 54 
49](https://github.com/apache/nifi/assets/6797571/c0e4c7b9-49b2-43a0-873a-7c8ae0958c08)
   


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12734: Import from Registry [nifi]

2024-02-05 Thread via GitHub


scottyaslan commented on PR #8354:
URL: https://github.com/apache/nifi/pull/8354#issuecomment-1928546370

   Reviewing...


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] NIFI-12734: Import from Registry [nifi]

2024-02-02 Thread via GitHub


mcgilman opened a new pull request, #8354:
URL: https://github.com/apache/nifi/pull/8354

   NIFI-12734:
   - Import from Registry.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org