Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: cleanup routes and unused components #1239

Merged
46 changes: 0 additions & 46 deletions apps/dsp-app/src/app/app-global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,15 @@ import { StringLiteral } from '@dasch-swiss/dsp-js';
import { MenuItem } from './main/declarations/menu-item';

export class AppGlobal {
// project navigation
public static projectNav: MenuItem[] = [
{
label: 'Project information',
shortLabel: 'Project',
route: RouteConstants.info,
icon: 'assignment',
},
{
label: 'Project members',
shortLabel: 'Members',
route: RouteConstants.collaboration,
icon: 'group',
},
{
label: 'Permission groups',
shortLabel: 'Groups',
route: RouteConstants.permissions,
icon: 'lock_open',
},
{
label: 'Data model',
shortLabel: 'Data model',
route: RouteConstants.ontologies,
icon: 'bubble_chart',
},
{
label: 'Lists',
shortLabel: 'Lists',
route: RouteConstants.lists,
icon: 'list',
},
];

// user navigation
public static userNav: MenuItem[] = [
{
label: 'Dashboard',
shortLabel: 'Dashboard',
route: RouteConstants.dashboardRelative,
icon: 'dashboard',
},
{
label: 'My Projects',
shortLabel: 'Projects',
route: RouteConstants.projectsRelative,
icon: 'assignment',
},
// label to reactivate when dsp-app will be used as a research platform again: -->
/* {
label: 'My Collections',
shortLabel: 'Collections',
route: '/collections',
icon: 'star'
}, */
{
label: 'My Account',
shortLabel: 'Account',
Expand Down
27 changes: 0 additions & 27 deletions apps/dsp-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HintComponent } from './main/action/hint/hint.component';
import { CookiePolicyComponent } from './main/cookie-policy/cookie-policy.component';
import { AuthGuard } from './main/guard/auth.guard';
import { HelpComponent } from './main/help/help.component';
Expand All @@ -15,7 +14,6 @@ import { ListInfoFormComponent } from './project/list/list-info-form/list-info-f
import { ListComponent } from './project/list/list.component';
import { OntologyFormComponent } from './project/ontology/ontology-form/ontology-form.component';
import { OntologyComponent } from './project/ontology/ontology.component';
import { PermissionComponent } from './project/permission/permission.component';
import { ProjectComponent } from './project/project.component';
import { ProjectsComponent } from './system/projects/projects.component';
// system
Expand Down Expand Up @@ -62,11 +60,6 @@ const routes: Routes = [
component: OntologyFormComponent,
canActivate: [AuthGuard],
},
{
path: RouteConstants.ontology,
component: HintComponent,
data: { topic: 'ontology' },
},
{
path: RouteConstants.dataModels,
component: DataModelsComponent,
Expand Down Expand Up @@ -104,11 +97,6 @@ const routes: Routes = [
component: ListInfoFormComponent,
canActivate: [AuthGuard],
},
{
path: RouteConstants.list,
component: HintComponent,
data: { topic: 'list' },
},
{
path: `${RouteConstants.list}/:${RouteConstants.listParameter}`,
component: ListComponent
Expand All @@ -127,10 +115,6 @@ const routes: Routes = [
path: RouteConstants.collaboration,
component: CollaborationComponent,
},
{
path: RouteConstants.permissions,
component: PermissionComponent,
},
],
},
{
Expand All @@ -148,12 +132,6 @@ const routes: Routes = [
},
],
},
/*
{
path: 'user/:name',
component: ProfileComponent
},
*/
{
path: RouteConstants.profile,
component: UserComponent,
Expand All @@ -169,11 +147,6 @@ const routes: Routes = [
component: UserComponent,
canActivate: [AuthGuard],
},
/* {
path: 'collections',
component: UserComponent,
canActivate: [AuthGuard]
}, */
{
path: RouteConstants.system,
component: SystemComponent,
Expand Down
10 changes: 0 additions & 10 deletions apps/dsp-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,15 @@ import { PropertyFormComponent } from './project/ontology/property-form/property
import { PropertyInfoComponent } from './project/ontology/property-info/property-info.component';
import { ResourceClassFormComponent } from './project/ontology/resource-class-form/resource-class-form.component';
import { ResourceClassInfoComponent } from './project/ontology/resource-class-info/resource-class-info.component';
import { AddGroupComponent } from './project/permission/add-group/add-group.component';
import { PermissionComponent } from './project/permission/permission.component';
import { ProjectFormComponent } from './project/project-form/project-form.component';
import { ProjectComponent } from './project/project.component';
import { AppErrorHandler } from '@dasch-swiss/vre/shared/app-error-handler';
import { GroupsListComponent } from './system/groups/groups-list/groups-list.component';
import { GroupsComponent } from './system/groups/groups.component';
import { ProjectsListComponent } from './system/projects/projects-list/projects-list.component';
import { ProjectsComponent } from './system/projects/projects.component';
import { SystemComponent } from './system/system.component';
import { UsersListComponent } from './system/users/users-list/users-list.component';
import { UsersComponent } from './system/users/users.component';
import { AccountComponent } from './user/account/account.component';
import { CollectionListComponent } from './user/collection-list/collection-list.component';
import { MembershipComponent } from './user/membership/membership.component';
import { ProfileComponent } from './user/profile/profile.component';
import { PasswordFormComponent } from './user/user-form/password-form/password-form.component';
Expand Down Expand Up @@ -175,7 +170,6 @@ export function httpLoaderFactory(httpClient: HttpClient) {
@NgModule({
declarations: [
AccountComponent,
AddGroupComponent,
AddRegionFormComponent,
AddUserComponent,
AddValueComponent,
Expand All @@ -188,7 +182,6 @@ export function httpLoaderFactory(httpClient: HttpClient) {
DescriptionComponent,
BooleanValueComponent,
CollaborationComponent,
CollectionListComponent,
ColorPickerComponent,
ColorValueComponent,
CommentFormComponent,
Expand All @@ -215,8 +208,6 @@ export function httpLoaderFactory(httpClient: HttpClient) {
FulltextSearchComponent,
GeonameValueComponent,
GridComponent,
GroupsComponent,
GroupsListComponent,
HeaderComponent,
HelpComponent,
IntermediateComponent,
Expand All @@ -239,7 +230,6 @@ export function httpLoaderFactory(httpClient: HttpClient) {
OntologyComponent,
OntologyFormComponent,
PasswordFormComponent,
PermissionComponent,
PermissionInfoComponent,
ProfileComponent,
ProjectComponent,
Expand Down
35 changes: 4 additions & 31 deletions apps/dsp-app/src/app/main/action/hint/hint.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

export type HintTopic = 'search';

@Component({
selector: 'app-hint',
templateUrl: './hint.component.html',
styleUrls: ['./hint.component.scss'],
})
export class HintComponent implements OnInit {
@Input() topic: string;
@Input() topic: HintTopic;

content: string;

Expand All @@ -16,13 +18,6 @@ export class HintComponent implements OnInit {
constructor(private _route: ActivatedRoute) {}

ngOnInit(): void {
if (!this.topic) {
// but status is defined in app.routing
this._route.data.subscribe((data) => {
this.topic = data.topic;
});
}

this.content = this._getHint(this.topic);
}

Expand All @@ -33,7 +28,7 @@ export class HintComponent implements OnInit {
*
* todo: the hint should be written in markdown in different languages. Maybe stored in docs.
*/
private _getHint(topic: string): string {
private _getHint(topic: HintTopic): string {
switch (topic) {
case 'search':
this.documentation =
Expand All @@ -51,28 +46,6 @@ export class HintComponent implements OnInit {
</li>
</ul>`;
break;
case 'ontology':
this.documentation =
'https://docs.dasch.swiss/latest/DSP-APP/user-guide/project/#data-model';
return `<p>Data Model</p>
<p>
The definition of the data model (ontology) is the most important step.
The data model is indispensable for structuring your data. Our platform
provides a tool for an easy creation of one or more project data models.
First, you have to know which data and sources you want to work with.
The data model can be flexible and customizable.
</p>`;
break;
case 'list':
this.documentation =
'https://docs.dasch.swiss/latest/DSP-APP/user-guide/project/#define-lists';
return `<p>List Data</p>
<p>
Lists are very useful if you want to use controlled vocabulary to describe something.
Typical examples are keywords.
</p>`;
break;

default:
return `There's no hint implemented for the topic <strong>${topic}<strong>.`;
}
Expand Down
Empty file.
Empty file.

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions apps/dsp-app/src/app/project/permission/permission.component.html

This file was deleted.

Empty file.