datamanagemnet

This commit is contained in:
string 2025-08-13 11:05:11 +05:30
parent 01a0a2f959
commit 006f503e27
4 changed files with 897 additions and 850 deletions

View File

@ -24,7 +24,8 @@
</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
@ -44,12 +45,14 @@
Action 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-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><span class="label label-light-blue" style="display: inline;margin-left: 10px; cursor: pointer;"
<clr-dg-cell>{{user.entityName}}</clr-dg-cell> (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"
style="color: red;"></clr-icon></span>
<span class="tooltip-content">Delete</span> <span class="tooltip-content">Delete</span>
</a> </a>
</clr-dg-cell> </clr-dg-cell>

View File

@ -51,7 +51,7 @@ export class DatamanagementComponent implements OnInit {
} }
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";
@ -139,8 +139,7 @@ this.modalAdd=false;
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(

View File

@ -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,8 +12,10 @@
<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>
@ -126,8 +127,10 @@
<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>
@ -138,7 +141,8 @@
</div> </div>
</div></div> </div>
</div>
<!--STEP 1--> <!--STEP 1-->
<div class="card" *ngIf="timelineStyle.step1.open"> <div class="card" *ngIf="timelineStyle.step1.open">
<div class="card-header"> <div class="card-header">
@ -159,10 +163,12 @@
<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}"
name="sheetName" class="clr-input" readonly />
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}" name="TableName" class="clr-input"/> <input type="text" [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}"
name="TableName" class="clr-input" />
<!-- <select [(ngModel)]="data.TableName" [ngModelOptions]="{standalone: true}" name="TableName"> <!-- <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> -->
@ -174,12 +180,16 @@
</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>
</form>
<div class="container"> <div class="container">
<div class="clr-col-6"> <div class="clr-col-6">
@ -188,7 +198,8 @@
<div class="container"> <div class="container">
</div> </div>
</div></div> </div>
</div>
<div class="card" *ngIf="timelineStyle.step2.open"> <div class="card" *ngIf="timelineStyle.step2.open">
@ -206,31 +217,42 @@
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea> <textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
</div> </div>
<div *ngIf="transform"> <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> <label for="sequence" style="font-weight: bold;">Mapper Fields <span
<textarea type="text" name="mapperText" style="height:150px;" [(ngModel)]="mapperText" readonly></textarea> 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> </div>
<div class="horizontal1 clr-col-6"> <div class="horizontal1 clr-col-6">
<div *ngIf="checkRule"><!--*ngIf="checkRule"--> <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> <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)&nbsp;&nbsp;<clr-icon shape="pop-out"></clr-icon></label> --> <!-- <label for="sequence" style="font-weight: bold; cursor: pointer;" (click)="goFromMapper()">Mapper Fields (Transform)&nbsp;&nbsp;<clr-icon shape="pop-out"></clr-icon></label> -->
<textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea> <textarea type="text" style="height:150px; background-color:#d6d6d6;" readonly></textarea>
</div> </div>
<div *ngIf="Rule"> <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> <label for="sequence" style="font-weight: bold;"><span class="label label-light-green p7 lbutton"
<textarea type="text" name="RuleData" style="height:150px;" [(ngModel)]="RuleData" readonly></textarea> (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> </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.step2 ={ state: 'success', open: false };this.timelineStyle.step3 ={ state: 'current', open: true }; ">Complete</button> <button type="button" class="btn btn-primary"
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step1 ={ state: 'success', open: true };this.timelineStyle.step2 ={ state: 'not-started', open: false };">Back</button> (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> <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>
</form>
<div class="container"> <div class="container">
<div class="clr-col-6"> <div class="clr-col-6">
@ -239,7 +261,9 @@
<div class="container"> <div class="container">
</div> </div>
</div></div> </div>
</div>
<!--STEP 2--> <!--STEP 2-->
<div class="card" *ngIf="timelineStyle.step3.open"> <div class="card" *ngIf="timelineStyle.step3.open">
<div class="card-header"> <div class="card-header">
@ -295,11 +319,19 @@
</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>
</div>
</div>
</div>
</div>
</div>
<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>
</div></div></div></div></div>
<!--STEP 3--> <!--STEP 3-->
<div class="card" *ngIf="timelineStyle.step4.open;"> <div class="card" *ngIf="timelineStyle.step4.open;">
<div class="card-header"> <div class="card-header">
@ -307,20 +339,29 @@
<div class="clr-row"> <div class="clr-row">
</div> </div>
<div class="container"> <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 type="button" class="btn btn-primary"
<button class="btn btn-primary-outline" (click)="this.timelineStyle.step3 ={ state: 'success', open: true };this.timelineStyle.step4 ={ state: 'not-started', open: false };">Back</button> (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> <button type="button" class="btn btn-primary"
</div></div></div> (click)="this.timelineStyle.step4 ={state:'not-started',open:false};this.timelineStyle.step5 ={state:'not-started',open:true}">Next</button>
</div>
</div>
</div>
<!--STEP 4--> <!--STEP 4-->
<div class="card" *ngIf="timelineStyle.step5.open"> <div class="card" *ngIf="timelineStyle.step5.open">
<div class="card-header"> <div class="card-header">
<h3 style="text-align: center;" *ngIf="!appToUpdate">File is Downloaded</h3> <h3 style="text-align: center;" *ngIf="!appToUpdate">File is Downloaded</h3>
<div class="container"> <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-outline"
<button class="btn btn-primary" (click)="this.timelineStyle.step5 ={ state: 'success', open: false }; this.back()"> Finish</button> (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>
</div>
</div>
</div> </div>
@ -347,7 +388,8 @@
<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}"
name="headerName" class="clr-input" readonly />
</td> </td>
<td> <td>
<!-- <input type="text" [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value" class="clr-input"/> --> <!-- <input type="text" [(ngModel)]="data.value" [ngModelOptions]="{standalone: true}" name="value" class="clr-input"/> -->
@ -396,31 +438,40 @@
<tbody> <tbody>
<tr *ngFor="let data of RuleHeader; let i = index"> <tr *ngFor="let data of RuleHeader; let i = index">
<td> <td>
<input type="text" [(ngModel)]="data.rulename" [ngModelOptions]="{standalone: true}" name="rulename" class="clr-input"> <input type="text" [(ngModel)]="data.rulename" [ngModelOptions]="{standalone: true}" name="rulename"
class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.fromsheet" [ngModelOptions]="{standalone: true}" name="fromsheet" class="clr-input"> <input type="text" [(ngModel)]="data.fromsheet" [ngModelOptions]="{standalone: true}"
name="fromsheet" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.fromColumn" [ngModelOptions]="{standalone: true}" name="fromcolomn" class="clr-input"> <input type="text" [(ngModel)]="data.fromColumn" [ngModelOptions]="{standalone: true}"
name="fromcolomn" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.validationTable" [ngModelOptions]="{standalone: true}" name="validationtable" class="clr-input"> <input type="text" [(ngModel)]="data.validationTable" [ngModelOptions]="{standalone: true}"
name="validationtable" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.checkColumn" [ngModelOptions]="{standalone: true}" name="checkcolumn" class="clr-input"> <input type="text" [(ngModel)]="data.checkColumn" [ngModelOptions]="{standalone: true}"
name="checkcolumn" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.useColumn" [ngModelOptions]="{standalone: true}" name="useColumn" class="clr-input"> <input type="text" [(ngModel)]="data.useColumn" [ngModelOptions]="{standalone: true}"
name="useColumn" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.replacementTable" [ngModelOptions]="{standalone: true}" name="replacementTable" class="clr-input"> <input type="text" [(ngModel)]="data.replacementTable" [ngModelOptions]="{standalone: true}"
name="replacementTable" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.replacementcolumn" [ngModelOptions]="{standalone: true}" name="replacementcolumn" class="clr-input"> <input type="text" [(ngModel)]="data.replacementcolumn" [ngModelOptions]="{standalone: true}"
name="replacementcolumn" class="clr-input">
</td> </td>
<td> <td>
<input type="text" [(ngModel)]="data.errormsg" [ngModelOptions]="{standalone: true}" name="errormsg" class="clr-input"> <input type="text" [(ngModel)]="data.errormsg" [ngModelOptions]="{standalone: true}" name="errormsg"
class="clr-input">
</td> </td>
<td style="width:40px;"> <td style="width:40px;">
<a (click)="deleteRow(i)"> <a (click)="deleteRow(i)">
@ -444,6 +495,3 @@
</form> </form>
</div> </div>
</clr-modal> </clr-modal>

View File

@ -264,13 +264,10 @@ this.rows = [this.rows]
var j; var j;
var cart = []; var cart = [];
for(var i = 0; i < data.length; i++) for (var i = 0; i < data.length; i++) {
{
var columnsIn = data[i]; var columnsIn = data[i];
if(i==1) if (i == 1) {
{ for (var key in columnsIn) {
for(var key in columnsIn)
{
j = { prop: key, name: key }; j = { prop: key, name: key };
cart.push(j) cart.push(j)