[ https://issues.apache.org/jira/browse/NIFIREG-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16153993#comment-16153993
]
ASF GitHub Bot commented on NIFIREG-13:
---------------------------------------
Github user mcgilman commented on a diff in the pull request:
https://github.com/apache/nifi-registry/pull/8#discussion_r137053368
--- Diff: nifi-registry-web-ui/src/main/webapp/components/administration/users/nf-registry-users-administration.js
---
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+var ngCore = require('@angular/core');
+var NfRegistryService = require('nifi-registry/services/nf-registry.service.js');
+var ngRouter = require('@angular/router');
+var nfRegistryAnimations = require('nifi-registry/nf-registry.animations.js');
+var fdsDialogsModule = require('@fluid-design-system/dialogs');
+
+/**
+ * NfRegistryUsersAdministration constructor.
+ *
+ * @param nfRegistryService The nf-registry.service module.
+ * @param ActivatedRoute The angular activated route module.
+ * @param Router The angular router module.
+ * @param FdsDialogService The FDS dialog service.
+ * @constructor
+ */
+function NfRegistryUsersAdministration(nfRegistryService, ActivatedRoute, Router, FdsDialogService)
{
+ this.route = ActivatedRoute;
+ this.nfRegistryService = nfRegistryService;
+ this.router = Router;
+ this.dialogService = FdsDialogService;
+};
+
+NfRegistryUsersAdministration.prototype = {
+ constructor: NfRegistryUsersAdministration,
+
+ /**
+ * Initialize the component.
+ */
+ ngOnInit: function () {
+ var self = this;
+ this.route.params
+ .switchMap(function (params) {
+ self.nfRegistryService.adminPerspective = 'users';
+ return self.nfRegistryService.getUsers(self.nfRegistryService.registry.id);
+ })
+ .subscribe(function (users) {
+ self.nfRegistryService.users = self.nfRegistryService.filteredUsers =
users;
+ self.nfRegistryService.filterUsers();
+ });
+ },
+
+ /**
+ * Destroy the component.
+ */
+ ngOnDestroy: function () {
+ this.nfRegistryService.adminPerspective = '';
+ this.nfRegistryService.users = this.nfRegistryService.filteredUsers = [];
+ },
+
+ /**
+ * Execute the given user action.
+ *
+ * @param action The action object.
+ * @param user The user object the `action` will act upon.
+ */
+ execute: function (action, user) {
+ var self = this;
+ if (user) {
+ user.checked = !user.checked;
+ }
+ switch (action.name.toLowerCase()) {
+ case 'delete':
+ this.dialogService.openConfirm({
+ title: 'Delete User',
+ message: 'User will be deleted.',
+ cancelButton: 'Cancel',
+ acceptButton: 'Delete',
+ acceptButtonColor: 'fds-warn'
+ }).afterClosed().subscribe(
+ function (accept) {
+ if (accept) {
+ self.nfRegistryService.deleteUser(user.id);
+ }
+ });
+ break;
+ case 'suspend':
+ this.dialogService.openConfirm({
+ title: 'Suspend User',
+ message: 'User permissions will be suspended.',
+ cancelButton: 'Cancel',
+ acceptButton: 'Confirm',
+ acceptButtonColor: 'fds-critical'
+ }).afterClosed().subscribe(
+ function (accept) {
+ if (accept) {
+ self.nfRegistryService.suspendUser(user.id);
+ }
+ });
+ break;
+ case 'add':
+ this.router.navigateByUrl('/nifi-registry/administration/' + this.nfRegistryService.registry.id
+ '/users(sidenav:user/add)');
+ break;
+ default:
+ this.router.navigateByUrl('/nifi-registry/administration/' + this.nfRegistryService.registry.id
+ '/users(' + action.type + ':user/' + action.name + '/' + user.id + ')');
--- End diff --
Does `navigateByUrl` automatically encode these URI components?
> Initial implementation for registry UI
> --------------------------------------
>
> Key: NIFIREG-13
> URL: https://issues.apache.org/jira/browse/NIFIREG-13
> Project: NiFi Registry
> Issue Type: Sub-task
> Reporter: Scott Aslan
> Assignee: Scott Aslan
>
> This ticket is to implement a production ready build for an SPA that will eventually
call the REST layer to request data. The SPA will:
> # Provide reuseable UI/UX components in the form (Fluid Design System NgModule)
> # Provide deep linking capabilities
> # Provide internationalization capability
> # Provide karma/Jasmine unit test harness (unit tests will be disabled be default)
> # Provide Protractor e2e test harness
> # Be theme-able (leveraging SASS and compiled at build time)
> # Use mock data instead of making actual REST calls
> # Be a rough draft of the UI/UX mocks provided in the parent ticket for this sub task.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
|