Feature: Download Products
Fix: Add user Fix: Added 5000 page size in products Fix: Local Time Pipe was showing the wrong time
This commit is contained in:
@@ -7,6 +7,7 @@ import {ToasterService} from '../../core/toaster.service';
|
||||
import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import {MatDialog} from '@angular/material';
|
||||
import {FormArray, FormBuilder, FormGroup} from '@angular/forms';
|
||||
import {Account} from "../../account/account";
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-detail',
|
||||
@@ -43,18 +44,25 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { item: User }) => {
|
||||
this.item = data.item;
|
||||
this.form.get('name').setValue(this.item.name);
|
||||
this.form.setControl('groups', this.fb.array(
|
||||
this.item.groups.map(
|
||||
x => this.fb.group({
|
||||
group: x.enabled
|
||||
})
|
||||
)
|
||||
));
|
||||
this.showItem(data.item);
|
||||
});
|
||||
}
|
||||
|
||||
showItem(item: User) {
|
||||
this.item = item;
|
||||
this.form.get('name').setValue(item.name);
|
||||
this.form.get('password').setValue('');
|
||||
this.form.get('lockedOut').setValue(item.lockedOut);
|
||||
this.form.setControl('groups', this.fb.array(
|
||||
item.groups.map(
|
||||
x => this.fb.group({
|
||||
group: x.enabled
|
||||
})
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
this.nameElement.nativeElement.focus();
|
||||
@@ -103,7 +111,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
getItem(): User {
|
||||
const formModel = this.form.value;
|
||||
this.item.name = formModel.name;
|
||||
this.item.password = formModel.password``;
|
||||
this.item.password = formModel.password;
|
||||
this.item.lockedOut = formModel.lockedOut;
|
||||
const array = this.form.get('groups') as FormArray;
|
||||
this.item.groups.forEach((item, index) => {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<mat-card>
|
||||
<mat-card-title-group>
|
||||
<mat-card-title>Users</mat-card-title>
|
||||
<a mat-button [routerLink]="['/User']">
|
||||
<mat-icon>add_box</mat-icon>
|
||||
Add
|
||||
</a>
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
|
||||
Reference in New Issue
Block a user