-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from fujaba/fix/assignments
Assignment Bugfixes
- Loading branch information
Showing
23 changed files
with
120 additions
and
147 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
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
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
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
23 changes: 23 additions & 0 deletions
23
...tend/src/app/assignment/modules/shared/assignee-dropdown/assignee-dropdown.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,23 @@ | ||
<div ngbDropdown> | ||
<button ngbDropdownToggle class="btn p-0 text-white text-shadow" | ||
[class.bi-person-plus]="!assignee" | ||
[ngbTooltip]="assignee || 'Add Assignee'" | ||
> | ||
{{ (assignee || '') | initials }} | ||
</button> | ||
<div ngbDropdownMenu> | ||
<button *ngFor="let suggestion of assignees" ngbDropdownItem (click)="assignee = suggestion; save()"> | ||
<span class="badge" [style.background-color]="suggestion | assigneeColor">{{ suggestion | initials }}</span> | ||
{{ suggestion }} | ||
</button> | ||
<button ngbDropdownItem class="bi-person-x" (click)="this.assignee = ''; save()"> | ||
Unassign | ||
</button> | ||
<div class="dropdown-item-text"> | ||
<label class="form-label" for="custom-assignee"> | ||
Custom Assignee | ||
</label> | ||
<input type="text" class="form-control" id="custom-assignee" [(ngModel)]="assignee" (change)="save()"> | ||
</div> | ||
</div> | ||
</div> |
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
frontend/src/app/assignment/modules/shared/assignee-dropdown/assignee-dropdown.component.ts
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,32 @@ | ||
import {Component, EventEmitter, Input, Output} from '@angular/core'; | ||
import {AssigneeService} from "../../../services/assignee.service"; | ||
import {ToastService} from "@mean-stream/ngbx"; | ||
|
||
@Component({ | ||
selector: 'app-assignee-dropdown', | ||
templateUrl: './assignee-dropdown.component.html', | ||
styleUrls: ['./assignee-dropdown.component.scss'] | ||
}) | ||
export class AssigneeDropdownComponent { | ||
@Input({required: true}) assignment: string; | ||
@Input({required: true}) solution: string; | ||
@Input() assignee?: string; | ||
@Input() assignees: string[] = []; | ||
|
||
@Output() assigneeChange = new EventEmitter<string | undefined>(); | ||
|
||
constructor( | ||
private assigneeService: AssigneeService, | ||
private toastService: ToastService, | ||
) { | ||
} | ||
|
||
save(): void { | ||
this.assigneeService.setAssignee(this.assignment, this.solution, this.assignee).subscribe(result => { | ||
this.assigneeChange.next(result?.assignee); | ||
this.toastService.success('Assignee', result ? `Successfully assigned to ${result.assignee}` : 'Successfully de-assigned'); | ||
}, error => { | ||
this.toastService.error('Assignee', 'Failed to assign', error); | ||
}); | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
frontend/src/app/assignment/modules/shared/assignee-input/assignee-input.component.html
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
frontend/src/app/assignment/modules/shared/assignee-input/assignee-input.component.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Oops, something went wrong.