2 Commits

Author SHA1 Message Date
Gaurav Kumar
7cea739e7f data lake 2025-12-06 12:35:02 +05:30
Gaurav Kumar
cf5461c8b0 working code with dynamic chart load 2025-11-18 19:43:18 +05:30
9 changed files with 145 additions and 129 deletions

View File

@@ -181,40 +181,30 @@
</button>
<!-- Blending Keys button (only shown for blending type with non-empty blending_lakeids) -->
<button class="btn btn-icon"
(click)="fetchBlendingKeys(user)"
title="Configure Blending Query"
*ngIf="canShowBlendingAction(user)">
<button class="btn btn-icon" (click)="fetchBlendingKeys(user)" title="Configure Blending Query"
*ngIf="canShowBlendingAction(user)">
<clr-icon shape="code"></clr-icon>
</button>
<!-- Field Mapping button -->
<button class="btn btn-icon"
(click)="openFieldMappingModal(user)"
title="Field Mapping"
*ngIf="user.url && user.sure_connect_id">
<button class="btn btn-icon" (click)="openFieldMappingModal(user)" title="Field Mapping"
*ngIf="user.url && user.sure_connect_id">
<clr-icon shape="map"></clr-icon>
</button>
<!-- Scheduler button -->
<button class="btn btn-icon"
(click)="openSchedulerModal(user)"
title="Scheduler">
<button class="btn btn-icon" (click)="openSchedulerModal(user)" title="Scheduler">
<clr-icon shape="clock"></clr-icon>
</button>
<!-- Webhook toggle button -->
<button class="btn btn-icon"
(click)="toggleWebhook(user)"
title="Toggle Webhook">
<button class="btn btn-icon" (click)="toggleWebhook(user)" title="Toggle Webhook">
<clr-icon shape="network-globe"></clr-icon>
</button>
<!-- Copy Webhook URL button -->
<button class="btn btn-icon"
(click)="copyWebhookUrl(user.webhook_url)"
title="Copy Webhook URL"
*ngIf="user.webhook_url && user.webhook_url.trim() !== ''">
<button class="btn btn-icon" (click)="copyWebhookUrl(user.webhook_url)" title="Copy Webhook URL"
*ngIf="user.webhook_url && user.webhook_url.trim() !== ''">
<clr-icon shape="copy-to-clipboard"></clr-icon>
</button>
</clr-dg-cell>
@@ -455,16 +445,16 @@
instanceId="edit-form-{{rowSelected.id}}"></app-cron-job-builder>
</div>
<div class="clr-col-sm-12">
<!-- <div class="clr-col-sm-12">
<label> json</label>
<input id="name" type="Text" class="form-control" style="border: none; outline: none; height:33px !important;"
[(ngModel)]="rowSelected.json" name=" json " />
</div>
<div class="clr-col-sm-12">
<label>Url</label>
<label>Url Endpoint</label>
<input class="clr-input" type="text" [(ngModel)]="rowSelected.url_endpoint" name="url_endpoint" />
</div>
</div> -->
<div class="clr-col-sm-12">
<label>Batch Volume</label>
@@ -493,9 +483,7 @@
<label>Blending Data Lakes</label>
<div class="checkbox-container">
<div *ngFor="let dataLake of dataLakeList" class="checkbox-item">
<input
type="checkbox"
[value]="dataLake.id"
<input type="checkbox" [value]="dataLake.id"
(change)="onEditBlendingLakeCheckboxChange($event, dataLake.id)"
[checked]="isEditBlendingLakeSelected(dataLake.id)">
<label>{{ dataLake.name }}</label>
@@ -608,16 +596,16 @@
(cronExpressionChange)="onAddCronExpressionChange($event)" instanceId="add-form"></app-cron-job-builder>
</div>
<div class="clr-col-sm-12">
<!-- <div class="clr-col-sm-12">
<label>json</label>
<input class="form-control" type="Text" formControlName="json"
style="border: none; outline: none; height:33px !important;" />
</div>
</div> -->
<div class="clr-col-sm-12">
<!-- <div class="clr-col-sm-12">
<label> Url Endpoint</label>
<input class="clr-input" type="text" formControlName="url_endpoint" />
</div>
</div> -->
<div class="clr-col-sm-12">
<label> Batch Volume</label>
@@ -646,10 +634,7 @@
<label>Blending Data Lakes</label>
<div class="checkbox-container">
<div *ngFor="let dataLake of dataLakeList" class="checkbox-item">
<input
type="checkbox"
[value]="dataLake.id"
(change)="onBlendingLakeCheckboxChange($event, dataLake.id)"
<input type="checkbox" [value]="dataLake.id" (change)="onBlendingLakeCheckboxChange($event, dataLake.id)"
[checked]="isBlendingLakeSelected(dataLake.id)">
<label>{{ dataLake.name }}</label>
</div>
@@ -1031,10 +1016,8 @@
<!-- SQL Query Editor -->
<div class="sql-editor-container">
<h4>SQL Query Builder</h4>
<textarea class="clr-textarea sql-textarea"
[(ngModel)]="sqlQueryText"
placeholder="Enter your SQL query here using the available headers..."
rows="6"></textarea>
<textarea class="clr-textarea sql-textarea" [(ngModel)]="sqlQueryText"
placeholder="Enter your SQL query here using the available headers..." rows="6"></textarea>
<div class="editor-actions">
<button class="btn btn-primary" (click)="updateSqlQuery()">Update SQL Query</button>
</div>
@@ -1059,8 +1042,7 @@
<h5>Data Lake {{ keyData.lakeId }} - Table: {{ keyData.tableName }}</h5>
</div>
<div class="headers-container">
<span class="header-tag" *ngFor="let header of keyData.headers"
(click)="insertHeaderIntoQuery(header)">
<span class="header-tag" *ngFor="let header of keyData.headers" (click)="insertHeaderIntoQuery(header)">
{{ header }}
</span>
</div>
@@ -1075,12 +1057,12 @@
SQL Query Builder
</h4>
<div class="sql-editor-container">
<textarea class="clr-textarea sql-textarea"
[(ngModel)]="sqlQueryText"
placeholder="Enter your SQL query here using the available headers. Click on header names above to insert them into your query."
rows="8"></textarea>
<textarea class="clr-textarea sql-textarea" [(ngModel)]="sqlQueryText"
placeholder="Enter your SQL query here using the available headers. Click on header names above to insert them into your query."
rows="8"></textarea>
<div class="editor-hint">
<small class="clr-subtext">Tip: Click on header names above to automatically insert them into your query</small>
<small class="clr-subtext">Tip: Click on header names above to automatically insert them into your
query</small>
</div>
</div>
</div>
@@ -1115,11 +1097,8 @@
<span class="field-tag">{{ field.original }}</span>
</td>
<td>
<input type="text"
class="clr-input mapping-input"
[(ngModel)]="field.mapped"
placeholder="Enter new field name"
(ngModelChange)="updateFieldMapping(i, $event)">
<input type="text" class="clr-input mapping-input" [(ngModel)]="field.mapped"
placeholder="Enter new field name" (ngModelChange)="updateFieldMapping(i, $event)">
</td>
</tr>
</tbody>
@@ -1133,7 +1112,8 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="closeFieldMappingModal()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="updateFieldMappings()" [disabled]="!fieldMappingData || fieldMappingData.length === 0">Update Field Mappings</button>
<button type="button" class="btn btn-primary" (click)="updateFieldMappings()"
[disabled]="!fieldMappingData || fieldMappingData.length === 0">Update Field Mappings</button>
</div>
</clr-modal>

View File

@@ -171,6 +171,12 @@ export class Data_lakeComponent implements OnInit {
webhook_url: [null] // Add webhook_url field
});
// Set default SureConnect value after form initialization if list is already loaded
if (this.sureConnectList && this.sureConnectList.length > 0) {
const defaultSureConnectId = this.sureConnectList[0].id;
this.entryForm.get('sure_connect_id')?.setValue(defaultSureConnectId);
}
// form code start
this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => {
console.log(data);
@@ -262,6 +268,20 @@ export class Data_lakeComponent implements OnInit {
this.sureConnectService.getAll().subscribe((data: any[]) => {
this.sureConnectList = data;
console.log('SureConnect List:', this.sureConnectList);
// Set default SureConnect value if list is not empty
if (this.sureConnectList && this.sureConnectList.length > 0) {
// Set the first SureConnect item as default
const defaultSureConnectId = this.sureConnectList[0].id;
// Set default for ADD form if it exists
if (this.entryForm && this.entryForm.get('sure_connect_id')) {
// Only set default if no value is already selected
if (!this.entryForm.get('sure_connect_id')?.value) {
this.entryForm.get('sure_connect_id')?.setValue(defaultSureConnectId);
}
}
}
}, (error) => {
console.log('Error fetching SureConnect list:', error);
});
@@ -716,6 +736,12 @@ export class Data_lakeComponent implements OnInit {
// Set the selected SureConnect for edit form
this.selectedSureConnect = row.sure_connect_id || null;
// If no SureConnect is selected, set the first one as default
if (!this.rowSelected.sure_connect_id && this.sureConnectList && this.sureConnectList.length > 0) {
this.rowSelected.sure_connect_id = this.sureConnectList[0].id;
this.selectedSureConnect = this.sureConnectList[0].id;
}
// Initialize blending lake IDs for edit form from string
if (row.blending_lakeids && typeof row.blending_lakeids === 'string') {
this.editSelectedBlendingLakeIds = row.blending_lakeids.split(',').filter(id => id.trim() !== '');
@@ -889,6 +915,17 @@ export class Data_lakeComponent implements OnInit {
}
// Reset blending_lakeids to empty string
this.entryForm.get('blending_lakeids')?.setValue('');
// Set default SureConnect value if available
if (this.sureConnectList && this.sureConnectList.length > 0) {
const defaultSureConnectId = this.sureConnectList[0].id;
// Only set default if no value is already selected
if (!this.entryForm.get('sure_connect_id')?.value) {
this.entryForm.get('sure_connect_id')?.setValue(defaultSureConnectId);
}
} else {
this.entryForm.get('sure_connect_id')?.setValue('');
}
}
this.modalAdd = true;
}

View File

@@ -42,7 +42,8 @@
</ul>
</nav>
<div style="width: 100%;">
<gridster [options]="options" (drop)="onDrop($event)" style="background-color: transparent;">
<!-- Remove the (drop) event binding since it's already handled by gridster's emptyCellDropCallback -->
<gridster [options]="options" style="background-color: transparent;">
<gridster-item [item]="item" *ngFor="let item of dashboardArray">
<!-- <ng-container *ngIf="addToDashboard && item.addToDashboard"> -->
<button class="btn btn-icon btn-danger" style="margin-left: 10px; margin-top: 10px;" (click)="removeItem(item)" *ngIf="!fromRunner">

View File

@@ -66,18 +66,18 @@ export class EditnewdashComponent implements OnInit {
name: 'Common Filter',
identifier: 'common_filter'
},
{
name: 'Radar Chart',
identifier: 'radar_chart'
},
{
name: 'Doughnut Chart',
identifier: 'doughnut_chart'
},
{
name: 'Line Chart',
identifier: 'line_chart'
},
// {
// name: 'Radar Chart',
// identifier: 'radar_chart'
// },
// {
// name: 'Doughnut Chart',
// identifier: 'doughnut_chart'
// },
// {
// name: 'Line Chart',
// identifier: 'line_chart'
// },
// {
// name: 'Bar Chart',
// identifier: 'bar_chart'
@@ -98,22 +98,22 @@ export class EditnewdashComponent implements OnInit {
// name: 'Scatter Chart',
// identifier: 'scatter_chart'
// },
{
name: 'Dynamic Chart',
identifier: 'dynamic_chart'
},
{
name: 'Financial Chart',
identifier: 'financial_chart'
},
{
name: 'To Do',
identifier: 'to_do_chart'
},
{
name: 'Grid View',
identifier: 'grid_view'
},
// {
// name: 'Dynamic Chart',
// identifier: 'dynamic_chart'
// },
// {
// name: 'Financial Chart',
// identifier: 'financial_chart'
// },
// {
// name: 'To Do',
// identifier: 'to_do_chart'
// },
// {
// name: 'Grid View',
// identifier: 'grid_view'
// },
{
name: 'Compact Filter',
identifier: 'compact_filter'
@@ -2110,6 +2110,9 @@ export class EditnewdashComponent implements OnInit {
this.dashboardArray.push(chartItem);
console.log(`Created dynamic chart:`, chartItem);
// Update the dashboard collection and trigger refresh
this.itemChange();
},
error: (error) => {
console.error(`Error loading configuration for ${chartTypeName}:`, error);
@@ -2180,13 +2183,8 @@ export class EditnewdashComponent implements OnInit {
this.dashboardArray.push(chartItem);
console.log('Created default chart:', chartItem);
// Update the dashboard collection
this.dashboardCollection.dashboard = this.dashboardArray.slice();
// Force gridster to refresh
if (this.options && this.options.api) {
this.options.api.optionsChanged();
}
// Update the dashboard collection and trigger refresh
this.itemChange();
}
// Helper method to get display name for chart type - making it fully dynamic

View File

@@ -33,7 +33,7 @@
[labels]="chartLabels"
[options]="chartOptions"
[legend]="chartLegend"
[chartType]="chartType || 'bar'"
[type]="chartType || 'bar'"
(chartClick)="chartClicked($event)"
(chartHover)="chartHovered($event)">
</canvas>
@@ -46,7 +46,7 @@
[labels]="chartLabels"
[options]="chartOptions"
[legend]="chartLegend"
[chartType]="'bar'"
[type]="'bar'"
(chartClick)="chartClicked($event)"
(chartHover)="chartHovered($event)">
</canvas>

View File

@@ -546,7 +546,7 @@ export class UnifiedChartComponent implements OnInit, OnChanges, OnDestroy {
// Check if filters are available
hasFilters(): boolean {
const hasBaseFilters = this.baseFilters && this.baseFilters.length > 0;
console.log('Checking for filters - baseFilters:', this.baseFilters, 'hasBaseFilters:', hasBaseFilters);
// console.log('Checking for filters - baseFilters:', this.baseFilters, 'hasBaseFilters:', hasBaseFilters);
return hasBaseFilters;
}
@@ -682,30 +682,30 @@ export class UnifiedChartComponent implements OnInit, OnChanges, OnDestroy {
}
switch (this.chartType) {
case 'bar':
this.initializeBarChartOptions();
break;
case 'line':
this.initializeLineChartOptions();
break;
case 'pie':
this.initializePieChartOptions();
break;
case 'doughnut':
this.initializeDoughnutChartOptions();
break;
case 'bubble':
this.initializeBubbleChartOptions();
break;
case 'radar':
this.initializeRadarChartOptions();
break;
case 'polar':
this.initializePolarChartOptions();
break;
case 'scatter':
this.initializeScatterChartOptions();
break;
// case 'bar':
// this.initializeBarChartOptions();
// break;
// case 'line':
// this.initializeLineChartOptions();
// break;
// case 'pie':
// this.initializePieChartOptions();
// break;
// case 'doughnut':
// this.initializeDoughnutChartOptions();
// break;
// case 'bubble':
// this.initializeBubbleChartOptions();
// break;
// case 'radar':
// this.initializeRadarChartOptions();
// break;
// case 'polar':
// this.initializePolarChartOptions();
// break;
// case 'scatter':
// this.initializeScatterChartOptions();
// break;
default:
this.initializeDefaultChartOptions();
}