Renamed groups to roles in the frontend
Working: Account Cost Centre Employee Product Group Product Role User Client
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<div fxLayout="row" *ngFor="let r of item.roles; index as i" [formGroupName]="i" fxLayout="row"
|
||||
fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<mat-checkbox formControlName="group" fxFlex>{{r.name}}</mat-checkbox>
|
||||
<mat-checkbox formControlName="role" fxFlex>{{r.name}}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -114,7 +114,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.lockedOut = formModel.lockedOut;
|
||||
const array = this.form.get('roles') as FormArray;
|
||||
this.item.roles.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.group;
|
||||
item.enabled = array.controls[index].value.role;
|
||||
});
|
||||
return this.item;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/users', row.name]">{{row.name}}</a></mat-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/users', row.id]">{{row.name}}</a></mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Locked Out Column -->
|
||||
|
||||
@@ -19,7 +19,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
get(id: string): Observable<User> {
|
||||
const getUrl: string = (id === null) ? `${url}/new` : `${url}/${id}`;
|
||||
const getUrl: string = (id === null) ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<User>>this.http.get<User>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`))
|
||||
@@ -27,23 +27,21 @@ export class UserService {
|
||||
}
|
||||
|
||||
list(): Observable<User[]> {
|
||||
const options = {params: new HttpParams().set('l', '')};
|
||||
return <Observable<User[]>>this.http.get<User[]>(url, options)
|
||||
return <Observable<User[]>>this.http.get<User[]>(`${url}/list`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
}
|
||||
|
||||
listOfNames(): Observable<string[]> {
|
||||
const options = {params: new HttpParams().set('n', '')};
|
||||
return <Observable<string[]>>this.http.get<string[]>(url, options)
|
||||
return <Observable<string[]>>this.http.get<string[]>(`${url}/active`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
}
|
||||
|
||||
save(user: User): Observable<User> {
|
||||
return <Observable<User>>this.http.post<User>(`${url}/new`, user, httpOptions)
|
||||
return <Observable<User>>this.http.post<User>(`${url}`, user, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save'))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user