Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/app/dashboard/f-cross-dashboard.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="panel-full-screen flex flex-row gap-8 px-16 overflow-x-auto">
<div *ngFor="let unit of units">
<div class="flex flex-col w-[34rem] shadow">
<div class="flex flex-row items-center gap-4 w-full bg-formatif-blue p-4 rounded-md">
<h3 class="m-0 flex-grow text-white truncate min-w-0">{{ unit.code }}</h3>
<input
type="text"
class="h-full w-64 p-2 px-4 text-md rounded-md"
placeholder="Search tasks..."
/>
<mat-icon style="color: white">sort</mat-icon>
<mat-icon style="color: white">filter_list_alt</mat-icon>
</div>

<!-- <div *ngFor="let task of unit.tasks">
</div> -->
</div>
</div>
</div>
Empty file.
41 changes: 41 additions & 0 deletions src/app/dashboard/f-cross-dashboard.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {Component, OnInit} from '@angular/core';
import {Unit} from 'src/app/api/models/unit';
import {GlobalStateService} from 'src/app/projects/states/index/global-state.service';

type IUnits = {
id: number;
code: string;
name: string;
// tasks: ITask[];
};

@Component({
selector: 'f-cross-dashboard',
templateUrl: './f-cross-dashboard.component.html',
styleUrls: ['./f-cross-dashboard.component.scss'],
})
export class CrossDashboardComponent implements OnInit {
constructor(private globalStateService: GlobalStateService) {}

units: IUnits[] = [];

ngOnInit(): void {
this.globalStateService.onLoad(() => {
this.globalStateService.loadedUnits.values.subscribe((units) => {
this.units = this.mapUnits(units);
});
});
}

mapUnit(unit: Unit): IUnits {
return {
id: unit.id,
code: unit.code,
name: unit.name,
};
}

mapUnits(units: readonly Unit[]) {
return units.map((unit) => this.mapUnit(unit));
}
}
2 changes: 2 additions & 0 deletions src/app/doubtfire-angular.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ import {TutorNotesModalComponent} from './common/modals/tutor-notes-modal/tutor-
import {FeedbackAppealModalComponent} from './tasks/modals/feedback-appeal-modal/feedback-appeal-modal.component';
import {ConfirmModerationModalComponent} from './units/states/tasks/inbox/directives/moderation/confirm-moderation-modal/confirm-moderation-modal.component';
import {TaskClaimComponent} from './units/states/tasks/inbox/directives/task-claim/task-claim.component';
import {CrossDashboardComponent} from './dashboard/f-cross-dashboard.component';

// See https://stackoverflow.com/questions/55721254/how-to-change-mat-datepicker-date-format-to-dd-mm-yyyy-in-simplest-way/58189036#58189036
const MY_DATE_FORMAT = {
Expand Down Expand Up @@ -394,6 +395,7 @@ const GANTT_CHART_CONFIG = {
ProjectPlanComponent,
SuccessCloseComponent,
HomeComponent,
CrossDashboardComponent,
CommentBubbleActionComponent,
UnitTutorialsListComponent,
UnitTutorialsManagerComponent,
Expand Down
19 changes: 19 additions & 0 deletions src/app/doubtfire.states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {ProjectPlanComponent} from './projects/states/plan/project-plan.componen
import {JplagReportViewerComponent} from './projects/states/jplag/jplag-report-viewer.component';
import {LtiDashboardComponent} from './home/states/lti-dashboard/lti-dashboard.component';
import {LtiUnitLinkComponent} from './home/states/lti-unit-link/lti-unit-link.component';
import {CrossDashboardComponent} from './dashboard/f-cross-dashboard.component';
/*
* Use this file to store any states that are sourced by angular components.
*/
Expand Down Expand Up @@ -69,6 +70,23 @@ const HomeState: NgHybridStateDeclaration = {
},
};

/**
* Define the state for the cross-unit dashboard.
*/
const CrossDashboard: NgHybridStateDeclaration = {
name: 'crossdashboard',
url: '/dashboard',
views: {
main: {
component: CrossDashboardComponent,
},
},
data: {
pageTitle: 'Dashboard',
roleWhitelist: ['Student'],
},
};

// const unitParentState: NgHybridStateDeclaration = {
// name: 'units',
// url: '/units/:unit_id',
Expand Down Expand Up @@ -581,6 +599,7 @@ export const doubtfireStates = [
institutionSettingsState,
TeachingPeriodsState,
HomeState,
CrossDashboard,
WelcomeState,
SignInState,
EditProfileState,
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/states/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h2>Enrolled units</h2>
</div>
<!--Start for two buttons All for dashboard and All for all prev Units-->
<div class="flex flex-col justify-around items-start h-60">
<a uiSref="view-all-projects">
<a uiSref="crossdashboard">
<button
matTooltip="View current units"
matTooltipPosition="above"
Expand Down
Loading