datamanagemnet
This commit is contained in:
parent
01a0a2f959
commit
006f503e27
@ -1,7 +1,7 @@
|
|||||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||||
<li><a href="javascript://" [routerLink]="['/cns-portal/dashboard/order']"><clr-icon shape="home"></clr-icon></a></li>
|
<li><a href="javascript://" [routerLink]="['/cns-portal/dashboard/order']"><clr-icon shape="home"></clr-icon></a></li>
|
||||||
<li><a href="" >Data Management</a></li>
|
<li><a href="">Data Management</a></li>
|
||||||
<li><a href="" > Data Management</a></li>
|
<li><a href=""> Data Management</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="dg-wrapper">
|
<div class="dg-wrapper">
|
||||||
@ -14,21 +14,22 @@
|
|||||||
<button class="btn btn-outline" (click)="getall()">
|
<button class="btn btn-outline" (click)="getall()">
|
||||||
<clr-icon shape="refresh"></clr-icon> Reload
|
<clr-icon shape="refresh"></clr-icon> Reload
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline" (click)="onExport()">
|
<button class="btn btn-outline" (click)="onExport()">
|
||||||
<clr-icon shape="export"></clr-icon> xlsx
|
<clr-icon shape="export"></clr-icon> xlsx
|
||||||
</button>
|
</button>
|
||||||
<button id="add" class="btn btn-primary" (click)="goToAdd()" >
|
<button id="add" class="btn btn-primary" (click)="goToAdd()">
|
||||||
<clr-icon shape="plus"></clr-icon>ADD
|
<clr-icon shape="plus"></clr-icon>ADD
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<clr-datagrid [clrDgLoading]="loading" >
|
<clr-datagrid [clrDgLoading]="loading">
|
||||||
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>Loading ... </clr-spinner></ng-template>
|
<clr-dg-placeholder><ng-template #loadingSpinner><clr-spinner>Loading ... </clr-spinner></ng-template>
|
||||||
<div *ngIf="error;else loadingSpinner">{{error}}</div></clr-dg-placeholder>
|
<div *ngIf="error;else loadingSpinner">{{error}}</div>
|
||||||
|
</clr-dg-placeholder>
|
||||||
|
|
||||||
<clr-dg-column [clrDgField]="''"><ng-container *clrDgHideableColumn="{hidden: false}">
|
<clr-dg-column [clrDgField]="''"><ng-container *clrDgHideableColumn="{hidden: false}">
|
||||||
Go To
|
Go To
|
||||||
</ng-container></clr-dg-column>
|
</ng-container></clr-dg-column>
|
||||||
<!-- <clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
<!-- <clr-dg-column [clrDgField]="'name'"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
||||||
User Name
|
User Name
|
||||||
</ng-container></clr-dg-column> -->
|
</ng-container></clr-dg-column> -->
|
||||||
@ -36,25 +37,27 @@
|
|||||||
<ng-container *clrDgHideableColumn="{hidden: false}">
|
<ng-container *clrDgHideableColumn="{hidden: false}">
|
||||||
Entity Name
|
Entity Name
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</clr-dg-column >
|
</clr-dg-column>
|
||||||
<clr-dg-column [clrDgField]="'subject'"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
<clr-dg-column [clrDgField]="'subject'"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
||||||
File Name
|
File Name
|
||||||
</ng-container></clr-dg-column>
|
|
||||||
<clr-dg-column [clrDgField]="''" style="width: 220px;"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
|
||||||
Action
|
|
||||||
</ng-container></clr-dg-column>
|
</ng-container></clr-dg-column>
|
||||||
<clr-dg-row *clrDgItems="let user of data?.reverse()?.slice();" [clrDgItem]="user" >
|
<clr-dg-column [clrDgField]="''" style="width: 220px;"> <ng-container *clrDgHideableColumn="{hidden: false}">
|
||||||
<clr-dg-cell><span class="label label-light-blue" style="display: inline;margin-left: 10px; cursor: pointer;" (click)="work(user.id)">Workflow</span></clr-dg-cell>
|
Action
|
||||||
<clr-dg-cell>{{user.entityName}}</clr-dg-cell>
|
</ng-container></clr-dg-column>
|
||||||
|
<clr-dg-row *clrDgItems="let user of data?.reverse()?.slice();" [clrDgItem]="user">
|
||||||
|
<clr-dg-cell><span class="label label-light-blue" style="display: inline;margin-left: 10px; cursor: pointer;"
|
||||||
|
(click)="work(user.id)">Workflow</span></clr-dg-cell>
|
||||||
|
<clr-dg-cell>{{user.entity_name}}</clr-dg-cell>
|
||||||
<clr-dg-cell>{{user.file_name}}</clr-dg-cell>
|
<clr-dg-cell>{{user.file_name}}</clr-dg-cell>
|
||||||
<clr-dg-cell>
|
<clr-dg-cell>
|
||||||
<a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm tooltip-top-left">
|
<a href="javascript:void(0)" role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm tooltip-top-left">
|
||||||
<span style="cursor: pointer;"><clr-icon shape="trash" (click)="onDelete(user)" class="red is-error" style="color: red;"></clr-icon></span>
|
<span style="cursor: pointer;"><clr-icon shape="trash" (click)="onDelete(user)" class="red is-error"
|
||||||
<span class="tooltip-content">Delete</span>
|
style="color: red;"></clr-icon></span>
|
||||||
|
<span class="tooltip-content">Delete</span>
|
||||||
</a>
|
</a>
|
||||||
</clr-dg-cell>
|
</clr-dg-cell>
|
||||||
<clr-dg-action-overflow>
|
<clr-dg-action-overflow>
|
||||||
<button class="action-item" (click)="onEdit(user)">Edit</button>
|
<button class="action-item" (click)="onEdit(user)">Edit</button>
|
||||||
</clr-dg-action-overflow>
|
</clr-dg-action-overflow>
|
||||||
|
|
||||||
|
|
||||||
@ -94,7 +97,7 @@
|
|||||||
<div class="clr-col-md-4 clr-col-sm-12">
|
<div class="clr-col-md-4 clr-col-sm-12">
|
||||||
<label for="email">Entity Name</label>
|
<label for="email">Entity Name</label>
|
||||||
<!-- <input type="text" list="config" class="clr-dropdown" name="file_type" [(ngModel)]="rowSelected.file_type"> -->
|
<!-- <input type="text" list="config" class="clr-dropdown" name="file_type" [(ngModel)]="rowSelected.file_type"> -->
|
||||||
<select name="entityName" [(ngModel)]="rowSelected.entityName" class="clr-dropdown">
|
<select name="entityName" [(ngModel)]="rowSelected.entityName" class="clr-dropdown">
|
||||||
<option *ngFor="let data of tableList" [value]="data.entity_name">{{data.entity_name}}</option>
|
<option *ngFor="let data of tableList" [value]="data.entity_name">{{data.entity_name}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -108,8 +111,8 @@
|
|||||||
<br>
|
<br>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
|
<button type="button" class="btn btn-outline" (click)="modalEdit = false">Cancel</button>
|
||||||
<button type="submit" class="btn btn-primary" >UPDATE</button>
|
<button type="submit" class="btn btn-primary">UPDATE</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
@ -122,7 +125,7 @@
|
|||||||
<h2 class="heading">{{rowSelected.id}}</h2>
|
<h2 class="heading">{{rowSelected.id}}</h2>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
|
<button type="button" class="btn btn-outline" (click)="modaldelete = false">Cancel</button>
|
||||||
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary" >Delete</button>
|
<button type="button" (click)="delete(rowSelected.id)" class="btn btn-primary">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
@ -157,17 +160,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="clr-col-md-4 clr-col-sm-12">
|
<div class="clr-col-md-4 clr-col-sm-12">
|
||||||
<label for="email">File</label>
|
<label for="email">File</label>
|
||||||
<input type="file" (change)="onFileChanged($event)" formControlName="file_name">
|
<input type="file" (change)="onFileChanged($event)" formControlName="file_name">
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
||||||
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
<button type="button" class="btn btn-outline" (click)="modalAdd = false">Cancel</button>
|
||||||
<button type="submit" class="btn btn-primary" >ADD</button>
|
<button type="submit" class="btn btn-primary">ADD</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
@ -14,22 +14,22 @@ import { BulkimportService } from 'src/app/services/fnd/bulkimport.service';
|
|||||||
styleUrls: ['./datamanagement.component.scss']
|
styleUrls: ['./datamanagement.component.scss']
|
||||||
})
|
})
|
||||||
export class DatamanagementComponent implements OnInit {
|
export class DatamanagementComponent implements OnInit {
|
||||||
rowSelected :any= {};
|
rowSelected: any = {};
|
||||||
modaldelete=false;
|
modaldelete = false;
|
||||||
modalEdit=false;
|
modalEdit = false;
|
||||||
modalAdd= false;
|
modalAdd = false;
|
||||||
public entryForm: FormGroup;
|
public entryForm: FormGroup;
|
||||||
selected: any[] = [];
|
selected: any[] = [];
|
||||||
error;
|
error;
|
||||||
loading = false;
|
loading = false;
|
||||||
data;
|
data;
|
||||||
udata;
|
udata;
|
||||||
selectedFile: File[]=[];
|
selectedFile: File[] = [];
|
||||||
entitydata;
|
entitydata;
|
||||||
// tableList =['priority','impact','urgency','category','state','contact_type','customer','handler'];
|
// tableList =['priority','impact','urgency','category','state','contact_type','customer','handler'];
|
||||||
tableList;
|
tableList;
|
||||||
constructor( private excel: ExcelService, private datamservice:DatamanagementService, private toastr: ToastrService,
|
constructor(private excel: ExcelService, private datamservice: DatamanagementService, private toastr: ToastrService,
|
||||||
private _fb: FormBuilder, private userservice:UsermaintanceService, private router: Router,private bulkimportService:BulkimportService,
|
private _fb: FormBuilder, private userservice: UsermaintanceService, private router: Router, private bulkimportService: BulkimportService,
|
||||||
private route: ActivatedRoute,) { }
|
private route: ActivatedRoute,) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -38,51 +38,51 @@ export class DatamanagementComponent implements OnInit {
|
|||||||
this.allentity();
|
this.allentity();
|
||||||
this.entitygetall();
|
this.entitygetall();
|
||||||
this.entryForm = this._fb.group({
|
this.entryForm = this._fb.group({
|
||||||
user_id:[null],
|
user_id: [null],
|
||||||
file_name:[null],
|
file_name: [null],
|
||||||
entityName:[null],
|
entityName: [null],
|
||||||
// entity_name:[null],
|
// entity_name:[null],
|
||||||
file_type:[null],
|
file_type: [null],
|
||||||
|
|
||||||
});
|
});
|
||||||
// this.datamservice.getjson().subscribe((data)=>{
|
// this.datamservice.getjson().subscribe((data)=>{
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
getall(){
|
getall() {
|
||||||
this.datamservice.getall().subscribe((data)=>{
|
this.datamservice.getall().subscribe((data) => {
|
||||||
console.log(data);
|
console.log('data managemnt ', data);
|
||||||
this.data=data;
|
this.data = data;
|
||||||
if(this.data.length == 0){
|
if (this.data.length == 0) {
|
||||||
this.error="No data Available";
|
this.error = "No data Available";
|
||||||
console.log(this.error);
|
console.log(this.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
},(error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if(error){
|
if (error) {
|
||||||
this.error="No data Available OR server Error";
|
this.error = "No data Available OR server Error";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
entitygetall(){
|
entitygetall() {
|
||||||
this.bulkimportService.getDetails().subscribe((data)=>{
|
this.bulkimportService.getDetails().subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.tableList=data;
|
this.tableList = data;
|
||||||
},(error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getuserall(){
|
getuserall() {
|
||||||
this.userservice.getAll().subscribe((data)=>{
|
this.userservice.getAll().subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.udata=data;
|
this.udata = data;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
allentity(){
|
allentity() {
|
||||||
// this.datamservice.getallentity().subscribe((data)=>{
|
// this.datamservice.getallentity().subscribe((data)=>{
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// this.entitydata=data;
|
// this.entitydata=data;
|
||||||
@ -101,77 +101,76 @@ export class DatamanagementComponent implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
goToAdd() {
|
goToAdd() {
|
||||||
this.modalAdd = true;
|
this.modalAdd = true;
|
||||||
}
|
}
|
||||||
onSubmit(){
|
onSubmit() {
|
||||||
console.log(this.entryForm.value);
|
console.log(this.entryForm.value);
|
||||||
this.datamservice.create(this.selectedFile,this.entryForm.value.entityName).subscribe((data)=>{
|
this.datamservice.create(this.selectedFile, this.entryForm.value.entityName).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if(data.status===202){
|
if (data.status === 202) {
|
||||||
this.toastr.success("Added Succesfully");
|
this.toastr.success("Added Succesfully");
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.getall();
|
this.getall();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
this.getall();
|
|
||||||
}, (error: HttpErrorResponse)=>{
|
|
||||||
console.log(error);
|
|
||||||
if(error.status >=200 && error.status <= 299){
|
|
||||||
this.toastr.success("Added Succesfully");
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getall();
|
this.getall();
|
||||||
}, 1000);
|
}, (error: HttpErrorResponse) => {
|
||||||
}
|
console.log(error);
|
||||||
if(error.status===404){
|
if (error.status >= 200 && error.status <= 299) {
|
||||||
this.toastr.error("Not Added");
|
this.toastr.success("Added Succesfully");
|
||||||
}
|
setTimeout(() => {
|
||||||
this.ngOnInit();
|
this.getall();
|
||||||
});
|
}, 1000);
|
||||||
this.modalAdd=false;
|
}
|
||||||
|
if (error.status === 404) {
|
||||||
|
this.toastr.error("Not Added");
|
||||||
|
}
|
||||||
|
this.ngOnInit();
|
||||||
|
});
|
||||||
|
this.modalAdd = false;
|
||||||
}
|
}
|
||||||
onEdit(row) {
|
onEdit(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
this.modalEdit = true;
|
this.modalEdit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
onDelete(row) {
|
onDelete(row) {
|
||||||
this.rowSelected = row;
|
this.rowSelected = row;
|
||||||
this.modaldelete=true;
|
this.modaldelete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(id)
|
delete(id) {
|
||||||
{
|
|
||||||
this.modaldelete = false;
|
this.modaldelete = false;
|
||||||
console.log("in delete "+id);
|
console.log("in delete " + id);
|
||||||
this.datamservice.delete(id).subscribe(
|
this.datamservice.delete(id).subscribe(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
|
|
||||||
if(data.status >=200 && data.status <= 299 || data == null) {
|
if (data.status >= 200 && data.status <= 299 || data == null) {
|
||||||
this.toastr.success("Delete Succesfully");
|
this.toastr.success("Delete Succesfully");
|
||||||
}
|
}
|
||||||
}, (error: HttpHeaderResponse)=>{
|
}, (error: HttpHeaderResponse) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if(error.status >=200 && error.status <= 299){
|
if (error.status >= 200 && error.status <= 299) {
|
||||||
this.toastr.success("Delete Succesfully");
|
this.toastr.success("Delete Succesfully");
|
||||||
}
|
}
|
||||||
if(error.status >=400 && error.status <= 499){
|
if (error.status >= 400 && error.status <= 499) {
|
||||||
this.toastr.error("Not Delete");
|
this.toastr.error("Not Delete");
|
||||||
}
|
}
|
||||||
if(error.status >=500 && error.status <= 599){
|
if (error.status >= 500 && error.status <= 599) {
|
||||||
this.toastr.error("Server Error");
|
this.toastr.error("Server Error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
}
|
}
|
||||||
onUpdate(id) {
|
onUpdate(id) {
|
||||||
this.modalEdit = false;
|
this.modalEdit = false;
|
||||||
this.datamservice.update(id,this.rowSelected,this.selectedFile).subscribe(
|
this.datamservice.update(id, this.rowSelected, this.selectedFile).subscribe(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if(data.status===202){
|
if (data.status === 202) {
|
||||||
this.toastr.success("Updated Succesfully");
|
this.toastr.success("Updated Succesfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,9 +180,9 @@ this.modalAdd=false;
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.ngOnInit();
|
this.ngOnInit();
|
||||||
}
|
}
|
||||||
work(id:any){
|
work(id: any) {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
this.router.navigate(["../dataworkflow/"+ id], { relativeTo: this.route });
|
this.router.navigate(["../dataworkflow/" + id], { relativeTo: this.route });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
<ol class="breadcrumb breadcrumb-arrow font-trirong">
|
||||||
<li><a href="javascript://" [routerLink]="['/']">Admin</a></li>
|
<li><a href="javascript://" [routerLink]="['/']">Admin</a></li>
|
||||||
<li><a href="javascript://">Data Import </a></li>
|
<li><a href="javascript://">Data Import </a></li>
|
||||||
@ -13,63 +12,65 @@
|
|||||||
<span class="spacer"></span>
|
<span class="spacer"></span>
|
||||||
<button class="btn btn-sm btn-primary" (click)="reset()">Reset</button>
|
<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)="changeToHorizonTal()"
|
||||||
<button class="btn btn-sm btn-primary" (click)="changeToVertical()" *ngIf="layout.direction === 'horizontal'">Vertical Layout</button>
|
*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>
|
||||||
|
|
||||||
<div class="clr-row" >
|
<div class="clr-row">
|
||||||
<div [class]="layout.block1" >
|
<div [class]="layout.block1">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="clr-row">
|
<div class="clr-row">
|
||||||
<div class="clr-col-6">
|
<div class="clr-col-6">
|
||||||
<h3 style="text-align: right;"> Data Import</h3>
|
<h3 style="text-align: right;"> Data Import</h3>
|
||||||
|
</div>
|
||||||
|
<div class="clr-col-6" style="text-align: right;" *ngIf="timelineStyle.step4.open">
|
||||||
|
<button type="button" class="btn text-dark" (click)="getSheet(id)">Download File</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-col-6" style="text-align: right;" *ngIf="timelineStyle.step4.open">
|
|
||||||
<button type="button" class="btn text-dark" (click)="getSheet(id)">Download File</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class=" card-block container">
|
<div class=" card-block container">
|
||||||
|
|
||||||
<clr-timeline [clrLayout]="layout.direction" >
|
<clr-timeline [clrLayout]="layout.direction">
|
||||||
<clr-timeline-step [clrState]="timelineStyle.step0.state">
|
<clr-timeline-step [clrState]="timelineStyle.step0.state">
|
||||||
<clr-timeline-step-header>Step 0</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 0</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title> <span >Review</span> </clr-timeline-step-title>
|
<clr-timeline-step-title> <span>Review</span> </clr-timeline-step-title>
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
|
|
||||||
<clr-timeline-step [clrState]="timelineStyle.step1.state">
|
<clr-timeline-step [clrState]="timelineStyle.step1.state">
|
||||||
<clr-timeline-step-header>Step 1</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 1</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title> <span> Table Mapping </span></clr-timeline-step-title>
|
<clr-timeline-step-title> <span> Table Mapping </span></clr-timeline-step-title>
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
|
|
||||||
<clr-timeline-step class="gemini-ignore" [clrState]="timelineStyle.step2.state">
|
<clr-timeline-step class="gemini-ignore" [clrState]="timelineStyle.step2.state">
|
||||||
<clr-timeline-step-header>Step 2</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 2</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title> <span> Data Mapping </span></clr-timeline-step-title>
|
<clr-timeline-step-title> <span> Data Mapping </span></clr-timeline-step-title>
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
|
|
||||||
<clr-timeline-step [clrState]="timelineStyle.step3.state" >
|
<clr-timeline-step [clrState]="timelineStyle.step3.state">
|
||||||
<clr-timeline-step-header>Step 3</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 3</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title><span>Import</span></clr-timeline-step-title>
|
<clr-timeline-step-title><span>Import</span></clr-timeline-step-title>
|
||||||
|
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
<clr-timeline-step [clrState]="timelineStyle.step4.state" >
|
<clr-timeline-step [clrState]="timelineStyle.step4.state">
|
||||||
<clr-timeline-step-header>Step 4</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 4</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title>Download Excel</clr-timeline-step-title>
|
<clr-timeline-step-title>Download Excel</clr-timeline-step-title>
|
||||||
|
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
<clr-timeline-step [clrState]="timelineStyle.step5.state">
|
<clr-timeline-step [clrState]="timelineStyle.step5.state">
|
||||||
<clr-timeline-step-header>Step 5</clr-timeline-step-header>
|
<clr-timeline-step-header>Step 5</clr-timeline-step-header>
|
||||||
<clr-timeline-step-title>Finish</clr-timeline-step-title>
|
<clr-timeline-step-title>Finish</clr-timeline-step-title>
|
||||||
|
|
||||||
</clr-timeline-step>
|
</clr-timeline-step>
|
||||||
</clr-timeline>
|
</clr-timeline>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div [class]="layout.block2">
|
||||||
<div [class]="layout.block2" >
|
|
||||||
|
|
||||||
<!--STEP 0-->
|
<!--STEP 0-->
|
||||||
<div class="card" *ngIf="timelineStyle.step0.open">
|
<div class="card" *ngIf="timelineStyle.step0.open">
|
||||||
@ -78,12 +79,12 @@
|
|||||||
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{college.studentname}}</h3>
|
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{college.studentname}}</h3>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<br/>
|
<br />
|
||||||
|
|
||||||
<!-- entry form-->
|
<!-- entry form-->
|
||||||
<form #contactForm="ngForm" (ngSubmit)="onSave()">
|
<form #contactForm="ngForm" (ngSubmit)="onSave()">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<!-- <div class="clr-row">
|
<!-- <div class="clr-row">
|
||||||
<div class="horizontal1">
|
<div class="horizontal1">
|
||||||
<label for="tags"> Student Name<span class="required-field">*</span></label>
|
<label for="tags"> Student Name<span class="required-field">*</span></label>
|
||||||
<input id="name" type="text" placeholder="Enter name" name="name" required>
|
<input id="name" type="text" placeholder="Enter name" name="name" required>
|
||||||
@ -104,152 +105,175 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
<div *ngFor="let sheetName of sheetNames" >
|
<div *ngFor="let sheetName of sheetNames">
|
||||||
<h3>{{ sheetName }}</h3>
|
<h3>{{ sheetName }}</h3>
|
||||||
<div style="max-width:fit-content; overflow-x:auto">
|
<div style="max-width:fit-content; overflow-x:auto">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th *ngFor="let co of getHeaders(sheetName)">{{ co }}</th>
|
<th *ngFor="let co of getHeaders(sheetName)">{{ co }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let item of getData(sheetName)">
|
<tr *ngFor="let item of getData(sheetName)">
|
||||||
<td *ngFor="let key of getHeaders(sheetName)">{{ item[key] }}</td>
|
<td *ngFor="let key of getHeaders(sheetName)">{{ item[key] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="button">
|
<div class="button">
|
||||||
<!-- <button type="submit" class="btn btn-primary" [disabled]="!contactForm.valid">Submit</button> -->
|
<!-- <button type="submit" class="btn btn-primary" [disabled]="!contactForm.valid">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.getColumns(tableName); getColumnforstep1();" >Complete</button>
|
<button type="button" class="btn btn-primary"
|
||||||
<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>
|
(click)=" this.timelineStyle.step0 ={ state: 'success', open: false };this.timelineStyle.step1 ={ state: 'current', open: true }; this.getColumns(tableName); getColumnforstep1();">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>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div></div>
|
</div>
|
||||||
<!--STEP 1-->
|
</div>
|
||||||
<div class="card" *ngIf="timelineStyle.step1.open">
|
<!--STEP 1-->
|
||||||
<div class="card-header">
|
<div class="card" *ngIf="timelineStyle.step1.open">
|
||||||
<h3 style="text-align: center;" *ngIf="!appToUpdate">Table Mapping</h3>
|
<div class="card-header">
|
||||||
|
<h3 style="text-align: center;" *ngIf="!appToUpdate">Table Mapping</h3>
|
||||||
|
|
||||||
<form #contactForm="ngForm" >
|
<form #contactForm="ngForm">
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="clr-row fieldWrapper">
|
<div class="clr-row fieldWrapper">
|
||||||
<div class="clr-col-md-12 clr-col-sm-12">
|
<div class="clr-col-md-12 clr-col-sm-12">
|
||||||
<table class="table" style="width:100%;">
|
<table class="table" style="width:100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Sheet Name</th>
|
<th>Sheet Name</th>
|
||||||
<th>Table Name</th>
|
<th>Table Name</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let data of columnJson; let i = index">
|
<tr *ngFor="let data of columnJson; let i = index">
|
||||||
<td class="left">
|
<td class="left">
|
||||||
<input type="text" [(ngModel)]="data.sheetName" [ngModelOptions]="{standalone: true}" name="sheetName" class="clr-input" readonly/>
|
<input type="text" [(ngModel)]="data.sheetName" [ngModelOptions]="{standalone: true}"
|
||||||
</td>
|
name="sheetName" class="clr-input" readonly />
|
||||||
<td>
|
</td>
|
||||||
<input type="text" [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}" name="TableName" class="clr-input"/>
|
<td>
|
||||||
<!-- <select [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}" name="TableName">
|
<input type="text" [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="TableName" class="clr-input" />
|
||||||
|
<!-- <select [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}" name="TableName">
|
||||||
<option *ngFor="let data of headerData" [value]="data">{{data}}</option>
|
<option *ngFor="let data of headerData" [value]="data">{{data}}</option>
|
||||||
</select> -->
|
</select> -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <button type="submit" class="btn btn-primary" >Submit</button> -->
|
<!-- <button type="submit" class="btn btn-primary" >Submit</button> -->
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step1 ={ state: 'success', open: false };this.timelineStyle.step2 ={ state: 'current', open: true }; this.getHeadersById(id,sheetNames[0]); this.rulechecking()">Complete</button>
|
<button type="button" class="btn btn-primary"
|
||||||
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step0 ={ state: 'success', open: true };this.timelineStyle.step1 ={ state: 'not-started', open: false };">Back</button>
|
(click)="this.timelineStyle.step1 ={ state: 'success', open: false };this.timelineStyle.step2 ={ state: 'current', open: true }; this.getHeadersById(id,sheetNames[0]); this.rulechecking()">Complete</button>
|
||||||
|
<button class="btn btn-primary-outline"
|
||||||
|
(click)="this.timelineStyle.step0 ={ state: 'success', open: true };this.timelineStyle.step1 ={ state: 'not-started', open: false };">Back</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step1 ={state:'not-started',open:false};this.timelineStyle.step2 ={state:'not-started',open:true}">Next</button>
|
<button type="button" class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step1 ={state:'not-started',open:false};this.timelineStyle.step2 ={state:'not-started',open:true}">Next</button>
|
||||||
|
|
||||||
</div></form>
|
|
||||||
<div class="container">
|
|
||||||
<div class="clr-col-6">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="container" >
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card" *ngIf="timelineStyle.step2.open">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 style="text-align: center;" *ngIf="!appToUpdate">Data Mapping</h3>
|
|
||||||
|
|
||||||
<form #contactForm="ngForm" >
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="clr-row">
|
|
||||||
<div class="horizontal1 clr-col-6">
|
|
||||||
<div *ngIf="checkTransform">
|
|
||||||
<span class="label label-light-green p7 lbutton" (click)="checkTrans()">Enable TransFormation</span>
|
|
||||||
<!-- <label for="sequence" style="font-weight: bold; cursor: pointer;" (click)="goFromMapper()">Mapper Fields (Transform) <clr-icon shape="pop-out"></clr-icon></label> -->
|
|
||||||
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="transform">
|
</form>
|
||||||
<label for="sequence" style="font-weight: bold;">Mapper Fields <span class="label label-light-green p7 lbutton" (click)="goFromMapper()">OPEN</span><span class="label label-light-green p7 lbutton" (click)="transReset()">RESET</span></label>
|
<div class="container">
|
||||||
<textarea type="text" name="mapperText" style="height:150px;" [(ngModel)]="mapperText" readonly></textarea>
|
<div class="clr-col-6">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="container">
|
||||||
<div class="horizontal1 clr-col-6">
|
|
||||||
<div *ngIf="checkRule"><!--*ngIf="checkRule"-->
|
|
||||||
<div style="text-align: right; width: 100px;"> <span style="cursor: pointer;" class="label label-light-green p7 lbutton" (click)="checkRules()">Add Rule line</span></div>
|
|
||||||
<!-- <label for="sequence" style="font-weight: bold; cursor: pointer;" (click)="goFromMapper()">Mapper Fields (Transform) <clr-icon shape="pop-out"></clr-icon></label> -->
|
|
||||||
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="Rule">
|
|
||||||
<label for="sequence" style="font-weight: bold;"><span class="label label-light-green p7 lbutton" (click)="goFromRule()">OPEN</span><span class="label label-light-green p7 lbutton" (click)="resetRule()">RESET</span></label>
|
|
||||||
<textarea type="text" name="RuleData" style="height:150px;" [(ngModel)]="RuleData" readonly></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <button type="submit" class="btn btn-primary" >Submit</button> -->
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step2 ={ state: 'success', open: false };this.timelineStyle.step3 ={ state: 'current', open: true }; ">Complete</button>
|
|
||||||
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step1 ={ state: 'success', open: true };this.timelineStyle.step2 ={ state: 'not-started', open: false };">Back</button>
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step2 ={state:'not-started',open:false};this.timelineStyle.step3 ={state:'not-started',open:true}">Next</button>
|
<div class="card" *ngIf="timelineStyle.step2.open">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 style="text-align: center;" *ngIf="!appToUpdate">Data Mapping</h3>
|
||||||
|
|
||||||
</div></form>
|
<form #contactForm="ngForm">
|
||||||
<div class="container">
|
|
||||||
<div class="clr-col-6">
|
<div class="container">
|
||||||
|
<div class="clr-row">
|
||||||
|
<div class="horizontal1 clr-col-6">
|
||||||
|
<div *ngIf="checkTransform">
|
||||||
|
<span class="label label-light-green p7 lbutton" (click)="checkTrans()">Enable TransFormation</span>
|
||||||
|
<!-- <label for="sequence" style="font-weight: bold; cursor: pointer;" (click)="goFromMapper()">Mapper Fields (Transform) <clr-icon shape="pop-out"></clr-icon></label> -->
|
||||||
|
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="transform">
|
||||||
|
<label for="sequence" style="font-weight: bold;">Mapper Fields <span
|
||||||
|
class="label label-light-green p7 lbutton" (click)="goFromMapper()">OPEN</span><span
|
||||||
|
class="label label-light-green p7 lbutton" (click)="transReset()">RESET</span></label>
|
||||||
|
<textarea type="text" name="mapperText" style="height:150px;" [(ngModel)]="mapperText"
|
||||||
|
readonly></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="horizontal1 clr-col-6">
|
||||||
|
<div *ngIf="checkRule"><!--*ngIf="checkRule"-->
|
||||||
|
<div style="text-align: right; width: 100px;"> <span style="cursor: pointer;"
|
||||||
|
class="label label-light-green p7 lbutton" (click)="checkRules()">Add Rule line</span></div>
|
||||||
|
<!-- <label for="sequence" style="font-weight: bold; cursor: pointer;" (click)="goFromMapper()">Mapper Fields (Transform) <clr-icon shape="pop-out"></clr-icon></label> -->
|
||||||
|
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="Rule">
|
||||||
|
<label for="sequence" style="font-weight: bold;"><span class="label label-light-green p7 lbutton"
|
||||||
|
(click)="goFromRule()">OPEN</span><span class="label label-light-green p7 lbutton"
|
||||||
|
(click)="resetRule()">RESET</span></label>
|
||||||
|
<textarea type="text" name="RuleData" style="height:150px;" [(ngModel)]="RuleData"
|
||||||
|
readonly></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <button type="submit" class="btn btn-primary" >Submit</button> -->
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step2 ={ state: 'success', open: false };this.timelineStyle.step3 ={ state: 'current', open: true }; ">Complete</button>
|
||||||
|
<button class="btn btn-primary-outline"
|
||||||
|
(click)="this.timelineStyle.step1 ={ state: 'success', open: true };this.timelineStyle.step2 ={ state: 'not-started', open: false };">Back</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step2 ={state:'not-started',open:false};this.timelineStyle.step3 ={state:'not-started',open:true}">Next</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="container">
|
||||||
|
<div class="clr-col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container" >
|
|
||||||
|
<!--STEP 2-->
|
||||||
</div>
|
<div class="card" *ngIf="timelineStyle.step3.open">
|
||||||
</div></div>
|
<div class="card-header">
|
||||||
<!--STEP 2-->
|
<h3 style="text-align: center;">Importing Data</h3>
|
||||||
<div class="card" *ngIf="timelineStyle.step3.open">
|
<!-- <h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{college.studentname}}</h3> -->
|
||||||
<div class="card-header">
|
<div class="container">
|
||||||
<h3 style="text-align: center;">Importing Data</h3>
|
<div class="clr-row">
|
||||||
<!-- <h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{college.studentname}}</h3> -->
|
<div class="container">
|
||||||
<div class="container">
|
<div class="container" *ngIf="keychangeTable">
|
||||||
<div class="clr-row">
|
<!-- <table class="table">
|
||||||
<div class="container" >
|
|
||||||
<div class="container" *ngIf="keychangeTable">
|
|
||||||
<!-- <table class="table">
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th *ngFor="let co of getHeaderskeychange();let i=index">{{co}}</th>
|
<th *ngFor="let co of getHeaderskeychange();let i=index">{{co}}</th>
|
||||||
@ -262,25 +286,25 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table> -->
|
</table> -->
|
||||||
|
|
||||||
<div *ngFor="let sheetName of sheetNames">
|
<div *ngFor="let sheetName of sheetNames">
|
||||||
<h3>{{ sheetName }}</h3>
|
<h3>{{ sheetName }}</h3>
|
||||||
<div style="max-width:1200px; overflow-x:auto ">
|
<div style="max-width:1200px; overflow-x:auto ">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th *ngFor="let co of getHeaderskeychange(sheetName)">{{ co }}</th>
|
<th *ngFor="let co of getHeaderskeychange(sheetName)">{{ co }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let item of getkeychangeData(sheetName)">
|
<tr *ngFor="let item of getkeychangeData(sheetName)">
|
||||||
<td *ngFor="let key of getHeaderskeychange(sheetName)">{{ item[key] }}</td>
|
<td *ngFor="let key of getHeaderskeychange(sheetName)">{{ item[key] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="clr-row">
|
<!-- <div class="clr-row">
|
||||||
<div class="horizontal1">
|
<div class="horizontal1">
|
||||||
<label for="tags"> Select Table:<span class="required-field">*</span></label><br>
|
<label for="tags"> Select Table:<span class="required-field">*</span></label><br>
|
||||||
|
|
||||||
@ -295,155 +319,179 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary"(click)="this.timelineStyle.step3 ={ state: 'success', open: false };this.timelineStyle.step4 ={ state: 'current', open: true }; this.downloadExcel(id);">Complete</button>
|
<button type="button" class="btn btn-primary"
|
||||||
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step2 ={ state: 'success', open: true };this.timelineStyle.step3 ={ state: 'not-started', open: false };">Back</button>
|
(click)="this.timelineStyle.step3 ={ state: 'success', open: false };this.timelineStyle.step4 ={ state: 'current', open: true }; this.downloadExcel(id);">Complete</button>
|
||||||
|
<button class="btn btn-primary-outline"
|
||||||
|
(click)="this.timelineStyle.step2 ={ state: 'success', open: true };this.timelineStyle.step3 ={ state: 'not-started', open: false };">Back</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step3 ={state:'not-started',open:false};this.timelineStyle.step4 ={state:'not-started',open:true}">Next</button>
|
<button type="button" class="btn btn-primary"
|
||||||
</div></div></div></div></div>
|
(click)="this.timelineStyle.step3 ={state:'not-started',open:false};this.timelineStyle.step4 ={state:'not-started',open:true}">Next</button>
|
||||||
<!--STEP 3-->
|
</div>
|
||||||
<div class="card" *ngIf="timelineStyle.step4.open;">
|
</div>
|
||||||
<div class="card-header">
|
</div>
|
||||||
<h3 style="text-align: center;" *ngIf="!appToUpdate">Download Excel</h3>
|
|
||||||
<div class="clr-row">
|
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
<button type="button" class="btn btn-primary"(click)="this.timelineStyle.step4 ={ state: 'success', open: false };this.timelineStyle.step5 ={ state: 'current', open: true }; ">Complete</button>
|
|
||||||
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step3 ={ state: 'success', open: true };this.timelineStyle.step4 ={ state: 'not-started', open: false };">Back</button>
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" (click)="this.timelineStyle.step4 ={state:'not-started',open:false};this.timelineStyle.step5 ={state:'not-started',open:true}" >Next</button>
|
|
||||||
</div></div></div>
|
|
||||||
<!--STEP 4-->
|
|
||||||
<div class="card" *ngIf="timelineStyle.step5.open">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 style="text-align: center;" *ngIf="!appToUpdate">File is Downloaded</h3>
|
|
||||||
<div class="container">
|
|
||||||
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step4 ={ state: 'current', open: true };this.timelineStyle.step5 ={ state: 'not-started', open: false };">Back</button>
|
|
||||||
<button class="btn btn-primary" (click)="this.timelineStyle.step5 ={ state: 'success', open: false }; this.back()"> Finish</button>
|
|
||||||
|
|
||||||
</div></div></div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="mappperModal" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
|
||||||
<h3 class="modal-title"> MAPPER FORM</h3>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form >
|
|
||||||
<div class="clr-row" style="padding-left: 10px;">
|
|
||||||
<div *ngFor="let sheetName of sheetNames" >
|
|
||||||
<button class="btn btn-primary" (click)="getHeaderbybutton(id,sheetName)">{{sheetName}}</button>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <button class="btn btn-primary" (click)="checkData()">Check data</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="clr-row fieldWrapper">
|
|
||||||
|
<!--STEP 3-->
|
||||||
|
<div class="card" *ngIf="timelineStyle.step4.open;">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 style="text-align: center;" *ngIf="!appToUpdate">Download Excel</h3>
|
||||||
|
<div class="clr-row">
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step4 ={ state: 'success', open: false };this.timelineStyle.step5 ={ state: 'current', open: true }; ">Complete</button>
|
||||||
|
<button class="btn btn-primary-outline"
|
||||||
|
(click)="this.timelineStyle.step3 ={ state: 'success', open: true };this.timelineStyle.step4 ={ state: 'not-started', open: false };">Back</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step4 ={state:'not-started',open:false};this.timelineStyle.step5 ={state:'not-started',open:true}">Next</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--STEP 4-->
|
||||||
|
<div class="card" *ngIf="timelineStyle.step5.open">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 style="text-align: center;" *ngIf="!appToUpdate">File is Downloaded</h3>
|
||||||
|
<div class="container">
|
||||||
|
<button class="btn btn-primary-outline"
|
||||||
|
(click)="this.timelineStyle.step4 ={ state: 'current', open: true };this.timelineStyle.step5 ={ state: 'not-started', open: false };">Back</button>
|
||||||
|
<button class="btn btn-primary"
|
||||||
|
(click)="this.timelineStyle.step5 ={ state: 'success', open: false }; this.back()"> Finish</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<clr-modal [(clrModalOpen)]="mappperModal" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||||
|
<h3 class="modal-title"> MAPPER FORM</h3>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form>
|
||||||
|
<div class="clr-row" style="padding-left: 10px;">
|
||||||
|
<div *ngFor="let sheetName of sheetNames">
|
||||||
|
<button class="btn btn-primary" (click)="getHeaderbybutton(id,sheetName)">{{sheetName}}</button>
|
||||||
|
</div>
|
||||||
|
<!-- <button class="btn btn-primary" (click)="checkData()">Check data</button> -->
|
||||||
|
</div>
|
||||||
|
<div class="clr-row fieldWrapper">
|
||||||
<div class="clr-col-md-12 clr-col-sm-12">
|
<div class="clr-col-md-12 clr-col-sm-12">
|
||||||
<table class="table" style="width:100%;" *ngIf="selectedSheetName">
|
<table class="table" style="width:100%;" *ngIf="selectedSheetName">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Header Fields</th>
|
<th>Header Fields</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let data of JsonHeader[selectedSheetName]; let i = index">
|
<tr *ngFor="let data of JsonHeader[selectedSheetName]; let i = index">
|
||||||
<td class="left">
|
<td class="left">
|
||||||
<input type="text" [(ngModel)]="data.headerName" [ngModelOptions]="{standalone: true}" name="headerName" class="clr-input" readonly/>
|
<input type="text" [(ngModel)]="data.headerName" [ngModelOptions]="{standalone: true}"
|
||||||
</td>
|
name="headerName" class="clr-input" readonly />
|
||||||
<td>
|
</td>
|
||||||
<!-- <input type="text" [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value" class="clr-input"/> -->
|
<td>
|
||||||
<select [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value">
|
<!-- <input type="text" [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value" class="clr-input"/> -->
|
||||||
<option value="null">choose {{selectedSheetName}}</option>
|
<select [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value">
|
||||||
<option *ngFor="let data of headerData" [value]="data">{{data}}</option>
|
<option value="null">choose {{selectedSheetName}}</option>
|
||||||
</select>
|
<option *ngFor="let data of headerData" [value]="data">{{data}}</option>
|
||||||
</td>
|
</select>
|
||||||
</tr>
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" form-control class="btn btn-outline" (click)="mappperModal = false">Back</button>
|
|
||||||
<button type="submit" form-control class="btn btn-primary" (click)="onUpdate()">SUBMIT</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</clr-modal>
|
|
||||||
|
|
||||||
<clr-modal [(clrModalOpen)]="ruleModal" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
|
||||||
<h3 class="modal-title">Add Rule Lines</h3>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form>
|
|
||||||
<div class="clr-row fieldWrapper" >
|
|
||||||
<div class="clr-col-12">
|
|
||||||
<table class="table table-striped table-bordered" style="margin-top: 0px;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Rule Name</th>
|
|
||||||
<th>From Sheet</th>
|
|
||||||
<th>From Column</th>
|
|
||||||
<th>validation Table</th>
|
|
||||||
<th>Check Column</th>
|
|
||||||
<th>Use Column (Id)</th>
|
|
||||||
<th>Replacement Table (Id)</th>
|
|
||||||
<th>Replacement Column (Id)</th>
|
|
||||||
<th>Error Message</th>
|
|
||||||
<th class="right" style="width:90px;">Action</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr *ngFor="let data of RuleHeader; let i = index">
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.rulename" [ngModelOptions]="{standalone: true}" name="rulename" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.fromsheet" [ngModelOptions]="{standalone: true}" name="fromsheet" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.fromColumn" [ngModelOptions]="{standalone: true}" name="fromcolomn" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.validationTable" [ngModelOptions]="{standalone: true}" name="validationtable" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.checkColumn" [ngModelOptions]="{standalone: true}" name="checkcolumn" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.useColumn" [ngModelOptions]="{standalone: true}" name="useColumn" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.replacementTable" [ngModelOptions]="{standalone: true}" name="replacementTable" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.replacementcolumn" [ngModelOptions]="{standalone: true}" name="replacementcolumn" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td >
|
|
||||||
<input type="text" [(ngModel)]="data.errormsg" [ngModelOptions]="{standalone: true}" name="errormsg" class="clr-input">
|
|
||||||
</td>
|
|
||||||
<td style="width:40px;">
|
|
||||||
<a (click)="deleteRow(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: 10px;" (click)="onAddLines()">
|
|
||||||
<clr-icon shape="plus"></clr-icon>
|
|
||||||
</button>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" form-control class="btn btn-outline" (click)="ruleModal = false">Back</button>
|
<button type="button" form-control class="btn btn-outline" (click)="mappperModal = false">Back</button>
|
||||||
|
<button type="submit" form-control class="btn btn-primary" (click)="onUpdate()">SUBMIT</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</clr-modal>
|
||||||
|
|
||||||
|
<clr-modal [(clrModalOpen)]="ruleModal" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
|
||||||
|
<h3 class="modal-title">Add Rule Lines</h3>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form>
|
||||||
|
<div class="clr-row fieldWrapper">
|
||||||
|
<div class="clr-col-12">
|
||||||
|
<table class="table table-striped table-bordered" style="margin-top: 0px;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Rule Name</th>
|
||||||
|
<th>From Sheet</th>
|
||||||
|
<th>From Column</th>
|
||||||
|
<th>validation Table</th>
|
||||||
|
<th>Check Column</th>
|
||||||
|
<th>Use Column (Id)</th>
|
||||||
|
<th>Replacement Table (Id)</th>
|
||||||
|
<th>Replacement Column (Id)</th>
|
||||||
|
<th>Error Message</th>
|
||||||
|
<th class="right" style="width:90px;">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let data of RuleHeader; let i = index">
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.rulename" [ngModelOptions]="{standalone: true}" name="rulename"
|
||||||
|
class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.fromsheet" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="fromsheet" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.fromColumn" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="fromcolomn" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.validationTable" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="validationtable" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.checkColumn" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="checkcolumn" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.useColumn" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="useColumn" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.replacementTable" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="replacementTable" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.replacementcolumn" [ngModelOptions]="{standalone: true}"
|
||||||
|
name="replacementcolumn" class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" [(ngModel)]="data.errormsg" [ngModelOptions]="{standalone: true}" name="errormsg"
|
||||||
|
class="clr-input">
|
||||||
|
</td>
|
||||||
|
<td style="width:40px;">
|
||||||
|
<a (click)="deleteRow(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: 10px;" (click)="onAddLines()">
|
||||||
|
<clr-icon shape="plus"></clr-icon>
|
||||||
|
</button>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" form-control class="btn btn-outline" (click)="ruleModal = false">Back</button>
|
||||||
<button type="submit" form-control class="btn btn-primary" (click)="onRuleUpdate()">SUBMIT</button>
|
<button type="submit" form-control class="btn btn-primary" (click)="onRuleUpdate()">SUBMIT</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</clr-modal>
|
</clr-modal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -16,48 +16,48 @@ export class DatamananementworkflowComponent implements OnInit {
|
|||||||
getbyiddata;
|
getbyiddata;
|
||||||
id;
|
id;
|
||||||
columns: any[];
|
columns: any[];
|
||||||
rows:any[];
|
rows: any[];
|
||||||
bodyrow:any[]=[];
|
bodyrow: any[] = [];
|
||||||
getHeaderData;
|
getHeaderData;
|
||||||
JsonHeader = [];
|
JsonHeader = [];
|
||||||
rowdata;
|
rowdata;
|
||||||
transform:boolean = false;
|
transform: boolean = false;
|
||||||
checkTransform:boolean = true;
|
checkTransform: boolean = true;
|
||||||
mapperText:string = '';
|
mapperText: string = '';
|
||||||
changeKeyJson:any[];
|
changeKeyJson: any[];
|
||||||
tableName;
|
tableName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Layout direction changing
|
|
||||||
|
|
||||||
layout = {
|
// Layout direction changing
|
||||||
direction: "horizontal",
|
|
||||||
block1: "clr-col-lg-12 clr-col-12 height container",
|
|
||||||
block2: "clr-col-lg-12 clr-col-12 container",
|
|
||||||
}
|
|
||||||
timelineStyle = {
|
|
||||||
step0: { state: "current", open: true, failed: false },
|
|
||||||
step1: { state: "not-started", open: false, failed: false },
|
|
||||||
step2: { state: "not-started", open: false, failed: false },
|
|
||||||
step3: { state: "not-started", open: false, failed: false },
|
|
||||||
step4: { state: "not-started", open: false, failed: false },
|
|
||||||
step5: { state: "not-started", open: false, failed: false },
|
|
||||||
};
|
|
||||||
|
|
||||||
json: string = "";
|
layout = {
|
||||||
|
direction: "horizontal",
|
||||||
|
block1: "clr-col-lg-12 clr-col-12 height container",
|
||||||
|
block2: "clr-col-lg-12 clr-col-12 container",
|
||||||
|
}
|
||||||
|
timelineStyle = {
|
||||||
|
step0: { state: "current", open: true, failed: false },
|
||||||
|
step1: { state: "not-started", open: false, failed: false },
|
||||||
|
step2: { state: "not-started", open: false, failed: false },
|
||||||
|
step3: { state: "not-started", open: false, failed: false },
|
||||||
|
step4: { state: "not-started", open: false, failed: false },
|
||||||
|
step5: { state: "not-started", open: false, failed: false },
|
||||||
|
};
|
||||||
|
|
||||||
|
json: string = "";
|
||||||
luisApp =
|
luisApp =
|
||||||
{
|
{
|
||||||
name: '',
|
name: '',
|
||||||
created: 1,
|
created: 1,
|
||||||
trained: 1,
|
trained: 1,
|
||||||
tested: 1,
|
tested: 1,
|
||||||
updated:1,
|
updated: 1,
|
||||||
published: 1,
|
published: 1,
|
||||||
|
|
||||||
};
|
};
|
||||||
constructor( private excel: ExcelService, private datamservice:DatamanagementService, private toastr: ToastrService,private router: Router,
|
constructor(private excel: ExcelService, private datamservice: DatamanagementService, private toastr: ToastrService, private router: Router,
|
||||||
private route: ActivatedRoute,public bulkUpload:BulkimportService) { }
|
private route: ActivatedRoute, public bulkUpload: BulkimportService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.id = this.route.snapshot.params["id"];
|
this.id = this.route.snapshot.params["id"];
|
||||||
@ -65,21 +65,21 @@ json: string = "";
|
|||||||
this.getall();
|
this.getall();
|
||||||
this.getSheetName(this.id);
|
this.getSheetName(this.id);
|
||||||
this.getById(this.id);
|
this.getById(this.id);
|
||||||
|
|
||||||
this.getTableData(this.id);
|
this.getTableData(this.id);
|
||||||
// this.getColumns(this.tableName);
|
// this.getColumns(this.tableName);
|
||||||
// this.getHeadersById(this.id);
|
// this.getHeadersById(this.id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getall(){
|
getall() {
|
||||||
this.datamservice.getall().subscribe((data)=>{
|
this.datamservice.getall().subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.data=data;
|
this.data = data;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getById(id) {
|
getById(id) {
|
||||||
this.datamservice.getTemplateById(id).subscribe((data) => {
|
this.datamservice.getTemplateById(id).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@ -88,20 +88,20 @@ json: string = "";
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
headerData;
|
headerData;
|
||||||
getColumns(table){
|
getColumns(table) {
|
||||||
console.log(table);
|
console.log(table);
|
||||||
// console.log(this.getbyiddata.entityName);
|
// console.log(this.getbyiddata.entityName);
|
||||||
this.bulkUpload.getColumnNames(table).subscribe((data) => {
|
this.bulkUpload.getColumnNames(table).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.headerData = data;
|
this.headerData = data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getHeadersById(id){
|
getHeadersById(id) {
|
||||||
console.log(this.columnJson);
|
console.log(this.columnJson);
|
||||||
this.bulkUpload.getHeader(id).subscribe((data) => {
|
this.bulkUpload.getHeader(id).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.getHeaderData = JSON.stringify(data);
|
this.getHeaderData = JSON.stringify(data);
|
||||||
|
|
||||||
// const objectArray = data.map(key => ({
|
// const objectArray = data.map(key => ({
|
||||||
// headerName: key,
|
// headerName: key,
|
||||||
// value: "",
|
// value: "",
|
||||||
@ -113,19 +113,19 @@ getHeadersById(id){
|
|||||||
// const json = `{"Customer":[{"headerName":"balance","value":""},{"headerName":"c_status","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"currency_code","value":""},{"headerName":"customer_id","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"defaultsite_id","value":""}],
|
// const json = `{"Customer":[{"headerName":"balance","value":""},{"headerName":"c_status","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"currency_code","value":""},{"headerName":"customer_id","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"defaultsite_id","value":""}],
|
||||||
// "Site":[{"headerName":"balance","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"credit_profile","value":""},{"headerName":"currency_code","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"default_order_type","value":""},{"headerName":"dsa","value":""}]}`
|
// "Site":[{"headerName":"balance","value":""},{"headerName":"city","value":""},{"headerName":"country","value":""},{"headerName":"credit_profile","value":""},{"headerName":"currency_code","value":""},{"headerName":"date_of_birth","value":""},{"headerName":"default_order_type","value":""},{"headerName":"dsa","value":""}]}`
|
||||||
// this.getHeaderData = json;
|
// this.getHeaderData = json;
|
||||||
|
|
||||||
},(error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedSheetName: string | null = null;
|
selectedSheetName: string | null = null;
|
||||||
getHeaderbybutton(id,sheetName){
|
getHeaderbybutton(id, sheetName) {
|
||||||
// this.bulkUpload.getHeader(id,sheetName).subscribe((data) => {
|
// this.bulkUpload.getHeader(id,sheetName).subscribe((data) => {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// this.getHeaderData = data;
|
// this.getHeaderData = data;
|
||||||
|
|
||||||
// const objectArray = data.map(key => ({
|
// const objectArray = data.map(key => ({
|
||||||
// headerName: key,
|
// headerName: key,
|
||||||
// value: "",
|
// value: "",
|
||||||
@ -133,426 +133,423 @@ getHeadersById(id){
|
|||||||
// // console.log(objectArray);
|
// // console.log(objectArray);
|
||||||
// this.getHeaderData = JSON.stringify(objectArray);
|
// this.getHeaderData = JSON.stringify(objectArray);
|
||||||
// console.log(this.getHeaderData);
|
// console.log(this.getHeaderData);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// },(error) => {
|
// },(error) => {
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
// });
|
// });
|
||||||
this.selectedSheetName = sheetName;
|
this.selectedSheetName = sheetName;
|
||||||
const columnEntry = this.columnJson.find(entry => entry.sheetName === sheetName);
|
const columnEntry = this.columnJson.find(entry => entry.sheetName === sheetName);
|
||||||
if (columnEntry) {
|
if (columnEntry) {
|
||||||
const tablename = columnEntry.TableName;
|
const tablename = columnEntry.TableName;
|
||||||
this.getColumns(tablename);
|
this.getColumns(tablename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkData(){
|
checkData() {
|
||||||
console.log(this.JsonHeader);
|
console.log(this.JsonHeader);
|
||||||
console.log(this.mapperText);
|
console.log(this.mapperText);
|
||||||
}
|
}
|
||||||
|
|
||||||
getkeychangesJson(){
|
getkeychangesJson() {
|
||||||
|
|
||||||
const jsonString = JSON.stringify(this.rows);
|
const jsonString = JSON.stringify(this.rows);
|
||||||
console.log("body",jsonString);
|
console.log("body", jsonString);
|
||||||
// const datajson = JSON.parse(this.datajson);
|
// const datajson = JSON.parse(this.datajson);
|
||||||
// this.datajson = [datajson];
|
// this.datajson = [datajson];
|
||||||
// console.log(this.datajson);
|
// console.log(this.datajson);
|
||||||
|
|
||||||
this.bulkUpload.changeKeysOfJson(this.datajson,jsonString).subscribe((data) => {
|
this.bulkUpload.changeKeysOfJson(this.datajson, jsonString).subscribe((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.changeKeyJson = data.body;
|
this.changeKeyJson = data.body;
|
||||||
},(error:HttpErrorResponse) => {
|
}, (error: HttpErrorResponse) => {
|
||||||
console.log(error.error);
|
console.log(error.error);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
// getHeaderskeychange() {
|
||||||
|
// let headers: string[] = [];
|
||||||
|
// if(this.changeKeyJson) {
|
||||||
|
// this.changeKeyJson.forEach((value) => {
|
||||||
|
// Object.keys(value).forEach((key) => {
|
||||||
|
// if(!headers.find((header) => header == key)){
|
||||||
|
// headers.push(key)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// })
|
||||||
|
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// return headers;
|
||||||
|
// }
|
||||||
|
getHeaderskeychange(sheetName: string) {
|
||||||
|
if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) {
|
||||||
|
// Assuming the first item in the array contains the keys.
|
||||||
|
return Object.keys(this.changeKeyJson[0][sheetName][0]);
|
||||||
}
|
}
|
||||||
// getHeaderskeychange() {
|
return [];
|
||||||
// let headers: string[] = [];
|
|
||||||
// if(this.changeKeyJson) {
|
|
||||||
// this.changeKeyJson.forEach((value) => {
|
|
||||||
// Object.keys(value).forEach((key) => {
|
|
||||||
// if(!headers.find((header) => header == key)){
|
|
||||||
// headers.push(key)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// return headers;
|
|
||||||
// }
|
|
||||||
getHeaderskeychange(sheetName: string) {
|
|
||||||
if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) {
|
|
||||||
// Assuming the first item in the array contains the keys.
|
|
||||||
return Object.keys(this.changeKeyJson[0][sheetName][0]);
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
getkeychangeData(sheetName: string) {
|
|
||||||
if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) {
|
|
||||||
// Returning the array of data.
|
|
||||||
return this.changeKeyJson[0][sheetName];
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
// 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 ",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reset() {
|
|
||||||
this.json = "";
|
|
||||||
this.luisApp =
|
|
||||||
{
|
|
||||||
name: '',
|
|
||||||
trained: 1,
|
|
||||||
tested: 1,
|
|
||||||
updated:1,
|
|
||||||
published: 1,
|
|
||||||
|
|
||||||
|
getkeychangeData(sheetName: string) {
|
||||||
created: 1,
|
if (this.changeKeyJson && this.changeKeyJson.length > 0 && this.changeKeyJson[0][sheetName]) {
|
||||||
|
// Returning the array of data.
|
||||||
};
|
return this.changeKeyJson[0][sheetName];
|
||||||
|
|
||||||
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 },
|
|
||||||
step3: { state: "not-started", open: false, failed: false },
|
|
||||||
step4: { state: "not-started", open: false, failed: false },
|
|
||||||
step5: { state: "not-started", open: false, failed: false },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//dynamic table
|
|
||||||
sheetNames:any;
|
|
||||||
getSheetName(id){
|
|
||||||
this.bulkUpload.getSheetName(id).subscribe(data => {
|
|
||||||
console.log(data);
|
|
||||||
this.sheetNames = data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getTableData(id){
|
|
||||||
// console.log(this.getbyiddata.file_name);
|
|
||||||
this.bulkUpload.convertFileToJson(id).subscribe((data) => {
|
|
||||||
this.rows = data;
|
|
||||||
// this.bodyrow = data;
|
|
||||||
console.log(this.rows);
|
|
||||||
this.rowdata= [this.rows];
|
|
||||||
this.rows = [this.rows]
|
|
||||||
console.log(typeof this.rows);
|
|
||||||
if(data){
|
|
||||||
// this.toastr.success("Run Successfully")
|
|
||||||
}
|
}
|
||||||
var j;
|
return [];
|
||||||
var cart = [];
|
}
|
||||||
|
// 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 ",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reset() {
|
||||||
|
this.json = "";
|
||||||
|
this.luisApp =
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
trained: 1,
|
||||||
|
tested: 1,
|
||||||
|
updated: 1,
|
||||||
|
published: 1,
|
||||||
|
|
||||||
for(var i = 0; i < data.length; i++)
|
|
||||||
{
|
|
||||||
var columnsIn = data[i];
|
|
||||||
if(i==1)
|
|
||||||
{
|
|
||||||
for(var key in columnsIn)
|
|
||||||
{
|
|
||||||
j={prop:key , name: key};
|
|
||||||
cart.push(j)
|
|
||||||
|
|
||||||
|
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 },
|
||||||
|
step3: { state: "not-started", open: false, failed: false },
|
||||||
|
step4: { state: "not-started", open: false, failed: false },
|
||||||
|
step5: { state: "not-started", open: false, failed: false },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//dynamic table
|
||||||
|
sheetNames: any;
|
||||||
|
getSheetName(id) {
|
||||||
|
this.bulkUpload.getSheetName(id).subscribe(data => {
|
||||||
|
console.log(data);
|
||||||
|
this.sheetNames = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getTableData(id) {
|
||||||
|
// console.log(this.getbyiddata.file_name);
|
||||||
|
this.bulkUpload.convertFileToJson(id).subscribe((data) => {
|
||||||
|
this.rows = data;
|
||||||
|
// this.bodyrow = data;
|
||||||
|
console.log(this.rows);
|
||||||
|
this.rowdata = [this.rows];
|
||||||
|
this.rows = [this.rows]
|
||||||
|
console.log(typeof this.rows);
|
||||||
|
if (data) {
|
||||||
|
// this.toastr.success("Run Successfully")
|
||||||
|
}
|
||||||
|
var j;
|
||||||
|
var cart = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
var columnsIn = data[i];
|
||||||
|
if (i == 1) {
|
||||||
|
for (var key in columnsIn) {
|
||||||
|
j = { prop: key, name: key };
|
||||||
|
cart.push(j)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
this.columns = cart;
|
||||||
this.columns = cart;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// sheetNames = ['Customer', 'Site'];
|
|
||||||
getHeaders(sheetName: string) {
|
|
||||||
if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) {
|
|
||||||
// Assuming the first item in the array contains the keys.
|
|
||||||
return Object.keys(this.rows[0][sheetName][0]);
|
|
||||||
}
|
}
|
||||||
return [];
|
// sheetNames = ['Customer', 'Site'];
|
||||||
}
|
getHeaders(sheetName: string) {
|
||||||
|
if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) {
|
||||||
getData(sheetName: string) {
|
// Assuming the first item in the array contains the keys.
|
||||||
if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) {
|
return Object.keys(this.rows[0][sheetName][0]);
|
||||||
// Returning the array of data.
|
}
|
||||||
return this.rows[0][sheetName];
|
return [];
|
||||||
}
|
}
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// getHeaders() {
|
getData(sheetName: string) {
|
||||||
// let headers: string[] = [];
|
if (this.rows && this.rows.length > 0 && this.rows[0][sheetName]) {
|
||||||
// this.rows= []
|
// Returning the array of data.
|
||||||
// if(this.rows) {
|
return this.rows[0][sheetName];
|
||||||
// this.rows.forEach((value) => {
|
}
|
||||||
// Object.keys(value).forEach((key) => {
|
return [];
|
||||||
// if(!headers.find((header) => header == key)){
|
|
||||||
// headers.push(key)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// return headers;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//data mapping
|
|
||||||
checkTrans(){
|
|
||||||
|
|
||||||
console.log("transform open")
|
|
||||||
// console.log(this.storeData);
|
|
||||||
if(this.getHeaderData){
|
|
||||||
this.checkTransform = false;
|
|
||||||
this.transform = true;
|
|
||||||
console.log(this.getHeaderData);
|
|
||||||
if(this.mapperText === "undefined"){ this.mapperText= '';}
|
|
||||||
const currentText = this.mapperText;
|
|
||||||
let trnsfData = currentText + '' +this.getHeaderData;
|
|
||||||
this.mapperText = trnsfData;
|
|
||||||
}else {
|
|
||||||
this.checkTransform = true;
|
|
||||||
this.transform = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// getHeaders() {
|
||||||
mappperModal = false;
|
// let headers: string[] = [];
|
||||||
goFromMapper(){
|
// this.rows= []
|
||||||
this.mappperModal = true;
|
// if(this.rows) {
|
||||||
this.selectedSheetName = this.sheetNames[0];
|
// this.rows.forEach((value) => {
|
||||||
const tablename = this.columnJson[0].TableName;
|
// Object.keys(value).forEach((key) => {
|
||||||
this.getColumns(tablename)
|
// if(!headers.find((header) => header == key)){
|
||||||
if(this.mapperText){
|
// headers.push(key)
|
||||||
try {
|
// }
|
||||||
this.JsonHeader = JSON.parse(this.mapperText);
|
|
||||||
console.log('Received data:', this.JsonHeader );
|
// })
|
||||||
} catch (e) { console.error('Invalid JSON:', this.mapperText);}
|
|
||||||
}else
|
// })
|
||||||
if (this.getHeaderData) {
|
// }
|
||||||
|
// return headers;
|
||||||
|
// }
|
||||||
|
|
||||||
|
//data mapping
|
||||||
|
checkTrans() {
|
||||||
|
|
||||||
|
console.log("transform open")
|
||||||
|
// console.log(this.storeData);
|
||||||
|
if (this.getHeaderData) {
|
||||||
|
this.checkTransform = false;
|
||||||
|
this.transform = true;
|
||||||
|
console.log(this.getHeaderData);
|
||||||
|
if (this.mapperText === "undefined") { this.mapperText = ''; }
|
||||||
|
const currentText = this.mapperText;
|
||||||
|
let trnsfData = currentText + '' + this.getHeaderData;
|
||||||
|
this.mapperText = trnsfData;
|
||||||
|
} else {
|
||||||
|
this.checkTransform = true;
|
||||||
|
this.transform = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
mappperModal = false;
|
||||||
|
goFromMapper() {
|
||||||
|
this.mappperModal = true;
|
||||||
|
this.selectedSheetName = this.sheetNames[0];
|
||||||
|
const tablename = this.columnJson[0].TableName;
|
||||||
|
this.getColumns(tablename)
|
||||||
|
if (this.mapperText) {
|
||||||
|
try {
|
||||||
|
this.JsonHeader = JSON.parse(this.mapperText);
|
||||||
|
console.log('Received data:', this.JsonHeader);
|
||||||
|
} catch (e) { console.error('Invalid JSON:', this.mapperText); }
|
||||||
|
} else
|
||||||
|
if (this.getHeaderData) {
|
||||||
// try {
|
// try {
|
||||||
// this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '')
|
// this.serverData = data.replace(/\[|\]|"/g, '').split(','); //(/\[|\]|'/g, '') //(/[\[\]"]/g, '')
|
||||||
// console.log('Received data:', this.serverData );
|
// console.log('Received data:', this.serverData );
|
||||||
// } catch (e) { console.error('Invalid JSON:', data);}
|
// } catch (e) { console.error('Invalid JSON:', data);}
|
||||||
try {
|
try {
|
||||||
this.JsonHeader = JSON.parse(this.getHeaderData);
|
this.JsonHeader = JSON.parse(this.getHeaderData);
|
||||||
console.log('Received data:', this.JsonHeader );
|
console.log('Received data:', this.JsonHeader);
|
||||||
} catch (e) { console.error('Invalid JSON:', this.getHeaderData);}
|
} catch (e) { console.error('Invalid JSON:', this.getHeaderData); }
|
||||||
|
|
||||||
}
|
}
|
||||||
//this.mappperclick = true;
|
//this.mappperclick = true;
|
||||||
// this.router.navigate(["../../mapperTable/"], { relativeTo: this.route, queryParams: { id: this.updateId, data: this.nodeEditProperties.mappers, title:this.nodeEditProperties.title }, skipLocationChange: true});
|
// this.router.navigate(["../../mapperTable/"], { relativeTo: this.route, queryParams: { id: this.updateId, data: this.nodeEditProperties.mappers, title:this.nodeEditProperties.title }, skipLocationChange: true});
|
||||||
// console.log("gofrommapper",this.updateId,this.nodeEditProperties.mappers)
|
// console.log("gofrommapper",this.updateId,this.nodeEditProperties.mappers)
|
||||||
// if(this.mappperclick = true && this.datajson!= null){
|
// if(this.mappperclick = true && this.datajson!= null){
|
||||||
// this.nodeEditProperties.mappers = this.datajson;
|
// this.nodeEditProperties.mappers = this.datajson;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
transReset(){
|
transReset() {
|
||||||
this.mapperText = '';
|
this.mapperText = '';
|
||||||
this.transform = false;
|
this.transform = false;
|
||||||
this.checkTransform = true;
|
this.checkTransform = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rule:boolean = false;
|
Rule: boolean = false;
|
||||||
checkRule:boolean = true;
|
checkRule: boolean = true;
|
||||||
RuleData:string = '';
|
RuleData: string = '';
|
||||||
ruleModal = false;
|
ruleModal = false;
|
||||||
RuleHeader = [];
|
RuleHeader = [];
|
||||||
|
|
||||||
checkRules(){
|
checkRules() {
|
||||||
console.log("rule line open")
|
console.log("rule line open")
|
||||||
this.ruleModal = true;
|
this.ruleModal = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
rulechecking(){
|
}
|
||||||
if(this.RuleData){
|
|
||||||
console.log(this.RuleData);
|
rulechecking() {
|
||||||
this.checkRule = false;
|
if (this.RuleData) {
|
||||||
this.Rule = true;
|
console.log(this.RuleData);
|
||||||
}else{
|
this.checkRule = false;
|
||||||
|
this.Rule = true;
|
||||||
|
} else {
|
||||||
|
this.Rule = false;
|
||||||
|
this.checkRule = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mappperclick = false;
|
||||||
|
goFromRule() {
|
||||||
|
this.ruleModal = true;
|
||||||
|
if (this.RuleData) {
|
||||||
|
try {
|
||||||
|
this.RuleHeader = JSON.parse(this.RuleData);
|
||||||
|
console.log('Received data:', this.RuleHeader);
|
||||||
|
} catch (e) { console.error('Invalid JSON:', this.RuleData); }
|
||||||
|
}
|
||||||
|
console.log(this.RuleHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
resetRule() {
|
||||||
|
this.RuleData = undefined;
|
||||||
|
this.RuleHeader = [];
|
||||||
this.Rule = false;
|
this.Rule = false;
|
||||||
this.checkRule = true;
|
this.checkRule = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mappperclick = false;
|
|
||||||
goFromRule(){
|
|
||||||
this.ruleModal = true;
|
|
||||||
if(this.RuleData){
|
|
||||||
try {
|
|
||||||
this.RuleHeader = JSON.parse(this.RuleData);
|
|
||||||
console.log('Received data:', this.RuleHeader );
|
|
||||||
} catch (e) { console.error('Invalid JSON:', this.RuleData);}
|
|
||||||
}
|
|
||||||
console.log(this.RuleHeader);
|
|
||||||
}
|
|
||||||
|
|
||||||
resetRule(){
|
|
||||||
this.RuleData = undefined;
|
|
||||||
this.RuleHeader = [];
|
|
||||||
this.Rule = false;
|
|
||||||
this.checkRule = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
onAddLines(){
|
|
||||||
this.RuleHeader.push({
|
|
||||||
rulename: "",
|
|
||||||
fromsheet:"",
|
|
||||||
fromColumn: "",
|
|
||||||
validationTable: "",
|
|
||||||
checkColumn: "",
|
|
||||||
useColumn:"",
|
|
||||||
replacementTable:"",
|
|
||||||
replacementcolumn:"",
|
|
||||||
errormsg:""
|
|
||||||
});
|
|
||||||
}
|
|
||||||
deleteRow(index) {
|
|
||||||
this.RuleHeader.splice(index, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
onRuleUpdate(){
|
|
||||||
this.ruleModal = false;
|
|
||||||
console.log("rule",this.RuleHeader);
|
|
||||||
let serverData = JSON.stringify(this.RuleHeader);
|
|
||||||
// console.log(serverData);
|
|
||||||
let product = JSON.stringify(serverData);
|
|
||||||
// console.log(product);
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.RuleData = JSON.parse(product);
|
|
||||||
console.log('Received rulejson data:', this.RuleData);
|
|
||||||
} catch (e) { console.error('Invalid JSON:', product);}
|
|
||||||
this.rulechecking()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
datajson;
|
|
||||||
keychangeTable = false;
|
|
||||||
onUpdate(){
|
|
||||||
this.mappperModal = false;
|
|
||||||
console.log(this.JsonHeader);
|
|
||||||
let serverData = JSON.stringify(this.JsonHeader);
|
|
||||||
// console.log(serverData);
|
|
||||||
let product = JSON.stringify(serverData);
|
|
||||||
// console.log(product);
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.datajson = JSON.parse(product);
|
|
||||||
console.log('Received Newjson data:', this.datajson);
|
|
||||||
} catch (e) { console.error('Invalid JSON:', product);}
|
|
||||||
|
|
||||||
this.mapperText = this.datajson;
|
|
||||||
|
|
||||||
// const output = this.datajson.reduce((result, item) => {
|
|
||||||
// result[item.headerName] = item.value;
|
|
||||||
// return result;
|
|
||||||
// }, {});
|
|
||||||
|
|
||||||
// console.log(output);
|
|
||||||
|
|
||||||
this.getkeychangesJson();
|
|
||||||
this.keychangeTable=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//download excel file
|
|
||||||
|
|
||||||
selectedTable;
|
|
||||||
selectTable(val){
|
|
||||||
this.selectedTable = val;
|
|
||||||
// this.downloadExcel(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
downloadExcel(id){
|
|
||||||
console.log(this.changeKeyJson);
|
|
||||||
const jsonDataWithoutBrackets = this.changeKeyJson[0];
|
|
||||||
console.log(jsonDataWithoutBrackets);
|
|
||||||
console.log(this.RuleHeader);
|
|
||||||
this.bulkUpload.downloadExcel(id,jsonDataWithoutBrackets,this.RuleHeader).subscribe(
|
|
||||||
(response: Blob) => {
|
|
||||||
// Process the downloaded Excel file
|
|
||||||
console.log(response);
|
|
||||||
// const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
||||||
// const fileUrl = URL.createObjectURL(file);
|
|
||||||
// const link = document.createElement('a');
|
|
||||||
// link.href = fileUrl;
|
|
||||||
// link.download = 'data.xlsx'; // Set the desired file name
|
|
||||||
// link.click();
|
|
||||||
|
|
||||||
// this.timelineStyle = {
|
|
||||||
// step0: { state: "success", open: false, failed: false },
|
|
||||||
// step1: { state: "success", open: false, failed: false },
|
|
||||||
// step2: { state: "success", open: false, failed: false },
|
|
||||||
// step3: { state: "success", open: false, failed: false },
|
|
||||||
// step4: { state: "current", open: true, failed: false },
|
|
||||||
// };
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
// Handle error
|
|
||||||
console.log(error);
|
|
||||||
// this.timelineStyle = {
|
|
||||||
// step0: { state: "success", open: false, failed: false },
|
|
||||||
// step1: { state: "success", open: false, failed: false },
|
|
||||||
// step2: { state: "success", open: false, failed: false },
|
|
||||||
// step3: { state: "current", open: true, failed: false },
|
|
||||||
// step4: { state: "not-started", open: false, failed: false },
|
|
||||||
// step5: { state: "not-started", open: false, failed: false },
|
|
||||||
// };
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
getSheet(id){
|
|
||||||
this.bulkUpload.getSheet(id).subscribe(
|
|
||||||
(response: Blob) => {
|
|
||||||
// Process the downloaded Excel file
|
|
||||||
console.log(response);
|
|
||||||
const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
||||||
const fileUrl = URL.createObjectURL(file);
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = fileUrl;
|
|
||||||
link.download = 'data.xlsx'; // Set the desired file name
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
|
onAddLines() {
|
||||||
|
this.RuleHeader.push({
|
||||||
|
rulename: "",
|
||||||
|
fromsheet: "",
|
||||||
|
fromColumn: "",
|
||||||
|
validationTable: "",
|
||||||
|
checkColumn: "",
|
||||||
|
useColumn: "",
|
||||||
|
replacementTable: "",
|
||||||
|
replacementcolumn: "",
|
||||||
|
errormsg: ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
deleteRow(index) {
|
||||||
|
this.RuleHeader.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
back(){
|
onRuleUpdate() {
|
||||||
this.router.navigate(["../../datamanagement"], { relativeTo: this.route });
|
this.ruleModal = false;
|
||||||
}
|
console.log("rule", this.RuleHeader);
|
||||||
|
let serverData = JSON.stringify(this.RuleHeader);
|
||||||
|
// console.log(serverData);
|
||||||
|
let product = JSON.stringify(serverData);
|
||||||
|
// console.log(product);
|
||||||
|
|
||||||
////step 1 - mapping name
|
try {
|
||||||
columnJson =[]
|
this.RuleData = JSON.parse(product);
|
||||||
getColumnforstep1(){
|
console.log('Received rulejson data:', this.RuleData);
|
||||||
|
} catch (e) { console.error('Invalid JSON:', product); }
|
||||||
const objectArray = this.sheetNames.map(key => ({
|
this.rulechecking()
|
||||||
sheetName: key,
|
}
|
||||||
TableName: "",
|
|
||||||
}));
|
|
||||||
// console.log(objectArray);
|
|
||||||
this.columnJson = objectArray;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
datajson;
|
||||||
|
keychangeTable = false;
|
||||||
|
onUpdate() {
|
||||||
|
this.mappperModal = false;
|
||||||
|
console.log(this.JsonHeader);
|
||||||
|
let serverData = JSON.stringify(this.JsonHeader);
|
||||||
|
// console.log(serverData);
|
||||||
|
let product = JSON.stringify(serverData);
|
||||||
|
// console.log(product);
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.datajson = JSON.parse(product);
|
||||||
|
console.log('Received Newjson data:', this.datajson);
|
||||||
|
} catch (e) { console.error('Invalid JSON:', product); }
|
||||||
|
|
||||||
|
this.mapperText = this.datajson;
|
||||||
|
|
||||||
|
// const output = this.datajson.reduce((result, item) => {
|
||||||
|
// result[item.headerName] = item.value;
|
||||||
|
// return result;
|
||||||
|
// }, {});
|
||||||
|
|
||||||
|
// console.log(output);
|
||||||
|
|
||||||
|
this.getkeychangesJson();
|
||||||
|
this.keychangeTable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//download excel file
|
||||||
|
|
||||||
|
selectedTable;
|
||||||
|
selectTable(val) {
|
||||||
|
this.selectedTable = val;
|
||||||
|
// this.downloadExcel(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadExcel(id) {
|
||||||
|
console.log(this.changeKeyJson);
|
||||||
|
const jsonDataWithoutBrackets = this.changeKeyJson[0];
|
||||||
|
console.log(jsonDataWithoutBrackets);
|
||||||
|
console.log(this.RuleHeader);
|
||||||
|
this.bulkUpload.downloadExcel(id, jsonDataWithoutBrackets, this.RuleHeader).subscribe(
|
||||||
|
(response: Blob) => {
|
||||||
|
// Process the downloaded Excel file
|
||||||
|
console.log(response);
|
||||||
|
// const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||||
|
// const fileUrl = URL.createObjectURL(file);
|
||||||
|
// const link = document.createElement('a');
|
||||||
|
// link.href = fileUrl;
|
||||||
|
// link.download = 'data.xlsx'; // Set the desired file name
|
||||||
|
// link.click();
|
||||||
|
|
||||||
|
// this.timelineStyle = {
|
||||||
|
// step0: { state: "success", open: false, failed: false },
|
||||||
|
// step1: { state: "success", open: false, failed: false },
|
||||||
|
// step2: { state: "success", open: false, failed: false },
|
||||||
|
// step3: { state: "success", open: false, failed: false },
|
||||||
|
// step4: { state: "current", open: true, failed: false },
|
||||||
|
// };
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
// Handle error
|
||||||
|
console.log(error);
|
||||||
|
// this.timelineStyle = {
|
||||||
|
// step0: { state: "success", open: false, failed: false },
|
||||||
|
// step1: { state: "success", open: false, failed: false },
|
||||||
|
// step2: { state: "success", open: false, failed: false },
|
||||||
|
// step3: { state: "current", open: true, failed: false },
|
||||||
|
// step4: { state: "not-started", open: false, failed: false },
|
||||||
|
// step5: { state: "not-started", open: false, failed: false },
|
||||||
|
// };
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getSheet(id) {
|
||||||
|
this.bulkUpload.getSheet(id).subscribe(
|
||||||
|
(response: Blob) => {
|
||||||
|
// Process the downloaded Excel file
|
||||||
|
console.log(response);
|
||||||
|
const file = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||||
|
const fileUrl = URL.createObjectURL(file);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = fileUrl;
|
||||||
|
link.download = 'data.xlsx'; // Set the desired file name
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
back() {
|
||||||
|
this.router.navigate(["../../datamanagement"], { relativeTo: this.route });
|
||||||
|
}
|
||||||
|
|
||||||
|
////step 1 - mapping name
|
||||||
|
columnJson = []
|
||||||
|
getColumnforstep1() {
|
||||||
|
|
||||||
|
const objectArray = this.sheetNames.map(key => ({
|
||||||
|
sheetName: key,
|
||||||
|
TableName: "",
|
||||||
|
}));
|
||||||
|
// console.log(objectArray);
|
||||||
|
this.columnJson = objectArray;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user