merge changes : kms
This commit is contained in:
parent
2364d53218
commit
3d05553993
@ -2,7 +2,7 @@
|
||||
<div class="form-bg">
|
||||
<div fxLayout="row" fxLayoutAlign="center" class="pt-2">
|
||||
<!-- <p>SINEEDGE Login Details</p> -->
|
||||
<h3><img [src]="'http://ssa.sineedge.com/sparqapi/logo/sineedge_red.png'" style="height: 50px;;"> <span> SINEEDGE </span>
|
||||
<h3 class="page-title"><img [src]="'http://ssa.sineedge.com/sparqapi/logo/sineedge_red.png'" style="height: 50px;;"> <span> SINEEDGE </span>
|
||||
</h3>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="center start" class="pt-2">
|
||||
@ -11,7 +11,6 @@
|
||||
<div>
|
||||
<h2 class="base-border">Login</h2>
|
||||
<!-- <p>Enter Your Login Details</p> -->
|
||||
<br>
|
||||
<form #form="ngForm" (ngSubmit)="login()">
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
@ -22,11 +21,12 @@
|
||||
<input matInput placeholder="Password" minlength= "8" type="password" name="password" required [(ngModel)]="password">
|
||||
</mat-form-field>
|
||||
<button class="mat-green" mat-raised-button>SIGN IN</button><br/>
|
||||
<div *ngIf="email">
|
||||
<a class="mat-text-warn mb-0" (click)="forgotpassword();">Forgot password?</a></div>
|
||||
<div>
|
||||
<a *ngIf="email" class="mat-text-warn mb-0" (click)="forgotpassword();">Forgot password?</a></div>
|
||||
<!-- <p class="mb-0">Don't have an account? <a [routerLink]="['/register']" class="mat-text-primary">Register Here</a></p> -->
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</mat-card>
|
||||
@ -41,7 +41,7 @@
|
||||
<footer class="page-footer">
|
||||
|
||||
<!-- © Copyright -->
|
||||
<div class="footer-copyright text-center py-1">© 2018
|
||||
<div class="footer-copyright text-center">© 2018
|
||||
<a href="http://www.sineedge.com" target="_blank"> SineEdge Consulting Pvt Ltd. </a> All rights are reserved
|
||||
</div>
|
||||
<!-- © Copyright -->
|
||||
|
||||
@ -1,35 +1,40 @@
|
||||
.form-bg {
|
||||
// background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important;
|
||||
//background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important;
|
||||
//background-image: url(../../../assets/images/login_o.jpg);
|
||||
//background-color: #F44336;
|
||||
background: url(../../../assets/images/bg.png) repeat-x 0 0 #E00201;
|
||||
height: 100vh !important;
|
||||
//background-color: #F44336;
|
||||
background: url(../../../assets/images/bg.png) repeat-x 0 0 #ffffff;
|
||||
//height: 100vh !important;
|
||||
background-position: center !important;
|
||||
min-height: calc(0vh + 0px) !important;
|
||||
min-height: calc(90vh + 90px) !important;
|
||||
}
|
||||
|
||||
.signin-page{
|
||||
float: left;
|
||||
width: 100%;
|
||||
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
// .form-bg {
|
||||
// float: left;
|
||||
// width: 100%;
|
||||
// background-color: repeat-x 0 0 #F44336;
|
||||
// padding-bottom: 40px;
|
||||
// }
|
||||
// .form-bg {
|
||||
// float: left;
|
||||
// width: 100%;
|
||||
// background-color: repeat-x 0 0 #F44336;
|
||||
// padding-bottom: 40px;
|
||||
// }
|
||||
.form-bg::before {
|
||||
background-color: rgba(0, 0, 0, 0) !important;
|
||||
}
|
||||
.form-bg::after{
|
||||
background-color: #E00201;
|
||||
}
|
||||
h3, .page-footer{
|
||||
.page-title{
|
||||
color:#E00201;
|
||||
background-color:#ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
.page-footer{
|
||||
color:#E00201;
|
||||
background-color:#ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.bottom-sec,.mat-green{
|
||||
color:white !important;
|
||||
font-weight: 700;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div fxLayout="row wrap" fxLayoutAlign="end">
|
||||
<div fxLayout="row wrap" fxLayoutAlign="end" style="padding-top:1%">
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Billing Information" matTooltipPosition="above" (click)="editDetails(null); false"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
<mat-card *ngFor="let data of entityBillingInfoRecord">
|
||||
@ -8,17 +8,17 @@
|
||||
</div>
|
||||
<div fxFlex="50%">
|
||||
<div>
|
||||
{{data.addressline2}}, {{data.addressline3}}
|
||||
{{data.addressline2}}<span *ngIf="data.addressline3">, {{data.addressline3}}</span>
|
||||
</div>
|
||||
<div>
|
||||
Pan: {{data.pan}}, Gst: {{data.gstno}}
|
||||
<span *ngIf="data.pan">Pan: {{data.pan}}</span> <span *ngIf="data.gstno">, Gst: {{data.gstno}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngFor="let conts of data.contacts; let last = last">{{conts.contact_person}} - {{conts.contact_email}} - {{conts.contact_mobile_no}} <span *ngIf="!last">,</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20%">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="editDetails(data)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDetails(data)"><mat-icon>edit</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
@ -1,6 +1,7 @@
|
||||
<form [formGroup]="_editEntityRegionFrom" (submit)="onSubmit()">
|
||||
<div formArrayName="region_lender" class="example-full-width">
|
||||
<mat-card *ngFor="let region of _editEntityRegionFrom.controls.region_lender['controls']; let i=index">
|
||||
<mat-card-content>
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="2%" fxLayoutAlign="center center">
|
||||
<mat-form-field fxFlex="30%">
|
||||
@ -31,7 +32,7 @@
|
||||
<mat-error *ngIf="submitted && region['controls'].fk_branch_id.hasError('required')" class="mat-text-warn">Branch Required.!</mat-error>
|
||||
</mat-form-field>-->
|
||||
|
||||
<div fxFlex="30%">
|
||||
<div fxFlex="30%" style="text-align:center;">
|
||||
<mat-checkbox *ngIf="region.get('entity_region_map_id').value != null" formControlName="isactive" [ngModel]="region.get('isactive').value == 1 ? true : region.get('isactive').value == 0 ? false : null"
|
||||
(ngModelChange)="region.get('isactive').value = $event ? 1 : 0"></mat-checkbox>
|
||||
|
||||
@ -41,6 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="row" style="text-align:right;">
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div style="overflow: auto;">
|
||||
<div >
|
||||
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="end">
|
||||
<div style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="end" style="padding-top:1%">
|
||||
<div fxFlex="20%">
|
||||
<button mat-fab class="mr-1 mb-1" color="primary"matTooltip="Add New Tat Details" matTooltipPosition="above" (click)="addNewTatDetails()"><mat-icon>add</mat-icon></button>
|
||||
<div fxFlex="20%" style="text-align:right;">
|
||||
<button mat-fab class="mr-1 mb-1" color="primary"matTooltip="Add More TAT Details" matTooltipPosition="above" (click)="addNewTatDetails()"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
{{data.tatVal2}}
|
||||
</div>
|
||||
<div fxFlex="18%">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="editDetails(data)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDetails(data)"><mat-icon>edit</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
@ -8,7 +8,40 @@
|
||||
<button mat-fab class="mr-1 mb-1" color="primary"matTooltip="Add New Entity" matTooltipPosition="above" (click)="addNewEntity()"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
<mat-card-content>
|
||||
<ng-container *ngIf="enityList.length > 0">
|
||||
<mat-table [dataSource]="dataSource">
|
||||
|
||||
<ng-container matColumnDef="entity_name">
|
||||
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
|
||||
<span *ngIf="product.entity_name" mat-line>{{ product.entity_name }}</span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
|
||||
<div> {{ product.full_name }} ({{product.short_name}})</div>
|
||||
<div> {{ product.branch_name }} </div>
|
||||
<div> {{product.city_name}}<span *ngIf="product.state_name">,</span> {{product.state_name}} </div>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="contact">
|
||||
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
|
||||
<div> {{ product.phone_number }}</div>
|
||||
<div> {{ product.official_email }}</div></mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product)"><mat-icon>edit</mat-icon></button>
|
||||
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
</ng-container>
|
||||
</mat-card-content>
|
||||
<!----<ng-container *ngIf="enityList.length > 0">
|
||||
<div style="padding: 0 12px;">
|
||||
<mat-card class="product-card" *ngFor="let product of dataSource.connect() | async">
|
||||
<div fxLayout="row" fxLayoutAlign="start start">
|
||||
@ -38,13 +71,17 @@
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>-->
|
||||
<mat-card *ngIf="noQuesMasterRecrdFound">
|
||||
<mat-card-content>
|
||||
<div class="no-record-found">No Record Found ... </div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<mat-paginator #paginator class="mat-elevation-z1" [length]="enityList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
<div *ngIf="enityList.length > 0">
|
||||
<mat-paginator [length]="enityList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
||||
</mat-paginator>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,55 +1,71 @@
|
||||
<div style="max-height: 580px;">
|
||||
<!--<pre> {{ m_group | json}}</pre>-->
|
||||
|
||||
<h2 mat-dialog-title>{{pageTitle}}</h2>
|
||||
<mat-dialog-content class="mat-typography">
|
||||
<mat-card style="width: 580px; padding: 6px;">
|
||||
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 50%;">{{pageTitle}}</h2>
|
||||
<div style="width: 20%;"></div>
|
||||
<div style="width: 30%;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>
|
||||
<form [formGroup]="_addQuesFrom" (submit)="onSubmit()">
|
||||
<!--<div class="form-group">-->
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<form [formGroup]="_addQuesFrom" (submit)="onSubmit()" novalidate>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="50">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Category" formControlName="fk_question_category">
|
||||
<mat-option *ngFor="let ct of categories" [value]="ct.question_category_id">{{ ct.category_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_category.hasError('required')" class="mat-text-warn">You must Select Category.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="50">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Group" formControlName="fk_question_group_id">
|
||||
<mat-option *ngFor="let gp of m_group" [value]="gp.question_group_id">{{ gp.group_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_group_id.hasError('required')" class="mat-text-warn">You must Select Group.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div class="example-full-width">
|
||||
<mat-form-field fxFill>
|
||||
<textarea matInput placeholder="Question" formControlName="question"></textarea>
|
||||
<mat-error *ngIf="submitted && f.question.hasError('required')" class="mat-text-warn">You must Include Question.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div class="example-full-width">
|
||||
<mat-form-field fxFill>
|
||||
<textarea matInput placeholder="Description" formControlName="description"></textarea>
|
||||
<mat-error *ngIf="submitted && f.description.hasError('required')" class="mat-text-warn">You must Include Description.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Answer Type" formControlName="fk_question_answertype">
|
||||
<mat-option *ngFor="let ans of questionsOptions" [value]="ans.question_answer_type_id">{{ ans.answer_type_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_answertype.hasError('required')" class="mat-text-warn">You must Select Answer Type.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<div formArrayName="answers" class="example-full-width">
|
||||
<div formArrayName="answers" fxFill>
|
||||
<div *ngFor="let answ of _addQuesFrom.controls.answers['controls']; let i=index">
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row" style="width: 100%">
|
||||
<div style="width: 80%">
|
||||
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
||||
<div fxFlex="80">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<!--<span>Answer {{i + 1}}</span>-->
|
||||
<textarea matInput placeholder="Answer" formControlName="answer"></textarea>
|
||||
<!--<mat-error *ngIf="submitted && answer.hasError('required')" class="mat-text-warn">You must Include Question.</mat-error>-->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div style="width:20%">
|
||||
<div fxFlex="30">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Group" formControlName="fk_question_group_id">
|
||||
<mat-option *ngFor="let gp of m_group" [value]="gp.question_group_id">{{ gp.group_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="20">
|
||||
<span *ngIf="_addQuesFrom.controls.answers.controls.length > 1" (click)="removeLanguage(i)">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
</span>
|
||||
@ -57,22 +73,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
|
||||
<!-- <button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage($event); false">Add More</button> -->
|
||||
<!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>-->
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
<!--Error List Shown Here-->
|
||||
<!--<ul>
|
||||
<li *ngFor="let err of errorMessage">
|
||||
<mat-error>{{err.err}}</mat-error>
|
||||
</li>
|
||||
</ul>-->
|
||||
<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"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
</form>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-button mat-dialog-close>Cancel</button>
|
||||
</mat-dialog-actions>
|
||||
@ -39,6 +39,7 @@ export class AddComponent implements OnInit {
|
||||
public submitted = false;
|
||||
public categories: any = [];
|
||||
public questionsOptions: any = [];
|
||||
public m_group: any = [];
|
||||
errorMessage: string;
|
||||
|
||||
/**
|
||||
@ -62,6 +63,7 @@ export class AddComponent implements OnInit {
|
||||
question: [null, Validators.compose([Validators.required])],
|
||||
description: [null, Validators.compose([Validators.required])],
|
||||
fk_question_category: [null, Validators.compose([Validators.required])],
|
||||
fk_question_group_id: [null, Validators.compose([Validators.required])],
|
||||
fk_question_answertype: [null, Validators.compose([Validators.required])],
|
||||
answers: this._formBuilder.array([
|
||||
this.initAnswers(),
|
||||
@ -70,6 +72,7 @@ export class AddComponent implements OnInit {
|
||||
// OnInit Load Category and Question Type Masters
|
||||
this.getCategoryListMaster();
|
||||
this.getQuestionOptionsMaster();
|
||||
this.getQuestionGroupMaster();
|
||||
}
|
||||
|
||||
// convenience getter for easy access to form fields
|
||||
@ -78,7 +81,8 @@ export class AddComponent implements OnInit {
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initAnswers() {
|
||||
return this._formBuilder.group({
|
||||
answer: ['', Validators.compose([Validators.required])]
|
||||
answer: ['', Validators.compose([Validators.required])],
|
||||
fk_question_group_id: ['']
|
||||
});
|
||||
}
|
||||
addLanguage(e) {
|
||||
@ -103,6 +107,19 @@ export class AddComponent implements OnInit {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getQuestionGroupMaster() {
|
||||
this.masterService.getAllMasterData('QUESTIONGROUP').subscribe(
|
||||
data => {
|
||||
this.m_group = data.records;
|
||||
},
|
||||
error => {
|
||||
this.notifier.notify('warning', 'No Question Group Records Found.!');
|
||||
this.errorMessage = "No Question Group Records Found.";
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getQuestionOptionsMaster() {
|
||||
this.masterService.getAllMasterData('QUESTIONANSWERTYPE').subscribe(
|
||||
data => {
|
||||
|
||||
@ -1,63 +1,77 @@
|
||||
<div style="max-height: 480px;">
|
||||
<h2 mat-dialog-title>{{pageTitle}}</h2>
|
||||
<mat-dialog-content class="mat-typography">
|
||||
<mat-card style="width: 580px; padding: 6px;">
|
||||
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 50%;">{{pageTitle}}</h2>
|
||||
<div style="width: 20%;"></div>
|
||||
<div style="width: 30%;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>
|
||||
|
||||
<form [formGroup]="_addQuesFrom" (submit)="onSubmit()">
|
||||
<!--<div class="form-group">-->
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<div fxFlex="50">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Category" formControlName="fk_question_category">
|
||||
<mat-option *ngFor="let ct of categories" [value]="ct.question_category_id">{{ ct.category_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_category.hasError('required')" class="mat-text-warn">You must Select Category.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="50">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Group" formControlName="fk_question_group_id">
|
||||
<mat-option *ngFor="let gp of m_group" [value]="gp.question_group_id">{{ gp.group_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_group_id.hasError('required')" class="mat-text-warn">You must Select Group.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div class="example-full-width">
|
||||
<mat-form-field fxFill>
|
||||
<textarea matInput placeholder="Question" formControlName="question"></textarea>
|
||||
<mat-error *ngIf="submitted && f.question.hasError('required')" class="mat-text-warn">You must Include Question.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div class="example-full-width">
|
||||
<mat-form-field fxFill>
|
||||
<textarea matInput placeholder="Description" formControlName="description"></textarea>
|
||||
<mat-error *ngIf="submitted && f.description.hasError('required')" class="mat-text-warn">You must Include Description.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Answer Type" formControlName="fk_question_answertype">
|
||||
<mat-option *ngFor="let ans of questionsOptions" [value]="ans.question_answer_type_id">{{ ans.answer_type_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_answertype.hasError('required')" class="mat-text-warn">You must Select Answer Type.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
|
||||
<!--<mat-checkbox formControlName="isactive" [ngModel]="f.isactive.value === 1 ? true : false"
|
||||
(ngModelChange)="f.isactive.value = $event ? 1 : 0">Active/InActive</mat-checkbox>
|
||||
-->
|
||||
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<div formArrayName="answers" class="example-full-width">
|
||||
<div formArrayName="answers" fxFill>
|
||||
<div *ngFor="let answ of f_ans.controls; let i=index">
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row" style="width: 100%">
|
||||
<div style="width: 80%">
|
||||
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
||||
<div fxFlex="80">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<!--<span>Answer {{i + 1}} </span>-->
|
||||
<textarea matInput placeholder="Answer" formControlName="answer"></textarea>
|
||||
<!--<mat-error *ngIf="submitted && answer.hasError('required')" class="mat-text-warn">You must Include Question.</mat-error>-->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div style="width:20%">
|
||||
<div fxFlex="30">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Select Group" formControlName="fk_question_group_id">
|
||||
<mat-option *ngFor="let gp of m_group" [value]="gp.question_group_id">{{ gp.group_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="20">
|
||||
<mat-checkbox *ngIf="answ.get('question_answer_id').value != null" formControlName="isactive" [ngModel]="answ.get('isactive').value == 1 ? true : answ.get('isactive').value == 0 ? false : null"
|
||||
(ngModelChange)="answ.get('isactive').value = $event ? 1 : 0"></mat-checkbox>
|
||||
<span *ngIf="_addQuesFrom.controls.answers.controls.length > 1" (click)="removeLanguage(i)">
|
||||
@ -67,12 +81,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" (click)="addLanguage(null, null, null, $event); false"><mat-icon>add</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" (click)="addLanguage(null, null, null, $event); false"><mat-icon>add</mat-icon></button>
|
||||
<!-- <button mat-button color="primary" matTooltip="Add More Answer" matTooltipPosition="above" (click)="addLanguage(null, null, null, $event); false">Add More</button> -->
|
||||
<!--<a (click)="addLanguage()" style="cursor: default">Add another Answer </a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Error List Shown Here-->
|
||||
<!--<ul>
|
||||
<li *ngFor="let err of errorMessage">
|
||||
@ -87,6 +101,8 @@
|
||||
<!--</div>-->
|
||||
</form>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-button mat-dialog-close>Cancel</button>
|
||||
</mat-dialog-actions>
|
||||
<notifier-container></notifier-container>
|
||||
@ -39,6 +39,7 @@ export class EditComponent implements OnInit {
|
||||
public _addQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
public categories: any = [];
|
||||
public m_group: any = [];
|
||||
public questionsOptions: any = [];
|
||||
errorMessage: string;
|
||||
|
||||
@ -60,15 +61,16 @@ export class EditComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.loadFormData();
|
||||
if (this.data["0"].length > 0) {
|
||||
for (let val of this.data["0"]) {
|
||||
// alert(JSON.stringify(val));
|
||||
let vals = val;
|
||||
this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null);
|
||||
}
|
||||
}
|
||||
// if (this.data["0"].length > 0) {
|
||||
// for (let val of this.data["0"]) {
|
||||
// // alert(JSON.stringify(val));
|
||||
// let vals = val;
|
||||
// this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null);
|
||||
// }
|
||||
// }
|
||||
// OnInit Load Category and Question Type Masters
|
||||
this.getCategoryListMaster();
|
||||
this.getQuestionGroupMaster();
|
||||
this.getQuestionOptionsMaster();
|
||||
}
|
||||
|
||||
@ -78,7 +80,7 @@ export class EditComponent implements OnInit {
|
||||
for (let val of this.data["0"]) {
|
||||
// alert(JSON.stringify(val));
|
||||
let vals = val;
|
||||
this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null);
|
||||
this.addLanguage(vals['answer'], vals['question_answer_id'], vals['fk_question_group_id'], vals['isactive'], null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -91,6 +93,7 @@ export class EditComponent implements OnInit {
|
||||
question: [this.data.question, Validators.compose([Validators.required])],
|
||||
description: [this.data.description, Validators.compose([Validators.required])],
|
||||
fk_question_category: [this.data.fk_question_category, Validators.compose([Validators.required])],
|
||||
fk_question_group_id: [this.data.fk_question_group_id, Validators.compose([Validators.required])],
|
||||
fk_question_answertype: [this.data.fk_question_answertype, Validators.compose([Validators.required])],
|
||||
isactive: [this.data.isactive],
|
||||
answers: this._formBuilder.array([
|
||||
@ -107,17 +110,18 @@ export class EditComponent implements OnInit {
|
||||
|
||||
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initAnswers(ans, fk_id, isAct) {
|
||||
initAnswers(ans, fk_id, fk_question_group_id, isAct) {
|
||||
isAct = isAct == null ? 1 : isAct;
|
||||
return this._formBuilder.group({
|
||||
answer: [ans, Validators.compose([Validators.required])],
|
||||
question_answer_id: [fk_id],
|
||||
fk_question_group_id: [fk_question_group_id],
|
||||
isactive: [isAct]
|
||||
});
|
||||
}
|
||||
addLanguage(ans, fk_id, isAct, e) {
|
||||
addLanguage(ans, fk_id, fk_question_group_id, isAct, e) {
|
||||
const control = <FormArray>this._addQuesFrom.controls['answers'];
|
||||
control.push(this.initAnswers(ans, fk_id, isAct));
|
||||
control.push(this.initAnswers(ans, fk_id, fk_question_group_id, isAct));
|
||||
}
|
||||
removeLanguage(i: number) {
|
||||
const control = <FormArray>this._addQuesFrom.controls['answers'];
|
||||
@ -137,6 +141,18 @@ export class EditComponent implements OnInit {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getQuestionGroupMaster() {
|
||||
this.masterService.getAllMasterData('QUESTIONGROUP').subscribe(
|
||||
data => {
|
||||
this.m_group = data.records;
|
||||
},
|
||||
error => {
|
||||
this.notifier.notify('warning', 'No Question Group Records Found.!');
|
||||
this.errorMessage = "No Question Group Records Found.";
|
||||
}
|
||||
)
|
||||
}
|
||||
getQuestionOptionsMaster() {
|
||||
this.masterService.getAllMasterData('QUESTIONANSWERTYPE').subscribe(
|
||||
data => {
|
||||
|
||||
@ -25,31 +25,33 @@
|
||||
</div>
|
||||
<!--</mat-card-content>-->
|
||||
<mat-card-content>
|
||||
<mat-table [dataSource]="dataSource" matSort *ngIf="productList.length > 0" >
|
||||
<ng-container *ngIf="productList.length > 0">
|
||||
<mat-table [dataSource]="dataSource">
|
||||
|
||||
<ng-container matColumnDef="category_name">
|
||||
<mat-cell fxFlex="25%" class="cell" *matCellDef="let product;" style="width:20% !important;">
|
||||
<mat-cell fxFlex="20%" class="cell" *matCellDef="let product;" >
|
||||
<span *ngIf="product.category_name" mat-line>{{ product.category_name }}</span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="question">
|
||||
<mat-cell fxFlex="65%" class="cell" *matCellDef="let product;" style="width:70% !important;">
|
||||
<mat-cell fxFlex="70%" class="cell" *matCellDef="let product;" >
|
||||
<span *ngIf="product.question" mat-line>{{ product.question }}</span>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-cell fxFlex="10%" class="cell" *matCellDef="let product;" style="width:10% !important;">
|
||||
<mat-cell fxFlex="10%" class="cell" *matCellDef="let product;">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editQuestion(product)"><mat-icon>edit</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
|
||||
<mat-paginator #paginator class="mat-elevation-z1" [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
</ng-container>
|
||||
<div *ngIf="productList.length > 0">
|
||||
<mat-paginator [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
||||
</mat-paginator>
|
||||
</div>
|
||||
|
||||
|
||||
<!---- <ng-container *ngIf="productList.length > 0">
|
||||
@ -79,7 +81,9 @@
|
||||
</div>
|
||||
</ng-container>-->
|
||||
<mat-card *ngIf="noQuesMasterRecrdFound">
|
||||
<mat-card-content>
|
||||
<div class="no-record-found">No Record Found ... </div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user