mtien-apache commented on a change in pull request #319:
URL: https://github.com/apache/nifi-registry/pull/319#discussion_r617195342



##########
File path: 
nifi-registry-core/nifi-registry-web-ui/src/main/webapp/components/explorer/grid-list/dialogs/import-new-flow/nf-registry-import-new-flow.js
##########
@@ -0,0 +1,182 @@
+/*
+ * 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 } from '@angular/core';
+
+import NfRegistryApi from 'services/nf-registry.api';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
+import { FdsSnackBarService } from '@nifi-fds/core';
+
+/**
+ * NfRegistryImportNewFlow constructor.
+ *
+ * @param nfRegistryApi         The api service.
+ * @param fdsSnackBarService    The FDS snack bar service module.
+ * @param matDialogRef          The angular material dialog ref.
+ * @param data                  The data passed into this component.
+ * @constructor
+ */
+function NfRegistryImportNewFlow(nfRegistryApi, fdsSnackBarService, 
matDialogRef, data) {
+    // Services
+    this.snackBarService = fdsSnackBarService;
+    this.nfRegistryApi = nfRegistryApi;
+    this.dialogRef = matDialogRef;
+    // local state
+    this.keepDialogOpen = false;
+    this.protocol = location.protocol;
+    this.buckets = data.buckets;
+    this.writableBuckets = [];
+    this.fileToUpload = null;
+    this.fileName = null;
+    this.name = '';
+    this.description = '';
+    this.selectedBucket = '';
+    this.hoverValidity = '';
+    this.extensions = 'application/json';
+    this.multiple = false;
+}
+
+NfRegistryImportNewFlow.prototype = {
+    constructor: NfRegistryImportNewFlow,
+
+    ngOnInit: function () {
+        // only show buckets the user can write
+        var self = this;
+        self.writableBuckets = self.filterWritableBuckets(self.buckets);
+    },
+
+    //TODO: get from the service instead

Review comment:
       My goal is to have this be like a utility method in Angular service 
(`nf-registry.service.js`). It would only show the buckets the user is 
authorized to write. I've been having issues injecting it into this 
import-new-flow component, so I'm in the middle of troubleshooting that.




-- 
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.

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


Reply via email to