master detail changes
This commit is contained in:
parent
3e22bc5e11
commit
6082271d4b
@ -0,0 +1,65 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Branch
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex>Branch</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex></div>
|
||||
</div>
|
||||
|
||||
<!-- {{empresas|json}} -->
|
||||
|
||||
<form [formGroup]="_branchForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-2">
|
||||
<mat-form-field>
|
||||
<!-- <ngx-select-dropdown [multiple]="false" [value]="citydatas.city_id" [options]="citydatas" ></ngx-select-dropdown> -->
|
||||
<mat-select placeholder="Pick Up City name" required [formControl]="_branchForm.controls['fk_city_id']">
|
||||
<!-- <mat-option (click)="onChangedData()" *ngFor="let masters of masterArray" [value]="masters.value" [disabled]="masters.disabled"> -->
|
||||
<mat-option *ngFor="let cd of citydatas" [value]="cd.city_id">{{ cd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</small> -->
|
||||
</div>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="Branch Name" required [formControl]="_branchForm.controls['name']">
|
||||
<mat-error *ngIf="!_branchForm.controls['name'].valid && _branchForm.controls['name'].touched">You must inculde a Name</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['name'].valid && _branchForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</small> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
|
||||
tate_id: "1", fk_region_id: "1", name: "TamilNadu", code: "TN", createdon: "2018-08-07 15:10:00", …}
|
||||
1
|
||||
:
|
||||
{state_id: "2", fk_region_id: "0", name: "one edited", code:
|
||||
<input matInput type="text" placeholder="City Name" required [formControl]="_branchForm.controls['fk_city_id']">
|
||||
</mat-form-field>
|
||||
<small *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must include a City Name.</small>
|
||||
</div> -->
|
||||
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_branchForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
</form>
|
||||
@ -0,0 +1,8 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
mat-dialog-container{
|
||||
width:10% !important;
|
||||
}
|
||||
|
||||
//style="width: 100%"
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BranchDialogComponent } from './branch-dialog.component';
|
||||
|
||||
describe('BranchDialogComponent', () => {
|
||||
let component: BranchDialogComponent;
|
||||
let fixture: ComponentFixture<BranchDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ BranchDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BranchDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,86 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { Branch,States,City } from '../../../model/branch';
|
||||
import { Observable } from 'rxjs/Observable';//for Datatables
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './branch-dialog.component.html',
|
||||
styleUrls: ['./branch-dialog.component.scss']
|
||||
})
|
||||
|
||||
export class BranchDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _branchForm: FormGroup;
|
||||
|
||||
citydatas: City[];
|
||||
errorMessage:string;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<BranchDialogComponent>,
|
||||
private _mastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: Branch) { }
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._branchForm = this._formBuilder.group({
|
||||
branch_id: [this.data.branch_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_city_id: [this.data.fk_city_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._branchForm);
|
||||
|
||||
this._mastersService.getAllMasterData('CITY')
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
if (data.status == 200) {
|
||||
this.citydatas = data.records;
|
||||
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
|
||||
}
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
}
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
|
||||
var BranchFormValues = this._branchForm.value;
|
||||
|
||||
if(isNaN(this.data.branch_id)) {
|
||||
|
||||
Object.keys(BranchFormValues)
|
||||
.forEach((key) => ( BranchFormValues[key] == null) && delete BranchFormValues[key]);
|
||||
//console.log(BranchFormValues);
|
||||
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(data=>{
|
||||
// alert(1);
|
||||
// console.log(data);
|
||||
this._mastersService.getAllBranch();
|
||||
|
||||
this.dialogRef.close();
|
||||
});
|
||||
// this.dialogRef.close();
|
||||
//alert("saved");
|
||||
} else {
|
||||
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe();
|
||||
this.dialogRef.close();
|
||||
//alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._branchForm.reset();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
<div class="pad-wrap">
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addBranch()" [disabled]="dialogRef"> + Add Branch</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="example-header">
|
||||
<mat-form-field>
|
||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="example-container mat-elevation-z8">
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="cname">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.cityname}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editBranch(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteBranch(row.branch_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<!--<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
|
||||
|
||||
<ng-container matColumnDef="position">
|
||||
<th mat-header-cell *matHeaderCellDef> No. </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> Name </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="weight">
|
||||
<th mat-header-cell *matHeaderCellDef> Weight </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.weight}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="symbol">
|
||||
<th mat-header-cell *matHeaderCellDef> Symbol </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>-->
|
||||
|
||||
|
||||
<!--<mat-table #table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="{{column.id}}" *ngFor="let column of columnNames">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> {{column.value}} </mat-header-cell>
|
||||
<mat-cell *matCellDef="let element"> {{element[column.id]}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>-->
|
||||
@ -0,0 +1,97 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/*** Structure *
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}****/
|
||||
|
||||
/**mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.button{
|
||||
padding-left: 6px;
|
||||
font-size: 20px;
|
||||
}**/
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BranchListComponent } from './branch-list.component';
|
||||
|
||||
describe('BranchListComponent', () => {
|
||||
let component: BranchListComponent;
|
||||
let fixture: ComponentFixture<BranchListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ BranchListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BranchListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,118 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import 'rxjs/add/operator/map';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
// import { Bra } from './../branch-list';
|
||||
// BranchListComponent
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component';
|
||||
import { Branch,States,City } from '../../../model/branch';
|
||||
|
||||
@Component({
|
||||
selector: 'app-branch-list',
|
||||
templateUrl: './branch-list.component.html',
|
||||
styleUrls: ['./branch-list.component.scss']
|
||||
})
|
||||
export class BranchListComponent implements OnInit {
|
||||
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
BranchList: any = [];
|
||||
|
||||
|
||||
|
||||
userData = null;
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
// displayedColumns = ['name', 'email', 'phone', 'company'];
|
||||
displayedColumns = ['name','cname', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _mastersService: MastersService) {
|
||||
this._mastersService.getAllBranch().subscribe(
|
||||
data => {
|
||||
this.userData = data.records;
|
||||
// alert(this.userData);
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
// this._mastersService.getAllBranch().subscribe(dataresult =>{
|
||||
// this.dataLength = dataresult.records.length;
|
||||
// alert(this.dataLength);
|
||||
|
||||
// this.dataSource = dataresult.records;
|
||||
|
||||
// })
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.getBranch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**Popup for ADD Branch */
|
||||
addBranch() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(BranchDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** Popup for EDIT Branch */
|
||||
editBranch(arr: Branch[]) {
|
||||
this.isPopupOpened = true;
|
||||
|
||||
const dialogRef = this.dialog.open(BranchDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** To delete Branch Datas */
|
||||
deleteBranch(id: number) {
|
||||
var PrimaryKeyWithValue ={'branch_id':id};
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe();
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/** To set the All Branch value as Data sources with help of connect() */
|
||||
@ -0,0 +1,56 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>City
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex="15px">City</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex></div>
|
||||
</div>
|
||||
|
||||
|
||||
<form [formGroup]="_cityForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Pick Up State Name" required [formControl]="_cityForm.controls['fk_state_id']">
|
||||
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_cityForm.controls['fk_state_id'].valid && _cityForm.controls['fk_state_id'].touched" class="mat-text-warn">You must Pickup State Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="City Name" required [formControl]="_cityForm.controls['name']">
|
||||
<mat-error *ngIf="!_cityForm.controls['name'].valid && _cityForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="State Name" required [formControl]="_cityForm.controls['fk_state_id']">
|
||||
</mat-form-field>
|
||||
<small *ngIf="!_cityForm.controls['fk_state_id'].valid && _cityForm.controls['fk_state_id'].touched" class="mat-text-warn">You must include a State Name.</small>
|
||||
</div> -->
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_cityForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CityDialogComponent } from './city-dialog.component';
|
||||
|
||||
describe('CityDialogComponent', () => {
|
||||
let component: CityDialogComponent;
|
||||
let fixture: ComponentFixture<CityDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CityDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CityDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,83 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { States } from '../../../model/states';
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './city-dialog.component.html',
|
||||
styleUrls: ['./city-dialog.component.scss']
|
||||
})
|
||||
export class CityDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _cityForm: FormGroup;
|
||||
|
||||
stateDatas: any[];
|
||||
errorMessage:string;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CityDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._cityForm = this._formBuilder.group({
|
||||
//City_id: any; fk_city_id: any;
|
||||
|
||||
city_id: [this.data.city_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._cityForm);
|
||||
|
||||
this._MastersService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateDatas = data.records;
|
||||
this.stateDatas = this.stateDatas.filter(city=>city.isactive == 1 );
|
||||
}
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addCity(this._cityForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editCity(this._cityForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.city_id)) {
|
||||
var my_array = this._cityForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._cityForm.value,'CITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._cityForm.reset();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addCity()" [disabled]="dialogRef"> + Add City</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<!-- displayedColumns = ['city_id','name', 'fk_state_id','state_name' , 'isactive','actions'];
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<table>-->
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">City Name</th>
|
||||
<th style="text-align: center;">State Name</th>
|
||||
<th style="text-align: center;">Isactive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="CityList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let CL of CityList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{CL.name}}</td>
|
||||
<td style="text-align: center;">{{CL.state_name}}</td>
|
||||
<td style="text-align: center;">{{CL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editCity(CL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteCity(CL.city_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- <div>
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="city_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.city_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_state_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> state ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_state_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="state_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> State Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.state_name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCity(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCity(user.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,69 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.button{
|
||||
padding-left: 6px;
|
||||
font-size: 20px;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CityListComponent } from './city-list.component';
|
||||
|
||||
describe('CityListComponent', () => {
|
||||
let component: CityListComponent;
|
||||
let fixture: ComponentFixture<CityListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CityListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CityListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,107 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { CityDialogComponent } from '../city-dialog/city-dialog.component';
|
||||
import { City } from '../../../model/city';
|
||||
|
||||
@Component({
|
||||
selector: 'app-city-list',
|
||||
templateUrl: './city-list.component.html',
|
||||
styleUrls: ['./city-list.component.scss']
|
||||
})
|
||||
export class CityListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
CityList: any = [];
|
||||
|
||||
//, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
displayedColumns = ['city_id','name', 'fk_state_id','state_name' , 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get CityList() {
|
||||
// return this._MastersService.getAllCity();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getCity();
|
||||
}
|
||||
|
||||
|
||||
addCity() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CityDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCity(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCity().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CityDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCity() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllCity().subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.CityList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteCity(id: number) {
|
||||
var PrimaryKeyWithValue ={'city_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<City[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCity();
|
||||
return this._bs.getAllMasterData('CITY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>CommentOnLocality
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex="15px">Comment On Locality</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex></div>
|
||||
</div>
|
||||
|
||||
|
||||
<form [formGroup]="_CommentOnLocalityForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Rating" required [formControl]="_CommentOnLocalityForm.controls['rating']">
|
||||
<mat-error *ngIf="!_CommentOnLocalityForm.controls['rating'].valid && _CommentOnLocalityForm.controls['rating'].touched" class="mat-text-warn">You must include a Rating.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_CommentOnLocalityForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CommentsOnLocalityDialogComponent } from './comments-on-locality-dialog.component';
|
||||
|
||||
describe('CommentsOnLocalityDialogComponent', () => {
|
||||
let component: CommentsOnLocalityDialogComponent;
|
||||
let fixture: ComponentFixture<CommentsOnLocalityDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CommentsOnLocalityDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CommentsOnLocalityDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,58 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './comments-on-locality-dialog.component.html',
|
||||
styleUrls: ['./comments-on-locality-dialog.component.scss']
|
||||
})
|
||||
export class CommentsOnLocalityDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _CommentOnLocalityForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CommentsOnLocalityDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._CommentOnLocalityForm = this._formBuilder.group({
|
||||
//branch_id: any; fk_city_id: any;
|
||||
comments_on_locality_id: [this.data.comments_on_locality_id],
|
||||
rating: [this.data.rating, Validators.compose([Validators.required])],
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.comments_on_locality_id)) {
|
||||
var my_array = this._CommentOnLocalityForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'COMMENTSONLOCALITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._CommentOnLocalityForm.reset();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addCommentsOnLocality()" [disabled]="dialogRef"> + Add Comments On Locality</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">Comments On Locality Id</th>
|
||||
<th style="text-align: center;">Rating</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="CommentsOnLocalityList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let CLL of CommentsOnLocalityList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{CLL.comments_on_locality_id}}</td>
|
||||
<td style="text-align: center;">{{CLL.rating}}</td>
|
||||
<td style="text-align: center;">{{CLL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editCommentsOnLocality(CLL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteCommentsOnLocality(CLL.comments_on_locality_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="comments_on_locality_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> No </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.comments_on_locality_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="rating">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Rating </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.rating}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCommentsOnLocality(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCommentsOnLocality(user.comments_on_locality_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CommentsOnLocalityListComponent } from './comments-on-locality-list.component';
|
||||
|
||||
describe('CommentsOnLocalityListComponent', () => {
|
||||
let component: CommentsOnLocalityListComponent;
|
||||
let fixture: ComponentFixture<CommentsOnLocalityListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CommentsOnLocalityListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CommentsOnLocalityListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,107 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialog/comments-on-locality-dialog.component';
|
||||
import { CommentsOnLocality } from '../../../model/comments-on-locality';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-comments-on-locality-list',
|
||||
templateUrl: './comments-on-locality-list.component.html',
|
||||
styleUrls: ['./comments-on-locality-list.component.scss']
|
||||
})
|
||||
export class CommentsOnLocalityListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
CommentsOnLocalityList: any = [];
|
||||
|
||||
displayedColumns = ['comments_on_locality_id','rating','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get CommentsOnLocalityList() {
|
||||
// return this._MastersService.getAllCommentsOnLocality();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getCommentsOnLocality();
|
||||
}
|
||||
|
||||
|
||||
addCommentsOnLocality() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCommentsOnLocality(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCommentsOnLocality().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCommentsOnLocality() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.CommentsOnLocalityList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteCommentsOnLocality(id: number) {
|
||||
var PrimaryKeyWithValue ={'comments_on_locality_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY');
|
||||
//this._MastersService.deleteMasterDetails('',id,'');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<CommentsOnLocality []> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCommentsOnLocality();
|
||||
return this._bs.getAllMasterData('COMMENTSONLOCALITY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Company
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex="15px">Company</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex></div>
|
||||
</div>
|
||||
|
||||
|
||||
<form [formGroup]="_companyForm" (ngsubmit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
<!-- displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state', 'pincode', 'logo']; -->
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company Name" required [formControl]="_companyForm.controls['name']">
|
||||
<mat-error *ngIf="!_companyForm.controls['name'].valid && _companyForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline1" required [formControl]="_companyForm.controls['addressline1']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline1'].valid && _companyForm.controls['addressline1'].touched" class="mat-text-warn">You must include a addressline1.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline2" required [formControl]="_companyForm.controls['addressline2']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline2'].valid && _companyForm.controls['addressline2'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline3" required [formControl]="_companyForm.controls['addressline3']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline3'].valid && _companyForm.controls['addressline3'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<!-- <div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="City" required [formControl]="_companyForm.controls['city']">
|
||||
<mat-error *ngIf="!_companyForm.controls['city'].valid && _companyForm.controls['city'].touched" class="mat-text-warn">You must include a City.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div> -->
|
||||
<div class="mb-1">
|
||||
<mat-form-field>
|
||||
<!-- <ngx-select-dropdown [multiple]="false" [value]="citydatas.city_id" [options]="citydatas" ></ngx-select-dropdown> -->
|
||||
<mat-select placeholder="Pick Up City name" required [formControl]="_companyForm.controls['city']">
|
||||
<!-- <mat-option (click)="onChangedData()" *ngFor="let masters of masterArray" [value]="masters.value" [disabled]="masters.disabled"> -->
|
||||
<mat-option *ngFor="let cd of citydatas" [value]="cd.city_id">{{ cd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_companyForm.controls['city'].valid && _companyForm.controls['city'].touched" class="mat-text-warn">You must include a City.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</small> -->
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Pin code" required [formControl]="_companyForm.controls['pincode']">
|
||||
<mat-hint>pincode should be in 6 digit format</mat-hint>
|
||||
<!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('required') && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include phone number.</mat-error> -->
|
||||
<!-- <mat-error *ngIf="!_companyForm.controls['pincode'].valid && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include a pincode number.</mat-error> -->
|
||||
<mat-error *ngIf="_companyForm.controls['pincode'].hasError('minlength') && _companyForm.controls['pincode'].touched" class="mat-text-warn">Your pincode must be at least 5 characters long.</mat-error>
|
||||
<mat-error *ngIf="_companyForm.controls['pincode'].hasError('maxlength') && _companyForm.controls['pincode'].touched" class="mat-text-warn">Your pincode name cannot exceed 6 characters.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div class="mb-1">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Pick Up State Name" required [formControl]="_companyForm.controls['state']">
|
||||
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_companyForm.controls['state'].valid && _companyForm.controls['state'].touched" class="mat-text-warn">You must Pickup a State.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<!-- <div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="logo" required [formControl]="_companyForm.controls['logo']">
|
||||
<mat-error *ngIf="!_companyForm.controls['logo'].valid && _companyForm.controls['logo'].touched" class="mat-text-warn">You must include a logo.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="mb-1">
|
||||
logo
|
||||
<input type="file" (change)="onFileChange($event)" [formControl]="_companyForm.controls['logo']"/>
|
||||
<!-- <span *ngIf="usersData!=''">{{img}}</span> -->
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_companyForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CompanyDialogComponent } from './company-dialog.component';
|
||||
|
||||
describe('CompanyDialogComponent', () => {
|
||||
let component: CompanyDialogComponent;
|
||||
let fixture: ComponentFixture<CompanyDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CompanyDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CompanyDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,113 @@
|
||||
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
//import { CompanyService } from '../../../service/company.service';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './company-dialog.component.html',
|
||||
styleUrls: ['./company-dialog.component.scss']
|
||||
})
|
||||
export class CompanyDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _companyForm: FormGroup;
|
||||
|
||||
stateDatas: any[];
|
||||
citydatas: any[];
|
||||
errorMessage:string;
|
||||
files: File = null
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CompanyDialogComponent>,
|
||||
private _masterService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._companyForm = this._formBuilder.group({
|
||||
//Company_id: any; fk_city_id: any;
|
||||
// <!-- displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state', 'pincode', 'logo']; -->
|
||||
company_id: [this.data.company_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
addressline1: [this.data.addressline1, Validators.compose([Validators.required])],
|
||||
addressline2: [this.data.addressline2, Validators.compose([Validators.required])],
|
||||
addressline3: [this.data.addressline3, Validators.compose([Validators.required])],
|
||||
city: [this.data.city, Validators.compose([Validators.required])],
|
||||
state: [this.data.state, Validators.compose([Validators.required])],
|
||||
pincode: [this.data.pincode, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(6)])],
|
||||
logo : [this.data.logo]
|
||||
});
|
||||
|
||||
this._masterService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateDatas = data.records;
|
||||
this.stateDatas = this.stateDatas.filter(dataresult=>dataresult.isactive == 1 );
|
||||
}
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
this._masterService.getAllMasterData('CITY')
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
this.citydatas = data.records;
|
||||
this.citydatas = this.citydatas.filter(dataresult=>dataresult.isactive == 1 );
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
|
||||
}
|
||||
onFileChange($event) {
|
||||
//console.log($event.target.files[0]);
|
||||
|
||||
//if($event.target.files[0] < 0 ){
|
||||
this.files = $event.target.files[0];
|
||||
//}
|
||||
//console.log(this.files);
|
||||
}
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._companyService.addCompany(this._companyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._companyService.editCompany(this._companyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if (this.files) {
|
||||
this.data.logo = this.files;
|
||||
}
|
||||
if(isNaN(this.data.company_id)) {
|
||||
var my_array = this._companyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._masterService.addMasterDetails(my_array,'COMPANY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._masterService.editMasterDetails(this._companyForm.value,'COMPANY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._companyForm.reset();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addCompany()" [disabled]="dialogRef"> + Add Company</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<!-- <th style="text-align: center;">Company ID</th> -->
|
||||
<th style="text-align: center;">Company Name</th>
|
||||
<th style="text-align: center;">Company City</th>
|
||||
<th style="text-align: center;">Company State</th>
|
||||
<!-- <th style="text-align: center;">Is Active</th> -->
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="CompanyList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let CL of CompanyList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{CL.name}}</td>
|
||||
<td style="text-align: center;">{{CL.city_name}}</td>
|
||||
<td style="text-align: center;">{{CL.state_name}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editCompany(CL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteCompany(CL.company_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!-- displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state', 'pincode', 'logo']; -->
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="company_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.company_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="addressline1">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> address </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.addressline1}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="addressline2">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> address 2 </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.addressline2}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="addressline3">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> address 3 </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.addressline3}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="city">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> city </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.city}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="state">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> state </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.state}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="city_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> city </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.city_name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="state_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> state </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.state_name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="pincode">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Pincode </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.pincode}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="logo">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> logo name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.logo}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="action">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCompany(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCompany(user.company_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>-->
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CompanyListComponent } from './company-list.component';
|
||||
|
||||
describe('CompanyListComponent', () => {
|
||||
let component: CompanyListComponent;
|
||||
let fixture: ComponentFixture<CompanyListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CompanyListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CompanyListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,109 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { CompanyDialogComponent } from '../company-dialog/company-dialog.component';
|
||||
import { Company } from '../../../model/company';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-company-list',
|
||||
templateUrl: './company-list.component.html',
|
||||
styleUrls: ['./company-list.component.scss']
|
||||
})
|
||||
export class CompanyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
CompanyList: any = [];
|
||||
|
||||
//displayedColumns = ['Company_id', 'fk_city_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions'];
|
||||
displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state','city_name', 'state_name', 'pincode', 'logo','action'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get CompanyList() {
|
||||
// return this._MastersService.getAllCompany();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getCompany();
|
||||
}
|
||||
|
||||
|
||||
addCompany() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CompanyDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCompany(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCompany().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CompanyDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCompany() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllCompany().subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.CompanyList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteCompany(id: number) {
|
||||
var PrimaryKeyWithValue ={'company_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY');
|
||||
//this._MastersService.deleteMasterDetails('company_id',id,'COMPANY');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Company[]> {
|
||||
//return this.userService.getUser();
|
||||
return this._bs.getAllCompany();
|
||||
//return this._bs.getAllMasterData('COMPANY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Customer Behaviour
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex>Customer Behaviour</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="15px"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_customerBehaviourForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Description" required [formControl]="_customerBehaviourForm.controls['description']">
|
||||
<mat-error *ngIf="!_customerBehaviourForm.controls['description'].valid && _customerBehaviourForm.controls['description'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<!-- customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive -->
|
||||
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_customerBehaviourForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomerBehaviourDialogComponent } from './customer-behaviour-dialog.component';
|
||||
|
||||
describe('CustomerBehaviourDialogComponent', () => {
|
||||
let component: CustomerBehaviourDialogComponent;
|
||||
let fixture: ComponentFixture<CustomerBehaviourDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CustomerBehaviourDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomerBehaviourDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,68 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './customer-behaviour-dialog.component.html',
|
||||
styleUrls: ['./customer-behaviour-dialog.component.scss']
|
||||
})
|
||||
export class CustomerBehaviourDialogComponent implements OnInit {
|
||||
|
||||
public _customerBehaviourForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CustomerBehaviourDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._customerBehaviourForm = this._formBuilder.group({
|
||||
//branch_id: any; fk_city_id: any;
|
||||
customer_behaviour_id: [this.data.customer_behaviour_id],
|
||||
description: [this.data.description, Validators.compose([Validators.required])]
|
||||
|
||||
});
|
||||
//customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
//console.log(this._customerBehaviourForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addBranch(this._customerBehaviourForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editBranch(this._customerBehaviourForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.customer_behaviour_id)) {
|
||||
var my_array = this._customerBehaviourForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._customerBehaviourForm.reset();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addCustomerBehaviour()" [disabled]="dialogRef"> + Add CustomerBehaviour</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">CustomerBehaviour ID</th>
|
||||
<th style="text-align: center;">Description</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="CustomerBehaviourList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let CBL of CustomerBehaviourList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{CBL.customer_behaviour_id}}</td>
|
||||
<td style="text-align: center;">{{CBL.description}}</td>
|
||||
<td style="text-align: center;">{{CBL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editCustomerBehaviour(CBL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteCustomerBehaviour(CBL.customer_behaviour_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- //customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive ->
|
||||
<div>
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="customer_behaviour_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.customer_behaviour_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> description </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.description}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerBehaviour(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerBehaviour(user.customer_behaviour_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomerBehaviourListComponent } from './customer-behaviour-list.component';
|
||||
|
||||
describe('CustomerBehaviourListComponent', () => {
|
||||
let component: CustomerBehaviourListComponent;
|
||||
let fixture: ComponentFixture<CustomerBehaviourListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CustomerBehaviourListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomerBehaviourListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,108 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component';
|
||||
import { CustomerBehaviour } from '../../../model/customer-behaviour';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-customer-behaviour-list',
|
||||
templateUrl: './customer-behaviour-list.component.html',
|
||||
styleUrls: ['./customer-behaviour-list.component.scss']
|
||||
})
|
||||
export class CustomerBehaviourListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
CustomerBehaviourList: any = [];
|
||||
|
||||
displayedColumns = ['customer_behaviour_id', 'description', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get CustomerBehaviourList() {
|
||||
// return this._MastersService.getAllCustomerBehaviour();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getCustomerBehaviour();
|
||||
}
|
||||
|
||||
|
||||
addCustomerBehaviour() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCustomerBehaviour(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCustomerBehaviour().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCustomerBehaviour() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.CustomerBehaviourList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteCustomerBehaviour(id: number) {
|
||||
var PrimaryKeyWithValue ={'customer_behaviour_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERBEHAVIOUR');
|
||||
//this._MastersService.deleteMasterDetails('customer_behaviour_id',id,'CUSTOMERBEHAVIOUR');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<CustomerBehaviour[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCustomerBehaviour();
|
||||
return this._bs.getAllMasterData('CUSTOMERBEHAVIOUR');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Customer Segment
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex>Customer Segment</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="15px"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_customerSegmentForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_customerSegmentForm.controls['name']">
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['name'].valid && _customerSegmentForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Abbrevation" required [formControl]="_customerSegmentForm.controls['abbr']">
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['abbr'].valid && _customerSegmentForm.controls['abbr'].touched" class="mat-text-warn">You must include a Abbrevation.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_customerSegmentForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomerSegmentDialogComponent } from './customer-segment-dialog.component';
|
||||
|
||||
describe('CustomerSegmentDialogComponent', () => {
|
||||
let component: CustomerSegmentDialogComponent;
|
||||
let fixture: ComponentFixture<CustomerSegmentDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CustomerSegmentDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomerSegmentDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,74 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './customer-segment-dialog.component.html',
|
||||
styleUrls: ['./customer-segment-dialog.component.scss']
|
||||
})
|
||||
export class CustomerSegmentDialogComponent implements OnInit {
|
||||
|
||||
public _customerSegmentForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CustomerSegmentDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._customerSegmentForm = this._formBuilder.group({
|
||||
//CustomerSegment_id: any; fk_city_id: any;
|
||||
customer_segment_id: [this.data.customer_segment_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
abbr: [this.data.abbr, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._customerSegmentForm);
|
||||
//customer_segment_id, name, abbr, createdon, fk_createdby, updatedon, isactive, fk_updatedby
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addCustomerSegment(this._customerSegmentForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editCustomerSegment(this._customerSegmentForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.customer_segment_id)) {
|
||||
var my_array = this._customerSegmentForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CUSTOMERSEGMENT').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._customerSegmentForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addCustomerSegment()" [disabled]="dialogRef"> + Add CustomerSegment</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<!-- <th style="text-align: center;">CustomerSegment ID</th> -->
|
||||
<th style="text-align: center;">CustomerSegment Name</th>
|
||||
<th style="text-align: center;">Abbrevation</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="CustomerSegmentList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let CSL of CustomerSegmentList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{CSL.name}}</td>
|
||||
<td style="text-align: center;">{{CSL.abbr}}</td>
|
||||
<td style="text-align: center;">{{CSL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editCustomerSegment(CSL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteCustomerSegment(CSL.customer_segment_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- //customer_Segment_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive ->
|
||||
<div>
|
||||
<-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="customer_segment_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.customer_segment_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="abbr">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Abbrevation </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.abbr}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerSegment(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerSegment(user.customer_segment_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomerSegmentListComponent } from './customer-segment-list.component';
|
||||
|
||||
describe('CustomerSegmentListComponent', () => {
|
||||
let component: CustomerSegmentListComponent;
|
||||
let fixture: ComponentFixture<CustomerSegmentListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CustomerSegmentListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomerSegmentListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,107 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component';
|
||||
import { CustomerSegment } from '../../../model/customer-segment';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-customer-segment-list',
|
||||
templateUrl: './customer-segment-list.component.html',
|
||||
styleUrls: ['./customer-segment-list.component.scss']
|
||||
})
|
||||
export class CustomerSegmentListComponent implements OnInit {
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
CustomerSegmentList: any = [];
|
||||
|
||||
displayedColumns = ['customer_segment_id', 'abbr', 'name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get CustomerSegmentList() {
|
||||
// return this._MastersService.getAllCustomerSegment();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getCustomerSegment();
|
||||
}
|
||||
|
||||
|
||||
addCustomerSegment() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCustomerSegment(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCustomerSegment().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCustomerSegment() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('CUSTOMERSEGMENT').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.CustomerSegmentList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteCustomerSegment(id: number) {
|
||||
var PrimaryKeyWithValue ={'customer_segment_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERSEGMENT');
|
||||
//this._MastersService.deleteMasterDetails('customer_segment_id',id,'CUSTOMERSEGMENT');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<CustomerSegment[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCustomerSegment();
|
||||
return this._bs.getAllMasterData('CUSTOMERSEGMENT');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Designation
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex="15px">Designation</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_designationForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_designationForm.controls['name']">
|
||||
<mat-error *ngIf="!_designationForm.controls['name'].valid && _designationForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- //designation_id, name, short_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive -->
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Short Name" required [formControl]="_designationForm.controls['short_name']">
|
||||
<mat-error *ngIf="!_designationForm.controls['short_name'].valid && _designationForm.controls['short_name'].touched" class="mat-text-warn">You must include a Short Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_designationForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DesignationDialogComponent } from './designation-dialog.component';
|
||||
|
||||
describe('DesignationDialogComponent', () => {
|
||||
let component: DesignationDialogComponent;
|
||||
let fixture: ComponentFixture<DesignationDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DesignationDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DesignationDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,73 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-designation-dialog',
|
||||
templateUrl: './designation-dialog.component.html',
|
||||
styleUrls: ['./designation-dialog.component.scss']
|
||||
})
|
||||
export class DesignationDialogComponent implements OnInit {
|
||||
|
||||
public _designationForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<DesignationDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._designationForm = this._formBuilder.group({
|
||||
//Designation_id: any; fk_city_id: any;
|
||||
designation_id: [this.data.designation_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
short_name: [this.data.short_name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._designationForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addDesignation(this._designationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editDesignation(this._designationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.designation_id)) {
|
||||
var my_array = this._designationForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'DESIGNATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._designationForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addDesignation()" [disabled]="dialogRef"> + Add Designation</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">Designation Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="DesignationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let DL of DesignationList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{DL.name}}</td>
|
||||
<td style="text-align: center;">{{DL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editDesignation(DL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteDesignation(DL.designation_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!-- //designation_id, name, short_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive ->
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="designation_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.designation_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="short_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Short Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.short_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDesignation(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteDesignation(user.Designation_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DesignationListComponent } from './designation-list.component';
|
||||
|
||||
describe('DesignationListComponent', () => {
|
||||
let component: DesignationListComponent;
|
||||
let fixture: ComponentFixture<DesignationListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DesignationListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DesignationListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,109 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { DesignationDialogComponent } from '../designation-dialog/designation-dialog.component';
|
||||
import { Designation } from '../../../model/designation';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-designation-list',
|
||||
templateUrl: './designation-list.component.html',
|
||||
styleUrls: ['./designation-list.component.scss']
|
||||
})
|
||||
export class DesignationListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
DesignationList: any = [];
|
||||
|
||||
displayedColumns = ['designation_id', 'name', 'short_name','isactive','actions'];
|
||||
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get DesignationList() {
|
||||
// return this._MastersService.getAllDesignation();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getDesignation();
|
||||
}
|
||||
|
||||
|
||||
addDesignation() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(DesignationDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editDesignation(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllDesignation().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(DesignationDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getDesignation() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('DESIGNATION').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.DesignationList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteDesignation(id: number) {
|
||||
var PrimaryKeyWithValue ={'designation_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'DESIGNATION');
|
||||
// this._MastersService.deleteMasterDetails('designation_id',id,'DESIGNATION');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Designation[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllDesignation();
|
||||
return this._bs.getAllMasterData('DESIGNATION');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Frequency
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex>Frequency</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="15px"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_frequencyForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Frequency Name" required [formControl]="_frequencyForm.controls['name']">
|
||||
<mat-error *ngIf="!_frequencyForm.controls['name'].valid && _frequencyForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_frequencyForm.valid"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FrequencyDialogComponent } from './frequency-dialog.component';
|
||||
|
||||
describe('FrequencyDialogComponent', () => {
|
||||
let component: FrequencyDialogComponent;
|
||||
let fixture: ComponentFixture<FrequencyDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FrequencyDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FrequencyDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,64 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './frequency-dialog.component.html',
|
||||
styleUrls: ['./frequency-dialog.component.scss']
|
||||
})
|
||||
export class FrequencyDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _frequencyForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<FrequencyDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._frequencyForm = this._formBuilder.group({
|
||||
frequency_id: [this.data.frequency_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._frequencyForm);
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.frequency_id)) {
|
||||
var my_array = this._frequencyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'FREQUENCY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._contactService.addIndustryMaster(this._frequencyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._contactService.editIndustryMaster(this._frequencyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onReset(){
|
||||
this._frequencyForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addFrequency()" [disabled]="dialogRef"> + Add Frequency</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">Frequency Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="FrequencyList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let FL of FrequencyList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{FL.name}}</td>
|
||||
<td style="text-align: center;">{{FL.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editFrequency(FL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteFrequency(FL.frequency_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="frequency_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.frequency_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="createdon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdon </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.createdon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_createdby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_createdby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="updatedon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updated on </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.updatedon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_updatedby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updatedby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_updatedby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editFrequency(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteFrequency(user.frequency_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,122 @@
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}*/
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FrequencyListComponent } from './frequency-list.component';
|
||||
|
||||
describe('FrequencyListComponent', () => {
|
||||
let component: FrequencyListComponent;
|
||||
let fixture: ComponentFixture<FrequencyListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FrequencyListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FrequencyListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,110 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { FrequencyDialogComponent }from '../frequency-dialog/frequency-dialog.component';
|
||||
import { Frequency } from '../../../model/frequency';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-frequency-list',
|
||||
templateUrl: './frequency-list.component.html',
|
||||
styleUrls: ['./frequency-list.component.scss']
|
||||
})
|
||||
export class FrequencyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
FrequencyList: any = [];
|
||||
|
||||
displayedColumns = ['frequency_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get FrequencyList() {
|
||||
// return this._MastersService. getAllFrequency();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getFrequency();
|
||||
}
|
||||
|
||||
|
||||
addFrequency() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(FrequencyDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editFrequency(arr: any) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllFrequency().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(FrequencyDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getFrequency() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('FREQUENCY').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.FrequencyList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteFrequency(id: number) {
|
||||
var PrimaryKeyWithValue ={'frequency_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'FREQUENCY');
|
||||
// this._MastersService.deleteMasterDetails('designation_id',id,'DESIGNATION');
|
||||
|
||||
//this._MastersService.deleteMasterDetails('frequency_id',id,'FREQUENCY');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _fs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Frequency[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._fs.getAllFrequency();
|
||||
return this._fs.getAllMasterData('FREQUENCY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Industry Classification
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Industry Classification</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_IndustryClassificationForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Classification Name" required [formControl]="_IndustryClassificationForm.controls['name']">
|
||||
<mat-error *ngIf="!_IndustryClassificationForm.controls['name'].valid && _IndustryClassificationForm.controls['name'].touched" class="mat-text-warn">You must include a Classified Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_IndustryClassificationForm.valid"><mat-icon>save</mat-icon></button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { IndustryMasterDialogComponent } from './industry-master-dialog.component';
|
||||
|
||||
describe('IndustryMasterDialogComponent ', () => {
|
||||
let component: IndustryMasterDialogComponent ;
|
||||
let fixture: ComponentFixture<IndustryMasterDialogComponent >;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ IndustryMasterDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(IndustryMasterDialogComponent );
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,64 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './industry_classification-dialog.component.html',
|
||||
styleUrls: ['./industry_classification-dialog.component.scss']
|
||||
})
|
||||
export class IndustryClassificationDialogComponent implements OnInit {
|
||||
|
||||
public _IndustryClassificationForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<IndustryClassificationDialogComponent>,
|
||||
private _contactService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._IndustryClassificationForm = this._formBuilder.group({
|
||||
industry_classification_id: [this.data.industry_classification_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._IndustryClassificationForm);
|
||||
//industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._contactService.addIndustryClassification(this._IndustryClassificationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._contactService.editIndustryClassification(this._IndustryClassificationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.industry_classification_id)) {
|
||||
var my_array = this._IndustryClassificationForm.value;
|
||||
Object.keys(my_array).forEach((key) => (my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._contactService.addMasterDetails(my_array,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
onReset(){
|
||||
this._IndustryClassificationForm.reset();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addIndustryClassification()" [disabled]="dialogRef"> + Add Industry Classification</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
|
||||
<th style="text-align: center;">Classification Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
|
||||
<tr *ngIf="IndustryClassificationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let IM of IndustryClassificationList ; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{IM.name}}</td>
|
||||
<td style="text-align: center;">{{IM.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editIndustryClassification(IM)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteIndustryClassification(IM.industry_classification_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="industry_classification_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.industry_classification_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="createdon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdon </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.createdon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_createdby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_createdby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="updatedon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updated on </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.updatedon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_updatedby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updatedby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_updatedby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editIndustryClassification(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(user.industry_classification_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>-->
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,118 @@
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}*/
|
||||
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { IndustryClassificationDialogComponent } from '../industry_classification-dialog/industry_classification-dialog.component';
|
||||
import { IndustryClassification } from '../../../model/industry_classification';
|
||||
|
||||
@Component({
|
||||
selector: 'app-industry_classification-list',
|
||||
templateUrl: './industry_classification-list.component.html',
|
||||
styleUrls: ['./industry_classification-list.component.scss']
|
||||
})
|
||||
|
||||
|
||||
// export class TablePagingComponent implements OnInit {
|
||||
|
||||
// }
|
||||
|
||||
export class IndustryClassificationListComponent implements OnInit {
|
||||
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
IndustryClassificationList: any = [];
|
||||
|
||||
|
||||
displayedColumns = ['industry_classification_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions'];
|
||||
//industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _IMService: MastersService) { }
|
||||
|
||||
// get IndustryClassificationList() {
|
||||
// return this._IMService.getAllIndustryClassification();
|
||||
// }
|
||||
|
||||
//displayedColumns: string[] = ['ID','ClassifiedName'];
|
||||
dataSource = new UserDataSource(this._IMService);
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.getIndustryClassification();
|
||||
}
|
||||
|
||||
|
||||
addIndustryClassification() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editIndustryClassification(arr: any) {
|
||||
this.isPopupOpened = true;
|
||||
//const indu = this._IMService.getAllIndustryClassification().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getIndustryClassification() {
|
||||
this.loader = true;
|
||||
this._IMService.getAllMasterData('INDUSTRYCLASSIFICATION').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.IndustryClassificationList = dataresult.records;
|
||||
}
|
||||
else{
|
||||
this.IndustryClassificationList = [];
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
deleteIndustryClassification(id: number) {
|
||||
var PrimaryKeyWithValue ={'industry_classification_id':id};
|
||||
console.log('PrimaryKeyWithValue',PrimaryKeyWithValue);
|
||||
console.log('id',id);
|
||||
this._IMService.deleteMasterDetails(PrimaryKeyWithValue,'INDUSTRYCLASSIFICATION');
|
||||
//this._IMService.deleteMasterDetails('industry_classification_id',id,'INDUSTRYCLASSIFICATION');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
constructor(private _ims: MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<IndustryClassification[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._ims.getAllIndustryClassification();
|
||||
return this._ims.getAllMasterData('INDUSTRYCLASSIFICATION');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Lender Hierarchy
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Lender Hierarchy </div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<form [formGroup]="_lenderHierarchyForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Lender Hierarchy Name" required [formControl]="_lenderHierarchyForm.controls['lender_hierarchy']">
|
||||
<mat-error *ngIf="!_lenderHierarchyForm.controls['lender_hierarchy'].valid && _lenderHierarchyForm.controls['lender_hierarchy'].touched" class="mat-text-warn">You must include a Lender Hierarchy Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_lenderHierarchyForm.valid"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LenderHierarchyDialogComponent } from './lender-hierarchy-dialog.component';
|
||||
|
||||
describe('LenderHierarchyDialogComponent', () => {
|
||||
let component: LenderHierarchyDialogComponent;
|
||||
let fixture: ComponentFixture<LenderHierarchyDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LenderHierarchyDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LenderHierarchyDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,73 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './lender-hierarchy-dialog.component.html',
|
||||
styleUrls: ['./lender-hierarchy-dialog.component.scss']
|
||||
})
|
||||
export class LenderHierarchyDialogComponent implements OnInit {
|
||||
|
||||
public _lenderHierarchyForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<LenderHierarchyDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._lenderHierarchyForm = this._formBuilder.group({
|
||||
//Designation_id: any; fk_city_id: any;
|
||||
|
||||
lender_hierarchy_id: [this.data.lender_hierarchy_id],
|
||||
lender_hierarchy: [this.data.lender_hierarchy, Validators.compose([Validators.required])],
|
||||
|
||||
});
|
||||
//console.log(this._lenderHierarchyForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addDesignation(this._lenderHierarchyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editDesignation(this._lenderHierarchyForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.lender_hierarchy_id)) {
|
||||
var my_array = this._lenderHierarchyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'LENDERHIERARCHY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._lenderHierarchyForm.value,'LENDERHIERARCHY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._lenderHierarchyForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addLenderHierarchy()" [disabled]="dialogRef"> + Add LenderHierarchy</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">Lender Hierarchy Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="LenderHierarchyList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let LHL of LenderHierarchyList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{LHL.lender_hierarchy}} </td>
|
||||
<td style="text-align: center;">{{LHL.isactive}} </td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editLenderHierarchy(LHL)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteLenderHierarchy(LHL.lender_hierarchy_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!- <mat-table [dataSource]="dataSource"> ->
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="lender_hierarchy_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.lender_hierarchy_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="lender_hierarchy">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Lender Hierarchy </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.lender_hierarchy}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editLenderHierarchy(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteLenderHierarchy(user.lender_hierarchy_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LenderHierarchyListComponent } from './lender-hierarchy-list.component';
|
||||
|
||||
describe('LenderHierarchyListComponent', () => {
|
||||
let component: LenderHierarchyListComponent;
|
||||
let fixture: ComponentFixture<LenderHierarchyListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LenderHierarchyListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LenderHierarchyListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,108 @@
|
||||
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { LenderHierarchyDialogComponent }from '../lender-hierarchy-dialog/lender-hierarchy-dialog.component';
|
||||
import { LenderHierarchy } from '../../../model/lender-hierarchy';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-lender-hierarchy-list',
|
||||
templateUrl: './lender-hierarchy-list.component.html',
|
||||
styleUrls: ['./lender-hierarchy-list.component.scss']
|
||||
})
|
||||
export class LenderHierarchyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
LenderHierarchyList: any = [];
|
||||
|
||||
displayedColumns = ['lender_hierarchy_id', 'lender_hierarchy','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get LenderHierarchyList() {
|
||||
// return this._MastersService. getAllLenderHierarchy();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getLenderHierarchy();
|
||||
}
|
||||
|
||||
|
||||
addLenderHierarchy() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editLenderHierarchy(arr: any) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllLenderHierarchy().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getLenderHierarchy() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('LENDERHIERARCHY').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.LenderHierarchyList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deleteLenderHierarchy(id: number) {
|
||||
var PrimaryKeyWithValue ={'lender_hierarchy_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'LENDERHIERARCHY');
|
||||
//this._MastersService.deleteMasterDetails('lender_hierarchy_id',id,'LENDERHIERARCHY');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _fs: MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<LenderHierarchy[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._fs.getAllLenderHierarchy();
|
||||
return this._fs.getAllMasterData('LENDERHIERARCHY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>Occupation of Non earning members
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Occupation of Non earning members </div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="2px"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_occupationForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_occupationForm.controls['name']">
|
||||
<mat-error *ngIf="!_occupationForm.controls['name'].valid && _occupationForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_occupationForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MembersOccupationDialogComponent } from './members-occupation-dialog.component';
|
||||
|
||||
describe('MembersOccupationDialogComponent', () => {
|
||||
let component: MembersOccupationDialogComponent;
|
||||
let fixture: ComponentFixture<MembersOccupationDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MembersOccupationDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MembersOccupationDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,63 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './members-occupation-dialog.component.html',
|
||||
styleUrls: ['./members-occupation-dialog.component.scss']
|
||||
})
|
||||
export class MembersOccupationDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _occupationForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<MembersOccupationDialogComponent>,
|
||||
private _memberService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._occupationForm = this._formBuilder.group({
|
||||
occupation_non_earning_member_id: [this.data.occupation_non_earning_member_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._occupationForm);
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.occupation_non_earning_member_id)) {
|
||||
var my_array = this._occupationForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._memberService.addMasterDetails(my_array,'OCCUPATIONMEMBERS').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._memberService.addMembersOccupation(this._occupationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._memberService.editMembersOccupation(this._occupationForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onReset(){
|
||||
this._occupationForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addMemberOccupation()" [disabled]="dialogRef"> + Add Member's Occupation</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<!-- <th style="text-align: center;">Occupation ID</th> -->
|
||||
<th style="text-align: center;">Occupation Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="MemberOccupationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let ML of MemberOccupationList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{ML.name}}</td>
|
||||
<td style="text-align: center;">{{ML.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editMemberOccupation(ML)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteMemberOccupation(ML.occupation_non_earning_member_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div> -->
|
||||
<!-- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="occupation_non_earning_member_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.occupation_non_earning_member_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="abbr">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Abbrevation </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.abbr}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="createdon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdon </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.createdon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_createdby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_createdby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="updatedon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updated on </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.updatedon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_updatedby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updatedby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_updatedby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editMemberOccupation(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteMemberOccupation(user.occupation_non_earning_member_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,59 @@
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}*/
|
||||
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MembersOccupationListComponent } from './members-occupation-list.component';
|
||||
|
||||
describe('MembersOccupationListComponent', () => {
|
||||
let component: MembersOccupationListComponent;
|
||||
let fixture: ComponentFixture<MembersOccupationListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MembersOccupationListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MembersOccupationListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,111 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { MembersOccupationDialogComponent } from '../members-occupation-dialog/members-occupation-dialog.component';
|
||||
import { MembersOccupation } from '../../../model/members-occupation';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-members-occupation-list',
|
||||
templateUrl: './members-occupation-list.component.html',
|
||||
styleUrls: ['./members-occupation-list.component.scss']
|
||||
})
|
||||
export class MembersOccupationListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
MemberOccupationList: any = [];
|
||||
|
||||
|
||||
displayedColumns = ['occupation_non_earning_member_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions'];
|
||||
//occupation_non_earning_member_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _memberService: MastersService) { }
|
||||
|
||||
// get MemberOccupationList() {
|
||||
// return this._memberService.getAllMembersOccupation();
|
||||
// }
|
||||
|
||||
ngOnInit() {
|
||||
this.getMemberOccupation();
|
||||
}
|
||||
|
||||
dataSource = new UserDataSource(this._memberService);
|
||||
|
||||
addMemberOccupation() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(MembersOccupationDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editMemberOccupation(arr : any) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._memberService.getAllMembersOccupation().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(MembersOccupationDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getMemberOccupation() {
|
||||
this.loader = true;
|
||||
this._memberService.getAllMasterData('OCCUPATIONMEMBERS').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.MemberOccupationList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
deleteMemberOccupation(id: number) {
|
||||
var PrimaryKeyWithValue ={'occupation_non_earning_member_id':id};
|
||||
this._memberService.deleteMasterDetails(PrimaryKeyWithValue,'OCCUPATIONMEMBERS');
|
||||
//this._memberService.deleteMasterDetails('occupation_non_earning_member_id',id,'OCCUPATIONMEMBERS');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
constructor(private _mos:MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<MembersOccupation[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._mos.getAllMembersOccupation();
|
||||
return this._mos.getAllMasterData('OCCUPATIONMEMBERS');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>PD Allocation Type
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD Allocation Type</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="2px" fxFlexOrder="2"></div>
|
||||
</div>
|
||||
|
||||
<form [formGroup]="_PDAllocationTypeForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="PD Allocation Type Name" required [formControl]="_PDAllocationTypeForm.controls['pd_allocation_type_name']">
|
||||
<mat-error *ngIf="!_PDAllocationTypeForm.controls['pd_allocation_type_name'].valid && _PDAllocationTypeForm.controls['pd_allocation_type_name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_PDAllocationTypeForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PdAllocationTypeDialogComponent } from './pd-allocation-type-dialog.component';
|
||||
|
||||
describe('PdAllocationTypeDialogComponent', () => {
|
||||
let component: PdAllocationTypeDialogComponent;
|
||||
let fixture: ComponentFixture<PdAllocationTypeDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PdAllocationTypeDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PdAllocationTypeDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,73 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './pd-allocation-type-dialog.component.html',
|
||||
styleUrls: ['./pd-allocation-type-dialog.component.scss']
|
||||
})
|
||||
export class PdAllocationTypeDialogComponent implements OnInit {
|
||||
|
||||
|
||||
|
||||
public _PDAllocationTypeForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<PdAllocationTypeDialogComponent>,
|
||||
private _pds: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._PDAllocationTypeForm = this._formBuilder.group({
|
||||
pd_allocation_type_id: [this.data.pd_allocation_type_id],
|
||||
pd_allocation_type_name: [this.data.pd_allocation_type_name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//pd_allocation_type_id, pd_allocation_type_name, createdon, fk_createdby, updatedon, isactive
|
||||
//console.log(this._PDAllocationTypeForm);
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.pd_allocation_type_id)) {
|
||||
var my_array = this._PDAllocationTypeForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._pds.addMasterDetails(my_array,'PDALLOCATIONTYPE').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
this._pds.editMasterDetails(this._PDAllocationTypeForm.value,'PDALLOCATIONTYPE').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._memberService.addMembersOccupation(this._PDAllocationTypeForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._memberService.editMembersOccupation(this._PDAllocationTypeForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onReset(){
|
||||
this._PDAllocationTypeForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addPDAllocationType()" [disabled]="dialogRef"> + Add PDAllocationType</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
<th style="text-align: center;">PD Allocation Type Name</th>
|
||||
<th style="text-align: center;">Isactive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
<tr *ngIf="PDAllocationTypeList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let PAT of PDAllocationTypeList; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{PAT.pd_allocation_type_name}}</td>
|
||||
<td style="text-align: center;">{{PAT.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editPDAllocationType(PAT)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deletePDAllocationType(PAT.pd_allocation_type_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<mat-table [dataSource]="dataSource"> ->
|
||||
-- pd_allocation_type_id: any; pd_allocation_type_name: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="pd_allocation_type_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.pd_allocation_type_name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="pd_allocation_type_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.pd_allocation_type_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPDAllocationType(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePDAllocationType(user.PDAllocationType_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mattable>
|
||||
</div>-->
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -0,0 +1,93 @@
|
||||
|
||||
/* Structure
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 56px;
|
||||
max-height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 24px 0;
|
||||
font-size: 20px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
|
||||
.mat-input-container {
|
||||
font-size: 14px;
|
||||
flex-grow: 1;
|
||||
margin-left: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.example-no-results {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
border-bottom: 1px solid #d696ac;
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
max-width: 54px;
|
||||
}
|
||||
|
||||
.mat-row:hover, .example-selected-row {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.mat-row:active, .mat-row.example-selected-row {
|
||||
background: #eaeaea;
|
||||
}
|
||||
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
/* Structure */
|
||||
.example-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 30px;
|
||||
width : 80%;
|
||||
margin : 20px auto;
|
||||
}
|
||||
|
||||
.example-header {
|
||||
min-height: 64px;
|
||||
padding: 8px 24px 0;
|
||||
}
|
||||
|
||||
//mat-cell{
|
||||
.cell{
|
||||
display:flex !important;
|
||||
justify-content:center!important;
|
||||
|
||||
}
|
||||
|
||||
// mat-header-cell {
|
||||
.header-cell{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PdAllocationTypeListComponent } from './pd-allocation-type-list.component';
|
||||
|
||||
describe('PdAllocationTypeListComponent', () => {
|
||||
let component: PdAllocationTypeListComponent;
|
||||
let fixture: ComponentFixture<PdAllocationTypeListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PdAllocationTypeListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PdAllocationTypeListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,109 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { PdAllocationTypeDialogComponent } from '../pd-allocation-type-dialog/pd-allocation-type-dialog.component';
|
||||
import { PdAllocationType } from '../../../model/pd';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-pd-allocation-type-list',
|
||||
templateUrl: './pd-allocation-type-list.component.html',
|
||||
styleUrls: ['./pd-allocation-type-list.component.scss']
|
||||
})
|
||||
export class PdAllocationTypeListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
PDAllocationTypeList: any = [];
|
||||
|
||||
displayedColumns = ['pd_allocation_type_id','pd_allocation_type_name','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) { }
|
||||
|
||||
// get PDAllocationTypeList() {
|
||||
// return this._MastersService.getAllPDAllocationType();
|
||||
// }
|
||||
|
||||
dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
this.getPDAllocationType();
|
||||
}
|
||||
|
||||
|
||||
addPDAllocationType() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editPDAllocationType(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllPDAllocationType().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getPDAllocationType() {
|
||||
this.loader = true;
|
||||
this._MastersService.getAllMasterData('PDALLOCATIONTYPE').subscribe(dataresult => {
|
||||
|
||||
this.loader = false;
|
||||
|
||||
if (dataresult.dataStatus === true) {
|
||||
this.PDAllocationTypeList = dataresult.records;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
deletePDAllocationType(id: number) {
|
||||
var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDALLOCATIONTYPE');
|
||||
//this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDALLOCATIONTYPE');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<PdAllocationType[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllPDAllocationType();
|
||||
return this._bs.getAllMasterData('PDALLOCATIONTYPE');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>PD Location Approach
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div> -->
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD Location Approach</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="2px" fxFlexOrder="2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_pdLocationApproachForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_pdLocationApproachForm.controls['description']">
|
||||
<mat-error *ngIf="!_pdLocationApproachForm.controls['description'].valid && _pdLocationApproachForm.controls['description'].touched" class="mat-text-warn">You must include a Description.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_pdLocationApproachForm.valid"><mat-icon>save</mat-icon></button>
|
||||
<!-- <button mat-button >RESET</button> -->
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -0,0 +1,3 @@
|
||||
mat-form-field{
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PdLocationApproachDialogComponent } from './pd-location-approach-dialog.component';
|
||||
|
||||
describe('PdLocationApproachDialogComponent', () => {
|
||||
let component: PdLocationApproachDialogComponent;
|
||||
let fixture: ComponentFixture<PdLocationApproachDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PdLocationApproachDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PdLocationApproachDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,75 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './pd-location-approach-dialog.component.html',
|
||||
styleUrls: ['./pd-location-approach-dialog.component.scss']
|
||||
})
|
||||
export class PdLocationApproachDialogComponent implements OnInit {
|
||||
|
||||
public _pdLocationApproachForm: FormGroup;
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<PdLocationApproachDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
//pd_location_approach_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
ngOnInit() {
|
||||
|
||||
this._pdLocationApproachForm = this._formBuilder.group({
|
||||
//branch_id: any; fk_city_id: any;
|
||||
pd_location_approach_id: [this.data.pd_location_approach_id],
|
||||
description: [this.data.description, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._pdLocationApproachForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addBranch(this._pdLocationApproachForm.value);
|
||||
// this.dialogRef.close();
|
||||
// } else {
|
||||
// this._MastersService.editBranch(this._pdLocationApproachForm.value);
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.pd_location_approach_id)) {
|
||||
var my_array = this._pdLocationApproachForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'PDLOCATIONAPPROACH').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._pdLocationApproachForm.value,'PDLOCATIONAPPROACH').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onReset(){
|
||||
this._pdLocationApproachForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user