feat(rep-create-form): Initialized and add as a pop-up menu in user-representation
This commit is contained in:
parent
36c55b6382
commit
52e6eac71d
@ -0,0 +1 @@
|
|||||||
|
<p>rep-create-form works!</p>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { RepCreateFormComponent } from './rep-create-form.component';
|
||||||
|
|
||||||
|
describe('RepCreateFormComponent', () => {
|
||||||
|
let component: RepCreateFormComponent;
|
||||||
|
let fixture: ComponentFixture<RepCreateFormComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [RepCreateFormComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(RepCreateFormComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { UserRep } from '../../../models/user-management.api.models';
|
||||||
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-rep-create-form',
|
||||||
|
standalone: true,
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './rep-create-form.component.html',
|
||||||
|
styleUrl: './rep-create-form.component.scss'
|
||||||
|
})
|
||||||
|
export class RepCreateFormComponent {
|
||||||
|
|
||||||
|
readonly userRep: UserRep = inject(MAT_DIALOG_DATA)
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
import { AfterViewInit, Component, ViewChild, inject } from '@angular/core';
|
||||||
import { GuiColumn, GuiSelectedRow } from '@generic-ui/ngx-grid/gui/grid/src/core/api/gui.grid.public-api';
|
import { GuiColumn, GuiSelectedRow } from '@generic-ui/ngx-grid/gui/grid/src/core/api/gui.grid.public-api';
|
||||||
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
|
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
|
||||||
import { UserRepTableComponent } from '../../components/tables/user-rep-table/user-rep-table.component';
|
import { UserRepTableComponent } from '../../components/tables/user-rep-table/user-rep-table.component';
|
||||||
@ -9,6 +9,8 @@ import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
|||||||
import { env } from '../../../environments/environment';
|
import { env } from '../../../environments/environment';
|
||||||
import { BasePageComponent } from '../base-page/base-page.component';
|
import { BasePageComponent } from '../base-page/base-page.component';
|
||||||
import { UserRep } from '../../models/user-management.api.models';
|
import { UserRep } from '../../models/user-management.api.models';
|
||||||
|
import { RepCreateFormComponent } from '../../components/forms/rep-create-form/rep-create-form.component';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -28,6 +30,8 @@ export class UserRepresentationComponent extends BasePageComponent implements Af
|
|||||||
slRepGroupId?: number;
|
slRepGroupId?: number;
|
||||||
slRepId?: number;
|
slRepId?: number;
|
||||||
|
|
||||||
|
private readonly dialog: MatDialog = inject(MatDialog);
|
||||||
|
|
||||||
initWithoutData = () => { }
|
initWithoutData = () => { }
|
||||||
|
|
||||||
constructor(private userRepService: UserRepService) {
|
constructor(private userRepService: UserRepService) {
|
||||||
@ -206,4 +210,11 @@ export class UserRepresentationComponent extends BasePageComponent implements Af
|
|||||||
this.slRepId = rows[0].source?.id;
|
this.slRepId = rows[0].source?.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openUpdateSheet(userRep: UserRep): void {
|
||||||
|
this.dialog.open(RepCreateFormComponent, {
|
||||||
|
width: "50rem",
|
||||||
|
data: userRep
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user