From 80fd9b5cf99eb15e3ecfdd28ebb12171fe44385c Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Wed, 4 Nov 2020 22:51:21 +0100 Subject: [PATCH] Improving navigation for angular app --- .../archiva-web/src/app/app-routing.module.ts | 13 +++- .../main/archiva-web/src/app/app.module.ts | 7 ++ .../modules/general/home/home.component.html | 2 +- .../general/sidemenu/sidemenu.component.html | 77 +++++++++---------- .../modules/repo/browse/browse.component.html | 19 +++++ .../modules/repo/browse/browse.component.scss | 18 +++++ .../repo/browse/browse.component.spec.ts | 43 +++++++++++ .../modules/repo/browse/browse.component.ts | 33 ++++++++ .../modules/repo/search/search.component.html | 19 +++++ .../modules/repo/search/search.component.scss | 18 +++++ .../repo/search/search.component.spec.ts | 43 +++++++++++ .../modules/repo/search/search.component.ts | 33 ++++++++ .../modules/repo/upload/upload.component.html | 19 +++++ .../modules/repo/upload/upload.component.scss | 18 +++++ .../repo/upload/upload.component.spec.ts | 43 +++++++++++ .../modules/repo/upload/upload.component.ts | 33 ++++++++ .../main/archiva-web/src/assets/i18n/en.json | 30 ++++++++ 17 files changed, 425 insertions(+), 43 deletions(-) create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.html create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.scss create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.spec.ts create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.ts create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.html create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.scss create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.spec.ts create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.ts create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.html create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.scss create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.spec.ts create mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.ts 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 f8c9eb033..cc81bdfb3 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 @@ -24,9 +24,20 @@ import { ContactComponent } from './modules/general/contact/contact.component'; import { HomeComponent } from './modules/general/home/home.component'; import { NotFoundComponent } from './modules/general/not-found/not-found.component'; import { LoginComponent } from "./modules/general/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"; const routes: Routes = [ - { path: '', component: HomeComponent, }, + { path: '', component: HomeComponent, + children: [ + {path:'repo/search', component: SearchComponent}, + {path:'repo/browse', component: BrowseComponent}, + {path:'repo/upload', component: UploadComponent}, + {path:'', redirectTo:'repo/search', pathMatch:'full'}, + {path:'**', component: NotFoundComponent} + + ]}, { path: 'contact', component: ContactComponent }, { path: 'about', component: AboutComponent }, { path: 'login', component: LoginComponent }, diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts index 8c7786ae2..9d9560a98 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts @@ -33,6 +33,10 @@ import {FormsModule, ReactiveFormsModule} from "@angular/forms"; import { LoginComponent } from './modules/general/login/login.component'; import { ViewPermissionDirective } from './directives/view-permission.directive'; import { NavSubgroupDirective } from './directives/nav-subgroup.directive'; +import { SearchComponent } from './modules/repo/search/search.component'; +import { BrowseComponent } from './modules/repo/browse/browse.component'; +import { UploadComponent } from './modules/repo/upload/upload.component'; + @NgModule({ declarations: [ @@ -45,6 +49,9 @@ import { NavSubgroupDirective } from './directives/nav-subgroup.directive'; LoginComponent, ViewPermissionDirective, NavSubgroupDirective, + SearchComponent, + BrowseComponent, + UploadComponent, ], imports: [ BrowserModule, diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/home/home.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/home/home.component.html index ce0a883cb..dfac255a5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/home/home.component.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/home/home.component.html @@ -21,6 +21,6 @@
- 2 of 2 +
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/sidemenu/sidemenu.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/sidemenu/sidemenu.component.html index d023167f9..e7ba3775b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/sidemenu/sidemenu.component.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/sidemenu/sidemenu.component.html @@ -20,60 +20,55 @@ diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.html new file mode 100644 index 000000000..197705273 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.html @@ -0,0 +1,19 @@ + + +

browse works!

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.scss b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.scss new file mode 100644 index 000000000..343c3b1c0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.scss @@ -0,0 +1,18 @@ +/*! + * 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. + */ + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.spec.ts new file mode 100644 index 000000000..cef77198f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.spec.ts @@ -0,0 +1,43 @@ +/* + * 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 { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BrowseComponent } from './browse.component'; + +describe('BrowseComponent', () => { + let component: BrowseComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BrowseComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BrowseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.ts new file mode 100644 index 000000000..9cd163d94 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/browse/browse.component.ts @@ -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 { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-browse', + templateUrl: './browse.component.html', + styleUrls: ['./browse.component.scss'] +}) +export class BrowseComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.html new file mode 100644 index 000000000..746a42a0d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.html @@ -0,0 +1,19 @@ + + +

Search Repositories

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.scss b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.scss new file mode 100644 index 000000000..343c3b1c0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.scss @@ -0,0 +1,18 @@ +/*! + * 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. + */ + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.spec.ts new file mode 100644 index 000000000..d7a770e5b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.spec.ts @@ -0,0 +1,43 @@ +/* + * 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 { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SearchComponent } from './search.component'; + +describe('SearchComponent', () => { + let component: SearchComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SearchComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.ts new file mode 100644 index 000000000..99dd75a83 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/search/search.component.ts @@ -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 { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-search', + templateUrl: './search.component.html', + styleUrls: ['./search.component.scss'] +}) +export class SearchComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.html new file mode 100644 index 000000000..d2799a0fc --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.html @@ -0,0 +1,19 @@ + + +

upload works!

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.scss b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.scss new file mode 100644 index 000000000..343c3b1c0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.scss @@ -0,0 +1,18 @@ +/*! + * 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. + */ + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.spec.ts new file mode 100644 index 000000000..ab8e0cbdd --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.spec.ts @@ -0,0 +1,43 @@ +/* + * 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 { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UploadComponent } from './upload.component'; + +describe('UploadComponent', () => { + let component: UploadComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ UploadComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(UploadComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.ts new file mode 100644 index 000000000..319f82a64 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/repo/upload/upload.component.ts @@ -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 { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-upload', + templateUrl: './upload.component.html', + styleUrls: ['./upload.component.scss'] +}) +export class UploadComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} 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 68494c40c..16ebb2d62 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 @@ -15,6 +15,36 @@ "about": "About", "contact": "Contact" }, + "sidemenu": { + "repo": { + "section": "Artifacts", + "search": "Search Artifacts", + "browse": "Browse Repositories", + "upload": "Upload Artifacts" + }, + "admin": { + "section": "Administration", + "repositories": "Repositories", + "repositorygroups": "Repository Groups", + "proxy": "Proxy", + "network": "Network", + "scanning": "Repository Scanning", + "runtimeconfig": "Runtime Configuration", + "status": "System Status", + "reports": "Reports" + }, + "user": { + "section": "User", + "users": "Manage Users", + "roles":"Manage Roles", + "config": "Security Configuration" + }, + "doc": { + "section": "Documentation", + "userguide": "User Guide", + "restapi": "REST API" + } + }, "api" : { "rb.auth.invalid_credentials": "Invalid credentials given" }