Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 7cd372a

Browse files
committed
Added privileges
1 parent 80b15d2 commit 7cd372a

36 files changed

Lines changed: 403 additions & 154 deletions

File tree

EEDU-Backend/src/main/java/de/gaz/eedu/user/privileges/SystemPrivileges.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ public enum SystemPrivileges
1111
{
1212
CLASS_CREATE,
1313
CLASS_DELETE,
14+
CLASS_GET,
1415

1516
SUBJECT_CREATE,
1617
SUBJECT_DELETE,
18+
SUBJECT_GET,
1719

1820
ROOM_CREATE,
1921
ROOM_DELETE,
22+
ROOM_GET,
2023

2124
COURSE_CREATE,
2225
COURSE_DELETE,
26+
COURSE_GET,
2327

2428
USER_DELETE,
2529
USER_CREATE,

EEDU-Frontend/src/app/common/abstract-list/abstract-list.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {AllCheckBoxComponent} from "./checkboxes/all-check-box.component";
1515
import {SingleCheckBoxComponent} from "./checkboxes/single-check-box.component";
1616
import {ListItemContent} from "./list-item-content";
1717
import {MatList, MatListItem} from "@angular/material/list";
18+
import {AccessibilityService} from "../../accessibility.service";
1819

1920
// noinspection JSUnusedGlobalSymbols
2021
export enum SelectionType {
@@ -50,6 +51,8 @@ export class AbstractList<T> {
5051

5152
private _values: readonly T[] = [];
5253

54+
public constructor(private readonly _accessibilityService: AccessibilityService) {}
55+
5356
@Input() public set values(value: readonly T[]) {
5457
this._values = value as readonly T[];
5558

@@ -70,7 +73,10 @@ export class AbstractList<T> {
7073
return this._values;
7174
}
7275

73-
protected get hasChips(): boolean { return !!this.itemInfo()!.chips; }
76+
protected get hasChips(): boolean
77+
{
78+
return !this._accessibilityService.mobile && !!this.itemInfo()!.chips;
79+
}
7480

7581
protected get hasContent(): boolean {
7682
return !!this.itemInfo()?.content;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="error-content">
2+
<div class="error-icon">
3+
<mat-icon color="warn" style="font-size: 64px; height: 64px; width: 64px;">warning</mat-icon>
4+
</div>
5+
<div class="error-message">
6+
<p><strong>{{ message() }}</strong></p>
7+
<p *ngIf="subMessage() != null" class="mat-caption">{{ subMessage() }}</p>
8+
</div>
9+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.error-content {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
text-align: center;
6+
padding: 24px;
7+
}
8+
9+
.error-icon {
10+
margin-bottom: 16px;
11+
}
12+
13+
.error-message p strong {
14+
color: #d32f2f;
15+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { GeneralErrorBoxComponent } from './general-error-box.component';
4+
5+
describe('GeneralErrorBoxComponent', () => {
6+
let component: GeneralErrorBoxComponent;
7+
let fixture: ComponentFixture<GeneralErrorBoxComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [GeneralErrorBoxComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(GeneralErrorBoxComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {Component, input, InputSignal} from '@angular/core';
2+
import {MatIcon} from "@angular/material/icon";
3+
import {NgIf} from "@angular/common";
4+
5+
@Component({
6+
selector: 'general-error-box',
7+
imports: [MatIcon, NgIf],
8+
templateUrl: './general-error-box.component.html',
9+
styleUrl: './general-error-box.component.scss'
10+
})
11+
export class GeneralErrorBoxComponent {
12+
public readonly message: InputSignal<string> = input<string>('');
13+
public readonly subMessage: InputSignal<string | null> = input<string | null>(null);
14+
}

EEDU-Frontend/src/app/entity/create-entity/abstract-create-entity.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export abstract class AbstractCreateEntity extends AbstractSimpleCreateEntity {
2424
return [this.form.value];
2525
}
2626

27-
protected get canSubmit(): boolean { return this.form.valid; }
27+
protected get canSubmit(): boolean {
28+
return this.form.valid;
29+
}
2830

2931
protected getForm(formBuilder: FormBuilder): FormGroup {
3032
return formBuilder.group({id: [null, Validators.required]});

EEDU-Frontend/src/app/entity/create-entity/s-create-dialog/simple-create-dialog.component.html renamed to EEDU-Frontend/src/app/entity/create-entity/simple-create-dialog/simple-create-dialog.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
}
1616
</mat-chip-grid>
1717
<input (matChipInputTokenEnd)="add($event)" [matChipInputFor]="reactiveChipGrid" matInput type="text"/>
18+
<mat-icon matSuffix matTooltip="Add items by typing and pressing Enter, and remove them by clicking the x icon.">help</mat-icon>
1819
</mat-form-field>
1920

2021
</mat-card-content>

EEDU-Frontend/src/app/entity/create-entity/s-create-dialog/simple-create-dialog.component.scss renamed to EEDU-Frontend/src/app/entity/create-entity/simple-create-dialog/simple-create-dialog.component.scss

File renamed without changes.

EEDU-Frontend/src/app/entity/create-entity/s-create-dialog/simple-create-dialog.component.spec.ts renamed to EEDU-Frontend/src/app/entity/create-entity/simple-create-dialog/simple-create-dialog.component.spec.ts

File renamed without changes.

0 commit comments

Comments
 (0)