build_app

This commit is contained in:
risadmin_prod 2025-06-21 10:17:28 +00:00
parent 997891eec1
commit 19d6cdec97
7 changed files with 230 additions and 46 deletions

View File

@ -75,6 +75,15 @@ addCustomMenu( "Steps","Stepper_workflow", "Transcations");
addCustomMenu( "Adv2","Adv2", "Transcations");
addCustomMenu( "Testlist","Testlist", "Transcations");
addCustomMenu( "Steps","Stepper_workflow", "Transcations");
addCustomMenu( "Adv2","Adv2", "Transcations");
addCustomMenu( "Testlist","Testlist", "Transcations");

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(["../steps/", id], { relativeTo: this.route });

View File

@ -48,13 +48,13 @@
<div class="card" *ngIf="timelineStyle.step0.open">
<div class="card-header">
<h3 style="text-align: center;" *ngIf="!appToUpdate">sss</h3>
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{TestlistentryForm.name}}</h3>
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{Adv2entryForm.name}}</h3>
<div class="container">
<br />
<form [formGroup]="TestlistentryForm">
<form [formGroup]="Adv2entryForm">
<div class="container">
@ -63,14 +63,67 @@
<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>sta mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiessta_mul.addselectedAttributessta_mul" formControlName="sta_mul" clrMulti="true">
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectsta_mul" [clrValue]="item"> {{item}}
</clr-option> </clr-options>
</clr-combobox>
</clr-combobox-container> </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>dyanmic mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesdyanmic_mul.addselectedAttributesdyanmic_mul" formControlName="dyanmic_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectdyanmic_mul" [clrValue]="item. name"> {{item. name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12" >
<label> Autocom</label>
<input type="text" list="autocomconfig" class="clr-input" formControlName="autocom">
<datalist id="autocomconfig"> <option *ngFor="let item of selectautocom" [value]="item.name">{{item. name }}</option> </datalist> </div>
<div class="clr-col-sm-12">
<label>Auto mul</label>
<clr-combobox-container style="margin-top: 0; padding-top: 0;">
<clr-combobox [(ngModel)]="nodeEditPropertiesauto_mul.addselectedAttributesauto_mul" formControlName="auto_mul" clrMulti="true" >
<ng-container *clrOptionSelected="let selected">
{{selected}} </ng-container>
<clr-options>
<clr-option *clrOptionItems="let item of selectauto_mul" [clrValue]="item. name"> {{item. name}}</clr-option></clr-options>
</clr-combobox>
</clr-combobox-container> </div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle/> </div>
</div>
@ -81,6 +134,12 @@
<div class="clr-row">
</div>
@ -109,11 +168,17 @@
<!-- Info -->
<div class="clr-row mb-3">
<div class="clr-col-12">
<h5>Sss Summary:</h5><p><strong>Name : </strong> {{ TestlistentryForm.get('name')?.value | json}}</p>
<h5>Sss Summary:</h5><p><strong>Name : </strong> {{ Adv2entryForm.get('name')?.value | json}}</p>
<p><strong>Description : </strong> {{ TestlistentryForm.get('description')?.value | json}}</p>
<p><strong>sta mul : </strong> {{ Adv2entryForm.get('sta_mul')?.value | json}}</p>
<p><strong>Active : </strong> {{ TestlistentryForm.get('active')?.value | json}}</p>
<p><strong>dynamic : </strong> {{ Adv2entryForm.get('dynamic')?.value | json}}</p>
<p><strong>dyanmic mul : </strong> {{ Adv2entryForm.get('dyanmic_mul')?.value | json}}</p>
<p><strong>Autocom : </strong> {{ Adv2entryForm.get('autocom')?.value | json}}</p>
<p><strong>Auto mul : </strong> {{ Adv2entryForm.get('auto_mul')?.value | json}}</p>
</div>

View File

@ -49,7 +49,7 @@ export class stepsComponent implements OnInit {
step0: { state: "current", open: true, failed: false },
step1: { state: "not-started", open: false, failed: false },
};
public TestlistentryForm: FormGroup;
public Adv2entryForm: FormGroup;
submitted = false;
rowSelected: any = {};
modalcomplete = false;
@ -57,7 +57,7 @@ public TestlistentryForm: FormGroup;
constructor(
private mainService: stepsservice,
private Testlist_fb: FormBuilder,
private Adv2_fb: FormBuilder,
private router: Router,
private route: ActivatedRoute,
private toastr: ToastrService,
@ -68,19 +68,31 @@ private router: Router,
console.log("update with id = ", this.id);
this.TestlistentryForm = this.Testlist_fb.group({
this.Adv2entryForm = this.Adv2_fb.group({
name : [null],
description : [null],
sta_mul : [null],
active : [true],
dynamic : [null],
dyanmic_mul : [null],
autocom : [null],
auto_mul : [null],
});
this.getalldynamic();
this.getalldyanmic_mul();
this.getallautocom();
this.getallauto_mul();
const stepId = this.id; // or from route/query/etc
@ -91,9 +103,9 @@ active : [true],
if (res === null) {
this.showEmptyForm();
} else {
if (res['Testlist']) {
if (res['Adv2']) {
this.prefillsssForm(res['Testlist']);
this.prefillsssForm(res['Adv2']);
}
}
});
@ -103,17 +115,23 @@ showEmptyForm(): void {
console.log('No config found. Showing empty form.');
// You can choose to show one or both based on some logic
this.TestlistentryForm.reset();
this.Adv2entryForm.reset();
} prefillsssForm(data: any): void {
console.log(' sss data ', data)
this.TestlistentryForm.patchValue({
this.Adv2entryForm.patchValue({
id: data.id || '',
name: data.name || '',
description: data.description || '',
sta_mul: data.sta_mul || '',
active: data.active || '',
dynamic: data.dynamic || '',
dyanmic_mul: data.dyanmic_mul || '',
autocom: data.autocom || '',
auto_mul: data.auto_mul || '',
});
}
@ -168,8 +186,8 @@ active: data.active || '',
getByTableNameAndId(tableName: string, id: number): Observable<any> {
switch (tableName) {
case 'Testlist':
return this.mainService.getTestlistById(id);// aur bhi cases agar naye table add ho to
case 'Adv2':
return this.mainService.getAdv2ById(id);// aur bhi cases agar naye table add ho to
default:
throw new Error(`Unknown table name: ${tableName}`);
}
@ -194,14 +212,14 @@ active: data.active || '',
onsssSave() {
console.log('Form Submitted:', this.TestlistentryForm.value);
console.log('Form Submitted:', this.Adv2entryForm.value);
this.submitted = true;
if (this.TestlistentryForm.invalid) {
if (this.Adv2entryForm.invalid) {
console.log('invalid form ..');
// Log all form errors
Object.keys(this.TestlistentryForm.controls).forEach(field => {
const control = this.TestlistentryForm.get(field);
Object.keys(this.Adv2entryForm.controls).forEach(field => {
const control = this.Adv2entryForm.get(field);
if (control && control.invalid) {
console.log(`Error in field: ${field}`, control.errors);
}
@ -215,11 +233,17 @@ active: data.active || '',
onsssCreate() {
this.Adv2entryForm.value.sta_mul = JSON.stringify(this.nodeEditPropertiessta_mul.addselectedAttributessta_mul );
this.Adv2entryForm.value.dyanmic_mul = JSON.stringify(this.nodeEditPropertiesdyanmic_mul.addselectedAttributesdyanmic_mul );
this.mainService.createTestlist(this.TestlistentryForm.value).subscribe(
this.Adv2entryForm.value.auto_mul = JSON.stringify(this.nodeEditPropertiesauto_mul.addselectedAttributesauto_mul );
this.mainService.createAdv2(this.Adv2entryForm.value).subscribe(
(data) => {
console.log('adding data ', data);
this.customerId = data.id;
@ -228,7 +252,7 @@ active: data.active || '',
const tableId = data.id;
const tableName = 'Testlist';
const tableName = 'Adv2';
const stepperId = this.id;
// Save stepper config
@ -247,6 +271,12 @@ active: data.active || '',
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
@ -259,7 +289,7 @@ active: data.active || '',
this.toastr.error("Not Added");
}
});
this.rowSelected = this.TestlistentryForm.value;
this.rowSelected = this.Adv2entryForm.value;
setTimeout(() => {
this.ngOnInit();
@ -296,9 +326,55 @@ active: data.active || '',
}
rsModaldescription = false;
goToReplaceStringdescription(row){
this.rowSelected = row; this.rsModaldescription =true; }
nodeEditPropertiessta_mul = { addselectedAttributessta_mul :"", editselectedAttributessta_mul :"" }
selectsta_mul =[
'a',
'b',
'c',
];
selectdynamic ;
getalldynamic() {
this.mainService.getAlldynamic().subscribe(data=>{
this.selectdynamic = data;
console.log(data);
},(error) => { console.log(error); }); }
selectdyanmic_mul;
getalldyanmic_mul () {
this.mainService.getAlldyanmic_mul().subscribe(data=>{
this.selectdyanmic_mul = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesdyanmic_mul = { addselectedAttributesdyanmic_mul:"", editselectedAttributesdyanmic_mul :"" }
selectautocom ;
getallautocom () {
this.mainService.getAllautocom().subscribe(data=>{
this.selectautocom = data; console.log(data);
},(error) => { console.log(error); }); }
selectauto_mul;
getallauto_mul () {
this.mainService.getAllauto_mul().subscribe(data=>{
this.selectauto_mul = data;
console.log(data);
},(error) => { console.log(error); }); }
nodeEditPropertiesauto_mul = { addselectedAttributesauto_mul:"", editselectedAttributesauto_mul :"" }
@ -315,3 +391,9 @@ this.rowSelected = row; this.rsModaldescription =true; }

View File

@ -8,7 +8,7 @@ import { environment } from 'src/environments/environment';
})
export class stepsservice{
private StepperURL = "Stepper_table_config/Stepper_table_config";
private TestlistURL = "Testlist/Testlist" ; constructor(
private Adv2URL = "Adv2/Adv2" ; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
@ -24,29 +24,36 @@ gettabledata(id: number): Observable<any> {
.set('tableName', tableName);
return this.apiRequest.post(this.StepperURL, null, params); // null body, params used
} getAllTestlist(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.TestlistURL);
} getAllAdv2(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.Adv2URL);
}
getTestlistById(id: number): Observable<any> {
const _http = this.TestlistURL + "/" + id;
getAdv2ById(id: number): Observable<any> {
const _http = this.Adv2URL + "/" + id;
return this.apiRequest.get(_http);
}
createTestlist(data: any): Observable<any> {
return this.apiRequest.post(this.TestlistURL, data);
createAdv2(data: any): Observable<any> {
return this.apiRequest.post(this.Adv2URL, data);
}
updateTestlist(id: number, data: any): Observable<any> {
const _http = this.TestlistURL + "/" + id;
updateAdv2(id: number, data: any): Observable<any> {
const _http = this.Adv2URL + "/" + id;
return this.apiRequest.put(_http, data);
}
deleteTestlist(id: number): Observable<any> {
const _http = this.TestlistURL + "/" + id;
deleteAdv2(id: number): Observable<any> {
const _http = this.Adv2URL + "/" + id;
return this.apiRequest.delete(_http);
}
getAlldynamic(): Observable<any> {
return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1"); }
getAlldyanmic_mul(): Observable<any> { return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1"); }
getAllautocom(): Observable<any> { return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1"); }
getAllauto_mul(): Observable<any> { return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1"); }
// updateaction
}

View File

@ -1,3 +1,6 @@
import { stepsComponent } from './BuilderComponents/stepperworkflow/steps/steps.component';
import { Adv2Component } from './BuilderComponents/basicp1/Adv2/Adv2.component';
import { TestlistComponent } from './BuilderComponents/basicp1/Testlist/Testlist.component';
@ -259,6 +262,12 @@ const routes: Routes = [
// buildercomponents
{path:'steps/:id',component:stepsComponent},

View File

@ -1,3 +1,6 @@
import { stepsComponent } from './BuilderComponents/stepperworkflow/steps/steps.component';
import { Adv2Component } from './BuilderComponents/basicp1/Adv2/Adv2.component';
import { TestlistComponent } from './BuilderComponents/basicp1/Testlist/Testlist.component';
@ -132,6 +135,12 @@ import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/S
// buildercomponents
stepsComponent,