build_app

This commit is contained in:
risadmin_prod 2025-06-17 10:45:58 +00:00
parent 809481e265
commit bb77718fbe
24 changed files with 871 additions and 316 deletions

View File

@ -69,6 +69,12 @@ public class BuilderService {
executeDump(true);
// ADD OTHER SERVICE
addCustomMenu( "select","Stepper_workflow", "Transcations");
addCustomMenu( "Forma","Forma", "Transcations");
addCustomMenu( "adv ","Stepper_workflow", "Transcations");

View File

@ -24,10 +24,6 @@ import com.realnet.basicp1.Services.FormaService ;
@RequestMapping(value = "/Forma")
@CrossOrigin("*")
@RestController
@ -46,10 +42,6 @@ public class FormaController {
@PostMapping("/Forma")
public Forma Savedata(@RequestBody Forma data) {
Forma save = Service.Savedata(data) ;
@ -60,10 +52,6 @@ public class FormaController {
System.out.println("data saved..." + save);
return save;
@ -116,8 +104,4 @@ public class FormaController {
}

View File

@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Forma_ListFilter1;
import com.realnet.basicp1.Services.Forma_ListFilter1Service ;
@RequestMapping(value = "/Forma_ListFilter1")
@RestController
public class Forma_ListFilter1Controller {
@Autowired
private Forma_ListFilter1Service Service;
@GetMapping("/Forma_ListFilter1")
public List<Forma_ListFilter1> getlist() {
List<Forma_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Forma_ListFilter11")
public List<Forma_ListFilter1> getlistwithparam( ) {
List<Forma_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@ -24,10 +24,6 @@ import com.realnet.basicp1.Services.FormaService ;
@RequestMapping(value = "/token/Forma")
@CrossOrigin("*")
@RestController
@ -46,10 +42,6 @@ public class tokenFree_FormaController {
@PostMapping("/Forma")
public Forma Savedata(@RequestBody Forma data) {
Forma save = Service.Savedata(data) ;
@ -60,10 +52,6 @@ public class tokenFree_FormaController {
System.out.println("data saved..." + save);
return save;
@ -116,8 +104,4 @@ public class tokenFree_FormaController {
}

View File

@ -0,0 +1,24 @@
package com.realnet.basicp1.Controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.realnet.basicp1.Entity.Forma_ListFilter1;
import com.realnet.basicp1.Services.Forma_ListFilter1Service ;
@RequestMapping(value = "/token/Forma_ListFilter1")
@RestController
public class tokenFree_Forma_ListFilter1Controller {
@Autowired
private Forma_ListFilter1Service Service;
@GetMapping("/Forma_ListFilter1")
public List<Forma_ListFilter1> getlist() {
List<Forma_ListFilter1> get = Service.getlistbuilder();
return get;
}
@GetMapping("/Forma_ListFilter11")
public List<Forma_ListFilter1> getlistwithparam( ) {
List<Forma_ListFilter1> get = Service.getlistbuilderparam( );
return get;
}
}

View File

@ -12,10 +12,6 @@ import com.realnet.WhoColumn.Entity.Extension;
@Entity
@Data
public class Forma extends Extension {
@ -30,20 +26,13 @@ import com.realnet.WhoColumn.Entity.Extension;
private String name;
private String radio_field;
private String static;
private String dynamic;
private String dynamicname;
private boolean a;
private String currency;
private String qrcode_field;
private String barcode_field;
private String auto;
private String autotypename;
}

View File

@ -0,0 +1,14 @@
package com.realnet.basicp1.Entity;
import lombok.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Data
public class Forma_ListFilter1 {
private Integer id;
private String name;
}

View File

@ -16,11 +16,13 @@ import com.realnet.users.entity1.AppUser;
import com.realnet.basicp1.Entity.Forma;
import com.realnet.basicp1.Services.FormaService;
import com.realnet.basicp1.Entity.Forma;
import com.realnet.basicp1.Services.FormaService;
@ -37,13 +39,11 @@ private FormaRepository Repository;
@Autowired
private FormaService dynamicserv;
@Autowired
private FormaService autoserv;
public Forma Savedata(Forma data) {
@ -51,11 +51,43 @@ public Forma Savedata(Forma data) {
if (data.getDynamic() != null) {
try {
int dynamicId = Integer.valueOf(data.getDynamic());
Forma get = dynamicserv.getdetailsbyId(dynamicId);
if (get != null) {
data.setDynamicname(get.getName());
}
} catch (NumberFormatException e) {
System.out.println(" dynamicId is not integer..");
// Invalid integer string ignore or log
}
}
if (data.getAuto() != null) {
try {
int autoId = Integer.valueOf(data.getAuto());
Forma get = autoserv.getdetailsbyId(autoId);
if (get != null) {
data.setAutoname(get.getName());
}
} catch (NumberFormatException e) {
System.out.println(" autoId is not integer..");
// Invalid integer string ignore or log
}
}
data.setUpdatedBy(getUser().getUserId());
@ -91,21 +123,11 @@ public Forma update(Forma data,Integer id) {
Forma old = Repository.findById(id).get();
old.setName(data.getName());
old.setRadio_field(data.getRadio_field());
old.setStatic(data.getStatic());
old.setA(data.isA());
old.setDynamic(data.getDynamic());
old.setCurrency(data.getCurrency());
old.setQrcode_field(data.getQrcode_field());
old.setBarcode_field(data.getBarcode_field());
old.setAuto(data.getAuto());
final Forma test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
@ -118,10 +140,6 @@ final Forma test = Repository.save(old);
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;

View File

@ -0,0 +1,47 @@
package com.realnet.basicp1.Services;
import java.util.*;
import com.realnet.basicp1.Repository.FormaRepository;
import com.realnet.basicp1.Entity.Forma;
import com.realnet.basicp1.Entity.Forma_ListFilter1;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class Forma_ListFilter1Service {
@Autowired
private FormaRepository Repository;
public List<Forma_ListFilter1> getlistbuilder() {
List<Forma> list= Repository.findAll();
ArrayList<Forma_ListFilter1> l = new ArrayList<>();
for (Forma data : list) {
{
Forma_ListFilter1 dummy = new Forma_ListFilter1();
dummy.setId(data.getId());
dummy.setName(data.getName());
l.add(dummy);
}
}
return l;}
public List<Forma_ListFilter1> getlistbuilderparam( ) {
List<Forma> list= Repository.findAll();
ArrayList<Forma_ListFilter1> l = new ArrayList<>();
for (Forma data : list) {
{
Forma_ListFilter1 dummy = new Forma_ListFilter1();
dummy.setId(data.getId());
dummy.setName(data.getName());
l.add(dummy);
}
}
return l;}
}

View File

@ -1,2 +1,2 @@
CREATE TABLE db.Forma(id BIGINT NOT NULL AUTO_INCREMENT, radio_field VARCHAR(400), a bit(1), b bit(1), currency VARCHAR(400), qrcode_field VARCHAR(400), barcode_field VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE db.Forma(id BIGINT NOT NULL AUTO_INCREMENT, auto int, static VARCHAR(400), dynamic int, name VARCHAR(400), PRIMARY KEY (id));

View File

@ -27,28 +27,15 @@
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' radio_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Radio Field
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' a'"> <ng-container *clrDgHideableColumn="{hidden: false}"> a
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' currency'"> <ng-container *clrDgHideableColumn="{hidden: false}"> Currency
<clr-dg-column [clrDgField]="' static'"> <ng-container *clrDgHideableColumn="{hidden: false}"> static
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' qrcode_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> QRCode Field
<clr-dg-column [clrDgField]="' dynamic'"> <ng-container *clrDgHideableColumn="{hidden: false}"> dynamic
</ng-container></clr-dg-column>
<clr-dg-column [clrDgField]="' barcode_field'"> <ng-container *clrDgHideableColumn="{hidden: false}"> BarCode Field
<clr-dg-column [clrDgField]="' auto'"> <ng-container *clrDgHideableColumn="{hidden: false}"> auto
</ng-container></clr-dg-column>
@ -63,24 +50,13 @@
<clr-dg-cell>{{user. name }}</clr-dg-cell>
<clr-dg-cell>{{user. radio_field }}</clr-dg-cell>
<clr-dg-cell>{{user. static }}</clr-dg-cell>
<clr-dg-cell>{{user. a}}</clr-dg-cell>
<clr-dg-cell>{{user. dynamicname }}</clr-dg-cell>
<clr-dg-cell>{{user. currency }}</clr-dg-cell>
<clr-dg-cell>{{user. qrcode_field }}</clr-dg-cell>
<clr-dg-cell>{{user. barcode_field }}</clr-dg-cell>
<clr-dg-cell>{{user. autoname }}</clr-dg-cell>
<!-- who column -->
@ -242,10 +218,6 @@
<!-- // EDIT DATA......... -->
<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
<h3 class="modal-title">Update Forma
@ -257,10 +229,6 @@
</h3>
<div class="modal-body" *ngIf="rowSelected.id">
<h2 class="heading">{{rowSelected.id}}</h2>
@ -272,58 +240,42 @@
<input class="clr-input" type="text" [(ngModel)]="rowSelected.name" name="name" />
</div>
<div class="clr-col-sm-12">
<label> Radio Field</label>
<clr-radio-container clrInline style="margin-top: 0;">
<clr-radio-wrapper>
<input type="radio" clrRadio (change)="updateradio_fieldEdit('f')" [checked]="rowSelected.radio_field === 'f'" />
<label>f</label>
</clr-radio-wrapper>
</clr-radio-container> </div>
<!-- multiselect checkbox field start -->
<div class="clr-col-sm-12">
<label> checkbox Field</label>
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
<div class="clr-control-container">
<label> static</label>
<select name="static" [(ngModel)]="rowSelected.static">
<option [value]="null">Selectstatic
</option>
<div class="clr-checkbox-wrapper"> <input type="checkbox" id="a" name="a" [(ngModel)]="rowSelected.a" class="clr-checkbox" />
<label for="a" class="clr-control-label"> a</label> </div>
<option> a </option>
</div>
</div>
</div>
<!-- multiselect checkbox field end -->
</select> </div>
<div class="clr-col-sm-12">
<label>dynamic</label>
<select name="dynamic" [(ngModel)]="rowSelected.dynamic">
<option [value]="null">Choose dynamic</option>
<option *ngFor=" let item of selectdynamic" [value]="item.name">{{item.name }}</option> </select> </div>
<!-- currency field start -->
<div class="clr-col-sm-12">
<label> Currency</label>
<input type="number" class="clr-input" [(ngModel)]="rowSelected.currency" name="currency" (blur)="formatCurrencycurrency()" [value]="rowSelected.currency | removeCommas">
</div>
<!-- currency field end -->
<label> auto</label>
<input type="text" list="autoconfig" class="clr-input" name="auto" [(ngModel)]="rowSelected.auto">
<datalist id="autoconfig">
<option *ngFor="let item of selectauto" [value]="item.name">{{item.name }}</option> </datalist> </div>
<!-- qrCode field start -->
<div class="clr-col-sm-12">
<label> QRCode Field</label>
<input class="clr-input" type="text" name="qrcode_field" [(ngModel)]="rowSelected.qrcode_field" />
<qrcode [qrdata]="rowSelected.qrcode_field ? rowSelected.qrcode_field : '' " [width]="135" [errorCorrectionLevel]="'M'"></qrcode>
</div>
<!-- qrCode field end -->
<!-- bar code field start -->
<div class="clr-col-sm-12">
<label> BarCode Field</label>
<input type="text" class="clr-input" name="barcode_field" [(ngModel)]="rowSelected.barcode_field" (input)="generateBarcodebarcode_field($event.target.value)" /> <svg id="barcodebarcode_field"></svg>
</div> <!-- bar code field end -->
</div>
@ -334,10 +286,6 @@
<!-- form code start -->
<div *ngIf="checkFormCode">
<h4 style="font-weight: 300;display: inline;">Extension</h4>
@ -390,10 +338,6 @@
<!-- aeroplane icon -->
&nbsp; &nbsp; &nbsp; &nbsp;
<a *ngIf="userrole?.includes('ADMIN')" style="float: right;" href="javascript:void(0)" role="tooltip" aria-haspopup="true"
@ -412,60 +356,36 @@
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label>Radio Field</label>
<clr-radio-container clrInline style="margin-top: 0;">
<div class="clr-col-sm-12">
<label>static</label>
<select formControlName="static">
<option [value]="null">Select static </option>
<option> a </option>
</select></div>
<clr-radio-wrapper>
<input type="radio" clrRadio formControlName="radio_field" (change)="updateradio_field('f')" [checked]="entryForm.get('radio_field').value === 'f'" />
<label> f </label>
</clr-radio-wrapper>
<div class="clr-col-sm-12">
<label> dynamic</label>
<select formControlName="dynamic">
<option [value]="null">Choose dynamic</option>
<option *ngFor="let item of selectdynamic" [value]="item.name">{{item.name}}</option>
</select> </div>
</clr-radio-container>
</div>
<!-- multiselect checkbox field start -->
<div class="clr-col-sm-12">
<label> checkbox Field</label>
<div class="clr-form-control" style="margin-top: 5px;margin-bottom: 10px;">
<div class="clr-control-container">
<div class="clr-checkbox-wrapper">
<input type="checkbox" id="a" formControlName="a" class="clr-checkbox" />
<label for="a" class="clr-control-label">a</label> </div>
<div class="clr-col-sm-12" >
<label> auto</label>
<input type="text" list="autoconfig" class="clr-input" formControlName="auto">
<datalist id="autoconfig"> <option *ngFor="let item of selectauto" [value]="item.name">{{item. name }}</option> </datalist> </div>
</div> </div> </div>
<!-- multiselect checkbox field end -->
<!-- currency field start -->
<div class="clr-col-sm-12">
<label> Currency</label>
<input type="number" class="clr-input" formControlName="currency" [value]="entryForm.value.currency | number:'1.2-2' | removeCommas">
</div>
<!-- currency field end -->
<!-- qrCode field start -->
<div class="clr-col-sm-12">
<label>QRCode Field</label>
<input class="clr-input" type="text" formControlName="qrcode_field" />
<qrcode [qrdata]="entryForm.value.qrcode_field ? entryForm.value.qrcode_field : '' " [width]="135" [errorCorrectionLevel]="'M'" ></qrcode> </div>
<!-- qrCode field end -->
<!-- bar code field start -->
<div class="clr-col-sm-12">
<label> BarCode Field</label>
<input type="text" class="clr-input" formControlName="barcode_field" (input)="generateBarcodebarcode_field($event.target.value)" />
<svg id="barcodebarcode_field"></svg> </div>
<!-- bar code field end -->
</div>
@ -477,10 +397,6 @@
<!-- form code start -->
@ -521,8 +437,4 @@
<!-- htmlpopup -->

View File

@ -65,19 +65,11 @@ private userInfoService:UserInfoService,
this.entryForm = this._fb.group({
name : [null],
radio_field : [null],
static : [null],
a:[false],
dynamic : [null],
currency : [null, { updateOn: 'blur' }],
qrcode_field : [null],
barcode_field : [null],
auto : [null],
@ -88,10 +80,6 @@ barcode_field : [null],
}); // component_button200
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
@ -118,13 +106,9 @@ barcode_field : [null],
this.getalldynamic();
this.getallauto();
}
@ -136,10 +120,6 @@ barcode_field : [null],
error;
getData() {
this.mainService.getAll().subscribe((data) => {
@ -165,14 +145,6 @@ barcode_field : [null],
// bar code field start
setTimeout(function(){
JsBarcode("#barcodebarcode_field", row?.barcode_field);
}, 500);
// bar code field start
this.modalEdit = true;
}
@ -201,10 +173,6 @@ barcode_field : [null],
//console.log("in update");
console.log("id " + id);
console.log(this.rowSelected);
@ -226,10 +194,6 @@ setTimeout(() => {
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
@ -256,10 +220,6 @@ onCreate() {
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log(data);
@ -276,10 +236,6 @@ setTimeout(() => {
}, (error) => {
console.log(error);
@ -306,10 +262,6 @@ this.modalAdd = true; this.submitted = false;
}
submitted = false;
@ -323,34 +275,20 @@ onSubmit() {
}
updateradio_field (radio_field : string): void {
this.entryForm.get('radio_field').setValue(radio_field); }
updateradio_fieldEdit(radio_field : string): void { this.rowSelected.radio_field = radio_field }
;
selectdynamic ;
getalldynamic() {
this.mainService.getAlldynamic().subscribe(data=>{
this.selectdynamic = data;
console.log(data);
},(error) => { console.log(error); }); }
//currency field start
formatCurrencycurrency () {
// Format the currency with two decimal places
this.rowSelected.currency = Number(this.rowSelected.currency ).toFixed(2);
// Remove commas from the formatted currency
this.rowSelected.currency = this.rowSelected.currency?.replace(/,/g, ''); }
//currency field end
//bar code field start
generateBarcodebarcode_field(value) {
const barcodeValue = value;
const barcodeElement = document.getElementById("barcodebarcode_field");
if (barcodeElement) { if (barcodeValue) {
JsBarcode(barcodeElement, barcodeValue, { format: "CODE128"
}); } else {
// Clear the barcode if the input is empty
barcodeElement.innerHTML = ''; } } }
// bar code field end
selectauto ;
getallauto () {
this.mainService.getAllauto().subscribe(data=>{
this.selectauto = data; console.log(data);
},(error) => { console.log(error); }); }
// updateaction
}
@ -361,7 +299,3 @@ updateradio_fieldEdit(radio_field : string): void { this.rowSelected.radio_fi

View File

@ -33,13 +33,10 @@ export class Formaservice{
getAlldynamic(): Observable<any> {
return this.apiRequest.get("Forma_ListFilter1/Forma_ListFilter1"); }
getAllauto(): Observable<any> { return this.apiRequest.get("Forma_ListFilter1/Forma_ListFilter1"); }
// updateaction
}

View File

@ -20,6 +20,7 @@
import { Component, OnInit } from '@angular/core';
@ -250,6 +251,8 @@ export class Stepper_workflowComponent implements OnInit {
console.log('id is ', id)
// stepper route
this.router.navigate(["../select/", id], { relativeTo: this.route });
this.router.navigate(["../adv_/", id], { relativeTo: this.route });

View File

@ -0,0 +1 @@
{"version":3,"sources":["select.component.scss","select.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":"select.component.css"}

View File

@ -0,0 +1,155 @@
<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/select_field<br> Information Of
Customer</span></clr-timeline-step-description>
</clr-timeline-step>
<clr-timeline-step [clrState]="timelineStyle.step1.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">select_field</h3>
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{FormaentryForm.name}}</h3>
<div class="container">
<br />
<form [formGroup]="FormaentryForm">
<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>static</label>
<select formControlName="static">
<option [value]="null">Select static </option>
<option> a </option>
</select></div>
<div class="clr-col-sm-12">
<label> dynamic</label>
<select formControlName="dynamic">
<option [value]="null">Choose dynamic</option>
<option *ngFor="let item of selectdynamic" [value]="item.name">{{item.name}}</option>
</select> </div>
<div class="clr-col-sm-12" >
<label> auto</label>
<input type="text" list="autoconfig" class="clr-input" formControlName="auto">
<datalist id="autoconfig"> <option *ngFor="let item of selectauto" [value]="item.name">{{item. name }}</option> </datalist> </div>
</div>
<div class="clr-row">
</div>
<!-- end row -->
<br>
<div class="button">
<button type="submit" class="btn btn-primary" (click)="onselect_fieldSave()">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"> Review And Confirmation</h3>
<div class="container">
<!-- Info -->
<div class="clr-row mb-3">
<div class="clr-col-12">
<h5>select_field Summary:</h5><p><strong>Name : </strong> {{ FormaentryForm.get('name')?.value }}</p>
<p><strong>static : </strong> {{ FormaentryForm.get('static')?.value }}</p>
<p><strong>dynamic : </strong> {{ FormaentryForm.get('dynamic')?.value }}</p>
<p><strong>auto : </strong> {{ FormaentryForm.get('auto')?.value }}</p>
</div>
</div><div class="button">
<button class="btn btn-primary-outline"
(click)="this.timelineStyle.step0 = { state: 'current', open: true };
this.timelineStyle.step1 = { state: 'not-started', open: false }">Back</button>
<button class="btn btn-primary"
(click)="timelineStyle.step1 = { state: 'success', open: false }; current();
alert('Process Finished Successfully!')">Finish</button>
</div></div>
</div>
</div>

View File

@ -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%;
}}

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { selectComponent } from './select.component';
describe('selectComponent', () => {
let component: selectComponent;
let fixture: ComponentFixture<selectComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ selectComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(selectComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,330 @@
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 { selectservice } from './select.service';
@Component({
selector: 'app-editstepper',
templateUrl: './select.component.html',
styleUrls: ['./select.component.scss']
})
export class selectComponent 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 },
};
public FormaentryForm: FormGroup;
submitted = false;
rowSelected: any = {};
modalcomplete = false;
constructor(
private mainService: selectservice,
private select_field_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.FormaentryForm = this.select_field_fb.group({
name : [null],
static : [null],
dynamic : [null],
auto : [null],
});
this.getalldynamic();
this.getallauto();
this.getalldynamic();
this.getallauto();
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['Forma']) {
this.prefillselect_fieldForm(res['Forma']);
}
}
});
}
showEmptyForm(): void {
console.log('No config found. Showing empty form.');
// You can choose to show one or both based on some logic
this.FormaentryForm.reset();
} prefillselect_fieldForm(data: any): void {
console.log(' select_field data ', data)
this.FormaentryForm.patchValue({
id: data.id || '',
name: data.name || '',
static: data.static || '',
dynamic: data.dynamic || '',
auto: data.auto || '',
});
}
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 'Forma':
return this.mainService.getFormaById(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 ",
}
}
onselect_fieldSave() {
console.log('Form Submitted:', this.FormaentryForm.value);
this.submitted = true;
if (this.FormaentryForm.invalid) {
console.log('invalid form ..');
// Log all form errors
Object.keys(this.FormaentryForm.controls).forEach(field => {
const control = this.FormaentryForm.get(field);
if (control && control.invalid) {
console.log(`Error in field: ${field}`, control.errors);
}
}
);
return;
}
this.onselect_fieldCreate();
}
onselect_fieldCreate() {
this.mainService.createForma(this.FormaentryForm.value).subscribe(
(data) => {
console.log('adding data ', data);
this.customerId = data.id;
console.log('id is ', this.customerId);
const tableId = data.id;
const tableName = 'Forma';
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.FormaentryForm.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 },
};
}
current() {
console.log(this.timelineStyle)
this.stringJson = JSON.stringify(this.timelineStyle);
console.log("String json object :", this.stringJson);
}
// updateaction
}

View File

@ -0,0 +1,55 @@
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 selectservice{
private StepperURL = "Stepper_table_config/Stepper_table_config";
private FormaURL = "Forma/Forma" ; 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
} getAllForma(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.FormaURL);
}
getFormaById(id: number): Observable<any> {
const _http = this.FormaURL + "/" + id;
return this.apiRequest.get(_http);
}
createForma(data: any): Observable<any> {
return this.apiRequest.post(this.FormaURL, data);
}
updateForma(id: number, data: any): Observable<any> {
const _http = this.FormaURL + "/" + id;
return this.apiRequest.put(_http, data);
}
deleteForma(id: number): Observable<any> {
const _http = this.FormaURL + "/" + id;
return this.apiRequest.delete(_http);
}
getAlldynamic(): Observable<any> {
return this.apiRequest.get("Forma_ListFilter1/Forma_ListFilter1"); }
getAllauto(): Observable<any> { return this.apiRequest.get("Forma_ListFilter1/Forma_ListFilter1"); }
// updateaction
}

View File

@ -1,3 +1,5 @@
import { selectComponent } from './BuilderComponents/stepperworkflow/select/select.component';
import { adv_Component } from './BuilderComponents/stepperworkflow/adv_/adv_.component';
import { FormaComponent } from './BuilderComponents/basicp1/Forma/Forma.component';
@ -258,6 +260,11 @@ const routes: Routes = [
// buildercomponents
{path:'select/:id',component:selectComponent},
{path:'adv_/:id',component:adv_Component},

View File

@ -1,3 +1,5 @@
import { selectComponent } from './BuilderComponents/stepperworkflow/select/select.component';
import { adv_Component } from './BuilderComponents/stepperworkflow/adv_/adv_.component';
import { FormaComponent } from './BuilderComponents/basicp1/Forma/Forma.component';
@ -131,6 +133,11 @@ import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/S
// buildercomponents
selectComponent,
adv_Component,

View File

@ -226,12 +226,9 @@
"MENU_ACTION_LINK": "Menu Action Link",
"STATUS": "Status",
"SUB_MENU": "Sub Menu",
"Radio_Field": "Radio_Field",
"a": "a",
"b": "b",
"auto": "auto",
"Forma": "Forma",
"Currency": "Currency",
"QRCode_Field": "QRCode_Field",
"BarCode_Field": "BarCode_Field",
"static": "static",
"dynamic": "dynamic",
"Name": "Name"
}