From 2930232d92f29c90b3b73c061dbadc6b1b2b2c02 Mon Sep 17 00:00:00 2001 From: Sujay-Deakin Date: Sun, 3 May 2026 14:22:22 +1000 Subject: [PATCH] fix: re-add groups module registration to states.coffee and angularjs module --- src/app/doubtfire-angular.module.ts | 2 ++ src/app/doubtfire-angularjs.module.ts | 5 +++++ src/app/units/states/groups/groups.coffee | 7 +----- .../units/states/groups/groups.component.html | 22 +++++++++++++++++++ .../units/states/groups/groups.component.scss | 1 + .../units/states/groups/groups.component.ts | 13 +++++++++++ src/app/units/states/groups/groups.tpl.html | 22 ------------------- 7 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 src/app/units/states/groups/groups.component.html create mode 100644 src/app/units/states/groups/groups.component.scss create mode 100644 src/app/units/states/groups/groups.component.ts delete mode 100644 src/app/units/states/groups/groups.tpl.html diff --git a/src/app/doubtfire-angular.module.ts b/src/app/doubtfire-angular.module.ts index ae030bcc3e..8813076139 100644 --- a/src/app/doubtfire-angular.module.ts +++ b/src/app/doubtfire-angular.module.ts @@ -229,6 +229,7 @@ import {TaskDefinitionResourcesComponent} from './units/states/edit/directives/u import {TaskDefinitionOverseerComponent} from './units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-overseer/task-definition-overseer.component'; import {TaskDefinitionScormComponent} from './units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-scorm/task-definition-scorm.component'; import {UnitAnalyticsComponent} from './units/states/analytics/unit-analytics-route.component'; +import {UnitGroupsStateComponent} from './units/states/groups/groups.component'; import {FileDropComponent} from './common/file-drop/file-drop.component'; import {UnitTaskEditorComponent} from './units/states/edit/directives/unit-tasks-editor/unit-task-editor.component'; import {FUsersComponent} from './admin/states/f-users/f-users.component'; @@ -408,6 +409,7 @@ const GANTT_CHART_CONFIG = { TaskDefinitionOverseerComponent, TaskDefinitionScormComponent, UnitAnalyticsComponent, + UnitGroupsStateComponent, StudentTutorialSelectComponent, StudentCampusSelectComponent, TaskListItemComponent, diff --git a/src/app/doubtfire-angularjs.module.ts b/src/app/doubtfire-angularjs.module.ts index ca57426fd2..84de3efe91 100644 --- a/src/app/doubtfire-angularjs.module.ts +++ b/src/app/doubtfire-angularjs.module.ts @@ -205,6 +205,7 @@ import {TaskSubmissionCardComponent} from './projects/states/dashboard/directive import {InboxComponent} from './units/states/tasks/inbox/inbox.component'; import {TaskDefinitionEditorComponent} from './units/states/edit/directives/unit-tasks-editor/task-definition-editor/task-definition-editor.component'; import {UnitAnalyticsComponent} from './units/states/analytics/unit-analytics-route.component'; +import {UnitGroupsStateComponent} from './units/states/groups/groups.component'; import {UnitTaskEditorComponent} from './units/states/edit/directives/unit-tasks-editor/unit-task-editor.component'; import {CreateNewUnitModal} from './admin/modals/create-new-unit-modal/create-new-unit-modal.component'; import {FUsersComponent} from './admin/states/f-users/f-users.component'; @@ -380,6 +381,10 @@ DoubtfireAngularJSModule.directive( 'fUnitAnalytics', downgradeComponent({component: UnitAnalyticsComponent}), ); +DoubtfireAngularJSModule.directive( + 'fUnitGroups', + downgradeComponent({component: UnitGroupsStateComponent}), +); DoubtfireAngularJSModule.directive( 'extensionComment', downgradeComponent({component: ExtensionCommentComponent}), diff --git a/src/app/units/states/groups/groups.coffee b/src/app/units/states/groups/groups.coffee index 90e10afbad..04a81d50f3 100644 --- a/src/app/units/states/groups/groups.coffee +++ b/src/app/units/states/groups/groups.coffee @@ -6,15 +6,10 @@ angular.module('doubtfire.units.states.groups', []) $stateProvider.state 'units/students/groups', { parent: 'units/index' url: '/students/groups' - templateUrl: "units/states/groups/groups.tpl.html" - controller: "UnitGroupsStateCtrl" + template: "" data: task: "Student Groups" pageTitle: "_Home_" roleWhitelist: ['Tutor', 'Convenor', 'Admin', 'Auditor'] } ) -.controller("UnitGroupsStateCtrl", ($scope) -> - # No controller needed if there is no groupwork - return unless $scope.unit.hasGroupwork() -) diff --git a/src/app/units/states/groups/groups.component.html b/src/app/units/states/groups/groups.component.html new file mode 100644 index 0000000000..e819d02ab0 --- /dev/null +++ b/src/app/units/states/groups/groups.component.html @@ -0,0 +1,22 @@ +@if (unit.hasGroupwork()) { + + +} @else { +
+ +

No Groupwork Enabled

+

+ There is no group work enabled for this unit. Convenors should create at + least one group set first for groups to be created. This can be found under + the groups tab in the unit administration settings. +

+ + + Unit Administration + +
+} diff --git a/src/app/units/states/groups/groups.component.scss b/src/app/units/states/groups/groups.component.scss new file mode 100644 index 0000000000..3a7f92cf7f --- /dev/null +++ b/src/app/units/states/groups/groups.component.scss @@ -0,0 +1 @@ +// No custom styles needed — layout handled via Tailwind/Angular Material utilities diff --git a/src/app/units/states/groups/groups.component.ts b/src/app/units/states/groups/groups.component.ts new file mode 100644 index 0000000000..0b26cde702 --- /dev/null +++ b/src/app/units/states/groups/groups.component.ts @@ -0,0 +1,13 @@ +import {Component, Input} from '@angular/core'; +import {Unit} from 'src/app/api/models/unit'; +import {UnitRole} from 'src/app/api/models/unit-role'; + +@Component({ + selector: 'f-unit-groups', + templateUrl: 'groups.component.html', + styleUrls: ['groups.component.scss'], +}) +export class UnitGroupsStateComponent { + @Input() unit: Unit; + @Input() unitRole: UnitRole; +} diff --git a/src/app/units/states/groups/groups.tpl.html b/src/app/units/states/groups/groups.tpl.html deleted file mode 100644 index 319f46e08f..0000000000 --- a/src/app/units/states/groups/groups.tpl.html +++ /dev/null @@ -1,22 +0,0 @@ -
- - -
-
-
- -

No Groupwork Enabled

-
-
-

- There is no group work enabled for this unit. Convenors should create at - least one group set first for groups to be created. This can be found under - the groups tab in the unit administration settings. -

- Unit Administration -
-