-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tasksEvaluationPage): Made a new Page - Tasks Evaluation
Signed-off-by: sid-bagwe <[email protected]>
- Loading branch information
Showing
13 changed files
with
551 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"projects": { | ||
"default": "worktrolly" | ||
"default": "my-first-project-d8086" | ||
}, | ||
"targets": { | ||
"worktrolly": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
functions/model/tasksEvaluation/readTasksEvalulationData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* eslint-disable linebreak-style */ | ||
/* eslint-disable require-jsdoc */ | ||
/* eslint-disable object-curly-spacing */ | ||
// /* eslint-disable no-undef */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { db } = require('../application/lib'); | ||
|
||
exports.readTasksEvaluationData = function(request, response) { | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
const teamId = request.body.data.TeamId; | ||
const sprintNumber = request.body.data.SprintNumber; | ||
const pageToLoad = request.body.data.PageToLoad; | ||
const lastInResultTaskId = request.body.data.LastInResultTaskId; | ||
const firstInResultTaskId = request.body.data.FirstInResultTaskId; | ||
const startAt = request.body.data.StartAt; | ||
let tasks = []; | ||
let status = 200; | ||
let disableNext = false; | ||
let disablePrev = false; | ||
let promise; | ||
let query = db.collection("Organizations").doc(orgDomain).collection("Tasks").where('TeamId', '==', teamId).orderBy('Id', 'desc'); | ||
|
||
if (sprintNumber) { | ||
query = query.where('SprintNumber', '==', sprintNumber); | ||
} | ||
|
||
if(pageToLoad == 'initial') { | ||
query = query.limit(20); | ||
} else if(pageToLoad == 'next') { | ||
query = query.startAfter(lastInResultTaskId).limit(20); | ||
} else if(pageToLoad == 'previous') { | ||
query = query.startAt(startAt).endBefore(firstInResultTaskId).limit(20); | ||
} | ||
|
||
promise = query.get().then(snapshot => { | ||
snapshot.docs.forEach(doc => { | ||
tasks.push(doc.data()); | ||
}); | ||
let p1; | ||
if(pageToLoad == 'next') { | ||
p1 = db.collection("Organizations").doc(orgDomain).collection("Tasks").where('TeamId', '==', teamId).orderBy('Id', 'desc').startAfter(tasks[tasks.length - 1].Id).get().then(docs => { | ||
if(docs.empty) { | ||
disableNext = true; | ||
} | ||
}); | ||
} else if(pageToLoad == 'previous') { | ||
p1 = db.collection("Organizations").doc(orgDomain).collection("Tasks").where('TeamId', '==', teamId).orderBy('Id', 'desc').endBefore(tasks[0].Id).get().then(docs => { | ||
if(docs.empty) { | ||
disablePrev = true; | ||
} | ||
}); | ||
} | ||
return Promise.resolve(p1); | ||
}).catch(error => { | ||
console.log(error); | ||
status = 500; | ||
}); | ||
|
||
return Promise.resolve(promise).then(() => { | ||
result = { data: {Tasks: tasks, DisableNext: disableNext, DisablePrev: disablePrev} }; | ||
console.log("Read Task Evaluation Page Data Successfully"); | ||
return response.status(status).send(result); | ||
}).catch(err => { | ||
result = { data: err }; | ||
console.log("Error occured"); | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable linebreak-style */ | ||
/* eslint-disable object-curly-spacing */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { functions, cors } = require("../application/lib"); | ||
const { readTasksEvaluationData } = require("./readTasksEvalulationData"); | ||
|
||
exports.tasksEvaluation = functions.https.onRequest((request, response) => { | ||
cors(request, response, () => { | ||
const mode = request.body.data.mode; | ||
if(mode == 'readTasksEvaluationData') { | ||
return readTasksEvaluationData(request, response); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/app/body/tasks-evaluation/tasks-evaluation.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#navbarMenu { | ||
background-color: var(--primary-color); | ||
color: var(--button-text); | ||
} | ||
|
||
.container { | ||
background-color: var(--secondary-bg); | ||
box-shadow: var(--box-shadow-bottom); | ||
color: var(--text); | ||
} | ||
|
||
.table th { | ||
color: var(--text); | ||
} | ||
|
||
.table td:not(:last-child){ | ||
color: var(--text); | ||
cursor: pointer; | ||
} | ||
|
||
#moveBtn, #dropdownButton { | ||
background-color: var(--secondary-color); | ||
color: var(--button-text); | ||
} | ||
|
||
#moveBtn:hover:disabled { | ||
background-color: var(--secondary-color); | ||
color: var(--button-text); | ||
} | ||
|
||
#moveBtn:hover { | ||
background-color: var(--primary-color); | ||
color: var(--button-text); | ||
} | ||
|
||
.dropdown #button { | ||
color: var(--button-text); | ||
} | ||
|
||
.dropdown #button:hover { | ||
background-color: var(--secondary-color); | ||
} | ||
|
||
select { | ||
background: none; | ||
border: none; | ||
color: var(--button-text); | ||
} | ||
|
||
select:hover { | ||
background-color: var(--secondary-color); | ||
} | ||
|
||
select option { | ||
background-color: var(--secondary-color); | ||
} | ||
|
||
.pagination li a:hover { | ||
cursor: pointer; | ||
background-color: var(--secondary-bg); | ||
} | ||
|
||
.pagination li a:focus { | ||
box-shadow: none; | ||
outline: none 0; | ||
} | ||
|
||
.pagination li a { | ||
color: var(--secondary-color); | ||
background-color: var(--secondary-bg); | ||
} | ||
|
||
.pagination .disabled a { | ||
color: var(--text); | ||
} | ||
|
||
#filterMenu { | ||
background-color: var(--secondary-bg); | ||
padding-right: 35px; | ||
padding-left: 5px; | ||
} | ||
|
||
.modal-header { | ||
background-color: var(--primary-color); | ||
} | ||
|
||
.modal-content { | ||
background-color: var(--secondary-bg); | ||
border: var(--primary-border); | ||
color: var(--text); | ||
} | ||
|
||
.head { | ||
font-weight: bolder; | ||
} | ||
|
||
.btn-secondary { | ||
background-color: var(--button-hover-bg); | ||
} | ||
|
||
.btn-secondary:hover { | ||
background-color: var(--button-bg); | ||
} |
139 changes: 139 additions & 0 deletions
139
src/app/body/tasks-evaluation/tasks-evaluation.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<div class="container"> | ||
<div class="row align-items-center py-2" id="navbarMenu"> | ||
<div class="col-8"> | ||
<h5 style="font-weight:bolder">Tasks</h5> | ||
</div> | ||
<div class="col-3 text-right"> | ||
<select class="form-select form-control-lg p-2" [(ngModel)]="selectedTeamId" (ngModelChange)="readTasks()"> | ||
<ng-container *ngFor="let teamId of teamIds"> | ||
<option>{{ teamId }}</option> | ||
</ng-container> | ||
</select> | ||
</div> | ||
<div class="col-1 text-right"> | ||
<div class="dropdown float-right"> | ||
<button class="btn material-icons" type="button" id="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">filter_list</button> | ||
<div class="dropdown-menu dropdown-menu-right py-4" id="filterMenu" aria-labelledby="dropdownMenuButton"> | ||
<div class="input-group"> | ||
<input class="form-control" style="font-size: 11px;" type="number" id="filterSprintNumberInput" [(ngModel)]="filterSprintNumber"> | ||
<div class="col-md-3 col-3"> | ||
<button class="btn" id="dropdownButton" style="font-size: 10px;" (click)="readTasks()">Filter</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row pt-1"> | ||
<ng-container> | ||
<div class="col"> | ||
<ng-container> | ||
<div class="table-responsive"> | ||
<table class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th colspan="1">Status</th> | ||
<th colspan="1">Priority</th> | ||
<th colspan="1">Difficulty</th> | ||
<th colspan="1">Task Id</th> | ||
<th colspan="3">Title</th> | ||
<th colspan="2">Assignee</th> | ||
<th colspan="1">Sprint</th> | ||
<th colspan="2">Move to Current Sprint?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ng-container *ngIf="!tasks.length && !showLoader;"> | ||
<tr> | ||
<td colspan="12" class="text-center">No tasks available</td> | ||
</tr> | ||
</ng-container> | ||
<ng-container *ngIf="tasks.length && !showLoader;"> | ||
<ng-container *ngFor="let item of tasks"> | ||
<tr> | ||
<td colspan="1"> | ||
<app-status-icons [Status]="item.Status"></app-status-icons> | ||
</td> | ||
<td colspan="1"> | ||
<app-priority-icons [Priority]="item.Priority"></app-priority-icons> | ||
</td> | ||
<td colspan="1"> | ||
<app-difficulty-icons [Difficulty]="item.Difficulty"></app-difficulty-icons> | ||
</td> | ||
<td colspan="1"><span style="font-weight:bold;" data-toggle="tooltip" data-placement="top" title="task.id">{{item.Id}}</span></td> | ||
<td colspan="3">{{item.Title}}</td> | ||
<td colspan="2"><span class="material-icons" data-toggle="tooltip" style="vertical-align: middle;" data-placement="top" title="Assignee">perm_identity</span> {{item.Assignee}}</td> | ||
<td colspan="1">{{ getSprintName(item.SprintNumber) }}</td> | ||
<td colspan="2" class="text-center"> | ||
<button class="btn" id="moveBtn" [disabled]="item.SprintNumber == teamCurrentSprint" (click)="moveToCurrentSprint(item)" data-bs-toggle="tooltip" data-bs-placement="top" data-toggle="modal" data-target="#Modal">Move</button> | ||
</td> | ||
</tr> | ||
</ng-container> | ||
</ng-container> | ||
<ng-container *ngIf="showLoader"> | ||
<tr> | ||
<td colspan="12" class="text-center"><app-loader></app-loader></td> | ||
</tr> | ||
</ng-container> | ||
<tr> | ||
<td colspan="12" class="pb-0"> | ||
<nav id="pagination"> | ||
<ul class="pagination justify-content-end"> | ||
<li [ngClass]="disable_prev ? 'page-item disabled' : 'page-item'" (click)="prevPage()"> | ||
<a class="page-link" tabindex="-1">Previous</a> | ||
</li> | ||
<li [ngClass]="disable_next ? 'page-item disabled' : 'page-item'" (click)="nextPage()"> | ||
<a class="page-link">Next</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> | ||
<div class="modal fade" id="Modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> | ||
<div class="modal-dialog modal-dialog-centered" role="document"> | ||
<div class="modal-content"> | ||
<nav class="modal-header navbar navbar-expand navbar-dark" id="navbarMenu"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item"> | ||
<h5 class="active nav-link head" id="ModalLabel">Moving to Current Sprint</h5> | ||
</li> | ||
</ul> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li class="nav-item"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true" class="material-icons text-light">close</span> | ||
</button> | ||
</li> | ||
</ul> | ||
</nav> | ||
<ng-container *ngIf="showModalLoader"> | ||
<div class="container pt-2"> | ||
<div class="row"> | ||
<div class="col"><app-loader></app-loader></div> | ||
</div> | ||
</div> | ||
</ng-container> | ||
<ng-container *ngIf="!showModalLoader"> | ||
<div class="container pt-2"> | ||
<div class="row"> | ||
<div class="col">Successfully Moved to Current Sprint!</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-9"></div> | ||
<div class="col-md-3 pb-2 px-4"> | ||
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.