Commit 739935a3 authored by hasan khaddour's avatar hasan khaddour

add static pages

parent f15b49b8
...@@ -8,6 +8,7 @@ import { CustomerListComponent } from './customers/pages/customer-list/customer- ...@@ -8,6 +8,7 @@ import { CustomerListComponent } from './customers/pages/customer-list/customer-
import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.component'; import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.component';
import { ProjectFAQComponent } from './pages/project-faq/project-faq.component'; import { ProjectFAQComponent } from './pages/project-faq/project-faq.component';
import { PsmStartComponent } from './pages/psm-start/psm-start.component'; import { PsmStartComponent } from './pages/psm-start/psm-start.component';
import { AccessDeniedComponent } from './pages/access-denied/access-denied.component';
export const routes: Routes = [ export const routes: Routes = [
...@@ -33,6 +34,11 @@ export const routes: Routes = [ ...@@ -33,6 +34,11 @@ export const routes: Routes = [
path: 'Help', path: 'Help',
component: PsmStartComponent, component: PsmStartComponent,
},
{
path: 'forbiden',
component: AccessDeniedComponent,
}, },
{ {
path: '', path: '',
...@@ -64,14 +70,14 @@ export const routes: Routes = [ ...@@ -64,14 +70,14 @@ export const routes: Routes = [
, { , {
path: 'types', path: 'types',
loadChildren: () => import('./projects-types/projects-types.module').then(m => m.ProjectsTypesModule) loadChildren: () => import('./projects-types/projects-types.module').then(m => m.ProjectsTypesModule)
} ,
{
path: '**',
component:PageNotfoundComponent
} }
] ]
} }
,
{
path: '**',
component:PageNotfoundComponent
}
]; ];
......
...@@ -31,6 +31,7 @@ import { ProjectRoutingModule } from './projects/routing/project-routing.module' ...@@ -31,6 +31,7 @@ import { ProjectRoutingModule } from './projects/routing/project-routing.module'
import { ProjectFAQComponent } from './pages/project-faq/project-faq.component'; import { ProjectFAQComponent } from './pages/project-faq/project-faq.component';
import { PsmStartComponent } from './pages/psm-start/psm-start.component'; import { PsmStartComponent } from './pages/psm-start/psm-start.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { AccessDeniedComponent } from './pages/access-denied/access-denied.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -40,6 +41,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; ...@@ -40,6 +41,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
PageNotfoundComponent, PageNotfoundComponent,
ProjectFAQComponent, ProjectFAQComponent,
PsmStartComponent, PsmStartComponent,
AccessDeniedComponent,
], ],
imports: [ imports: [
......
export const ROLES = { export const ROLES = {
ADMIN: 'Admin', ADMIN: 'Admin',
PROJECTS_PLANNER: 'Planner', PROJECTS_PLANNER: "Projects-Planner",
CUSTOMERS_PLANER:'Planner', CUSTOMERS_PLANER: "Customer-Planner",
SCIENTIFIC_DEPUTY: 'Employee', SCIENTIFIC_DEPUTY: 'Scientific-Deputy',
EMPLOYEE :'Employee', EMPLOYEE :"Employee",
USER: 'User', USER: 'User',
} as const; } as const;
\ No newline at end of file
<div class="container">
<section class="section error-404 min-vh-90 d-flex flex-column align-items-center justify-content-center">
<h2>عذراً، ليس لديك صلاحيات اللولوج إلى هذه الصفحة</h2>
<a class="btn" [routerLink]="['/']">العودة إلى الصفحة الرئيسية</a>
<img src="assets/images/not-found.svg" class="img-fluid" alt="Page Not Found">
</section>
</div>
import { Component } from '@angular/core';
@Component({
selector: 'access-denied',
templateUrl: './access-denied.component.html',
styleUrl: './access-denied.component.css'
})
export class AccessDeniedComponent {
}
<div class="container"> <div class="container">
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center"> <section class="section error-404 max-vh-80 d-flex flex-column align-items-center justify-content-center">
<h1>404</h1> <h2>عذراً، إن الصفحة المطلوبة غير موجودة</h2>
<h2>The page you are looking for doesn't exist.</h2> <a class="btn" [routerLink]="['/']">العودة إلى الصفحة الرئيسية</a>
<a class="btn" href="index.html">Back to home</a> <img src="assets/images/not-found.svg" class="img-fluid" alt="Page Not Found">
<img src="assets/images/not-found.svg" class="img-fluid py-5" alt="Page Not Found">
</section> </section>
</div> </div>
.accordion-button::after{
margin-left:0!important;
padding: 2px;
}
\ No newline at end of file
...@@ -7,27 +7,27 @@ ...@@ -7,27 +7,27 @@
<div class="card p-4"> <div class="card p-4">
<form #form="ngForm" class="php-email-form"> <form #form="ngForm" class="php-email-form">
<div class="row text-center"> <div class="row text-center">
<p> <h4 class="text-center text-primary ">
إصافة نوع مشروع إصافة نوع مشروع جديد
</p> </h4>
</div> </div>
<div class="row gy-4"> <div class="row gy-4">
<div class="col-12"> <div class="col-6">
<input type="text" [(ngModel)]="request.typeName" <input type="text" [(ngModel)]="request.typeName"
name="typeName" class="form-control" placeholder="اسم المشروع" required> name="typeName" class="form-control" placeholder="اسم المشروع" required>
</div> </div>
<div class="col-6">
<div class="col-6 "> <input type="number" [(ngModel)]="request.expectedEffort"
class="form-control" name="expectedNumberOfWorker" placeholder="ساعات العمل اللازمة" required min="0" >
</div>
<div class="col-12 ">
<textarea type="tex" [(ngModel)]="request.description" [cols]="4" name="description" <textarea type="tex" [(ngModel)]="request.description" [cols]="4" name="description"
class="form-control" name="requestdescription" placeholder="الوصف" minlength="15" required> class="form-control" name="requestdescription" placeholder="الوصف" minlength="15" required>
</textarea> </textarea>
</div> </div>
<div class="col-6">
<input type="number" [(ngModel)]="request.expectedEffort"
class="form-control" name="expectedNumberOfWorker" placeholder="ساعات العمل اللازمة" required min="0" >
</div>
<div class="col-6"> <div class="col-6">
<input type="number" [(ngModel)]="request.expectedNumberOfWorker" <input type="number" [(ngModel)]="request.expectedNumberOfWorker"
class="form-control" name="expectedNumberOfWorker" placeholder="عدد العمال المتوقع" required min="0" > class="form-control" name="expectedNumberOfWorker" placeholder="عدد العمال المتوقع" required min="0" >
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
<div class="col-md-12 text-center"> <div class="col-md-12 text-center">
<button class="btn btn-primary" [disabled]="form.invalid" (click)="submit(request)">إضافة</button> <button class="btn m-4 btn-success" [disabled]="form.invalid" (click)="submit(request)">إضافة</button>
<button class="btn m-4 btn-secondary" [routerLink]="['/types']">قائمة أنواع المشاريع</button>
</div> </div>
</div> </div>
......
...@@ -51,13 +51,12 @@ ...@@ -51,13 +51,12 @@
<!-- Delete Confirmation --> <!-- Delete Confirmation -->
<div *ngIf="modalMode === 'delete'"> <div *ngIf="modalMode === 'delete'">
<p>هل أنت متأكد من أنك تريد حذف النوع {{ selectedtype.typeName }} ؟</p> <p>هل أنت متأكد من أنك تريد حذف النوع {{ selectedtype.typeName }} ؟</p>
<button type="button" class="btn m-4 btn-danger" (click)="delete()">Delete</button> <button type="button" class="btn m-4 btn-danger" (click)="delete()">إزالة</button>
<button type="button" class="btn m-4 btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn m-4 btn-secondary" data-bs-dismiss="modal">إلغاء</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- .row --> </div>
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="modalLabel">{{ modalTitle }}</h5> <h5 class="modal-title" id="modalLabel">{{ modalTitle }}</h5>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<!-- Edit Form --> <!-- Edit Form -->
...@@ -44,10 +45,10 @@ ...@@ -44,10 +45,10 @@
></edit-type-modal> ></edit-type-modal>
</div> </div>
<!-- Delete Confirmation --> <!-- Delete Confirmation -->
<div *ngIf="modalMode === 'delete'"> <div *ngIf="modalMode === 'delete'" class="row ">
<p>هل أنت متأكد من أنك تريد حذف عنصر {{ selectedItem.typeName }}?</p> <p>هل أنت متأكد من أنك تريد حذف عنصر {{ selectedItem.typeName }}?</p>
<button type="button" class="btn m-4 btn-danger" (click)="delete()">Delete</button> <button type="button" class="col-4 m-4 btn btn-danger" (click)="delete()">إزالة</button>
<button type="button" class="btn m-4 btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn col-4 my-4 btn-secondary" data-bs-dismiss="modal">إلغاء</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -47,7 +47,7 @@ export class ProjectsTypesService { ...@@ -47,7 +47,7 @@ export class ProjectsTypesService {
return this return this
.http .http
.delete<void> .delete<void>
(this.config.getServerUrl()+ "/ProjectsTypes"+typeId); (this.config.getServerUrl()+ "/ProjectsTypes/"+typeId);
} }
......
...@@ -68,7 +68,8 @@ ...@@ -68,7 +68,8 @@
<hr> <hr>
<plan-controll <plan-controll
[project]="project" *ngIf="project.currentState.toLocaleLowerCase()=='inplan'"
[project]="project"
(toProgress)="openMoveToProgressModal()" (toProgress)="openMoveToProgressModal()"
> >
...@@ -77,7 +78,8 @@ ...@@ -77,7 +78,8 @@
<hr> <hr>
<track-controll <track-controll
[project]="project" *ngIf="project.currentState.toLocaleLowerCase()=='inprogress'"
[project]="project"
(complete)="openProjectComplete()" (complete)="openProjectComplete()"
(replan)="openReplan()" (replan)="openReplan()"
> >
...@@ -91,7 +93,6 @@ ...@@ -91,7 +93,6 @@
[project]="project" [project]="project"
(changeLeader)="openChangeTeamLeader()" (changeLeader)="openChangeTeamLeader()"
(changeManager)="openChangeProjectManager()" (changeManager)="openChangeProjectManager()"
> >
</info-controll> </info-controll>
......
...@@ -11,6 +11,8 @@ import { ProjectCompleteModalComponent } from '../../components/projectModals/pr ...@@ -11,6 +11,8 @@ import { ProjectCompleteModalComponent } from '../../components/projectModals/pr
import { ProjectReplanModalComponent } from '../../components/projectModals/project-replan-modal/project-replan-modal.component'; import { ProjectReplanModalComponent } from '../../components/projectModals/project-replan-modal/project-replan-modal.component';
import { ChangeManagerModalComponent } from '../../components/projectModals/change-manager-modal/change-manager-modal.component'; import { ChangeManagerModalComponent } from '../../components/projectModals/change-manager-modal/change-manager-modal.component';
import { ChangeLeaderModalComponent } from '../../components/projectModals/change-leader-modal/change-leader-modal.component'; import { ChangeLeaderModalComponent } from '../../components/projectModals/change-leader-modal/change-leader-modal.component';
import { UserService } from '../../../core/services/authentication/user.service';
import { ROLES } from '../../../core/constants/roles';
@Component({ @Component({
...@@ -28,6 +30,7 @@ export class ProjectDetailsComponent implements OnInit { ...@@ -28,6 +30,7 @@ export class ProjectDetailsComponent implements OnInit {
private projectService: ProjectService, private projectService: ProjectService,
private toastr: ToastrService, private toastr: ToastrService,
private modalService :NgbModal , private modalService :NgbModal ,
private userService :UserService,
private pdfDownloader : PdfDownloaderService private pdfDownloader : PdfDownloaderService
) {} ) {}
...@@ -137,8 +140,21 @@ export class ProjectDetailsComponent implements OnInit { ...@@ -137,8 +140,21 @@ export class ProjectDetailsComponent implements OnInit {
.getProjectById(this.projectId) .getProjectById(this.projectId)
.subscribe({ .subscribe({
next :(data) => { next :(data) => {
this.project = data; if(
data.projectManager.id == this.userService.getEmployeeId()
||data.teamLeader.id== this.userService.getEmployeeId()
||this.userService.hasRole(ROLES.SCIENTIFIC_DEPUTY) ){
this.project = data;
}else{
this.toastr.error('ليس مخولا لك الولوج إلى هذه الصفحة')
this.router.navigate(['/forbiden'])
}
}, },
error : (err)=>{ error : (err)=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment