This is an automated email from the ASF dual-hosted git repository.
martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git
The following commit(s) were added to refs/heads/master by this push:
new 8866128 Additional angular code
8866128 is described below
commit 8866128e14ead1883897235c0dbb7f7925435bed
Author: Martin Stockhammer <[email protected]>
AuthorDate: Tue Dec 15 22:32:52 2020 +0100
Additional angular code
---
.../main/archiva-web/src/app/app-routing.module.ts | 3 +-
.../app/modules/security/role-routing.module.ts | 50 +++++++++++++++++++++
.../security/{user.module.ts => role.module.ts} | 33 +++++---------
.../manage-roles-edit.component.html} | 3 +-
.../manage-roles-edit.component.scss} | 1 -
.../manage-roles-edit.component.spec.ts} | 13 +++---
.../manage-roles-edit.component.ts} | 9 ++--
.../manage-roles-list.component.html | 51 ++++++++++++++++++++++
.../manage-roles-list.component.scss} | 1 -
.../manage-roles-list.component.spec.ts} | 13 +++---
.../manage-roles-list.component.ts | 49 +++++++++++++++++++++
.../manage-roles/manage-roles.component.html | 12 ++++-
.../manage-roles/manage-roles.component.scss | 1 -
.../manage-roles/manage-roles.component.spec.ts | 1 -
.../manage-roles/manage-roles.component.ts | 30 ++++++++++++-
.../security-configuration.component.html | 1 -
.../security-configuration.component.scss | 1 -
.../security-configuration.component.spec.ts | 1 -
.../security-configuration.component.ts | 1 -
.../app/modules/security/user-routing.module.ts | 3 +-
.../src/app/modules/security/user.module.ts | 7 ++-
.../manage-users-list.component.html | 2 +-
.../archiva-web/src/app/services/role.service.ts | 19 ++++++++
.../src/main/archiva-web/src/assets/i18n/en.json | 15 +++++++
24 files changed, 257 insertions(+), 63 deletions(-)
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
index be8b0a5..c07b1fe 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
@@ -27,7 +27,6 @@ import {LoginComponent} from
"./modules/shared/login/login.component";
import {SearchComponent} from './modules/repo/search/search.component';
import {BrowseComponent} from "./modules/repo/browse/browse.component";
import {UploadComponent} from "./modules/repo/upload/upload.component";
-import {ManageRolesComponent} from
"./modules/security/manage-roles/manage-roles.component";
import {RoutingGuardService as Guard} from "./services/routing-guard.service";
import {SecurityConfigurationComponent} from
"./modules/security/security-configuration/security-configuration.component";
@@ -51,7 +50,7 @@ const routes: Routes = [
path: 'security', component:
HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
children: [
{path: 'users', loadChildren: () =>
import('./modules/security/user.module').then(m => m.UserModule)},
- {path: 'roles', component: ManageRolesComponent},
+ {path: 'roles', loadChildren: () =>
import('./modules/security/role.module').then(m => m.RoleModule)},
{path: 'config', component: SecurityConfigurationComponent},
]
},
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role-routing.module.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role-routing.module.ts
new file mode 100644
index 0000000..6452e65
--- /dev/null
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role-routing.module.ts
@@ -0,0 +1,50 @@
+/*
+ * 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 {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {RoutingGuardService as Guard} from
"@app/services/routing-guard.service";
+import {ManageRolesComponent} from
"@app/modules/security/roles/manage-roles/manage-roles.component";
+import {ManageRolesListComponent} from
"@app/modules/security/roles/manage-roles-list/manage-roles-list.component";
+import {ManageRolesEditComponent} from
"@app/modules/security/roles/manage-roles-edit/manage-roles-edit.component";
+
+
+/**
+ * You can use Guard (RoutingGuardService) for permission checking. The
service needs data with one parameter 'perm',
+ * that gives the path of the uiPermission map of the user service.
+ */
+
+const routes: Routes = [
+ {
+ path: '', component: ManageRolesComponent, canActivate: [Guard],
+ data: {perm: 'menu.user.roles'},
+ children: [
+ {path: 'list', component: ManageRolesListComponent},
+ {path: 'edit/:roleid', component: ManageRolesEditComponent},
+ {path: '', redirectTo: 'list', pathMatch: 'full'}
+ ]
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [],
+ declarations: []
+})
+export class RoleRoutingModule {
+}
+
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role.module.ts
similarity index 51%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role.module.ts
index 8cef860..018ae2b 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role.module.ts
@@ -18,40 +18,31 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
-import {ManageUsersComponent} from
"./users/manage-users/manage-users.component";
-import {ManageUsersListComponent} from
"./users/manage-users-list/manage-users-list.component";
-import {ManageUsersAddComponent} from
"./users/manage-users-add/manage-users-add.component";
-import {ManageUsersEditComponent} from
"./users/manage-users-edit/manage-users-edit.component";
import {SharedModule} from "../shared/shared.module";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
-import {ManageUsersDeleteComponent} from
'./users/manage-users-delete/manage-users-delete.component';
-import {UserRoutingModule} from "./user-routing.module";
-import { ManageUsersRolesComponent } from
'./users/manage-users-roles/manage-users-roles.component';
-import {RoutingGuardService} from "../../services/routing-guard.service";
+import {ManageRolesComponent} from
"@app/modules/security/roles/manage-roles/manage-roles.component";
+import {RoleRoutingModule} from "@app/modules/security/role-routing.module";
+import { ManageRolesListComponent } from
'./roles/manage-roles-list/manage-roles-list.component';
+import { ManageRolesEditComponent } from
'./roles/manage-roles-edit/manage-roles-edit.component';
@NgModule({
declarations: [
- ManageUsersComponent,
- ManageUsersListComponent,
- ManageUsersAddComponent,
- ManageUsersEditComponent,
- ManageUsersDeleteComponent,
- ManageUsersRolesComponent
+ ManageRolesComponent,
+ ManageRolesListComponent,
+ ManageRolesEditComponent
],
exports: [
- ManageUsersComponent,
- ManageUsersListComponent,
- ManageUsersAddComponent,
- ManageUsersEditComponent
+ ManageRolesComponent,
+ ManageRolesListComponent
],
imports: [
CommonModule,
SharedModule,
+ RoleRoutingModule,
FormsModule,
- ReactiveFormsModule,
- UserRoutingModule
+ ReactiveFormsModule
]
})
-export class UserModule {
+export class RoleModule {
}
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.html
similarity index 96%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.html
index 1611de7..292d9d5 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.html
@@ -8,7 +8,6 @@
~ 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
@@ -17,4 +16,4 @@
~ under the License.
-->
-<p>manage-roles works!</p>
+<p>manage-roles-edit works!</p>
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.scss
similarity index 99%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.scss
index 573c9ef..343c3b1 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.scss
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.spec.ts
similarity index 77%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.spec.ts
index f3d2b64..4dd52a9 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.spec.ts
@@ -8,7 +8,6 @@
* 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
@@ -19,21 +18,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { ManageRolesComponent } from './manage-roles.component';
+import { ManageRolesEditComponent } from './manage-roles-edit.component';
-describe('ManageRolesComponent', () => {
- let component: ManageRolesComponent;
- let fixture: ComponentFixture<ManageRolesComponent>;
+describe('ManageRolesEditComponent', () => {
+ let component: ManageRolesEditComponent;
+ let fixture: ComponentFixture<ManageRolesEditComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [ ManageRolesComponent ]
+ declarations: [ ManageRolesEditComponent ]
})
.compileComponents();
});
beforeEach(() => {
- fixture = TestBed.createComponent(ManageRolesComponent);
+ fixture = TestBed.createComponent(ManageRolesEditComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.ts
similarity index 82%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.ts
index 5109a87..4a642cb 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-edit/manage-roles-edit.component.ts
@@ -8,7 +8,6 @@
* 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
@@ -20,11 +19,11 @@
import { Component, OnInit } from '@angular/core';
@Component({
- selector: 'app-manage-roles',
- templateUrl: './manage-roles.component.html',
- styleUrls: ['./manage-roles.component.scss']
+ selector: 'app-manage-roles-edit',
+ templateUrl: './manage-roles-edit.component.html',
+ styleUrls: ['./manage-roles-edit.component.scss']
})
-export class ManageRolesComponent implements OnInit {
+export class ManageRolesEditComponent implements OnInit {
constructor() { }
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.html
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.html
new file mode 100644
index 0000000..8b21e6c
--- /dev/null
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.html
@@ -0,0 +1,51 @@
+<!--
+ ~ 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.
+ -->
+
+<app-paginated-entities [service]="service" pageSize="10"
[(sortField)]="sortField" [(sortOrder)]="sortOrder"
+ #parent>
+
+ <table class="table table-striped table-bordered">
+ <thead class="thead-light">
+ <tr sorted [sortFieldEmitter]="parent.sortFieldChange"
[sortOrderEmitter]="parent.sortOrderChange"
+ [toggleObserver]="parent">
+ <app-th-sorted [fieldArray]="['id']"
contentText="roles.attributes.id"></app-th-sorted>
+ <app-th-sorted [fieldArray]="['name']"
contentText="roles.attributes.name" ></app-th-sorted>
+ <app-th-sorted [fieldArray]="['description']"
contentText="roles.attributes.description" ></app-th-sorted>
+ <app-th-sorted [fieldArray]="['template_instance']"
contentText="roles.attributes.template_instance" ></app-th-sorted>
+ <app-th-sorted [fieldArray]="['resource']"
contentText="roles.attributes.resource" ></app-th-sorted>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr *ngFor="let role of parent.items$ | async"
[ngClass]="(role.permanent)?'table-secondary':''">
+ <td><span data-toggle="tooltip" placement="left"
ngbTooltip="{{role.id}}">{{role.id}}</span></td>
+ <td>{{role.name}}</td>
+ <td>{{role.description}}</td>
+ <td><span class="far"
[attr.aria-valuetext]="role.template_instance"
+
[ngClass]="role.template_instance?'fa-check-circle':'fa-circle'"></span></td>
+ <td>{{role.resource}}</td>
+ <td>
+ <a [routerLink]="['..','edit', role.id]"
[queryParams]="{editmode:true}" [attr.title]="'roles.edit.head'
|translate"><span class="fas fa-edit"></span></a>
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+</app-paginated-entities>
+
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.scss
similarity index 99%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.scss
index 573c9ef..343c3b1 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.scss
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.spec.ts
similarity index 77%
copy from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
copy to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.spec.ts
index f3d2b64..05c448b 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.spec.ts
@@ -8,7 +8,6 @@
* 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
@@ -19,21 +18,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { ManageRolesComponent } from './manage-roles.component';
+import { ManageRolesListComponent } from './manage-roles-list.component';
-describe('ManageRolesComponent', () => {
- let component: ManageRolesComponent;
- let fixture: ComponentFixture<ManageRolesComponent>;
+describe('ManageRolesListComponent', () => {
+ let component: ManageRolesListComponent;
+ let fixture: ComponentFixture<ManageRolesListComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [ ManageRolesComponent ]
+ declarations: [ ManageRolesListComponent ]
})
.compileComponents();
});
beforeEach(() => {
- fixture = TestBed.createComponent(ManageRolesComponent);
+ fixture = TestBed.createComponent(ManageRolesListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.ts
new file mode 100644
index 0000000..e3998d7
--- /dev/null
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles-list/manage-roles-list.component.ts
@@ -0,0 +1,49 @@
+/*
+ * 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, OnInit} from '@angular/core';
+import {TranslateService} from "@ngx-translate/core";
+import {UserService} from "@app/services/user.service";
+import {EntityService} from "@app/model/entity-service";
+import {Role} from "@app/model/role";
+import {Observable} from "rxjs";
+import {PagedResult} from "@app/model/paged-result";
+import {UserInfo} from "@app/model/user-info";
+import {RoleService} from "@app/services/role.service";
+
+@Component({
+ selector: 'app-manage-roles-list',
+ templateUrl: './manage-roles-list.component.html',
+ styleUrls: ['./manage-roles-list.component.scss']
+})
+export class ManageRolesListComponent implements OnInit {
+
+ service: EntityService<Role>
+
+ constructor(private translator: TranslateService, private roleService :
RoleService) {
+ this.service = function (searchTerm: string, offset: number, limit:
number, orderBy: string[], order: string) : Observable<PagedResult<Role>> {
+ console.log("Retrieving data " + searchTerm + "," + offset + "," + limit
+ "," + orderBy + "," + order);
+ return roleService.query(searchTerm, offset, limit, orderBy, order);
+ }
+ }
+
+ ngOnInit(): void {
+ }
+
+
+}
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.html
similarity index 65%
rename from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
rename to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.html
index 1611de7..229d1e7 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.html
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.html
@@ -8,7 +8,6 @@
~ 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
@@ -17,4 +16,13 @@
~ under the License.
-->
-<p>manage-roles works!</p>
+<ul class="nav nav-tabs">
+ <li class="nav-item">
+ <a class="nav-link" routerLink="/security/roles/list"
routerLinkActive="active" href="#">{{'roles.list.head' | translate}}</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" routerLink="/security/roles/edit{{roleId$|async}}"
routerLinkActive="active" href="#">{{'roles.edit.head' |translate }}</a>
+ </li>
+</ul>
+
+<router-outlet></router-outlet>
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.scss
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.scss
similarity index 99%
rename from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.scss
rename to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.scss
index 573c9ef..343c3b1 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.scss
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.scss
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.spec.ts
similarity index 99%
rename from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
rename to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.spec.ts
index f3d2b64..d3bd373 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.spec.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.spec.ts
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.ts
similarity index 53%
rename from
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
rename to
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.ts
index 5109a87..f2a67dd 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/manage-roles/manage-roles.component.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/roles/manage-roles/manage-roles.component.ts
@@ -8,7 +8,6 @@
* 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
@@ -18,6 +17,9 @@
*/
import { Component, OnInit } from '@angular/core';
+import {merge, Observable} from "rxjs";
+import {map, tap} from "rxjs/operators";
+import {ActivatedRoute} from "@angular/router";
@Component({
selector: 'app-manage-roles',
@@ -26,9 +28,33 @@ import { Component, OnInit } from '@angular/core';
})
export class ManageRolesComponent implements OnInit {
- constructor() { }
+ roleId$:Observable<string>
+
+ constructor(private route : ActivatedRoute) { }
ngOnInit(): void {
}
+ onChildActivate(componentReference) {
+ // console.log("Activating "+componentReference+" -
"+JSON.stringify(componentReference,getCircularReplacer()))
+ if (componentReference.roleIdEvent!=null) {
+ let componentEmit : Observable<string> =
componentReference.roleIdEvent.pipe(
+ tap(userid=>console.log("Event "+componentReference.class+"
"+userid)),
+ map((userid: string) => this.getSubPath(userid)));
+ if (this.roleId$!=null) {
+ this.roleId$ = merge(this.roleId$, componentEmit)
+ } else {
+ this.roleId$ = componentEmit;
+ }
+ }
+ }
+
+ getSubPath(userid:string) {
+ if (userid!=null && userid.length>0) {
+ return '/' + userid;
+ } else {
+ return '';
+ }
+ }
+
}
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.html
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.html
index 8ace87c..ec4f0f9 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.html
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.html
@@ -8,7 +8,6 @@
~ 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
index 573c9ef..343c3b1 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.scss
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.spec.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.spec.ts
index d6ce62f..7fc64d5 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.spec.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.spec.ts
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.ts
index b97a1bc..303e840 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.ts
@@ -8,7 +8,6 @@
* 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user-routing.module.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user-routing.module.ts
index abb3a5e..c1cae57 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user-routing.module.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user-routing.module.ts
@@ -7,8 +7,7 @@
* "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
- *
+ * 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
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
index 8cef860..44fd8f1 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user.module.ts
@@ -26,8 +26,7 @@ import {SharedModule} from "../shared/shared.module";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {ManageUsersDeleteComponent} from
'./users/manage-users-delete/manage-users-delete.component';
import {UserRoutingModule} from "./user-routing.module";
-import { ManageUsersRolesComponent } from
'./users/manage-users-roles/manage-users-roles.component';
-import {RoutingGuardService} from "../../services/routing-guard.service";
+import {ManageUsersRolesComponent} from
'./users/manage-users-roles/manage-users-roles.component';
@NgModule({
@@ -48,9 +47,9 @@ import {RoutingGuardService} from
"../../services/routing-guard.service";
imports: [
CommonModule,
SharedModule,
+ UserRoutingModule,
FormsModule,
- ReactiveFormsModule,
- UserRoutingModule
+ ReactiveFormsModule
]
})
export class UserModule {
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/users/manage-users-list/manage-users-list.component.html
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/users/manage-users-list/manage-users-list.component.html
index 1c449ba..0731487 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/users/manage-users-list/manage-users-list.component.html
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/users/manage-users-list/manage-users-list.component.html
@@ -16,7 +16,7 @@
~ under the License.
-->
-<app-paginated-entities [service]="service" pageSize="5"
[(sortField)]="sortField" [(sortOrder)]="sortOrder"
+<app-paginated-entities [service]="service" pageSize="10"
[(sortField)]="sortField" [(sortOrder)]="sortOrder"
#parent>
<table class="table table-striped table-bordered">
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/role.service.ts
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/role.service.ts
index f92a4a7..79bee94 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/role.service.ts
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/role.service.ts
@@ -22,6 +22,8 @@ import {RoleTemplate} from "@app/model/role-template";
import { Observable } from 'rxjs';
import { Role } from '@app/model/role';
import {HttpResponse} from "@angular/common/http";
+import {PagedResult} from "@app/model/paged-result";
+import {UserInfo} from "@app/model/user-info";
@Injectable({
providedIn: 'root'
@@ -42,4 +44,21 @@ export class RoleService {
return this.rest.executeResponseCall<Role>("delete", "redback", "roles/" +
roleId + "/user/" + userId, null);
}
+ public query(searchTerm: string, offset: number = 0, limit: number = 10,
orderBy: string[] = ['id'], order: string = 'asc'):
Observable<PagedResult<Role>> {
+ console.log("getRoleList " + searchTerm + "," + offset + "," + limit + ","
+ orderBy + "," + order);
+ if (searchTerm == null) {
+ searchTerm = ""
+ }
+ if (orderBy == null || orderBy.length == 0) {
+ orderBy = ['id'];
+ }
+ return this.rest.executeRestCall<PagedResult<Role>>("get", "redback",
"roles", {
+ 'q': searchTerm,
+ 'offset': offset,
+ 'limit': limit,
+ 'orderBy': orderBy,
+ 'order': order
+ });
+ }
+
}
diff --git
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json
index f12c6f2..6c39c16 100644
---
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json
+++
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json
@@ -127,6 +127,21 @@
}
}
},
+ "roles": {
+ "list": {
+ "head": "Roles List"
+ },
+ "edit": {
+ "head": "Edit/View Role"
+ },
+ "attributes": {
+ "id": "Identifier",
+ "name": "Name",
+ "description": "Description",
+ "template_instance": "Template Instance"
+ }
+ },
+
"search": {
"button": "Search",
"label": "Enter your search term",