]> source.dussan.org Git - archiva.git/commitdiff
Adding tooltip
authorMartin Stockhammer <martin_s@apache.org>
Thu, 5 Nov 2020 21:49:33 +0000 (22:49 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Thu, 5 Nov 2020 21:49:33 +0000 (22:49 +0100)
12 files changed:
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/angular.json
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/package-lock.json
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/package.json
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/sidemenu/sidemenu.component.html
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/manage-users/manage-users.component.html
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/users/manage-users-list/manage-users-list.component.html
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/users/manage-users-list/manage-users-list.component.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json

index 9ed3ad02b9b653ef76f069ae5da29ff1908aa439..f9631de492c69c760006b4919820849311657cb3 100644 (file)
@@ -37,6 +37,7 @@
             ],
             "scripts": [
               "node_modules/jquery/dist/jquery.js",
+              "node_modules/popper.js/dist/umd/popper.min.js",
               "node_modules/bootstrap/dist/js/bootstrap.js",
               "src/assets/params/js/index.js"
             ]
index d78c092276f33a68c282e4f16f5c568cd7eb054c..5ca161b53b3c52d90f138f81e803b0831ffbd8ac 100644 (file)
         "ts-pnp": "^1.1.6"
       }
     },
+    "popper.js": {
+      "version": "1.16.1",
+      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
+      "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ=="
+    },
     "portfinder": {
       "version": "1.0.28",
       "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
index c040d42c8101fd718e8cc37385ebaa957a032ca8..060bd9903ca9d044fd596d65804d78fb2e0a73be 100644 (file)
@@ -26,6 +26,7 @@
     "bootstrap": "^4.5.0",
     "flag-icon-css": "^3.5.0",
     "jquery": "^3.5.1",
+    "popper.js": "^1.16.1",
     "rxjs": "~6.6.3",
     "service": "^0.1.4",
     "tslib": "^2.0.0",
index 1f65d4bfcfcda218f34c4828eb076a4536a9659d..9f1249e7be6f5e87a80defde789202d9b0bb400e 100644 (file)
@@ -46,12 +46,12 @@ const routes: Routes = [
       { path: 'users', component: ManageUsersComponent,
         children: [
           {path: 'list', component: ManageUsersListComponent},
-          {path: 'add', component: ManageUsersAddComponent}
+          {path: 'add', component: ManageUsersAddComponent},
+          {path: '', redirectTo:'list', pathMatch:'full'}
         ]
       },
       { path: 'roles', component: ManageRolesComponent },
       { path: 'config', component: SecurityConfigurationComponent},
-      { path: '', component: ManageUsersComponent }
     ]
   },
   { path: 'contact', component: ContactComponent },
index 81f252395997a360471b2df5845b820d25c3401f..1fe0382d45c4e64f583e6682e6122023634f5e34 100644 (file)
@@ -41,6 +41,7 @@ import { ManageRolesComponent } from './modules/user/manage-roles/manage-roles.c
 import { SecurityConfigurationComponent } from './modules/user/security-configuration/security-configuration.component';
 import { ManageUsersListComponent } from './modules/user/users/manage-users-list/manage-users-list.component';
 import { ManageUsersAddComponent } from './modules/user/users/manage-users-add/manage-users-add.component';
+import { EnableTooltipDirective } from './directives/enable-tooltip.directive';
 
 
 @NgModule({
@@ -62,6 +63,7 @@ import { ManageUsersAddComponent } from './modules/user/users/manage-users-add/m
     SecurityConfigurationComponent,
     ManageUsersListComponent,
     ManageUsersAddComponent,
+    EnableTooltipDirective,
 
 
   ],
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.spec.ts
new file mode 100644 (file)
index 0000000..916f276
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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 { EnableTooltipDirective } from './enable-tooltip.directive';
+
+describe('EnableTooltipDirective', () => {
+  it('should create an instance', () => {
+    const directive = new EnableTooltipDirective();
+    expect(directive).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/directives/enable-tooltip.directive.ts
new file mode 100644 (file)
index 0000000..099001c
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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 {AfterViewChecked, AfterViewInit, Directive, ElementRef, OnInit} from '@angular/core';
+
+declare var jQuery:any;
+@Directive({
+  selector: '[appEnableTooltip]'
+})
+export class EnableTooltipDirective implements AfterViewInit {
+
+
+  constructor() { }
+
+  ngAfterViewInit(): void {
+     jQuery('[data-toggle="tooltip"]').tooltip({container: 'body', html: true});
+  }
+}
index e7ba3775b20c465147dc69cdb95c17bdb868f98a..c312cfc38ce73d839d8837f4b19aafbf91aa5228 100644 (file)
@@ -18,7 +18,7 @@
 -->
 <nav class="nav flex-column nav-pills " role="tablist" aria-orientation="vertical">
 
-    <div class="nav flex-column nav-pills" appNavSubgroup role="tablist" aria-orientation="vertical"
+    <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"
          [appViewPermission]="perms.menu.repo.section">
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">{{'sidemenu.repo.section'|translate}}</a>
 
            role="tab" aria-controls="v-pills-browse" aria-selected="false"
            [appViewPermission]="perms.menu.repo.upload">{{'sidemenu.repo.upload'|translate}}</a>
     </div>
-    <div class="nav flex-column nav-pills" appNavSubgroup aria-orientation="vertical" role="tablist"
+    <div class="nav flex-column nav-pills" aria-orientation="vertical" role="tablist"
          [appViewPermission]="perms.menu.admin.section">
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true"
            role="tab" aria-controls="v-pills-home" aria-selected="false">{{'sidemenu.admin.section'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-repos" routerLink="/admin/repositories" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-repos" routerLink="/admin/repositories" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.repositories'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-groups" routerLink="/admin/repositorygroups" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-groups" routerLink="/admin/repositorygroups" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.repositorygroups'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-proxy-conn" routerLink="/admin/proxy" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-proxy-conn" routerLink="/admin/proxy" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.proxy'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-network-proxy" routerLink="/admin/network" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-network-proxy" routerLink="/admin/network" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.network'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-repo-scan" routerLink="/admin/scanning" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-repo-scan" routerLink="/admin/scanning" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.scanning'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-runtime-configuration" routerLink="/admin/runtimeconfig" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-runtime-configuration" routerLink="/admin/runtimeconfig" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.config" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.runtimeconfig'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-status" routerLink="/admin/status" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-status" routerLink="/admin/status" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.status" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.status'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="admin-reports" routerLink="/admin/reports" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="admin-reports" routerLink="/admin/reports" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.reports" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.reports'|translate}}</a>
     </div>
-    <div class="nav flex-column nav-pills" appNavSubgroup [appViewPermission]="perms.menu.user.section">
+    <div class="nav flex-column nav-pills" [appViewPermission]="perms.menu.user.section">
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true" data-toggle="pill"
            role="tab" aria-controls="v-pills-home" aria-selected="false">{{'sidemenu.user.section'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="users-manage" routerLink="/user/users" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="users-manage" routerLink="/user/users" routerLinkActive="active" data-toggle="pill"
            role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.users'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="users-roles" routerLink="/user/roles" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="users-roles" routerLink="/user/roles" routerLinkActive="active" data-toggle="pill"
            role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.roles'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="users-configuration" routerLink="/user/config" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="users-configuration" routerLink="/user/config" routerLinkActive="active" data-toggle="pill"
            role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.config'|translate}}</a>
     </div>
-    <div class="nav flex-column nav-pills" appNavSubgroup>
+    <div class="nav flex-column nav-pills" >
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true" data-toggle="pill"
            role="tab" aria-controls="v-pills-home" aria-selected="false">{{'sidemenu.doc.section'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="doc-userdoc" routerLink="/doc/userguide" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="doc-userdoc" routerLink="/doc/userguide" routerLinkActive="active" data-toggle="pill"
            role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.doc.userguide'|translate}}</a>
-        <a class="nav-link my-0 py-0" id="doc-rest-api" routerLink="/user/restapi" data-toggle="pill"
+        <a class="nav-link my-0 py-0" id="doc-rest-api" routerLink="/user/restapi" routerLinkActive="active" data-toggle="pill"
            role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.doc.restapi'|translate}}</a>
     </div>
 </nav>
index 405ac1096bcaaa709027be5178f66fd184b8789a..c61718009a9ba42ac865129463cbd99e5061ba72 100644 (file)
 
 <ul class="nav nav-tabs">
     <li class="nav-item">
-        <a class="nav-link" routerLink="/user/users/list" href="#">{{'users.list.head' | translate}}</a>
+        <a class="nav-link" routerLink="/user/users/list" routerLinkActive="active" href="#">{{'users.list.head' | translate}}</a>
     </li>
     <li class="nav-item">
-        <a class="nav-link" routerLink="/user/users/add" href="#">{{'users.add.head' |translate }}</a>
+        <a class="nav-link" routerLink="/user/users/add" routerLinkActive="active" href="#">{{'users.add.head' |translate }}</a>
     </li>
 </ul>
 
index d04453d9978861db974a242e5178b60e17f4e2e3..2f367636aa6af281f08275fd6f768e8c155c3a85 100644 (file)
   ~ under the License.
   -->
 
-<p>manage-users-list works!</p>
+<form class="mt-3 mb-3">
+    <div class="form-row align-items-center">
+        <div class="col-lg-4 col-md-2 col-sm-1">
+            <label class="sr-only" for="searchQuery">{{'users.list.search' |translate}}</label>
+            <input type="text" class="form-control" id="searchQuery" placeholder="Search" data-toggle="tooltip"
+                   data-placement="top" title="SEARCHHH">
+        </div>
+        <div class="col-auto">
+            <button type="submit" class="btn btn-primary">{{'search.button'|translate}}</button>
+        </div>
+    </div>
+
+
+</form>
+
+<table class="table" appEnableTooltip>
+    <thead class="thead-light">
+    <tr>
+        <th scope="col">{{'users.list.table.head.id' | translate}}</th>
+        <th scope="col">{{'users.list.table.head.user_id' | translate}}</th>
+        <th scope="col">{{'users.list.table.head.fullName' | translate}}</th>
+        <th scope="col">{{'users.list.table.head.email' | translate}}</th>
+        <th scope="col"><span class="fas fa-check" data-toggle="tooltip" data-placement="top"
+                              [attr.data-original-title]="heads.validated" [attr.aria-label]="heads.validated"></span>
+        </th>
+        <th scope="col"><span class="fas fa-lock" data-toggle="tooltip" data-placement="top"
+                              [attr.data-original-title]="heads.locked" [attr.aria-label]="heads.locked"></span></th>
+        <th scope="col"><span class="fa fa-chevron-circle-right" data-toggle="tooltip" data-placement="top"
+                              [attr.data-original-title]="heads.pwchange" [attr.aria-label]="heads.pwchange"></span>
+        </th>
+        <th scope="col">{{'users.list.table.head.lastLogin' | translate}}</th>
+        <th scope="col">{{'users.list.table.head.created' | translate}}</th>
+    </tr>
+    </thead>
+    <tbody>
+    </tbody>
+</table>
index 43f922dbd4e838d1c45f9e4395c31c791a8f6308..22625a7b10b2150cb3bf538aa0ac7d703abf49e3 100644 (file)
  * under the License.
  */
 
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, Input } from '@angular/core';
+import {TranslateService} from "@ngx-translate/core";
+import {AppComponent} from "../../../../app.component";
+import {UserService} from "../../../../services/user.service";
 
 @Component({
   selector: 'app-manage-users-list',
@@ -25,10 +28,19 @@ import { Component, OnInit } from '@angular/core';
   styleUrls: ['./manage-users-list.component.scss']
 })
 export class ManageUsersListComponent implements OnInit {
+  @Input() heads: any;
 
-  constructor() { }
+  constructor(private translator: TranslateService, private userService : UserService) { }
 
   ngOnInit(): void {
+    this.heads={};
+    // We need to wait for the translator initialization and use the init key as step in.
+    this.translator.get('init').subscribe( () => {
+      // Only table headings for small columns that use icons
+      for (let suffix of ['validated', 'locked', 'pwchange']) {
+        this.heads[suffix] = this.translator.instant('users.list.table.head.' + suffix);
+      }
+    });
   }
 
 }
index 16ebb2d621aa8cc4f58397146b8aa0a31624cee4..d43bd2a92eced5f506bf7040d19219a3c2a63235 100644 (file)
@@ -1,4 +1,5 @@
 {
+  "init": "Initalize",
   "login": {
     "title": "Login to Archiva",
     "password": "Password",
   },
   "api" : {
     "rb.auth.invalid_credentials": "Invalid credentials given"
+  },
+  "users": {
+    "list": {
+      "head": "List Users",
+      "table":{
+        "head": {
+          "id": "ID",
+          "user_id": "User Identifier",
+          "email": "Email",
+          "fullName": "Name",
+          "validated": "User Validated",
+          "locked": "User Locked",
+          "pwchange": "Password Change Required",
+          "lastLogin": "Last Login",
+          "created": "Created"
+        }
+      }
+    },
+    "add": {
+      "head": "Add User"
+    }
+  },
+  "search": {
+    "button": "Search"
   }
 }
\ No newline at end of file