-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: create initial files for migration of project-tasks-list * feat: create initial files for migration of project-tasks-list * Revert "feat: create initial files for migration of project-tasks-list" This reverts commit 3d047b3. * refactor: migrate project-tasks-list component to TypeScript * chore: update Angular module files for project-tasks-list migration * fix: update project progress dashboard template * chore: update tasks CoffeeScript file * style: update task status colors generator mixin * feat: add order-by and tasks-for-group-set pipes * fix: address layout and styling issues in project-tasks-list - Ensure task boxes are consistent in size - Align layout to match the original design for row consistency - Correct hover effect to include bold styling for 'Assignment #' using a tooltip component and change color to black - Add blue outline on task box click - Update Angular module file - Update global styles * chore: remove deprecated CoffeeScript and template files for project-tasks-list * style: update styles for project-tasks-list component * style: update outline and styles for project-tasks-list component * fix: minor fixes for project tasks list --------- Co-authored-by: Andrew Cain <[email protected]>
- Loading branch information
1 parent
475c316
commit e9cf3ec
Showing
15 changed files
with
255 additions
and
143 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
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,28 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'orderBy' | ||
}) | ||
export class OrderByPipe implements PipeTransform { | ||
transform(array: any[], field: string, reverse: boolean = false): any[] { | ||
if (!array || !field) { | ||
return array; | ||
} | ||
|
||
const sortedArray = [...array].sort((a, b) => { | ||
if (a[field] < b[field]) { | ||
return -1; | ||
} | ||
if (a[field] > b[field]) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
|
||
if (reverse) { | ||
return sortedArray.reverse(); | ||
} | ||
|
||
return sortedArray; | ||
} | ||
} |
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,15 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { Task, GroupSet } from 'src/app/api/models/doubtfire-model'; | ||
|
||
@Pipe({ | ||
name: 'tasksForGroupset' | ||
}) | ||
export class TasksForGroupsetPipe implements PipeTransform { | ||
transform(tasks: Task[], groupSet: GroupSet): Task[] { | ||
if (!tasks) return tasks; | ||
|
||
return tasks.filter(task => { | ||
return (task.definition.groupSet === groupSet) || (!task.definition.groupSet && !groupSet); | ||
}); | ||
} | ||
} |
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
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
59 changes: 0 additions & 59 deletions
59
src/app/tasks/project-tasks-list/project-tasks-list.coffee
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/app/tasks/project-tasks-list/project-tasks-list.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,22 @@ | ||
<ul class="project-tasks-list"> | ||
<div *ngFor="let grouping of groupTasks" class="clearfix"> | ||
<h5 class="group-set-name" *ngIf="!hideGroupSetName">{{ grouping.name }}</h5> | ||
<div class="grid grid-cols-3 sm:grid-cols-4 gap-2 outline-1"> | ||
<mat-chip | ||
#tooltip="matTooltip" | ||
matTooltip="{{ task.definition.name }}: {{ task.statusLabel() }}" | ||
*ngFor=" | ||
let task of project.tasks | ||
| tasksForGroupset: grouping.groupSet | ||
| orderBy: ['definition.targetGrade', 'definition.seq']; | ||
let i = index | ||
" [class.mat-chip-clicked]="selectedTask === task" (click)="selectChip(task)" | ||
class="task-status chip truncate text-center" [ngClass]="newTaskService.statusClass(task.status)"> | ||
<mat-icon svgIcon="visibility" *ngIf="task.similarityFlag"></mat-icon> | ||
|
||
<span class="{{ task.status === 'not_started' ? 'text-black' : '' }}">{{ | ||
taskText(task) | ||
}}</span></mat-chip> | ||
</div> | ||
</div> | ||
</ul> |
25 changes: 25 additions & 0 deletions
25
src/app/tasks/project-tasks-list/project-tasks-list.component.scss
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,25 @@ | ||
.project-tasks-list { | ||
.chip { | ||
border-radius: 4px; | ||
::ng-deep .mdc-evolution-chip__text-label { | ||
color: inherit !important; | ||
} | ||
} | ||
|
||
.group-set-name { | ||
color: #777; | ||
text-align: center; | ||
font-size: 1em; | ||
font-weight: bold; | ||
} | ||
|
||
.mat-chip-clicked { | ||
outline: #007bff auto 1px !important; | ||
} | ||
|
||
.task-status { | ||
::ng-deep .mdc-evolution-chip__cell { | ||
justify-content: center !important; | ||
} | ||
} | ||
} |
Oops, something went wrong.