You need to sign in or sign up before continuing.
Commit 8aab3728 authored by hasan khaddour's avatar hasan khaddour

add the moduls of the project

parent a5828466
......@@ -51,11 +51,9 @@
"./node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/jquery-sparkline/jquery.sparkline.min.js",
"./node_modules/@popperjs/core/dist/umd/popper.min.js",
"node_modules/feather-icons/dist/feather.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"
"node_modules/feather-icons/dist/feather.min.js"
]
},
......
......@@ -24,8 +24,9 @@ export const routes: Routes = [
component: HomeComponent
},
{
path: 'projectfaq',
component: ProjectFAQComponent
path: 'Project-FAQ',
component: ProjectFAQComponent,
},
{
path: '',
......
......@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
import { DataStorageService } from './services/dataStorage/data-storage.service';
import { AuthenticationService } from './services/authentication/authentication.service';
import { ConfigurationService } from './services/configuration/configuration.service';
import { UserService } from './services/authentication/user.service';
@NgModule({
......@@ -14,7 +14,8 @@ import { ConfigurationService } from './services/configuration/configuration.ser
providers:[
DataStorageService,
AuthenticationService,
ConfigurationService
ConfigurationService,
UserService
]
})
export class CoreModule { }
......@@ -24,6 +24,7 @@ export class AuthenticationService {
.post<AuthenticationResponse>(
this.config.getServerUrl()+ "/Authentication/Login",loginRequest)
}
Register(registerRequest : RegisterRequest ) :Observable<AuthenticationResponse>{
return this.http
......@@ -44,7 +45,10 @@ export class AuthenticationService {
}
}
getToken(){
return this.dataStorage.getItem("token");
logou(){
this.dataStorage.removeItem("token");
this.dataStorage.removeItem("userDetails");
}
}
import { Injectable } from '@angular/core';
import { DataStorageService } from '../dataStorage/data-storage.service';
import { User } from '../../models/users/User';
@Injectable({
providedIn: 'root'
})
export class UserService {
constructor(private dataStorage : DataStorageService) { }
getCurrentUser():User{
return JSON.parse( this.dataStorage.getItem("userDetails"));
}
getUserFirstName():string{
return JSON.parse( this.dataStorage.getItem("userDetails")).firstName;
}
getUserLastName():string{
return JSON.parse( this.dataStorage.getItem("userDetails")).lastName;
}
}
......@@ -10,9 +10,16 @@ export class DataStorageService {
setItem(key : string , value : string){
localStorage.setItem(key,value);
}
getItem(key : string ):any{
return localStorage.getItem(key);
}
removeItem(key :string){
localStorage.removeItem(key);
}
clear(){
localStorage.clear();
}
......
import { Component } from '@angular/core';
@Component({
selector: 'participate-item',
templateUrl: './participate-item.component.html',
styleUrl: './participate-item.component.css'
})
export class ParticipateItemComponent {
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class EmployeesRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { EmployeesRoutingModule } from './employees-routing.module';
import { EmployeeProfileComponent } from './pages/employee-profile/employee-profile.component';
import { EmployeeParticipatesComponent } from './pages/employee-participates/employee-participates.component';
import { EmployeeParticipateComponent } from './pages/employee-participate/employee-participate.component';
import { ParticipateItemComponent } from './components/participate-item/participate-item.component';
@NgModule({
declarations: [
EmployeeProfileComponent,
EmployeeParticipatesComponent,
EmployeeParticipateComponent,
ParticipateItemComponent
],
imports: [
CommonModule,
EmployeesRoutingModule
]
})
export class EmployeesModule { }
export class GetEmployeeTrackHistoryRequest {
employeeId: number;
projectId: number;
pageNumber: number;
pageSize: number;
}
export interface UpdateEmplyeeWorkHours {
employeeId :number
workingHour :number
}
\ No newline at end of file
import { Availability } from "../vakueObjects/Availability"
import { PersonalInfo } from "../vakueObjects/personalInfo"
import { WorkInfo } from "../vakueObjects/WorkInfo"
export class Employee {
id:number
hiastId :number
userId :number
departmentName :string
personalInfo :PersonalInfo
availability :Availability
workInfo : WorkInfo
}
\ No newline at end of file
import { Employee } from "./employee"
export class EmployeeParticipate {
employeeId :number
projectId : number
employee :Employee
partialTimeRatio : number
role: string
}
\ No newline at end of file
export class Availability {
currentWorkingHours :number
isAvailable :boolean
}
\ No newline at end of file
export class PersonalInfo{
firstName :string
lastName :string
}
\ No newline at end of file
export class WorkInfo {
workType :string
workJob :string
}
\ No newline at end of file
import { Component } from '@angular/core';
@Component({
selector: 'employee-participate',
templateUrl: './employee-participate.component.html',
styleUrl: './employee-participate.component.css'
})
export class EmployeeParticipateComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'employee-participates',
templateUrl: './employee-participates.component.html',
styleUrl: './employee-participates.component.css'
})
export class EmployeeParticipatesComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'employee-profile',
templateUrl: './employee-profile.component.html',
styleUrl: './employee-profile.component.css'
})
export class EmployeeProfileComponent {
}
import { TestBed } from '@angular/core/testing';
import { DataStorageService } from './data-storage.service';
import { EmployeesService } from './employees.service';
describe('DataStorageService', () => {
let service: DataStorageService;
describe('EmployeesService', () => {
let service: EmployeesService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DataStorageService);
service = TestBed.inject(EmployeesService);
});
it('should be created', () => {
......
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class EmployeesService {
constructor() { }
}
import { Department } from './department';
describe('Department', () => {
it('should create an instance', () => {
expect(new Department()).toBeTruthy();
});
});
export class Department {
id :number
name :string
flat :number
}
......@@ -43,7 +43,7 @@ export class LoginComponent implements OnInit {
if(res.email) {
this.dataStorage.setItem('userDetails', JSON.stringify(res));
this.dataStorage.setItem('token', JSON.stringify(res.token));
console.log(res.token)
this.toastr.info('مرحبا بك مجددا يا ' + res.firstName+" " +res.lastName);
this.router.navigateByUrl('/home');
......
import { Component } from '@angular/core';
@Component({
selector: 'project-header',
templateUrl: './project-header.component.html',
styleUrl: './project-header.component.css'
})
export class ProjectHeaderComponent {
}
<tr>
<th scope="row"></th>
<td> {{step.stepInfo.stepName}}
</td>
<td class="text-left">{{step.stepInfo.description}}</td>
<td class="text-left">{{step.currentCompletionRatio}}</td>
<td class="text-left">{{step.weight}}</td>
<td class="text-left">{{step.stepInfo.startDate | date}}</td>
<td class="text-left">{{step.stepInfo.duration}}</td>
</tr>
import { Component, Input } from '@angular/core';
import { Step } from '../../models/responses/Step';
@Component({
selector: 'step-row-item',
templateUrl: './step-row-item.component.html',
styleUrl: './step-row-item.component.css'
})
export class StepRowItemComponent {
@Input() step :Step
}
import { StepInfo } from "../valueObjects/StepInfo";
export class Step {
id: number;
stepInfo: StepInfo;
currentCompletionRatio: number;
weight: number;
projectId: number;
}
import { Customer } from "../../../customers/models/customer"
import { Employee } from "../../../employees/models/responses/employee"
import { EmployeeParticipate } from "../../../employees/models/responses/employeeParticipate"
import { Aggreement } from "../valueObjects/Aggreement"
import { FinancialFund } from "../valueObjects/FinancialFund"
import { ProjectInfo } from "../valueObjects/ProjectInfo"
import { ProposalInfo } from "../valueObjects/proposalInfo"
import { Step } from "./Step"
export class Project
{
id:number
proposalInfo : ProposalInfo
projectInfo :ProjectInfo
currentState: any
projectAggreement :any
currentState: string
projectAggreement :Aggreement
teamLeaderId: number
teamLeader :any
teamLeader :Employee
projectManagerId:number
executer:any
proposerId:any
steps :any
projectManager: Employee
executer: {
name :string
}
proposerId:number
proposer:Customer
steps :Step[]
participants:EmployeeParticipate[]
financialFund:FinancialFund
}
export interface Aggreement {
aggreementNumber: number;
aggreementDate: Date;
}
......@@ -4,3 +4,4 @@ export interface FinancialFund {
financialStatus: string;
source: string;
}
export interface StepInfo {
stepName: string;
description: string;
startDate: Date;
duration: number;
}
......@@ -6,11 +6,11 @@
<h2 class="h3 mb-0 page-title"> قائمة المشاريع </h2>
</div>
<div class="col-auto">
<button type="button" (click)="this.router.navigate(['project/create'])" class="btn btn-primary"><span class="fe fe-file-plus fe-12 mr-2"></span>طرح مشروع</button>
<button type="button" (click)="this.router.navigate(['projects/create'])" class="btn btn-primary"><span class="fe fe-file-plus fe-12 mr-2"></span>طرح مشروع</button>
</div>
</div>
<div class="row">
<project-item class="col-md-4" *ngFor="let project of projects" [project]="project"></project-item>
<project-item class="col-md-4" (click)="this.router.navigate(['projects/detail',project.id])" *ngFor="let project of projects" [project]="project"></project-item>
</div>
</div>
......
......@@ -8,6 +8,8 @@ import { ProjectService } from './services/project.service';
import { FormsModule } from '@angular/forms';
import { SharedModule } from '../shared/shared.module';
import { ProjectRoutingModule } from './project-routing.module';
import { StepRowItemComponent } from './components/step-row-item/step-row-item.component';
import { ProjectHeaderComponent } from './components/project-header/project-header.component';
......@@ -16,7 +18,9 @@ import { ProjectRoutingModule } from './project-routing.module';
ProjectItemComponent,
AttachmentComponent,
ProjectListComponent,
ProjectDetailsComponent
ProjectDetailsComponent,
StepRowItemComponent,
ProjectHeaderComponent
],
providers:[
ProjectService
......
......@@ -11,9 +11,9 @@
<li class="nav-item dropdown pe-3">
<a class="nav-link nav-profile d-flex align-items-center pe-0" href="#" data-bs-toggle="dropdown">
<a class="nav-link nav-profile d-flex align-items-center pe-0" data-bs-toggle="dropdown">
<img src="assets/images/users/3.jpg" alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2">K. Anderson</span>
<span class="d-none d-md-block dropdown-toggle ps-2">{{fullName}}</span>
</a><!-- End Profile Iamge Icon -->
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile">
......@@ -56,10 +56,10 @@
</li>
<li>
<a class="dropdown-item d-flex align-items-center" href="#">
<button class="dropdown-item d-flex align-items-center" (click)="logout()">
<i class="fe fe-log-out"></i>
<span>Sign Out</span>
</a>
</button>
</li>
</ul><!-- End Profile Dropdown Items -->
......
......@@ -2,6 +2,9 @@ import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, Input, input, OnInit } from '@angular/core';
import { Router, RouterLink } from '@angular/router';
import { UserService } from '../../../core/services/authentication/user.service';
import { ToastrService } from 'ngx-toastr';
import { AuthenticationService } from '../../../core/services/authentication/authentication.service';
@Component({
selector: 'app-header',
......@@ -9,13 +12,36 @@ import { Router, RouterLink } from '@angular/router';
templateUrl: './header.component.html',
styleUrl: './header.component.css'
})
export class HeaderComponent {
export class HeaderComponent implements OnInit {
@Input() isToggled :Boolean;
constructor(private router: Router) { }
fullName :string
constructor(
private router: Router,
private userService : UserService,
private toastr : ToastrService,
private auth : AuthenticationService
) { }
ngOnInit(): void {
this.fullName= this.userService.getUserFirstName()+" " + this.userService.getUserLastName();
}
toggleSidebar() {
console.log(this.isToggled)
this.isToggled = !this.isToggled;
}
logout() {
this.toastr.info("بانتظارك في المرة القادمة");
this.auth.logou();
this.router.navigate(['/login']);
}
}
......@@ -60,25 +60,25 @@
</li><!-- End Components Nav -->
<li class="nav-heading">الجهات الطارحة</li>
<li class="nav-item">
<a routerLink="/customers" class="nav-link collapsed ">
<a [routerLink]="['customers']" class="nav-link collapsed ">
<i class="fe fe-map"></i><span> استعراض الجهات الطارحة</span>
</a>
</li>
<li class="nav-item">
<a routerlink="/customers/create" class="nav-link collapsed " >
<a [routerLink]="['/customers/create']" class="nav-link collapsed " >
<i class="fe fe-edit-2"></i><span>إضافة جهة طارحة</span>
</a>
</li>
<li class="nav-heading">إدارة المشاريع</li>
<li class="nav-item">
<a class="nav-link collapsed" href="forms-elements.html">
<a [routerLink]="['/projects/create']" class="nav-link collapsed" >
<i class="bi bi-circle"></i><span>طرح مشروع</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link collapsed" href="forms-layouts.html">
<i class="bi bi-circle"></i><span>تعديل مشروع</span>
<a [routerLink]="['/projects']" class="nav-link collapsed">
<i class="bi bi-circle"></i><span>استعراض المشاريع</span>
</a>
</li>
<li class="nav-item">
......@@ -91,27 +91,23 @@
<i class="bi bi-circle"></i><span>إضافة بيانات المشروع</span>
</a>
</li>
<li class="nav-heading">العمل</li>
<li [routerLink]="['/employees/paticipation']" class="nav-item">
<a class="nav-link collapsed" >
<i class="bi bi-layout-text-window-reverse"></i><span>استعراض مساهماتي</span><i class="bi bi-chevron-down ms-auto"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="collapse" href="#">
<i class="bi bi-layout-text-window-reverse"></i><span>العمل</span><i class="bi bi-chevron-down ms-auto"></i>
<i class="bi bi-layout-text-window-reverse"></i><span>استعراض ساعات عملي</span><i class="bi bi-chevron-down ms-auto"></i>
</a>
<ul id="tables-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
<li>
<a href="tables-general.html">
<i class="bi bi-circle"></i><span>استعراض مشاريعي</span>
</a>
</li>
<li>
<a href="tables-data.html">
<i class="bi bi-circle"></i><span>استعراض ساعات عملي</span>
</a>
</li>
</ul>
</li><!-- End Tables Nav -->
</li>
<li class="nav-heading">متفرقات</li>
<li class="nav-item">
<a class="nav-link collapsed" routerlink="/ProjectFAQ">
<a [routerLink]="['/Project-FAQ']" class="nav-link collapsed" >
<i class="bi bi-layout-text-window-reverse"></i><span>ملامح المشروع</span><i class="bi bi-chevron-down ms-auto"></i>
</a>
</li>
......
import { Component } from '@angular/core';
@Component({
selector: 'employee-track',
templateUrl: './employee-track.component.html',
styleUrl: './employee-track.component.css'
})
export class EmployeeTrackComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'step-track',
templateUrl: './step-track.component.html',
styleUrl: './step-track.component.css'
})
export class StepTrackComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'project-track-history',
templateUrl: './project-track-history.component.html',
styleUrl: './project-track-history.component.css'
})
export class ProjectTrackHistoryComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'step-track-details',
templateUrl: './step-track-details.component.html',
styleUrl: './step-track-details.component.css'
})
export class StepTrackDetailsComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'trac-create',
templateUrl: './trac-create.component.html',
styleUrl: './trac-create.component.css'
})
export class TracCreateComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'track-details',
templateUrl: './track-details.component.html',
styleUrl: './track-details.component.css'
})
export class TrackDetailsComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'tracks',
templateUrl: './tracks.component.html',
styleUrl: './tracks.component.css'
})
export class TracksComponent {
}
import { TestBed } from '@angular/core/testing';
import { TrackService } from './track.service';
describe('TrackService', () => {
let service: TrackService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TrackService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class TrackService {
constructor() { }
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class TracksRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TracksRoutingModule } from './tracks-routing.module';
import { TracksComponent } from './pages/tracks/tracks.component';
import { TrackDetailsComponent } from './pages/track-details/track-details.component';
import { TracCreateComponent } from './pages/trac-create/trac-create.component';
import { StepTrackComponent } from './components/step-track/step-track.component';
import { EmployeeTrackComponent } from './components/employee-track/employee-track.component';
import { StepTrackDetailsComponent } from './pages/step-track-details/step-track-details.component';
import { ProjectTrackHistoryComponent } from './pages/project-track-history/project-track-history.component';
@NgModule({
declarations: [
TracksComponent,
TrackDetailsComponent,
TracCreateComponent,
StepTrackComponent,
EmployeeTrackComponent,
StepTrackDetailsComponent,
ProjectTrackHistoryComponent
],
imports: [
CommonModule,
TracksRoutingModule
]
})
export class TracksModule { }
......@@ -25,6 +25,12 @@
<script src='assets/js/select2.min.js'></script>
<script src='assets/js/jquery.steps.min.js'></script>
<script src='assets/js/jquery.validate.min.js'></script>
>
<script src="assets/vendor/tinymce/tinymce.min.js"></script>
<script src="assets/js/template-main.js"></script>
</body>
</html>
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