questions conflict changes
This commit is contained in:
parent
3af394783e
commit
43b67bb7d3
10
ng6-seed/package-lock.json
generated
10
ng6-seed/package-lock.json
generated
@ -950,6 +950,11 @@
|
||||
"resolved": "https://registry.npmjs.org/angular-draggable-droppable/-/angular-draggable-droppable-2.0.0.tgz",
|
||||
"integrity": "sha512-/b8LIGamjOKnDI2uG1jRUErTIHeQ3w2WqHn4cbeiUTy+6eNHjkQI32DNhvxl0nVxr2gF5QluECNB4uWjMMyzQg=="
|
||||
},
|
||||
"angular-notifier": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/angular-notifier/-/angular-notifier-4.1.1.tgz",
|
||||
"integrity": "sha512-QrL5cW3GDjONy6Ack+HIgd3tUf93ztkPT6C551/pqOaE69Ad2YDem+JyBLnlLKBnCFUxhKkSVnv/Ak2HsOrBxQ=="
|
||||
},
|
||||
"angular-resizable-element": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/angular-resizable-element/-/angular-resizable-element-2.0.0.tgz",
|
||||
@ -7203,6 +7208,11 @@
|
||||
"resolved": "https://registry.npmjs.org/ng2-file-upload/-/ng2-file-upload-1.2.1.tgz",
|
||||
"integrity": "sha1-VWPF39b0P7++gVwgbjQ0ZKCmoZc="
|
||||
},
|
||||
"ng2-toastr": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ng2-toastr/-/ng2-toastr-4.1.2.tgz",
|
||||
"integrity": "sha1-G0UvBxOZYcOPhmxuJKBiR++iGxE="
|
||||
},
|
||||
"ng2-validation": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ng2-validation/-/ng2-validation-4.2.0.tgz",
|
||||
|
||||
@ -1,70 +1,4 @@
|
||||
<div style="max-height: 580px;">
|
||||
<<<<<<< HEAD
|
||||
<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">
|
||||
<mat-select placeholder="Select Category" formControlName="fk_question_catagory">
|
||||
<mat-option *ngFor="let ct of categories" [value]="ct.question_categroy_id">{{ ct.categroy_name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_question_catagory.hasError('required')" class="mat-text-warn">You must Select Category.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<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 fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<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 fxLayout="row" fxLayoutAlign="start none">
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<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 fxLayout="row" fxLayoutAlign="start none">
|
||||
<div formArrayName="answers" class="example-full-width">
|
||||
<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%">
|
||||
<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%">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>-->
|
||||
</div>
|
||||
</div>
|
||||
<!--Error List Shown Here-->
|
||||
<!--<ul>
|
||||
=======
|
||||
<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>
|
||||
@ -129,20 +63,10 @@
|
||||
</div>
|
||||
<!--Error List Shown Here-->
|
||||
<!--<ul>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<li *ngFor="let err of errorMessage">
|
||||
<mat-error>{{err.err}}</mat-error>
|
||||
</li>
|
||||
</ul>-->
|
||||
<<<<<<< HEAD
|
||||
<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 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>
|
||||
@ -150,5 +74,4 @@
|
||||
<!--</div>-->
|
||||
</form>
|
||||
</mat-card>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
</div>
|
||||
</div>
|
||||
@ -12,11 +12,8 @@ import {
|
||||
FormArray,
|
||||
} from '@angular/forms';
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
import {
|
||||
MatDialog,
|
||||
MatDialogRef,
|
||||
@ -26,38 +23,24 @@ import {
|
||||
import { MastersService } from './../../service/masters/masters.service';
|
||||
import { QuestionsService } from './../../service/questions/questions.service';
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/*
|
||||
* Question master add details
|
||||
* : kdk
|
||||
*/
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
@Component({
|
||||
selector: 'app-add',
|
||||
templateUrl: './add.component.html',
|
||||
styleUrls: ['./add.component.scss']
|
||||
})
|
||||
export class AddComponent implements OnInit {
|
||||
<<<<<<< HEAD
|
||||
|
||||
public pageTitle : string = "Add Question Details";
|
||||
=======
|
||||
|
||||
public pageTitle: string = "Add Question Details";
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
public _addQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
public categories: any = [];
|
||||
public questionsOptions: any = [];
|
||||
errorMessage: string;
|
||||
|
||||
<<<<<<< HEAD
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<AddComponent>,
|
||||
private masterService: MastersService,
|
||||
private questionsService: QuestionsService) { }
|
||||
=======
|
||||
/**
|
||||
* Notifier service
|
||||
*/
|
||||
@ -71,7 +54,6 @@ export class AddComponent implements OnInit {
|
||||
private questionsService: QuestionsService) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
@ -88,22 +70,6 @@ export class AddComponent implements OnInit {
|
||||
// OnInit Load Category and Question Type Masters
|
||||
this.getCategoryListMaster();
|
||||
this.getQuestionOptionsMaster();
|
||||
<<<<<<< HEAD
|
||||
|
||||
// /** For SelectDrop Datas*/
|
||||
// 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);
|
||||
|
||||
=======
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
}
|
||||
|
||||
// convenience getter for easy access to form fields
|
||||
@ -132,12 +98,8 @@ export class AddComponent implements OnInit {
|
||||
this.categories = data.records.filter(category => category.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
<<<<<<< HEAD
|
||||
this.errorMessage = "No Category Record Found.";
|
||||
=======
|
||||
this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
this.errorMessage = "No Category Records Found.";
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -147,10 +109,7 @@ export class AddComponent implements OnInit {
|
||||
this.questionsOptions = data.records;
|
||||
},
|
||||
error => {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
this.notifier.notify('warning', 'No Answer Type Records Found.!');
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.errorMessage = "No Answer Type Record Found.";
|
||||
}
|
||||
)
|
||||
@ -171,27 +130,6 @@ export class AddComponent implements OnInit {
|
||||
} else {
|
||||
var answerFormValues = this._addQuesFrom.value;
|
||||
|
||||
<<<<<<< HEAD
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
|
||||
|
||||
//Add BRANCH data with help Service File
|
||||
this.questionsService.addQuestionMasterDetails(answerFormValues).subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
alert("sample alert for Saving");
|
||||
}
|
||||
else {
|
||||
this.errorMessage = "Some Thing Wents Wrong Try Again !";
|
||||
}
|
||||
} , error => {
|
||||
this.errorMessage = "Some Thing Wents Wrong Try Again !";
|
||||
this.dialogRef.close();
|
||||
});
|
||||
//After Saving the BRANCH data then popup close
|
||||
// this.dialogRef.close();
|
||||
=======
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
|
||||
|
||||
@ -215,7 +153,6 @@ export class AddComponent implements OnInit {
|
||||
});
|
||||
//After Saving the BRANCH data then popup close
|
||||
// this.dialogRef.close();
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -65,13 +65,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start none">
|
||||
<<<<<<< HEAD
|
||||
<mat-checkbox formControlName="isactive" [ngModel]="f.isactive.value == 1 ? true : f.isactive.value == 0 ? false : null"
|
||||
(ngModelChange)="_addQuesFrom.controls['isactive'].setValue($event ? 1 : 0)">Active/InActive</mat-checkbox>
|
||||
=======
|
||||
<mat-checkbox formControlName="isactive" [ngModel]="f.isactive.value == 1 ? true : f.isactive.value == 0 ? false : null"
|
||||
(ngModelChange)="_addQuesFrom.controls['isactive'].setValue($event ? 1 : 0)">Active/InActive</mat-checkbox>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
</div>
|
||||
<!--Error List Shown Here-->
|
||||
<!--<ul>
|
||||
@ -80,17 +75,13 @@
|
||||
</li>
|
||||
</ul>-->
|
||||
<div class="row" style="text-align:right;">
|
||||
<<<<<<< HEAD
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button" (click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
=======
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
|
||||
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
<notifier-container></notifier-container>
|
||||
@ -23,13 +23,10 @@ import {
|
||||
import { MastersService } from './../../service/masters/masters.service';
|
||||
import { QuestionsService } from './../../service/questions/questions.service';
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/*
|
||||
* Question master details edit component
|
||||
* : kdk
|
||||
*/
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
@Component({
|
||||
selector: 'app-edit',
|
||||
templateUrl: './edit.component.html',
|
||||
@ -38,30 +35,18 @@ import { QuestionsService } from './../../service/questions/questions.service';
|
||||
export class EditComponent implements OnInit {
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
public pageTitle : string = "Edit Question Details";
|
||||
=======
|
||||
public pageTitle: string = "Edit Question Details";
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
public _addQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
public categories: any = [];
|
||||
public questionsOptions: any = [];
|
||||
errorMessage: string;
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
/**
|
||||
* Notifier service
|
||||
*/
|
||||
private notifier: NotifierService;
|
||||
=======
|
||||
|
||||
/**
|
||||
* Notifier service
|
||||
*/
|
||||
private notifier: NotifierService;
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
|
||||
constructor(
|
||||
notifier: NotifierService,
|
||||
@ -70,13 +55,8 @@ export class EditComponent implements OnInit {
|
||||
private masterService: MastersService,
|
||||
private questionsService: QuestionsService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
<<<<<<< HEAD
|
||||
this.notifier = notifier;
|
||||
}
|
||||
=======
|
||||
this.notifier = notifier;
|
||||
}
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
|
||||
ngOnInit() {
|
||||
this.loadFormData();
|
||||
@ -87,23 +67,14 @@ export class EditComponent implements OnInit {
|
||||
this.addLanguage(vals['answer'], vals['question_answer_id'], vals['isactive'], null);
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
// OnInit Load Category and Question Type Masters
|
||||
this.getCategoryListMaster();
|
||||
this.getQuestionOptionsMaster();
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
loadAnsData(){
|
||||
if (this.data["0"].length > 0) {
|
||||
=======
|
||||
// load answer details list
|
||||
loadAnsData() {
|
||||
if (this.data["0"].length > 0) {
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
for (let val of this.data["0"]) {
|
||||
// alert(JSON.stringify(val));
|
||||
let vals = val;
|
||||
@ -112,38 +83,22 @@ export class EditComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
loadFormData() {
|
||||
/** Questions Form Datas*/
|
||||
=======
|
||||
// load form data form the master
|
||||
loadFormData() {
|
||||
/** Questions Form Datas*/
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this._addQuesFrom = this._formBuilder.group({
|
||||
question_id: [this.data.question_id],
|
||||
question: [this.data.question, Validators.compose([Validators.required])],
|
||||
description: [this.data.description, Validators.compose([Validators.required])],
|
||||
fk_question_catagory: [this.data.fk_question_catagory, Validators.compose([Validators.required])],
|
||||
fk_question_answertype: [this.data.fk_question_answertype, Validators.compose([Validators.required])],
|
||||
<<<<<<< HEAD
|
||||
isactive:[this.data.isactive],
|
||||
=======
|
||||
isactive: [this.data.isactive],
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
answers: this._formBuilder.array([
|
||||
// this.initAnswers(null, null),
|
||||
])
|
||||
});
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
get f_ans() { return <FormArray>this._addQuesFrom.get('answers'); }
|
||||
|
||||
// convenience getter for easy access to form fields
|
||||
get f() { return this._addQuesFrom.controls; }
|
||||
|
||||
=======
|
||||
// convenience getter for easy access to form fields
|
||||
get f() { return this._addQuesFrom.controls; }
|
||||
|
||||
@ -151,7 +106,6 @@ export class EditComponent implements OnInit {
|
||||
get f_ans() { return <FormArray>this._addQuesFrom.get('answers'); }
|
||||
|
||||
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initAnswers(ans, fk_id, isAct) {
|
||||
isAct = isAct == null ? 1 : isAct;
|
||||
@ -178,10 +132,7 @@ export class EditComponent implements OnInit {
|
||||
this.categories = data.records.filter(category => category.isactive == 1);
|
||||
},
|
||||
error => {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.errorMessage = "No Category Record Found.";
|
||||
}
|
||||
)
|
||||
@ -192,10 +143,7 @@ export class EditComponent implements OnInit {
|
||||
this.questionsOptions = data.records;
|
||||
},
|
||||
error => {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
this.notifier.notify('warning', 'No Answer Type Records Found.!');
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.errorMessage = "No Answer Type Record Found.";
|
||||
}
|
||||
)
|
||||
@ -224,30 +172,18 @@ export class EditComponent implements OnInit {
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
<<<<<<< HEAD
|
||||
this.notifier.notify( 'success', 'Your Changes Updated!' );
|
||||
=======
|
||||
this.notifier.notify('success', 'Your Changes Updated.!');
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.dialogRef.close();
|
||||
// this.notifierService('success', 'You are awesome! I mean it!');
|
||||
// alert("sample alert for Saving");
|
||||
}
|
||||
else {
|
||||
<<<<<<< HEAD
|
||||
this.notifier.notify( 'warning', 'Something Wents Wrong Try Again !' );
|
||||
this.errorMessage = "Something Wents Wrong Try Again !";
|
||||
}
|
||||
}, error => {
|
||||
this.errorMessage = "Some Thing Wents Wrong Try Again !";
|
||||
=======
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.errorMessage = "Something Wents Wrong Try Again.!";
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.errorMessage = "Some Thing Wents Wrong Try Again.!";
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.dialogRef.close();
|
||||
});
|
||||
//After Saving the BRANCH data then popup close
|
||||
|
||||
@ -1,60 +1,5 @@
|
||||
<div>
|
||||
<mat-card>
|
||||
<<<<<<< HEAD
|
||||
<mat-card class="mat-elevation-z1">
|
||||
<!--<mat-card-title><span> Questions Master </span></mat-card-title>
|
||||
<mat-card-subtitle> List of Questions</mat-card-subtitle>
|
||||
<mat-card-content>-->
|
||||
<div style="margin: 6px; padding: 4px;">
|
||||
<div class="p_title" style="font-size: 16px; font-style: bold;">Questions Master</div>
|
||||
<div class="sub_title" style="font-size: 11px;">List of Questions</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none">
|
||||
<div fxFlex="80%">
|
||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutGap="0.5px" fxLayoutAlign="start none" style="padding: 6px;">
|
||||
<!--<mat-form-field class="example-full-width">
|
||||
<input matInput placeholder="Category" value="">
|
||||
</mat-form-field>-->
|
||||
<!--<mat-form-field>-->
|
||||
<mat-select placeholder="Category" formControlName="filterFormCtrl">
|
||||
<!--<ngx-mat-select-search [formControl]="masterFilterCtrl" ></ngx-mat-select-search>-->
|
||||
<mat-option *ngFor="let cat of categories" [value]="cat.question_categroy_id" (click)="getQuestionsMasters()">
|
||||
{{cat.categroy_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<!--</mat-form-field>-->
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="20%">
|
||||
<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--</mat-card-content>-->
|
||||
</mat-card>
|
||||
|
||||
<ng-container *ngIf="productList.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">
|
||||
|
||||
<div fxFlex="90%" style="padding: 12px 8px;">
|
||||
<!--<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="start none">
|
||||
<div class="category-label"> {{ product.categroy_name }}</div>
|
||||
</div>-->
|
||||
<div fxLayout="row" fxLayoutWrap fxLayoutAlign="none none">
|
||||
<div class="ml-xs" fxFlex="20%">
|
||||
{{ product.categroy_name }}
|
||||
</div>
|
||||
<div class="ml-xs" fxFlex="80%">
|
||||
<div class="text-line-limit">{{ product.question }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxFlex="10%">
|
||||
<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||
=======
|
||||
<mat-card class="mat-elevation-z1">
|
||||
<div style="margin: 6px; padding: 4px;">
|
||||
<div class="p_title" style="font-size: 16px; font-style: bold;">Questions Master</div>
|
||||
@ -103,7 +48,6 @@
|
||||
<div fxFlex="10%">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="editQuestion(product)"><mat-icon>edit</mat-icon></button>
|
||||
<!--<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<mat-icon>more_vert</mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
@ -111,17 +55,10 @@
|
||||
<mat-icon>create</mat-icon>
|
||||
<span>Edit</span>
|
||||
</button>
|
||||
<<<<<<< HEAD
|
||||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
<!--<mat-card-header>
|
||||
=======
|
||||
</mat-menu>-->
|
||||
</div>
|
||||
</div>
|
||||
<!--<mat-card-header>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<mat-card-title>
|
||||
<h4>{{ product.question }}</h4>
|
||||
</mat-card-title>
|
||||
@ -133,29 +70,6 @@
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="accent" (click)="addItemToCard(product)">Add to card</button>
|
||||
</mat-card-actions>-->
|
||||
<<<<<<< HEAD
|
||||
</mat-card>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<!--<mat-paginator
|
||||
#paginator
|
||||
[length]="productList.length"
|
||||
[pageSize]="5"
|
||||
[pageSizeOptions]="[5, 10, 25, 100]"
|
||||
[showFirstLastButtons]="true">
|
||||
</mat-paginator>-->
|
||||
|
||||
<mat-paginator #paginator class="mat-elevation-z1"
|
||||
[length]="productList.length"
|
||||
[pageIndex]="pageIndex"
|
||||
[pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 100]"
|
||||
(page)="pageEvent = $event; pageChange($event)">
|
||||
</mat-paginator>
|
||||
|
||||
<!--<mat-card>
|
||||
=======
|
||||
</mat-card>
|
||||
</div>
|
||||
</ng-container>
|
||||
@ -167,7 +81,6 @@
|
||||
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
|
||||
</mat-paginator>
|
||||
<!--<mat-card>
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<div class="example-container mat-elevation-z8">
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
@ -192,19 +105,15 @@
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
|
||||
</div>
|
||||
</mat-card>-->
|
||||
</mat-card>
|
||||
</div>
|
||||
<!--<div *ngIf="addView">
|
||||
</div>
|
||||
<!--<div *ngIf="addView">
|
||||
<app-add></app-add>
|
||||
</div>-->
|
||||
</div>-->
|
||||
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
<notifier-container></notifier-container>
|
||||
@ -44,12 +44,9 @@
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 3px #c8bbbb;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
.no-record-found {
|
||||
font-size: 18px;
|
||||
color: #03a9f4;
|
||||
padding : 12px 8px;
|
||||
}
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
<<<<<<< HEAD
|
||||
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent} from '@angular/material';
|
||||
import { FormGroup, FormControl } from '@angular/forms';
|
||||
=======
|
||||
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
|
||||
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { QuestionsService } from './../../service/questions/questions.service';
|
||||
@ -14,37 +9,16 @@ import { MastersService } from './../../service/masters/masters.service';
|
||||
import { AddComponent } from './../add/add.component';
|
||||
import { EditComponent } from './../edit/edit.component';
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/*
|
||||
* Questions master List component
|
||||
* : kdk
|
||||
*/
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
@Component({
|
||||
selector: 'app-list',
|
||||
templateUrl: './list.component.html',
|
||||
styleUrls: ['./list.component.scss']
|
||||
})
|
||||
export class ListComponent implements OnInit {
|
||||
<<<<<<< HEAD
|
||||
|
||||
public productList: any[] = [];
|
||||
public paginationList: any[] = [];
|
||||
public categories: any = [];
|
||||
public search_cid :any = null;
|
||||
|
||||
public filterFormCtrl : FormControl = new FormControl();
|
||||
/** control for the MatSelect filter keyword */
|
||||
// public masterFilterCtrl: FormControl = new FormControl();
|
||||
|
||||
length = 50;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
|
||||
pageEvent: PageEvent;
|
||||
|
||||
=======
|
||||
|
||||
public productList: any[] = [];
|
||||
public paginationList: any[] = [];
|
||||
@ -61,46 +35,15 @@ export class ListComponent implements OnInit {
|
||||
pageEvent: PageEvent;
|
||||
|
||||
// data source variable details
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
questionListData = null;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['categroy_name', 'question', 'actions'];
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
<<<<<<< HEAD
|
||||
private questionsService: QuestionsService,
|
||||
private masterService: MastersService) {
|
||||
this.getQuestionsMasters();
|
||||
}
|
||||
|
||||
getQuestionsMasters(){
|
||||
this.search_cid = this.filterFormCtrl.value;
|
||||
console.log(this.filterFormCtrl);
|
||||
this.questionsService.getQuestionMasterDetails(this.search_cid).subscribe(
|
||||
data => {
|
||||
this.productList = data.records;
|
||||
this.questionListData = data.records;
|
||||
// alert(this.userData);
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.questionListData;
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getCategorMaster();
|
||||
}
|
||||
|
||||
getCategorMaster() {
|
||||
=======
|
||||
private questionsService: QuestionsService,
|
||||
private masterService: MastersService,
|
||||
private _formBuilder: FormBuilder) {
|
||||
@ -143,7 +86,6 @@ export class ListComponent implements OnInit {
|
||||
|
||||
// get category master details
|
||||
getCategorMaster() {
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.masterService.getAllMasterData('QUESTIONCATEGORY').subscribe(
|
||||
data => {
|
||||
this.categories = data.records.filter(category => category.isactive == 1);
|
||||
@ -154,11 +96,7 @@ export class ListComponent implements OnInit {
|
||||
)
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
ngAfterViewInit() {
|
||||
=======
|
||||
ngAfterViewInit() {
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
@ -172,32 +110,6 @@ export class ListComponent implements OnInit {
|
||||
// add questions popup model call
|
||||
addNewQuestion() {
|
||||
const dialogRef = this.dialog.open(AddComponent, {
|
||||
<<<<<<< HEAD
|
||||
data: {}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getQuestionsMasters();
|
||||
// this.getBranch();
|
||||
// this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editQuestion(rowDetails: any){
|
||||
const dialogRef = this.dialog.open(EditComponent, {
|
||||
data: rowDetails
|
||||
});
|
||||
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getQuestionsMasters();
|
||||
// this.getBranch();
|
||||
// this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
=======
|
||||
data: {},
|
||||
disableClose: true
|
||||
});
|
||||
@ -223,7 +135,6 @@ export class ListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
// padination page event call
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
pageChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
@ -28,14 +28,8 @@ import { AddComponent } from './add/add.component';
|
||||
import { EditComponent } from './edit/edit.component';
|
||||
/*
|
||||
* Question Master Module details
|
||||
<<<<<<< HEAD
|
||||
*/
|
||||
|
||||
|
||||
=======
|
||||
* : kdk
|
||||
*/
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
/**
|
||||
* Custom angular notifier options
|
||||
*/
|
||||
@ -47,11 +41,7 @@ const customNotifierOptions: NotifierOptions = {
|
||||
},
|
||||
vertical: {
|
||||
position: 'top',
|
||||
<<<<<<< HEAD
|
||||
distance: 12,
|
||||
=======
|
||||
distance: 32,
|
||||
>>>>>>> 3bdd446b0760f030c46f5bea12469a0a15829ebe
|
||||
gap: 10
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user