Skip to content

Commit

Permalink
Merge branch 'development' into add-numbas-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ublefo committed May 7, 2024
2 parents aeec80c + cbbab2d commit 3a13cd2
Show file tree
Hide file tree
Showing 85 changed files with 2,188 additions and 2,473 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ tmp.scss
a.env
dist/
.angulardoc.json
.nx
.idea
Binary file added .nx/cache/18.3.4-nx.linux-arm64-gnu.node
Binary file not shown.
1,404 changes: 596 additions & 808 deletions package-lock.json

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
"keywords": [],
"author": "",
"dependencies": {
"@angular/animations": "^17.3.5",
"@angular/cdk": "^17.3.5",
"@angular/cli": "^17.3.5",
"@angular/common": "^17.3.5",
"@angular/compiler": "^17.3.5",
"@angular/core": "^17.3.5",
"@angular/forms": "^17.3.5",
"@angular/material": "^17.3.5",
"@angular/material-moment-adapter": "^17.3.5",
"@angular/platform-browser": "^17.3.5",
"@angular/platform-browser-dynamic": "^17.3.5",
"@angular/router": "^17.3.5",
"@angular/service-worker": "^17.3.5",
"@angular/upgrade": "^17.3.5",
"@angular/animations": "^17.3.6",
"@angular/cdk": "^17.3.6",
"@angular/cli": "^17.3.6",
"@angular/common": "^17.3.6",
"@angular/compiler": "^17.3.6",
"@angular/core": "^17.3.6",
"@angular/forms": "^17.3.6",
"@angular/material": "^17.3.6",
"@angular/material-moment-adapter": "^17.3.6",
"@angular/platform-browser": "^17.3.6",
"@angular/platform-browser-dynamic": "^17.3.6",
"@angular/router": "^17.3.6",
"@angular/service-worker": "^17.3.6",
"@angular/upgrade": "^17.3.6",
"@ctrl/ngx-emoji-mart": "^9.2.0",
"@uirouter/angular": "^13.0",
"@uirouter/angular-hybrid": "^17.1.0",
Expand Down Expand Up @@ -91,14 +91,14 @@
"zone.js": "~0.14"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.5",
"@angular-eslint/builder": "^17.1.1",
"@angular-eslint/eslint-plugin": "^17.1.1",
"@angular-eslint/eslint-plugin-template": "^17.1.1",
"@angular-eslint/schematics": "^17.1.1",
"@angular-eslint/template-parser": "^17.1.1",
"@angular/compiler-cli": "^17.3.5",
"@angular/language-service": "^17.3.5",
"@angular-devkit/build-angular": "^17.3.6",
"@angular-eslint/builder": "^17.3.0",
"@angular-eslint/eslint-plugin": "^17.3.0",
"@angular-eslint/eslint-plugin-template": "^17.3.0",
"@angular-eslint/schematics": "^17.3.0",
"@angular-eslint/template-parser": "^17.3.0",
"@angular/compiler-cli": "^17.3.6",
"@angular/language-service": "^17.3.6",
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^17",
"@types/angular": "1.5.11",
Expand All @@ -109,12 +109,12 @@
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.115",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"autoprefixer": "~6",
"canonical-path": "0.0.2",
"concurrently": "^3.2.0",
"eslint": "^8.53.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "39.3.6",
Expand Down
4 changes: 0 additions & 4 deletions src/app/admin/admin.coffee

This file was deleted.

208 changes: 116 additions & 92 deletions src/app/admin/states/f-units/f-units.component.html
Original file line number Diff line number Diff line change
@@ -1,113 +1,137 @@
<div class="table-padding">
<div class="flex flex-row gap-8">
<div class="flex-grow flex flex-col gap-8 gap-y-0">
<div class="flex flex-row">
<div>
<h3>Units</h3>
<p>Modify units registered with OnTrack</p>
</div>
<div class="flex-grow"></div>
<div>
<mat-form-field appearance="outline">
<mat-label>Search</mat-label>
<input matInput (keyup)="applyFilter($event)" />
</mat-form-field>
</div>
<div class="flex flex-row gap-8 md:px-28">
<div class="flex-grow flex flex-col gap-8 gap-y-0">
<div class="flex flex-col">
<div>
<h3>{{ title }}</h3>
</div>
<table
class="flex-grow f-table selectable"
mat-table
[dataSource]="dataSource"
matSort
(matSortChange)="sortTableData($event)"
>
<!-- Unit Code Column -->
<ng-container matColumnDef="unit_code" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Unit Code</th>
<td mat-cell *matCellDef="let element" class="w-0 min-w-full">
<f-chip class="shrink">{{ element.code }}</f-chip>
</td>
</ng-container>
<div>
<mat-form-field appearance="outline" class="w-full max-w-[720px] min-w-[160px]">
<mat-label>Search</mat-label>
<input matInput (keyup)="applyFilter($event)" />
<mat-icon matPrefix> search </mat-icon>
</mat-form-field>
</div>
</div>
<table
class="flex-grow f-table selectable"
mat-table
[dataSource]="dataSource"
matSort
(matSortChange)="sortTableData($event)"
>
<!-- Unit Code Column -->
<ng-container matColumnDef="unit_code" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Unit Code</th>
<td mat-cell *matCellDef="let element" class="w-0 min-w-full">
<f-chip class="shrink">{{ element.unit_code }}</f-chip>
</td>
</ng-container>

<!-- Name Column -->
<ng-container matColumnDef="name" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<td mat-cell *matCellDef="let element">{{ element.name }}</td>
</ng-container>
<!-- Name Column -->
<ng-container matColumnDef="name" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th>
<td mat-cell *matCellDef="let element">{{ element.name }}</td>
</ng-container>

<!-- Unit Role Column -->
<ng-container matColumnDef="unit_role" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Unit Role</th>
<td mat-cell *matCellDef="let element">{{ element.myRole }}</td>
</ng-container>
<!-- Unit Role Column -->
<ng-container matColumnDef="unit_role" sticky>
<th
mat-header-cell
[hidden]="!shouldShowUnitRoleColumn()"
*matHeaderCellDef
mat-sort-header
>
Unit Role
</th>
<td mat-cell [hidden]="!shouldShowUnitRoleColumn()" *matCellDef="let element">
{{ element.unit_role }}
</td>
</ng-container>

<!-- Teaching Period Column -->
<ng-container matColumnDef="teaching_period" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Teaching Period</th>
<td mat-cell *matCellDef="let element">
@if (element.teachingPeriod) {
{{ element.teachingPeriod.name }}
} @else {
Custom
}
</td>
</ng-container>
<!-- Teaching Period Column -->
<ng-container matColumnDef="teaching_period" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Teaching Period</th>
<td mat-cell *matCellDef="let element">
@if (element.teachingPeriod) {
{{ element.teachingPeriod.name }}
} @else {
Custom
}
</td>
</ng-container>

<!-- Start Date Column -->
<ng-container matColumnDef="start_date" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Start Time</th>
<td mat-cell *matCellDef="let element">{{ element.startDate | date: 'EEE d MMM y' }}</td>
</ng-container>
<!-- Start Date Column -->
<ng-container matColumnDef="start_date" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Start Date</th>
<td mat-cell *matCellDef="let element">{{ element.start_date | date: 'EEE d MMM y' }}</td>
</ng-container>

<!-- End Date Column -->
<ng-container matColumnDef="end_date" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>End Time</th>
<td mat-cell *matCellDef="let element">{{ element.endDate | date: 'EEE d MMM y' }}</td>
</ng-container>
<!-- End Date Column -->
<ng-container matColumnDef="end_date" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>End Date</th>
<td mat-cell *matCellDef="let element">{{ element.start_date | date: 'EEE d MMM y' }}</td>
</ng-container>

<!-- Active Column -->
<ng-container matColumnDef="active" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Active</th>
<td mat-cell *matCellDef="let element">
<!-- If element.teachingPeriod exists -->
@if (element.teachingPeriod) {
@if (element.teachingPeriod.active && element.active) {
<i class="fa fa-check"></i>
}
@if (!element.teachingPeriod.active || !element.active) {
<i class="fa fa-times"></i>
}
} @else {
@if (element.active) {
<i class="fa fa-check"></i>
}
@if (!element.active) {
<i class="fa fa-times"></i>
}
<!-- Active Column -->
<ng-container matColumnDef="active" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Active</th>
<td mat-cell *matCellDef="let element">
<!-- If element.teachingPeriod exists -->
@if (element.teachingPeriod) {
@if (element.teachingPeriod.active && element.active) {
<mat-icon>done</mat-icon>
}
@if (!element.teachingPeriod.active || !element.active) {
<mat-icon>close</mat-icon>
}
} @else {
@if (element.active) {
<mat-icon>done</mat-icon>
}
@if (!element.active) {
<mat-icon>close</mat-icon>
}
}

<!-- If element.teachingPeriod does not exist -->
</td>
</ng-container>
<!-- If element.teachingPeriod does not exist -->
</td>
</ng-container>

<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@if (mode === 'tutor') {
<tr
mat-row
*matRowDef="let row; columns: displayedColumns"
uiSref="units/tasks/inbox"
[uiParams]="{unitId: row.id}"
></tr>
}
@if (mode === 'admin') {
<tr
mat-row
*matRowDef="let row; columns: displayedColumns"
uiSref="units/admin"
[uiParams]="{unitId: row.id}"
></tr>
</table>
<span class="flex items-center">
<mat-paginator class="mat-elevation-z0" [pageSizeOptions]="[10, 25, 100]"></mat-paginator>
<span class="flex-grow"></span>
}
@if (mode === 'student') {
<tr
mat-row
*matRowDef="let row; columns: displayedColumns"
uiSref="projects/dashboard"
[uiParams]="{projectId: row.id, taskAbbr: ''}"
></tr>
}
</table>
<span class="flex items-center">
<mat-paginator class="mat-elevation-z0" [pageSizeOptions]="[10, 25, 100]"></mat-paginator>
<span class="flex-grow"></span>
@if (mode === 'admin') {
<button mat-raised-button color="primary" (click)="createUnit()">
<mat-icon aria-hidden="false" aria-label="Example home icon" class="icon_display"
>add</mat-icon
>
<mat-icon class="icon_display">add</mat-icon>
Create Unit
</button>
</span>
</div>
}
</span>
</div>
</div>
10 changes: 5 additions & 5 deletions src/app/admin/states/f-units/f-units.component.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.table-padding {
padding-left: 50px;
padding-right: 50px;
}

.icon_display {
transform: scale(2);
}

.mat-column-unit_code {
max-width: 130px !important;
min-width: 130px !important;
}
Loading

0 comments on commit 3a13cd2

Please sign in to comment.