Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groupsetmanager/migration #244

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
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
148 changes: 130 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@angular/animations": "^17.3.6",
"@angular/cdk": "^17.3.6",
"@angular/cli": "^17.3.6",
"@angular/cli": "^17.3.9",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have been updated

"@angular/common": "^17.3.6",
"@angular/compiler": "^17.3.6",
"@angular/core": "^17.3.6",
Expand Down
5 changes: 5 additions & 0 deletions src/app/doubtfire-angular.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {GroupSetManagerComponent} from './groups/group-set-manager/group-set-manager.component';

import {interval} from 'rxjs';
import {take} from 'rxjs/operators';

Expand Down Expand Up @@ -44,6 +46,8 @@ import {MatDialogModule as MatDialogModuleNew} from '@angular/material/dialog';
import {AlertService} from 'src/app/common/services/alert.service';
import {AlertComponent} from 'src/app/common/services/alert.service';



import {setTheme} from 'ngx-bootstrap/utils';

import {AboutDoubtfireModalService} from 'src/app/common/modals/about-doubtfire-modal/about-doubtfire-modal.service';
Expand Down Expand Up @@ -228,6 +232,7 @@ import {GradeService} from './common/services/grade.service';
@NgModule({
// Components we declare
declarations: [
GroupSetManagerComponent,
AlertComponent,
AboutDoubtfireModalContent,
TeachingPeriodUnitImportDialogComponent,
Expand Down
8 changes: 7 additions & 1 deletion src/app/doubtfire-angularjs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import 'build/src/app/projects/project-outcome-alignment/project-outcome-alignme
import 'build/src/app/admin/modals/modals.js';
import 'build/src/app/admin/modals/create-unit-modal/create-unit-modal.js';
import 'build/src/app/groups/group-selector/group-selector.js';
import 'build/src/app/groups/group-set-manager/group-set-manager.js';
// import 'build/src/app/groups/group-set-manager/group-set-manager.js';
import 'build/src/app/groups/groups.js';
import 'build/src/app/groups/group-member-contribution-assigner/group-member-contribution-assigner.js';
import 'build/src/app/groups/group-member-list/group-member-list.js';
Expand Down Expand Up @@ -146,6 +146,7 @@ import 'build/src/i18n/resources-locale_en-AU.js';
import 'build/src/i18n/resources-locale_en-GB.js';
//#endregion


import {AboutDoubtfireModal} from 'src/app/common/modals/about-doubtfire-modal/about-doubtfire-modal.component';
import {TaskCommentComposerComponent} from 'src/app/tasks/task-comment-composer/task-comment-composer.component';
import {DoubtfireConstants} from 'src/app/config/constants/doubtfire-constants';
Expand Down Expand Up @@ -220,6 +221,7 @@ import {FUnitTaskListComponent} from './units/states/tasks/viewer/directives/f-u
import {FTaskDetailsViewComponent} from './units/states/tasks/viewer/directives/f-task-details-view/f-task-details-view.component';
import {FTaskSheetViewComponent} from './units/states/tasks/viewer/directives/f-task-sheet-view/f-task-sheet-view.component';
import {TasksViewerComponent} from './units/states/tasks/tasks-viewer/tasks-viewer.component';
import {GroupSetManagerComponent} from './groups/group-set-manager/group-set-manager.component';

import {FUnitsComponent} from './admin/states/f-units/f-units.component';
import {MarkedPipe} from './common/pipes/marked.pipe';
Expand Down Expand Up @@ -301,6 +303,10 @@ DoubtfireAngularJSModule.factory(
'TransitionHooksService',
downgradeInjectable(TransitionHooksService),
);
DoubtfireAngularJSModule.directive(
'groupSetManagerComponent',
downgradeComponent({component: GroupSetManagerComponent}),
);
DoubtfireAngularJSModule.factory(
'EditProfileService',
downgradeInjectable(EditProfileDialogService),
Expand Down
44 changes: 0 additions & 44 deletions src/app/groups/group-set-manager/group-set-manager.coffee

This file was deleted.

59 changes: 59 additions & 0 deletions src/app/groups/group-set-manager/group-set-manager.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!-- <group-selector
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out? You should still be using group-selector. But that component would need to be migrated to Angular 17 first

[unit]="unit"
[unit-role]="unitRole"
[project]="project"
[selected-group]="selectedGroup"
[selected-group-set]="selectedGroupSet"
[show-group-set-selector]="showGroupSetSelector"
(on-select)="newGroupSelected()"
class="mat-card mat-card-primary"
> -->
<!-- </group-selector> -->

<mat-card *ngIf="selectedGroup">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngIf and the like should not be used

<mat-card-header>
<mat-card-title>
Members of
<span *ngIf="unitRole || selectedGroupSet.allowStudentsToManageGroups">
<a (click)="updateGroup(selectedGroup)">
{{ selectedGroup.name }}
</a>
</span>
</mat-card-title>
<mat-card-subtitle>
<mat-icon *ngIf="selectedGroup.locked" matTooltip="This group is locked">lock</mat-icon>
</mat-card-subtitle>
</mat-card-header>

<mat-card-content *ngIf="showMemberPanelToolbar">
<form (ngSubmit)="addMember(selectedStudent)" class="input-group">
<mat-form-field>
<input
matInput
placeholder="Enter student name or username..."
[(ngModel)]="selectedStudent"
name="selectedStudent"
[matAutocomplete]="auto"
(input)="filterStudents($event.target.value)"
/>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="addMember($event.option.value)">
<mat-option *ngFor="let student of filteredStudents | async" [value]="student">
{{ student.name }}
</mat-option>
</mat-autocomplete>
</mat-form-field>

<button mat-raised-button color="primary" type="submit" [disabled]="!selectedStudent.id">
<mat-icon>add</mat-icon> Add Member
</button>
</form>
</mat-card-content>

<group-member-list
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still a AngularJS component so this would not work

[unit]="unit"
[unit-role]="unitRole"
[project]="project"
[selected-group]="selectedGroup"
(on-members-loaded)="groupMembersLoaded()"
></group-member-list>
</mat-card>
Loading