build_app
This commit is contained in:
		
							parent
							
								
									06bc457928
								
							
						
					
					
						commit
						f77e2d3c63
					
				| @ -69,6 +69,18 @@ public class BuilderService { | ||||
| 		executeDump(true); | ||||
| 
 | ||||
| 		// ADD OTHER SERVICE | ||||
| addCustomMenu( "test vps steper","Stepper_workflow",  "Transcations");  | ||||
| 
 | ||||
| 
 | ||||
| addCustomMenu( "Document_upload","Document_upload",  "Transcations");  | ||||
| 
 | ||||
| 
 | ||||
| addCustomMenu( "Visa_entry_type","Visa_entry_type",  "Transcations");  | ||||
| 
 | ||||
| 
 | ||||
| addCustomMenu( "Customer_information","Customer_information",  "Transcations");  | ||||
| 
 | ||||
| 
 | ||||
| addCustomMenu( "Document_upload","Document_upload",  "Transcations");  | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -19,6 +19,7 @@ | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| @ -249,6 +250,8 @@ export class Stepper_workflowComponent implements OnInit { | ||||
|     console.log('id is ', id) | ||||
| 
 | ||||
|     // stepper route
 | ||||
|  this.router.navigate(["../test_vps_steper/", id], { relativeTo: this.route }); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -0,0 +1 @@ | ||||
| {"version":3,"sources":["test_vps_steper.component.scss","test_vps_steper.component.css"],"names":[],"mappings":"AAAA;EACE,UAAA;EACA,YAAA;ACCF;;ADCA;EACE,UAAA;EACA,aAAA;ACEF;;ADAA;EACE,UAAA;EACA,aAAA;ACGF;;ADDA;EACE,UAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACIF;;ADFA;EACE,UAAA;ACKF;;ADHA;EACE,kBAAA;ACMF;;ADHA;EACE,WAAA;ACMF;;ADJA;EACA;IACA,WAAA;ECOE;AACF","file":"test_vps_steper.component.css"} | ||||
| @ -0,0 +1,527 @@ | ||||
| <ol class="breadcrumb breadcrumb-arrow font-trirong"> | ||||
|   <li><a href="javascript://" [routerLink]="['/']">Home</a></li> | ||||
|   <li><a href="javascript://">stepper</a></li> | ||||
| </ol> | ||||
| 
 | ||||
| <div class="button-bar"> | ||||
| 
 | ||||
|   <span class="spacer"></span> | ||||
|   <button class="btn btn-sm btn-primary" (click)="reset()">Reset</button> | ||||
| 
 | ||||
|   <button class="btn btn-sm btn-primary" (click)="changeToHorizonTal()" | ||||
|     *ngIf="layout.direction === 'vertical'">HorizonTal Layout</button> | ||||
|   <button class="btn btn-sm btn-primary" (click)="changeToVertical()" *ngIf="layout.direction === 'horizontal'">Vertical | ||||
|     Layout</button> | ||||
| 
 | ||||
| </div> | ||||
| 
 | ||||
| <div class="clr-row"> | ||||
|   <div [class]="layout.block1"> | ||||
|     <div class="card"> | ||||
|       <div class="card-header"> | ||||
|         <h3 style="text-align: center;"> Workflow</h3> | ||||
|       </div> | ||||
| 
 | ||||
|       <div class=" card-block container"> | ||||
| 
 | ||||
|         <clr-timeline [clrLayout]="layout.direction"> | ||||
|    <clr-timeline-step [clrState]="timelineStyle.step0.state"> | ||||
|             <clr-timeline-step-header>step 0</clr-timeline-step-header> | ||||
|             <clr-timeline-step-title> <span *ngIf="!appToUpdate">Application</span><span *ngIf="appToUpdate"> Update | ||||
|                 Datagrid</span> </clr-timeline-step-title> | ||||
|             <clr-timeline-step-description> <span>Create/Customer_information<br> Information Of | ||||
|                 Customer</span></clr-timeline-step-description> | ||||
|           </clr-timeline-step>   | ||||
| 
 | ||||
|    <clr-timeline-step [clrState]="timelineStyle.step1.state"> | ||||
|             <clr-timeline-step-header>step 1</clr-timeline-step-header> | ||||
|             <clr-timeline-step-title> <span *ngIf="!appToUpdate">Application</span><span *ngIf="appToUpdate"> Update | ||||
|                 Datagrid</span> </clr-timeline-step-title> | ||||
|             <clr-timeline-step-description> <span>Create/Document_upload<br> Information Of | ||||
|                 Customer</span></clr-timeline-step-description> | ||||
|           </clr-timeline-step>   | ||||
| 
 | ||||
|  <clr-timeline-step [clrState]="timelineStyle.step2.state"> | ||||
|             <clr-timeline-step-header>Step 2</clr-timeline-step-header> | ||||
|             <clr-timeline-step-title>Review And <br>Confirmation</clr-timeline-step-title> | ||||
|             <clr-timeline-step-description> | ||||
|               Finish . | ||||
|             </clr-timeline-step-description> | ||||
|           </clr-timeline-step></clr-timeline> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <div [class]="layout.block2"> | ||||
|     <!--STEP 0--> | ||||
|     <div class="card" *ngIf="timelineStyle.step0.open"> | ||||
|       <div class="card-header"> | ||||
|         <h3 style="text-align: center;" *ngIf="!appToUpdate">Customer_information</h3> | ||||
|         <h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{Customer_informationentryForm.name}}</h3> | ||||
|         <div class="container"> | ||||
| 
 | ||||
|           <br /> | ||||
| 
 | ||||
|          | ||||
|           <form [formGroup]="Customer_informationentryForm"> | ||||
| 
 | ||||
|             <div class="container"> | ||||
| 
 | ||||
|               <div class="clr-row"><div class="clr-col-sm-12"> | ||||
|  <label>  Name</label> | ||||
|  <input class="clr-input"  type="text"  formControlName="name" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
|  <label>  Description</label>              | ||||
|  <textarea cols="10" rows="2" formControlName="description" placeholder="Textarea">  </textarea> | ||||
| 	            </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">             | ||||
|  <label> Active</label>             | ||||
|   <input type="checkbox" formControlName="active" clrToggle/>            </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Visa Entry Type</label> | ||||
| 							 <select formControlName="visa_entry_type"> | ||||
| 							    <option [value]="null">Select  Visa Entry Type </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> a </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> b </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Visa Duration</label> | ||||
| 							 <select formControlName="visa_duration"> | ||||
| 							    <option [value]="null">Select  Visa Duration </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> 10_days </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> 20_days </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Visa Processing</label> | ||||
| 							 <select formControlName="visa_processing"> | ||||
| 							    <option [value]="null">Select  Visa Processing </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> test2 </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> test </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Travel start date</label> | ||||
|  <input class="clr-input"  type="date"  formControlName="travel_start_date" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Travel end date</label> | ||||
|  <input class="clr-input"  type="date"  formControlName="travel_end_date" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  passport Number</label> | ||||
|  <input class="clr-input"  type="number"  formControlName="passport_number" />       | ||||
|  <div *ngIf="submitted && entryForm.controls.passport_number.errors" class="error_mess"> | ||||
|   <div *ngIf="submitted && entryForm.controls.passport_number.errors.required" class="error_mess">*This field is Required</div> | ||||
| </div>   | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Passport issue date</label> | ||||
|  <input class="clr-input"  type="date"  formControlName="passport_issue_date" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Passport expiry date</label> | ||||
|  <input class="clr-input"  type="date"  formControlName="passport_expiry_date" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
| 						<label> Email Field</label> | ||||
| <input class="clr-input" type="email" formControlName="email_field" pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"> | ||||
| <div *ngIf="entryForm.controls['email_field'].errors" class="error_mess"> | ||||
| 						          <div *ngIf="entryForm.controls['email_field'].hasError('pattern')" class="error_mess">* Email must be a valid email address | ||||
| 						            </div>  </div> | ||||
| </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">         | ||||
| <label>  Phone Number</label>         | ||||
| <input class="clr-input" type="text" formControlName="phone_number" pattern="((\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" /> | ||||
| 	        <div *ngIf="submitted && entryForm.controls['phone_number'].errors" class="error_mess"> | ||||
| 	          <div *ngIf="submitted && entryForm.controls['phone_number'].hasError('pattern')" class="error_mess">* Please Follow your pattern,+91 Enter 10 digit Mobile Number. | ||||
| 	          </div>      </div>      </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Birth Place</label> | ||||
|  <input class="clr-input"  type="text"  formControlName="birth_place" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Date of Birth</label> | ||||
|  <input class="clr-input"  type="date"  formControlName="date_of_birth" />        | ||||
|  </div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|             <label>Gender</label> | ||||
|             <clr-radio-container clrInline style="margin-top: 0;">  | ||||
| 
 | ||||
|   | ||||
|    <clr-radio-wrapper> | ||||
|                 <input type="radio" clrRadio formControlName="gender" (change)="updategender('Male')" [checked]="entryForm.get('gender').value === 'Male'" /> | ||||
|                 <label> Male </label> | ||||
|               </clr-radio-wrapper>      | ||||
|   | ||||
| 
 | ||||
|   | ||||
|    <clr-radio-wrapper> | ||||
|                 <input type="radio" clrRadio formControlName="gender" (change)="updategender('Female')" [checked]="entryForm.get('gender').value === 'Female'" /> | ||||
|                 <label> Female </label> | ||||
|               </clr-radio-wrapper>      | ||||
|   | ||||
| 
 | ||||
|      | ||||
|  </clr-radio-container> | ||||
|           </div>  | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <div class="clr-col-sm-12"> | ||||
|  <label>  Profession</label> | ||||
|  <input class="clr-input"  type="text"  formControlName="profession" />        | ||||
|  </div> | ||||
| 
 | ||||
| <!-- currency field start --> | ||||
|       <div class="clr-col-sm-12">         | ||||
|  <label> Visa cost</label>          | ||||
| <input type="number"  class="clr-input"   formControlName="visa_cost"  [value]="entryForm.value.visa_cost | number:'1.2-2' | removeCommas">    | ||||
|     </div>  | ||||
| 	      <!-- currency field end --> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Referrer</label> | ||||
| 							 <select formControlName="referrer"> | ||||
| 							    <option [value]="null">Select  Referrer </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> Ref1 </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> Ref2 </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Nationality</label> | ||||
| 							 <select formControlName="nationality"> | ||||
| 							    <option [value]="null">Select  Nationality </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> British </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> Indian </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Supplier</label> | ||||
| 							 <select formControlName="supplier"> | ||||
| 							    <option [value]="null">Select  Supplier </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> sup2 </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> sup1 </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| <div class="clr-col-sm-12">              | ||||
| 	 <label>Agent</label> | ||||
| 							 <select formControlName="agent"> | ||||
| 							    <option [value]="null">Select  Agent </option>  | ||||
| 								 | ||||
|   | ||||
| 								<option> Agent1 </option> | ||||
| 								  | ||||
| 
 | ||||
|   | ||||
| 								<option> Agent2 </option> | ||||
| 								  | ||||
| 
 | ||||
| 						</select></div> | ||||
| 
 | ||||
| 
 | ||||
|               </div> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|               <div class="clr-row"> | ||||
| 
 | ||||
|               </div> | ||||
|               <!-- end row --> | ||||
|               <br> | ||||
| <div class="button"> | ||||
|   <button type="submit" class="btn btn-primary" (click)="onCustomer_informationSave()">Submit</button> | ||||
|   <button type="button" class="btn btn-primary" | ||||
|     (click)="this.timelineStyle.step0 = { state: 'success', open: false }; | ||||
|              this.timelineStyle.step1 = { state: 'current', open: true }; this.current()">Complete</button> | ||||
|   <button type="button" class="btn btn-primary" | ||||
|     (click)="this.timelineStyle.step0 = { state: 'current', open: false }; | ||||
|              this.timelineStyle.step1 = { state: 'not-started', open: true }">Next</button> | ||||
| </div>  </div> | ||||
|           </form> | ||||
| 
 | ||||
|         </div> | ||||
| 
 | ||||
|       </div> | ||||
|     </div>  | ||||
|     <!--STEP 1--> | ||||
|     <div class="card" *ngIf="timelineStyle.step1.open"> | ||||
|       <div class="card-header"> | ||||
|         <h3 style="text-align: center;" *ngIf="!appToUpdate">Document_upload</h3> | ||||
|         <h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{Document_uploadentryForm.name}}</h3> | ||||
|         <div class="container"> | ||||
| 
 | ||||
|           <br /> | ||||
| 
 | ||||
|          | ||||
|           <form [formGroup]="Document_uploadentryForm"> | ||||
| 
 | ||||
|             <div class="container"> | ||||
| 
 | ||||
|               <div class="clr-row"> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|               </div> | ||||
| 
 | ||||
| <h6> List of imageupload_field</h6> | ||||
| 
 | ||||
|  <div  class="clr-row" style="margin-top: 10px;"> | ||||
|    <table class="table"> | ||||
|        <thead> | ||||
|         <tr> | ||||
|         <th>No</th> | ||||
|          <th> File</th> | ||||
|          <th>File Name</th> | ||||
|           <th>Preview</th> | ||||
|           <th>Cancel</th> | ||||
|            </tr> | ||||
|          </thead> | ||||
|          <tbody > | ||||
|            <tr *ngFor="let attach of FileDataimageupload_field; let i=index"> | ||||
|              <td style="width: 70px;"><input type="text" class="clr-input"  value={{i+1}} [readonly]="true">  </td> | ||||
|              <td><input type="file" (change)="onFileChangedimageupload_field($event, i)"  accept="image/*" /><!--accept=".pdf,.doc,.docx,.jpg,.msg"--> | ||||
|               </td> | ||||
|          <td>{{attach.uploadedfile_name}}</td> | ||||
|              <td >  <img [src]="attach.filePreview" alt="File Preview"  [ngModelOptions]="{standalone: true}" name="filePreview" width="100px" height="100px"></td> | ||||
|              <td> | ||||
|                <a  (click)="deleteRowimageupload_field(i)"> | ||||
|                  <clr-icon shape="trash" class="is-error"></clr-icon> | ||||
|                </a> | ||||
|              </td> | ||||
|            </tr> | ||||
| 
 | ||||
| 
 | ||||
|        </tbody> | ||||
|          <button type="button" class="btn btn-primary button1" style="margin-left: 20px;" (click)="onAddLinesimageupload_field()"> | ||||
|            <clr-icon shape="plus"></clr-icon> | ||||
|          </button> | ||||
| 
 | ||||
|        </table> </div> | ||||
| 
 | ||||
| <h6> List of fileupload_field</h6> | ||||
| 
 | ||||
|  <div  class="clr-row" style="margin-top: 10px;"> | ||||
|    <table class="table"> | ||||
|        <thead> | ||||
|         <tr> | ||||
|         <th>No</th> | ||||
|          <th> File</th> | ||||
|          <th>File Name</th> | ||||
|           <th>Preview</th> | ||||
|           <th>Cancel</th> | ||||
|            </tr> | ||||
|          </thead> | ||||
|          <tbody > | ||||
|            <tr *ngFor="let attach of FileDatafileupload_field; let i=index"> | ||||
|              <td style="width: 70px;"><input type="text" class="clr-input"  value={{i+1}} [readonly]="true">  </td> | ||||
|              <td><input type="file" (change)="onFileChangedfileupload_field($event, i)"  accept = "application/pdf,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" /><!--accept=".pdf,.doc,.docx,.jpg,.msg"--> | ||||
|               </td> | ||||
|          <td>{{attach.uploadedfile_name}}</td> | ||||
|              <td >  <img [src]="attach.filePreview" alt="File Preview"  [ngModelOptions]="{standalone: true}" name="filePreview" width="100px" height="100px"></td> | ||||
|              <td> | ||||
|                <a  (click)="deleteRowfileupload_field(i)"> | ||||
|                  <clr-icon shape="trash" class="is-error"></clr-icon> | ||||
|                </a> | ||||
|              </td> | ||||
|            </tr> | ||||
| 
 | ||||
| 
 | ||||
|        </tbody> | ||||
|          <button type="button" class="btn btn-primary button1" style="margin-left: 20px;" (click)="onAddLinesfileupload_field()"> | ||||
|            <clr-icon shape="plus"></clr-icon> | ||||
|          </button> | ||||
| 
 | ||||
|        </table> </div> | ||||
| 
 | ||||
|               <div class="clr-row"> | ||||
| 
 | ||||
|               </div> | ||||
|               <!-- end row --> | ||||
|               <br> | ||||
| <div class="button"> | ||||
|   <button type="submit" class="btn btn-success" (click)="onDocument_uploadSave()">Document Upload</button> | ||||
|   <button type="button" class="btn btn-primary" | ||||
|     (click)="timelineStyle.step1 = { state: 'success', open: false }; | ||||
|              timelineStyle.step2 = { state: 'current', open: true }">Complete</button> | ||||
|   <button class="btn btn-primary-outline" | ||||
|     (click)="timelineStyle.step0 = { state: 'current', open: true }; | ||||
|              timelineStyle.step1 = { state: 'not-started', open: false }">Back</button> | ||||
| </div>  </div> | ||||
|           </form> | ||||
| 
 | ||||
|         </div> | ||||
| 
 | ||||
|       </div> | ||||
|     </div>  | ||||
|  <!--STEP 2-->  <div class="card" *ngIf="timelineStyle.step2.open"> | ||||
|       <div class="card-header"> | ||||
|         <h3 style="text-align: center;" *ngIf="!appToUpdate"> Review And Confirmation</h3> | ||||
|         <div class="container"> | ||||
| 
 | ||||
|           <!--  Info --> | ||||
|    <div class="clr-row mb-3"> | ||||
|             <div class="clr-col-12"> | ||||
|               <h5>Customer_information Summary:</h5><p><strong>Name : </strong> {{ Customer_informationentryForm.get('name')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Description : </strong> {{ Customer_informationentryForm.get('description')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Active : </strong> {{ Customer_informationentryForm.get('active')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Visa Entry Type : </strong> {{ Customer_informationentryForm.get('visa_entry_type')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Visa Duration : </strong> {{ Customer_informationentryForm.get('visa_duration')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Visa Processing : </strong> {{ Customer_informationentryForm.get('visa_processing')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Travel start date : </strong> {{ Customer_informationentryForm.get('travel_start_date')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Travel end date : </strong> {{ Customer_informationentryForm.get('travel_end_date')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>passport Number : </strong> {{ Customer_informationentryForm.get('passport_number')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Passport issue date : </strong> {{ Customer_informationentryForm.get('passport_issue_date')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Passport expiry date : </strong> {{ Customer_informationentryForm.get('passport_expiry_date')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Email Field : </strong> {{ Customer_informationentryForm.get('email_field')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Phone Number : </strong> {{ Customer_informationentryForm.get('phone_number')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Birth Place : </strong> {{ Customer_informationentryForm.get('birth_place')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Date of Birth : </strong> {{ Customer_informationentryForm.get('date_of_birth')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Gender : </strong> {{ Customer_informationentryForm.get('gender')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Profession : </strong> {{ Customer_informationentryForm.get('profession')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Visa cost : </strong> {{ Customer_informationentryForm.get('visa_cost')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Referrer : </strong> {{ Customer_informationentryForm.get('referrer')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Nationality : </strong> {{ Customer_informationentryForm.get('nationality')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Supplier : </strong> {{ Customer_informationentryForm.get('supplier')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Agent : </strong> {{ Customer_informationentryForm.get('agent')?.value }}</p> | ||||
| 
 | ||||
| 
 | ||||
|             </div> | ||||
|           </div>   <div class="clr-row mb-3"> | ||||
|             <div class="clr-col-12"> | ||||
|               <h5>Document_upload Summary:</h5><p><strong>Imageupload Field : </strong> {{ Document_uploadentryForm.get('imageupload_field')?.value }}</p> | ||||
| 
 | ||||
| <p><strong>Fileupload Field : </strong> {{ Document_uploadentryForm.get('fileupload_field')?.value }}</p> | ||||
| 
 | ||||
| 
 | ||||
|             </div> | ||||
|           </div><div class="button"> | ||||
|   <button class="btn btn-primary-outline" | ||||
|     (click)="this.timelineStyle.step1 = { state: 'current', open: true }; | ||||
|              this.timelineStyle.step2 = { state: 'not-started', open: false }">Back</button> | ||||
|   <button class="btn btn-primary" | ||||
|     (click)="timelineStyle.step2 = { state: 'success', open: false }; current(); | ||||
|              alert('Process Finished Successfully!')">Finish</button> | ||||
| </div></div> | ||||
|       </div> | ||||
|     </div> | ||||
| @ -0,0 +1,46 @@ | ||||
| .horizontal{ | ||||
|   width: 25%; | ||||
|   padding: 5px; | ||||
| } | ||||
| .horizontal1{ | ||||
|   width: 50%; | ||||
|   padding: 10px; | ||||
| } | ||||
| .middle{ | ||||
|   width: 33%; | ||||
|   padding: 10px; | ||||
| } | ||||
| .middle1{ | ||||
|   width: 75%; | ||||
|   padding: 10px; | ||||
| } | ||||
| 
 | ||||
| .full{ | ||||
|   width: 100%; | ||||
|   padding: 10px; | ||||
| } | ||||
| 
 | ||||
| input[type=text],[type=date], select { | ||||
|   width: 100%; | ||||
|   padding: 12px 20px; | ||||
|   margin: 8px 0; | ||||
|   display: inline-block; | ||||
|   border: 1px solid #ccc; | ||||
|   border-radius: 4px; | ||||
|   box-sizing: border-box; | ||||
| } | ||||
| .required-field{ | ||||
|   color: red; | ||||
| } | ||||
| .center { | ||||
|   text-align: center; | ||||
| 
 | ||||
| } | ||||
| .center{ | ||||
|   color: blue; | ||||
| } | ||||
| @media (max-width: 600px){ | ||||
| .horizontal,.middle,.horizontal1,.middle1 { | ||||
| width: 100%; | ||||
| }} | ||||
| 
 | ||||
| @ -0,0 +1,25 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
| 
 | ||||
| import { test_vps_steperComponent } from './test_vps_steper.component'; | ||||
| 
 | ||||
| describe('test_vps_steperComponent', () => { | ||||
|   let component: test_vps_steperComponent; | ||||
|   let fixture: ComponentFixture<test_vps_steperComponent>; | ||||
| 
 | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [ test_vps_steperComponent ] | ||||
|     }) | ||||
|     .compileComponents(); | ||||
|   }); | ||||
| 
 | ||||
|   beforeEach(() => { | ||||
|     fixture = TestBed.createComponent(test_vps_steperComponent); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
| 
 | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @ -0,0 +1,824 @@ | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| 
 | ||||
| 
 | ||||
| import { ToastrService } from 'ngx-toastr'; | ||||
| import { ActivatedRoute, Router } from '@angular/router'; | ||||
| import { College } from 'src/app/models/fnd/play'; | ||||
| import { student } from 'src/app/models/fnd/Studentadd'; | ||||
| import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | ||||
| import { Observable } from 'rxjs'; | ||||
| import { ValidationError } from 'src/app/models/fnd/ValidationError'; | ||||
| import { test_vps_steperservice } from './test_vps_steper.service'; | ||||
| @Component({ | ||||
|   selector: 'app-editstepper', | ||||
|   templateUrl: './test_vps_steper.component.html', | ||||
|   styleUrls: ['./test_vps_steper.component.scss'] | ||||
| }) | ||||
| export class test_vps_steperComponent implements OnInit { | ||||
|   updated = false; | ||||
|   stringJson: any; | ||||
|   customerId: string = ''; | ||||
|   selectedFile!: File; | ||||
|   fileName = ''; | ||||
| 
 | ||||
|   id: number; | ||||
|   errorFields: ValidationError[] = []; | ||||
|   appToUpdate: College = null; | ||||
|   trained = false; | ||||
| 
 | ||||
|   json: string = ""; | ||||
|   luisApp = | ||||
|     { | ||||
|       name: '', | ||||
|       created: 1, | ||||
|       trained: 1, | ||||
|       tested: 1, | ||||
|       updated: 1, | ||||
|       published: 1, | ||||
| 
 | ||||
|     }; | ||||
|   // Layout direction changing
 | ||||
|   layout = { | ||||
|     direction: "vertical", | ||||
|     block1: "clr-col-lg-3 clr-col-12 ", | ||||
|     block2: "clr-col-lg-9 clr-col-12 ", | ||||
|   }; | ||||
| 
 | ||||
|   timelineStyle = {  | ||||
|  step0: { state: "current", open: true, failed: false },  | ||||
|     step1: { state: "not-started", open: false, failed: false }, | ||||
|     step2: { state: "not-started", open: false, failed: false }, | ||||
| }; | ||||
| public Customer_informationentryForm: FormGroup; | ||||
| public Document_uploadentryForm: FormGroup; | ||||
|   submitted = false; | ||||
|   rowSelected: any = {}; | ||||
|   modalcomplete = false; | ||||
| 
 | ||||
|   constructor(  | ||||
| private mainService: test_vps_steperservice, | ||||
| 
 | ||||
| private Customer_information_fb: FormBuilder,  | ||||
| private Document_upload_fb: FormBuilder,  | ||||
| private router: Router, | ||||
|  private route: ActivatedRoute, | ||||
|     private toastr: ToastrService, | ||||
|   ) { } | ||||
| 
 | ||||
|   ngOnInit(): void { | ||||
|     this.id = this.route.snapshot.params["id"]; | ||||
|     console.log("update with id = ", this.id); | ||||
| 
 | ||||
| 
 | ||||
|  this.Customer_informationentryForm = this.Customer_information_fb.group({  | ||||
| name : [null], | ||||
| 
 | ||||
| description : [null], | ||||
| 
 | ||||
| active : [true], | ||||
| 
 | ||||
| visa_entry_type : [null], | ||||
| 
 | ||||
| visa_duration : [null], | ||||
| 
 | ||||
| visa_processing : [null], | ||||
| 
 | ||||
| travel_start_date : [null], | ||||
| 
 | ||||
| travel_end_date : [null], | ||||
| 
 | ||||
| passport_number : [null,[Validators.required]], | ||||
| 
 | ||||
| passport_issue_date : [null], | ||||
| 
 | ||||
| passport_expiry_date : [null], | ||||
| 
 | ||||
| email_field : [null], | ||||
| 
 | ||||
| phone_number: ['+91'], | ||||
| 
 | ||||
| birth_place : [null], | ||||
| 
 | ||||
| date_of_birth : [null], | ||||
| 
 | ||||
| gender : [null], | ||||
| 
 | ||||
| profession : [null], | ||||
| 
 | ||||
| visa_cost : [null, { updateOn: 'blur' }], | ||||
| 
 | ||||
| referrer : [null], | ||||
| 
 | ||||
| nationality : [null], | ||||
| 
 | ||||
| supplier : [null], | ||||
| 
 | ||||
| agent : [null], | ||||
| 
 | ||||
| 
 | ||||
|   }); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  this.Document_uploadentryForm = this.Document_upload_fb.group({  | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   }); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  const stepId = this.id; // or from route/query/etc
 | ||||
|   | ||||
|     this.getResolvedDataFromStepper(stepId).subscribe(res => { | ||||
|       console.log('response get ', res); | ||||
| 
 | ||||
|       if (res === null) { | ||||
|         this.showEmptyForm(); | ||||
|       } else { | ||||
|  if (res['Customer_information']) { | ||||
|   | ||||
|  this.prefillCustomer_informationForm(res['Customer_information']); | ||||
|         } | ||||
| 
 | ||||
|  if (res['Document_upload']) { | ||||
|   | ||||
|  this.prefillDocument_uploadForm(res['Document_upload']); | ||||
|         } | ||||
| } | ||||
|     }); | ||||
| 
 | ||||
|   } | ||||
| showEmptyForm(): void { | ||||
|     console.log('No config found. Showing empty form.'); | ||||
|     // You can choose to show one or both based on some logic
 | ||||
| 
 | ||||
|  this.Customer_informationentryForm.reset(); | ||||
| 
 | ||||
|  this.Document_uploadentryForm.reset(); | ||||
|   }  prefillCustomer_informationForm(data: any): void { | ||||
| 
 | ||||
|     console.log(' Customer_information data ', data) | ||||
|     this.Customer_informationentryForm.patchValue({ | ||||
|       id: data.id || '', | ||||
| name: data.name || '', | ||||
| 
 | ||||
| description: data.description || '', | ||||
| 
 | ||||
| active: data.active || '', | ||||
| 
 | ||||
| visa_entry_type: data.visa_entry_type || '', | ||||
| 
 | ||||
| visa_duration: data.visa_duration || '', | ||||
| 
 | ||||
| visa_processing: data.visa_processing || '', | ||||
| 
 | ||||
| travel_start_date: data.travel_start_date || '', | ||||
| 
 | ||||
| travel_end_date: data.travel_end_date || '', | ||||
| 
 | ||||
| passport_number: data.passport_number || '', | ||||
| 
 | ||||
| passport_issue_date: data.passport_issue_date || '', | ||||
| 
 | ||||
| passport_expiry_date: data.passport_expiry_date || '', | ||||
| 
 | ||||
| email_field: data.email_field || '', | ||||
| 
 | ||||
| phone_number: data.phone_number || '', | ||||
| 
 | ||||
| birth_place: data.birth_place || '', | ||||
| 
 | ||||
| date_of_birth: data.date_of_birth || '', | ||||
| 
 | ||||
| gender: data.gender || '', | ||||
| 
 | ||||
| profession: data.profession || '', | ||||
| 
 | ||||
| visa_cost: data.visa_cost || '', | ||||
| 
 | ||||
| referrer: data.referrer || '', | ||||
| 
 | ||||
| nationality: data.nationality || '', | ||||
| 
 | ||||
| supplier: data.supplier || '', | ||||
| 
 | ||||
| agent: data.agent || '', | ||||
| 
 | ||||
|     }); | ||||
|   }  prefillDocument_uploadForm(data: any): void { | ||||
| 
 | ||||
|     console.log(' Document_upload data ', data) | ||||
|     this.Document_uploadentryForm.patchValue({ | ||||
|       id: data.id || '', | ||||
| imageupload_field: data.imageupload_field || '', | ||||
| 
 | ||||
| fileupload_field: data.fileupload_field || '', | ||||
| 
 | ||||
|     }); | ||||
|   } | ||||
|  getResolvedDataFromStepper(id: number): Observable<any> { | ||||
|     console.log('get step config'); | ||||
| 
 | ||||
|     return new Observable(observer => { | ||||
|       this.mainService.gettabledata(id).subscribe(configList => { | ||||
|         if (!configList || configList.length === 0) { | ||||
|           console.log('empty config'); | ||||
|           observer.next(null); | ||||
|           observer.complete(); | ||||
|           return; | ||||
|         } | ||||
| 
 | ||||
|         const results: { [key: string]: any } = {}; | ||||
|         let processed = 0; | ||||
| 
 | ||||
|         configList.forEach(config => { | ||||
|           const { table_name, table_id } = config; | ||||
| 
 | ||||
|           this.getByTableNameAndId(table_name, table_id).subscribe(data => { | ||||
| 
 | ||||
|             console.log('data is ', data); | ||||
|             results[table_name] = data; | ||||
| 
 | ||||
|             processed++; | ||||
|             if (processed === configList.length) { | ||||
|               observer.next(results);  // emit combined data
 | ||||
|               observer.complete(); | ||||
|             } | ||||
| 
 | ||||
|           }, error => { | ||||
|             console.error(`Error loading data for table ${table_name}`, error); | ||||
|             processed++; | ||||
|             if (processed === configList.length) { | ||||
|               observer.next(results);  // continue with what we have
 | ||||
|               observer.complete(); | ||||
|             } | ||||
|           }); | ||||
|         }); | ||||
| 
 | ||||
|       }, error => { | ||||
|         console.error("Error loading stepper config", error); | ||||
|         observer.error(error); | ||||
|       }); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   getByTableNameAndId(tableName: string, id: number): Observable<any> { | ||||
| 
 | ||||
|     switch (tableName) { | ||||
|    case 'Customer_information': | ||||
|         return this.mainService.getCustomer_informationById(id); case 'Document_upload': | ||||
|         return this.mainService.getDocument_uploadById(id);// aur bhi cases agar naye table add ho to
 | ||||
|       default: | ||||
|         throw new Error(`Unknown table name: ${tableName}`); | ||||
|     } | ||||
|   } | ||||
|   // Change to Horizontal Layout
 | ||||
|   changeToHorizonTal() { | ||||
|     this.layout = { | ||||
|       direction: "horizontal", | ||||
|       block1: "clr-col-lg-12 clr-col-12 height container", | ||||
|       block2: "clr-col-lg-12 clr-col-12 container", | ||||
|     } | ||||
|   } | ||||
|   // Change to Vertical Layout
 | ||||
|   changeToVertical() { | ||||
|     this.layout = { | ||||
|       direction: "vertical", | ||||
|       block1: "clr-col-lg-3 clr-col-12 ", | ||||
|       block2: "clr-col-lg-9 clr-col-12 ", | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   onCustomer_informationSave() { | ||||
|     console.log('Form Submitted:', this.Customer_informationentryForm.value); | ||||
|     this.submitted = true; | ||||
|     if (this.Customer_informationentryForm.invalid) { | ||||
| 
 | ||||
|       console.log('invalid form ..'); | ||||
|       // Log all form errors
 | ||||
|       Object.keys(this.Customer_informationentryForm.controls).forEach(field => { | ||||
|         const control = this.Customer_informationentryForm.get(field); | ||||
|         if (control && control.invalid) { | ||||
|           console.log(`Error in field: ${field}`, control.errors); | ||||
|         } | ||||
|       } | ||||
|       ); | ||||
|       return; | ||||
|     } | ||||
|     this.onCustomer_informationCreate(); | ||||
|   } | ||||
| 
 | ||||
|   onCustomer_informationCreate() { | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     this.mainService.createCustomer_information(this.Customer_informationentryForm.value).subscribe( | ||||
|       (data) => { | ||||
|         console.log('adding data ', data); | ||||
|         this.customerId = data.id; | ||||
| 
 | ||||
|         console.log('id is  ', this.customerId); | ||||
| 
 | ||||
| 
 | ||||
|  const tableId = data.id; | ||||
|         const tableName = 'Customer_information'; | ||||
|         const stepperId = this.id; | ||||
| 
 | ||||
|         // Save stepper config
 | ||||
|         this.mainService.saveStepperConfig(stepperId, tableId, tableName).subscribe(() => { | ||||
|           this.toastr.success("Stepper Config Saved"); | ||||
|         });        if (data || data.status >= 200 && data.status <= 299) { | ||||
|           this.toastr.success("Added Successfully"); | ||||
|         } | ||||
|         setTimeout(() => { | ||||
|           this.ngOnInit(); | ||||
|         }, 500); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|       }, (error) => { | ||||
|         console.log(error); | ||||
|         if (error.status >= 200 && error.status <= 299) { | ||||
|           // this.toastr.success("Added Succesfully");
 | ||||
|         } | ||||
|         if (error.status >= 400 && error.status <= 499) { | ||||
|           this.toastr.error("Not Added"); | ||||
|         } | ||||
|         if (error.status >= 500 && error.status <= 599) { | ||||
|           this.toastr.error("Not Added"); | ||||
|         } | ||||
|       }); | ||||
|     this.rowSelected = this.Customer_informationentryForm.value; | ||||
| 
 | ||||
|     setTimeout(() => { | ||||
|       this.ngOnInit(); | ||||
|     }, 500); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   onDocument_uploadSave() { | ||||
|     console.log('Form Submitted:', this.Document_uploadentryForm.value); | ||||
|     this.submitted = true; | ||||
|     if (this.Document_uploadentryForm.invalid) { | ||||
| 
 | ||||
|       console.log('invalid form ..'); | ||||
|       // Log all form errors
 | ||||
|       Object.keys(this.Document_uploadentryForm.controls).forEach(field => { | ||||
|         const control = this.Document_uploadentryForm.get(field); | ||||
|         if (control && control.invalid) { | ||||
|           console.log(`Error in field: ${field}`, control.errors); | ||||
|         } | ||||
|       } | ||||
|       ); | ||||
|       return; | ||||
|     } | ||||
|     this.onDocument_uploadCreate(); | ||||
|   } | ||||
| 
 | ||||
|   onDocument_uploadCreate() { | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     this.mainService.createDocument_upload(this.Document_uploadentryForm.value).subscribe( | ||||
|       (data) => { | ||||
|         console.log('adding data ', data); | ||||
|         this.customerId = data.id; | ||||
| 
 | ||||
|         console.log('id is  ', this.customerId); | ||||
| 
 | ||||
| 
 | ||||
|  const tableId = data.id; | ||||
|         const tableName = 'Document_upload'; | ||||
|         const stepperId = this.id; | ||||
| 
 | ||||
|         // Save stepper config
 | ||||
|         this.mainService.saveStepperConfig(stepperId, tableId, tableName).subscribe(() => { | ||||
|           this.toastr.success("Stepper Config Saved"); | ||||
|         });        if (data || data.status >= 200 && data.status <= 299) { | ||||
|           this.toastr.success("Added Successfully"); | ||||
|         } | ||||
|         setTimeout(() => { | ||||
|           this.ngOnInit(); | ||||
|         }, 500); | ||||
| for (let i = 0; i < this.selectedimageupload_field.length; i++){ | ||||
| 
 | ||||
|   this.mainService.uploadImageupload_field(data.id,tableName,this.selectedimageupload_field[i]).subscribe(uploaddata =>{ | ||||
|     console.log(uploaddata); | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| for (let i = 0; i < this.selectedfileupload_field.length; i++){ | ||||
| 
 | ||||
|   this.mainService.uploadfilefileupload_field(data.id,tableName,this.selectedfileupload_field[i]).subscribe(uploaddata =>{ | ||||
|     console.log(uploaddata); | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|       }, (error) => { | ||||
|         console.log(error); | ||||
|         if (error.status >= 200 && error.status <= 299) { | ||||
|           // this.toastr.success("Added Succesfully");
 | ||||
|         } | ||||
|         if (error.status >= 400 && error.status <= 499) { | ||||
|           this.toastr.error("Not Added"); | ||||
|         } | ||||
|         if (error.status >= 500 && error.status <= 599) { | ||||
|           this.toastr.error("Not Added"); | ||||
|         } | ||||
|       }); | ||||
|     this.rowSelected = this.Document_uploadentryForm.value; | ||||
| 
 | ||||
|     setTimeout(() => { | ||||
|       this.ngOnInit(); | ||||
|     }, 500); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   onnext() { | ||||
|     this.router.navigate(["../../main/workflow"], { relativeTo: this.route }); | ||||
|   } | ||||
|   reset() { | ||||
|     this.json = ""; | ||||
|     this.luisApp = | ||||
|     { | ||||
|       name: '', | ||||
|       trained: 1, | ||||
|       tested: 1, | ||||
|       updated: 1, | ||||
|       published: 1, | ||||
|       created: 1, | ||||
| 
 | ||||
|     }; | ||||
| 
 | ||||
|     this.timelineStyle = { | ||||
|       step0: { state: "current", open: true, failed: false }, | ||||
|       step1: { state: "not-started", open: false, failed: false }, | ||||
|       step2: { state: "not-started", open: false, failed: false }, | ||||
|  }; | ||||
|   } | ||||
|   current() { | ||||
|     console.log(this.timelineStyle) | ||||
|     this.stringJson = JSON.stringify(this.timelineStyle); | ||||
|     console.log("String json object :", this.stringJson); | ||||
| 
 | ||||
|   } | ||||
| filePreviewimageupload_field: string | ArrayBuffer | null = null; | ||||
| FileDataimageupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
 | ||||
| selectedimageupload_field: File[]=[];  | ||||
| public onFileChangedimageupload_field(event, index) { | ||||
|   const files = event.target.files; | ||||
|   for (let i = 0; i < files.length; i++) { | ||||
|     const file = files[i]; | ||||
|     this.FileDataimageupload_field[index].uploadedfile_name = files[i].name; | ||||
|     this.selectedimageupload_field.push(files[i]); | ||||
|     if (file.type.startsWith('image/')) { | ||||
|       const reader = new FileReader(); | ||||
|       reader.onload = (e) => { | ||||
|         // Set the file preview source
 | ||||
|         const filePreview = e.target?.result as string; | ||||
|         this.FileDataimageupload_field[index] = { | ||||
|           ...this.FileDataimageupload_field[index], // Preserve existing properties
 | ||||
|           filePreview: filePreview // Update only the filePreview property
 | ||||
|         }; | ||||
|       }; | ||||
|       reader.readAsDataURL(file); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|     onAddLinesimageupload_field(){ | ||||
|       this.FileDataimageupload_field.push({ | ||||
|         uploadedfile_name: "", | ||||
|         filePreview: "", | ||||
|         // f3: "",
 | ||||
|       }); | ||||
|     } | ||||
|     deleteRowimageupload_field(index,id) { | ||||
|       this.FileDataimageupload_field.splice(index, 1); | ||||
| 
 | ||||
|       if(id){ | ||||
|       this.mainService.uploadImageupload_fielddelete(id).subscribe(data =>{ | ||||
|         console.log(data); | ||||
|       }) | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
| filePreviewfileupload_field: string | ArrayBuffer | null = null; | ||||
| FileDatafileupload_field: {uploadedfile_name?:any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
 | ||||
| selectedfileupload_field: File[]=[];  | ||||
| public onFileChangedfileupload_field(event, index) { | ||||
|   const files = event.target.files; | ||||
|   for (let i = 0; i < files.length; i++) { | ||||
|     const file = files[i]; | ||||
|     this.FileDatafileupload_field[index].uploadedfile_name = files[i].name; | ||||
|     this.selectedfileupload_field.push(files[i]); | ||||
|     if (file.type.startsWith('file/')) { | ||||
|       const reader = new FileReader(); | ||||
|       reader.onload = (e) => { | ||||
|         // Set the file preview source
 | ||||
|         const filePreview = e.target?.result as string; | ||||
|         this.FileDatafileupload_field[index] = { | ||||
|           ...this.FileDatafileupload_field[index], // Preserve existing properties
 | ||||
|           filePreview: filePreview // Update only the filePreview property
 | ||||
|         }; | ||||
|       }; | ||||
|       reader.readAsDataURL(file); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|     onAddLinesfileupload_field(){ | ||||
|       this.FileDatafileupload_field.push({ | ||||
|         uploadedfile_name: "", | ||||
|         filePreview: "", | ||||
|         // f3: "",
 | ||||
|       }); | ||||
|     } | ||||
|     deleteRowfileupload_field(index,id) { | ||||
|       this.FileDatafileupload_field.splice(index, 1); | ||||
| 
 | ||||
|       if(id){ | ||||
|       this.mainService.uploadfiledeletefileupload_field(id).subscribe(data =>{ | ||||
|         console.log(data); | ||||
|       }) | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| FileDataImageupload_field: any[]; | ||||
|   selectedImageupload_field: any[]; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| // updateaction
 | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,138 @@ | ||||
| import { Injectable } from '@angular/core'; | ||||
| import { Observable } from "rxjs"; | ||||
| import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; | ||||
| import { ApiRequestService } from "src/app/services/api/api-request.service"; | ||||
| import { environment } from 'src/environments/environment'; | ||||
| @Injectable({ | ||||
|   providedIn: 'root' | ||||
| }) | ||||
| export class test_vps_steperservice{ | ||||
|   private StepperURL = "Stepper_table_config/Stepper_table_config"; | ||||
|   private Customer_informationURL = "Customer_information/Customer_information" ;  private Document_uploadURL = "Document_upload/Document_upload" ;  constructor( | ||||
|     private http: HttpClient, | ||||
|     private apiRequest: ApiRequestService, | ||||
|   ) { } | ||||
| gettabledata(id: number): Observable<any> { | ||||
|     const _http = this.StepperURL + "/stepId/" + id; | ||||
|     return this.apiRequest.get(_http); | ||||
|   } | ||||
| 
 | ||||
|   saveStepperConfig(stepperId: number, tableId: number, tableName: string): Observable<any> { | ||||
|     const params = new HttpParams() | ||||
|       .set('stepperId', stepperId.toString()) | ||||
|       .set('tableId', tableId.toString()) | ||||
|       .set('tableName', tableName); | ||||
| 
 | ||||
|     return this.apiRequest.post(this.StepperURL, null, params); // null body, params used
 | ||||
|   }  getAllCustomer_information(page?: number, size?: number): Observable<any> { | ||||
|     return this.apiRequest.get(this.Customer_informationURL); | ||||
|   } | ||||
|   getCustomer_informationById(id: number): Observable<any> { | ||||
|     const _http = this.Customer_informationURL + "/" + id; | ||||
|     return this.apiRequest.get(_http); | ||||
|   } | ||||
|   createCustomer_information(data: any): Observable<any> { | ||||
|     return this.apiRequest.post(this.Customer_informationURL, data); | ||||
|   } | ||||
|   updateCustomer_information(id: number, data: any): Observable<any> { | ||||
|     const _http = this.Customer_informationURL + "/" + id; | ||||
|     return this.apiRequest.put(_http, data); | ||||
|   } | ||||
|   deleteCustomer_information(id: number): Observable<any> { | ||||
|     const _http = this.Customer_informationURL + "/" + id; | ||||
|     return this.apiRequest.delete(_http); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   getAllDocument_upload(page?: number, size?: number): Observable<any> { | ||||
|     return this.apiRequest.get(this.Document_uploadURL); | ||||
|   } | ||||
|   getDocument_uploadById(id: number): Observable<any> { | ||||
|     const _http = this.Document_uploadURL + "/" + id; | ||||
|     return this.apiRequest.get(_http); | ||||
|   } | ||||
|   createDocument_upload(data: any): Observable<any> { | ||||
|     return this.apiRequest.post(this.Document_uploadURL, data); | ||||
|   } | ||||
|   updateDocument_upload(id: number, data: any): Observable<any> { | ||||
|     const _http = this.Document_uploadURL + "/" + id; | ||||
|     return this.apiRequest.put(_http, data); | ||||
|   } | ||||
|   deleteDocument_upload(id: number): Observable<any> { | ||||
|     const _http = this.Document_uploadURL + "/" + id; | ||||
|     return this.apiRequest.delete(_http); | ||||
|   } | ||||
|   uploadImageupload_field(ref:any, Document_upload:any, file:any): Observable<any>{ | ||||
|     const formData = new FormData(); | ||||
|     formData.append('file', file); | ||||
|     return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Document_upload}`, formData); | ||||
|   } | ||||
| 
 | ||||
|   uploadImageupload_fieldgetById(ref:any, Document_upload:any,): Observable<any> { | ||||
|     return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Document_upload}`); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   uploadImageupload_fielddelete(id: number): Observable<any> { | ||||
|     return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); | ||||
|   } | ||||
| 
 | ||||
|   uploadfilefileupload_field(ref:any, Document_upload:any, file:any): Observable<any>{ | ||||
|     const formData = new FormData(); | ||||
|     formData.append('file', file); | ||||
|     return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Document_upload}`, formData); | ||||
|   } | ||||
| 
 | ||||
|   uploadfilegetByIdfileupload_field(ref:any, Document_upload:any,): Observable<any> { | ||||
|     return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Document_upload}`); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   uploadfiledeletefileupload_field(id: number): Observable<any> { | ||||
|     return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); | ||||
|   } | ||||
| 
 | ||||
| // updateaction
 | ||||
| } | ||||
| @ -1,3 +1,7 @@ | ||||
| import { test_vps_steperComponent } from './BuilderComponents/stepperworkflow/test_vps_steper/test_vps_steper.component'; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| import { Document_uploadComponent } from './BuilderComponents/basicp1/Document_upload/Document_upload.component'; | ||||
| import { Visa_entry_typeComponent } from './BuilderComponents/basicp1/Visa_entry_type/Visa_entry_type.component'; | ||||
| import { Customer_informationComponent } from './BuilderComponents/basicp1/Customer_information/Customer_information.component'; | ||||
| @ -259,6 +263,15 @@ const routes: Routes = [ | ||||
| 
 | ||||
| 
 | ||||
|       // buildercomponents
 | ||||
| {path:'test_vps_steper/:id',component:test_vps_steperComponent}, | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| {path:'Document_upload',component:Document_uploadComponent}, | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -1,3 +1,7 @@ | ||||
| import { test_vps_steperComponent } from './BuilderComponents/stepperworkflow/test_vps_steper/test_vps_steper.component'; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| import { Document_uploadComponent } from './BuilderComponents/basicp1/Document_upload/Document_upload.component'; | ||||
| import { Visa_entry_typeComponent } from './BuilderComponents/basicp1/Visa_entry_type/Visa_entry_type.component'; | ||||
| import { Customer_informationComponent } from './BuilderComponents/basicp1/Customer_information/Customer_information.component'; | ||||
| @ -132,6 +136,15 @@ import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/S | ||||
| 
 | ||||
| 
 | ||||
|     // buildercomponents
 | ||||
| test_vps_steperComponent, | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| Document_uploadComponent, | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user