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-
import { PageNotfoundComponent } from './pages/page-notfound/page-notfound.component';
import { ProjectFAQComponent } from './pages/project-faq/project-faq.component';
import { PsmStartComponent } from './pages/psm-start/psm-start.component';
import { AccessDeniedComponent } from './pages/access-denied/access-denied.component';
export const routes: Routes = [
......@@ -33,6 +34,11 @@ export const routes: Routes = [
path: 'Help',
component: PsmStartComponent,
},
{
path: 'forbiden',
component: AccessDeniedComponent,
},
{
path: '',
......@@ -64,14 +70,14 @@ export const routes: Routes = [
, {
path: 'types',
loadChildren: () => import('./projects-types/projects-types.module').then(m => m.ProjectsTypesModule)
}
]
}
,
} ,
{
path: '**',
component:PageNotfoundComponent
}
]
}
];
......
......@@ -31,6 +31,7 @@ import { ProjectRoutingModule } from './projects/routing/project-routing.module'
import { ProjectFAQComponent } from './pages/project-faq/project-faq.component';
import { PsmStartComponent } from './pages/psm-start/psm-start.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { AccessDeniedComponent } from './pages/access-denied/access-denied.component';
@NgModule({
declarations: [
......@@ -40,6 +41,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
PageNotfoundComponent,
ProjectFAQComponent,
PsmStartComponent,
AccessDeniedComponent,
],
imports: [
......
export const ROLES = {
ADMIN: 'Admin',
PROJECTS_PLANNER: 'Planner',
CUSTOMERS_PLANER:'Planner',
SCIENTIFIC_DEPUTY: 'Employee',
EMPLOYEE :'Employee',
PROJECTS_PLANNER: "Projects-Planner",
CUSTOMERS_PLANER: "Customer-Planner",
SCIENTIFIC_DEPUTY: 'Scientific-Deputy',
EMPLOYEE :"Employee",
USER: 'User',
} 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">
<section class="section error-404 min-vh-100 d-flex flex-column align-items-center justify-content-center">
<h1>404</h1>
<h2>The page you are looking for doesn't exist.</h2>
<a class="btn" href="index.html">Back to home</a>
<img src="assets/images/not-found.svg" class="img-fluid py-5" alt="Page Not Found">
<section class="section error-404 max-vh-80 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>
.accordion-button::after{
margin-left:0!important;
padding: 2px;
}
\ No newline at end of file
......@@ -7,27 +7,27 @@
<div class="card p-4">
<form #form="ngForm" class="php-email-form">
<div class="row text-center">
<p>
إصافة نوع مشروع
</p>
<h4 class="text-center text-primary ">
إصافة نوع مشروع جديد
</h4>
</div>
<div class="row gy-4">
<div class="col-12">
<div class="col-6">
<input type="text" [(ngModel)]="request.typeName"
name="typeName" class="form-control" placeholder="اسم المشروع" required>
</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"
class="form-control" name="requestdescription" placeholder="الوصف" minlength="15" required>
</textarea>
</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">
<input type="number" [(ngModel)]="request.expectedNumberOfWorker"
class="form-control" name="expectedNumberOfWorker" placeholder="عدد العمال المتوقع" required min="0" >
......@@ -36,7 +36,8 @@
<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>
......
......@@ -51,13 +51,12 @@
<!-- Delete Confirmation -->
<div *ngIf="modalMode === 'delete'">
<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-secondary" data-bs-dismiss="modal">Cancel</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">إلغاء</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- .row -->
......@@ -31,6 +31,7 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="modalLabel">{{ modalTitle }}</h5>
</div>
......@@ -44,10 +45,10 @@
></edit-type-modal>
</div>
<!-- Delete Confirmation -->
<div *ngIf="modalMode === 'delete'">
<div *ngIf="modalMode === 'delete'" class="row ">
<p>هل أنت متأكد من أنك تريد حذف عنصر {{ selectedItem.typeName }}?</p>
<button type="button" class="btn m-4 btn-danger" (click)="delete()">Delete</button>
<button type="button" class="btn m-4 btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="col-4 m-4 btn btn-danger" (click)="delete()">إزالة</button>
<button type="button" class="btn col-4 my-4 btn-secondary" data-bs-dismiss="modal">إلغاء</button>
</div>
</div>
</div>
......
......@@ -47,7 +47,7 @@ export class ProjectsTypesService {
return this
.http
.delete<void>
(this.config.getServerUrl()+ "/ProjectsTypes"+typeId);
(this.config.getServerUrl()+ "/ProjectsTypes/"+typeId);
}
......
......@@ -68,6 +68,7 @@
<hr>
<plan-controll
*ngIf="project.currentState.toLocaleLowerCase()=='inplan'"
[project]="project"
(toProgress)="openMoveToProgressModal()"
>
......@@ -77,6 +78,7 @@
<hr>
<track-controll
*ngIf="project.currentState.toLocaleLowerCase()=='inprogress'"
[project]="project"
(complete)="openProjectComplete()"
(replan)="openReplan()"
......@@ -91,7 +93,6 @@
[project]="project"
(changeLeader)="openChangeTeamLeader()"
(changeManager)="openChangeProjectManager()"
>
</info-controll>
......
......@@ -11,6 +11,8 @@ import { ProjectCompleteModalComponent } from '../../components/projectModals/pr
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 { 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({
......@@ -28,6 +30,7 @@ export class ProjectDetailsComponent implements OnInit {
private projectService: ProjectService,
private toastr: ToastrService,
private modalService :NgbModal ,
private userService :UserService,
private pdfDownloader : PdfDownloaderService
) {}
......@@ -138,7 +141,20 @@ export class ProjectDetailsComponent implements OnInit {
.subscribe({
next :(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)=>{
......
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