Skip to content

Commit

Permalink
added projects page
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackerakiUA committed Jan 28, 2025
1 parent ed08f5f commit 22fdc6a
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 22 deletions.
81 changes: 62 additions & 19 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ const routes: Routes = [
component: UserComponent,
children: [
/* user */
{
path: 'mineprojects',
canActivate: [MetaGuard],
data: {
meta: {
title: 'Projects'
}
},
loadChildren: () =>
import('./pages/user/projects/projects.module').then(
(m) => m.ProjectsModule
)
},
{
path: 'modules',
canActivate: [MetaGuard],
Expand All @@ -69,8 +82,11 @@ const routes: Routes = [
title: 'Modules'
}
},
loadChildren: () => import('./modules/taskmodule/pages/modules/modules.module').then(m => m.ModulesModule)
},
loadChildren: () =>
import(
'./modules/taskmodule/pages/modules/modules.module'
).then((m) => m.ModulesModule)
},
{
path: 'task',
canActivate: [MetaGuard],
Expand All @@ -79,8 +95,11 @@ const routes: Routes = [
title: 'Task'
}
},
loadChildren: () => import('./pages/user/task/task.module').then(m => m.TaskModule)
},
loadChildren: () =>
import('./pages/user/task/task.module').then(
(m) => m.TaskModule
)
},
{
path: 'elements',
canActivate: [MetaGuard],
Expand All @@ -89,8 +108,11 @@ const routes: Routes = [
title: 'Elements'
}
},
loadChildren: () => import('./modules/taskelement/pages/elements/elements.module').then(m => m.ElementsModule)
},
loadChildren: () =>
import(
'./modules/taskelement/pages/elements/elements.module'
).then((m) => m.ElementsModule)
},
{
path: 'pages',
canActivate: [MetaGuard],
Expand All @@ -99,8 +121,11 @@ const routes: Routes = [
title: 'Pages'
}
},
loadChildren: () => import('./modules/taskpage/pages/pages/pages.module').then(m => m.PagesModule)
},
loadChildren: () =>
import('./modules/taskpage/pages/pages/pages.module').then(
(m) => m.PagesModule
)
},
{
path: 'tags',
canActivate: [MetaGuard],
Expand All @@ -109,8 +134,11 @@ const routes: Routes = [
title: 'Tags'
}
},
loadChildren: () => import('./modules/tasktag/pages/tags/tags.module').then(m => m.TagsModule)
},
loadChildren: () =>
import('./modules/tasktag/pages/tags/tags.module').then(
(m) => m.TagsModule
)
},
{
path: 'stories',
canActivate: [MetaGuard],
Expand All @@ -119,8 +147,11 @@ const routes: Routes = [
title: 'Stories'
}
},
loadChildren: () => import('./modules/taskstory/pages/stories/stories.module').then(m => m.StoriesModule)
},
loadChildren: () =>
import(
'./modules/taskstory/pages/stories/stories.module'
).then((m) => m.StoriesModule)
},
{
path: 'sprints',
canActivate: [MetaGuard],
Expand All @@ -129,8 +160,11 @@ const routes: Routes = [
title: 'Sprints'
}
},
loadChildren: () => import('./modules/tasksprint/pages/sprints/sprints.module').then(m => m.SprintsModule)
},
loadChildren: () =>
import(
'./modules/tasksprint/pages/sprints/sprints.module'
).then((m) => m.SprintsModule)
},
{
path: 'releases',
canActivate: [MetaGuard],
Expand All @@ -139,8 +173,11 @@ const routes: Routes = [
title: 'Releases'
}
},
loadChildren: () => import('./modules/taskrelease/pages/releases/releases.module').then(m => m.ReleasesModule)
},
loadChildren: () =>
import(
'./modules/taskrelease/pages/releases/releases.module'
).then((m) => m.ReleasesModule)
},
{
path: 'tasks',
canActivate: [MetaGuard],
Expand All @@ -149,8 +186,11 @@ const routes: Routes = [
title: 'Tasks'
}
},
loadChildren: () => import('./modules/task/pages/tasks/tasks.module').then(m => m.TasksModule)
},
loadChildren: () =>
import('./modules/task/pages/tasks/tasks.module').then(
(m) => m.TasksModule
)
},
{
path: 'projects',
canActivate: [MetaGuard],
Expand All @@ -159,7 +199,10 @@ const routes: Routes = [
title: 'Projects'
}
},
loadChildren: () => import('./modules/taskproject/pages/projects/projects.module').then(m => m.ProjectsModule)
loadChildren: () =>
import(
'./modules/taskproject/pages/projects/projects.module'
).then((m) => m.ProjectsModule)
},
{
path: 'profile',
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/theme/user/user.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<a
routerLinkActive="_activeLink"
(click)="showSidebar = false"
routerLink="/profile"
routerLink="/mineprojects"
class="nav__a"
>
<span class="material-icons">home</span>
<span class="material-icons">folder</span>
</a>
</li>
<li class="nav__li _burger" (click)="showSidebar = !showSidebar">
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/guest/sign/sign.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class SignComponent {

this.us.get();

this._router.navigateByUrl('/profile');
this._router.navigateByUrl('/mineprojects');
} else {
this._alert.error({
text: 'Something went wrong'
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/user/projects/project/project.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{project|json}}
Empty file.
12 changes: 12 additions & 0 deletions src/app/pages/user/projects/project/project.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, Input } from '@angular/core';
import { Taskproject } from 'src/app/modules/taskproject/interfaces/taskproject.interface';

@Component({
selector: 'app-project',
standalone: false,
templateUrl: './project.component.html',
styleUrl: './project.component.scss'
})
export class ProjectComponent {
@Input() project: Taskproject;
}
1 change: 1 addition & 0 deletions src/app/pages/user/projects/projects.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<app-project *ngFor="let project of projects" [project]="project"></app-project>
Empty file.
16 changes: 16 additions & 0 deletions src/app/pages/user/projects/projects.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Component } from '@angular/core';
import { Taskproject } from 'src/app/modules/taskproject/interfaces/taskproject.interface';
import { TaskprojectService } from 'src/app/modules/taskproject/services/taskproject.service';

@Component({
templateUrl: './projects.component.html',
styleUrls: ['./projects.component.scss'],
standalone: false
})
export class ProjectsComponent {
get projects(): Taskproject[] {
return this._taskprojectService.taskprojects;
}

constructor(private _taskprojectService: TaskprojectService) {}
}
18 changes: 18 additions & 0 deletions src/app/pages/user/projects/projects.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { CoreModule } from 'src/app/core/core.module';
import { ProjectsComponent } from './projects.component';
import { Routes, RouterModule } from '@angular/router';
import { ProjectComponent } from './project/project.component';

const routes: Routes = [
{
path: '',
component: ProjectsComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes), CoreModule],
declarations: [ProjectsComponent, ProjectComponent]
})
export class ProjectsModule {}

0 comments on commit 22fdc6a

Please sign in to comment.