add permissions to registration

This commit is contained in:
_Bastler 2021-03-29 20:09:53 +02:00
parent de7b2f507e
commit 35411505f8
6 changed files with 35 additions and 4 deletions

View File

@ -65,6 +65,16 @@
</mat-card> </mat-card>
</form> </form>
<div *ngIf="!success && permissions && permissions[0]">
<h3>{{'permissions' | i18n}}</h3>
<app-permissions [permissions]="permissions"></app-permissions>
</div>
<div *ngIf="!success && quotas && quotas[0]">
<h3>{{'quotas' | i18n}}</h3>
<app-quotas [quotas]="quotas"></app-quotas>
</div>
<mat-card *ngIf="success"> <mat-card *ngIf="success">
<mat-card-content> <mat-card-content>
<h2>{{'register.success.title' | i18n}}</h2> <h2>{{'register.success.title' | i18n}}</h2>
@ -76,3 +86,4 @@
</a> </a>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>

View File

@ -8,6 +8,8 @@ import {UserService} from './../../services/user.service';
import {ItemService} from './../../services/item.service'; import {ItemService} from './../../services/item.service';
import {I18nService} from './../../services/i18n.service'; import {I18nService} from './../../services/i18n.service';
import {MatchingValidator} from './../../utils/matching.validator'; import {MatchingValidator} from './../../utils/matching.validator';
import { PermissionService } from './../../services/permission.service';
import { QuotaService } from './../../services/quota.service';
import {uniqueNamesGenerator, Config, adjectives, colors, animals} from 'unique-names-generator'; import {uniqueNamesGenerator, Config, adjectives, colors, animals} from 'unique-names-generator';
@ -25,6 +27,8 @@ export class RegisterComponent implements OnInit {
public success: boolean; public success: boolean;
public working: boolean; public working: boolean;
items = []; items = [];
permissions = [];
quotas = [];
currentLocale: String; currentLocale: String;
model: any = { model: any = {
username: '', username: '',
@ -37,6 +41,8 @@ export class RegisterComponent implements OnInit {
private userService: UserService, private userService: UserService,
private itemService: ItemService, private itemService: ItemService,
private i18n: I18nService, private i18n: I18nService,
private permissionService: PermissionService,
private quotaService: QuotaService,
public dialog: MatDialog) { public dialog: MatDialog) {
this.currentLocale = this.i18n.getLocale(); this.currentLocale = this.i18n.getLocale();
} }
@ -55,6 +61,14 @@ export class RegisterComponent implements OnInit {
this.itemService.items().subscribe((data: any) => { this.itemService.items().subscribe((data: any) => {
this.items = data; this.items = data;
}); });
this.permissionService.permissionsNew().subscribe((data: any) => {
this.permissions = data;
})
this.quotaService.quotasNew().subscribe((data: any) => {
this.quotas = data;
})
} }
onPrimaryChange() { onPrimaryChange() {

View File

@ -104,6 +104,9 @@
"openBlob": "Anzeigen", "openBlob": "Anzeigen",
"type": { "type": {
".": "Typ", ".": "Typ",
"BLOB": {
".": "Binärblob"
},
"BOOL": { "BOOL": {
".": "Boolean" ".": "Boolean"
}, },

View File

@ -104,6 +104,9 @@
"openBlob": "Display", "openBlob": "Display",
"type": { "type": {
".": "Type", ".": "Type",
"BLOB": {
".": "Binary blob"
},
"BOOL": { "BOOL": {
".": "Boolean" ".": "Boolean"
}, },

View File

@ -22,7 +22,7 @@ $light-theme: mat-light-theme((color: (primary: $light-primary,
// Define an alternate dark theme. // Define an alternate dark theme.
$dark-theme: mat-dark-theme((color: (primary: $dark-primary, $dark-theme: mat-dark-theme((color: (primary: $dark-primary,
accent: $light-accent, accent: $light-accent,
warn: $dark-warn, warn: $light-warn,
))); )));
// Include theme styles for core and each component used in your app. // Include theme styles for core and each component used in your app.

View File

@ -15,6 +15,6 @@ $dark-warn: mat-palette($mat-deep-orange);
.dark-theme { .dark-theme {
$primary: mat-color($dark-primary); $primary: mat-color($dark-primary);
$accent: mat-color($dark-accent); $accent: mat-color($light-accent);
$warn: mat-color($dark-warn); $warn: mat-color($light-warn);
} }