diff --git a/steper008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/steper008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index 55b4bad..e44a38f 100644 --- a/steper008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/steper008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -69,6 +69,12 @@ public class BuilderService { executeDump(true); // ADD OTHER SERVICE +addCustomMenu( "steps01","Stepper_workflow", "Transcations"); + + +addCustomMenu( "Forma","Forma", "Transcations"); + + addCustomMenu( "Forma","Forma", "Transcations"); diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts index 8052672..8a121bd 100644 --- a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/Stepper_workflow/Stepper_workflow.component.ts @@ -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(["../steps01/", id], { relativeTo: this.route }); + diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.css.map b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.css.map new file mode 100644 index 0000000..7b45243 --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["steps01.component.scss","steps01.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":"steps01.component.css"} \ No newline at end of file diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.html b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.html new file mode 100644 index 0000000..b0704f0 --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.html @@ -0,0 +1,268 @@ + + +
+ + + + + + + +
+ +
+
+
+
+

Workflow

+
+ +
+ + + + step 0 + Application Update + Datagrid + Create/step01
Information Of + Customer
+
+ + + Step 2 + Review And
Confirmation
+ + Finish . + +
+
+
+
+
+ +
+
+

step01

+

Update {{FormaentryForm.name}}

+
+ +
+ + +
+ +
+ +
+ + +
+ + + + + + + + + + +
+ + + +
List of fileupload_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + + +
+ +
List of imageupload_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} File Preview + + + +
+ +
List of audio_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} + + + +
+ +
List of video_field
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
No FileFile NamePreviewCancel
+ {{attach.uploadedfile_name}} + + + +
+ +
+ +
+ +
+
+ + + +
+
+ +
+ +
+
+
+
+

Review And Confirmation

+
+ + +
+
+
step01 Summary:

Name : {{ FormaentryForm.get('name')?.value }}

+ +

Fileupload Field : {{ FormaentryForm.get('fileupload_field')?.value }}

+ +

Imageupload Field : {{ FormaentryForm.get('imageupload_field')?.value }}

+ +

audio Field : {{ FormaentryForm.get('audio_field')?.value }}

+ +

video Field : {{ FormaentryForm.get('video_field')?.value }}

+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.scss b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.scss new file mode 100644 index 0000000..35a9e5a --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.scss @@ -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%; +}} + diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.spec.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.spec.ts new file mode 100644 index 0000000..3951ccd --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { steps01Component } from './steps01.component'; + +describe('steps01Component', () => { + let component: steps01Component; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ steps01Component ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(steps01Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.ts new file mode 100644 index 0000000..cfc10bd --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.component.ts @@ -0,0 +1,370 @@ +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 { steps01service } from './steps01.service'; +@Component({ + selector: 'app-editstepper', + templateUrl: './steps01.component.html', + styleUrls: ['./steps01.component.scss'] +}) +export class steps01Component 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: steps01service, + +private step01_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.step01_fb.group({ +name : [null], + + + + + + + + + + + }); + + + + + + + + + + + + + + + + + + + + + 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.prefillstep01Form(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(); + } prefillstep01Form(data: any): void { + + console.log(' step01 data ', data) + this.FormaentryForm.patchValue({ + id: data.id || '', +name: data.name || '', + +fileupload_field: data.fileupload_field || '', + +imageupload_field: data.imageupload_field || '', + +audio_field: data.audio_field || '', + +video_field: data.video_field || '', + + }); + } + getResolvedDataFromStepper(id: number): Observable { + 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 { + + 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 ", + } + } + + + + onstep01Save() { + 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.onstep01Create(); + } + + onstep01Create() { + + + + + + + + + + + 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); + + +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); + }) +} + +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.selectedaudio_field.length; i++){ + + this.mainService.uploadAudio_field(data.id,tableName,this.selectedaudio_field[i]).subscribe(uploaddata =>{ + console.log(uploaddata); + }) +} + +for (let i = 0; i < this.selectedvideo_field.length; i++){ + + this.mainService.uploadVideo_field(data.id,tableName,this.selectedvideo_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.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); + + } + + + + +FileDataImageupload_field: any[]; + selectedImageupload_field: any[]; + +FileDataAudio_field: any[]; + selectedAudio_field: any[]; + +FileDataVideo_field: any[]; + selectedVideo_field: any[]; + + +// updateaction +} + + + + + + + + + diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.service.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.service.ts new file mode 100644 index 0000000..6cd7ac7 --- /dev/null +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stepperworkflow/steps01/steps01.service.ts @@ -0,0 +1,108 @@ +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 steps01service{ + private StepperURL = "Stepper_table_config/Stepper_table_config"; + private FormaURL = "Forma/Forma" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } +gettabledata(id: number): Observable { + const _http = this.StepperURL + "/stepId/" + id; + return this.apiRequest.get(_http); + } + + saveStepperConfig(stepperId: number, tableId: number, tableName: string): Observable { + 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 { + return this.apiRequest.get(this.FormaURL); + } + getFormaById(id: number): Observable { + const _http = this.FormaURL + "/" + id; + return this.apiRequest.get(_http); + } + createForma(data: any): Observable { + return this.apiRequest.post(this.FormaURL, data); + } + updateForma(id: number, data: any): Observable { + const _http = this.FormaURL + "/" + id; + return this.apiRequest.put(_http, data); + } + deleteForma(id: number): Observable { + const _http = this.FormaURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + uploadfilefileupload_field(ref:any, Forma:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Forma}`, formData); + } + + uploadfilegetByIdfileupload_field(ref:any, Forma:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Forma}`); + } + + + uploadfiledeletefileupload_field(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadImageupload_field(ref:any, Forma:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Forma}`, formData); + } + + uploadImageupload_fieldgetById(ref:any, Forma:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Forma}`); + } + + + uploadImageupload_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadAudio_field(ref:any, Forma:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Forma}`, formData); + } + + uploadAudio_fieldgetById(ref:any, Forma:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Forma}`); + } + + + uploadAudio_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + + uploadVideo_field(ref:any, Forma:any, file:any): Observable{ + const formData = new FormData(); + formData.append('file', file); + return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Forma}`, formData); + } + + uploadVideo_fieldgetById(ref:any, Forma:any,): Observable { + return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Forma}`); + } + + + uploadVideo_fielddelete(id: number): Observable { + return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`); + } + +// updateaction +} \ No newline at end of file diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts index c27e63d..6401372 100644 --- a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts @@ -1,3 +1,5 @@ +import { steps01Component } from './BuilderComponents/stepperworkflow/steps01/steps01.component'; + import { FormaComponent } from './BuilderComponents/basicp1/Forma/Forma.component'; import { SequencegenaratorComponent } from './fnd/sequencegenarator/sequencegenarator.component'; @@ -257,6 +259,11 @@ const routes: Routes = [ // buildercomponents +{path:'steps01/:id',component:steps01Component}, + + + + {path:'Forma',component:FormaComponent}, diff --git a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts index 33bdb2e..f7afca6 100644 --- a/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts +++ b/steper008-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts @@ -1,3 +1,5 @@ +import { steps01Component } from './BuilderComponents/stepperworkflow/steps01/steps01.component'; + import { FormaComponent } from './BuilderComponents/basicp1/Forma/Forma.component'; @@ -130,6 +132,11 @@ import { Stepper_workflowComponent } from './BuilderComponents/stepperworkflow/S // buildercomponents +steps01Component, + + + + FormaComponent,