diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.html b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.html index c7d3e1c..3a3d46f 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.html +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.html @@ -104,7 +104,7 @@ - {{user.url | slice:0:30}}{{user.url_endpoint.length > 30 ? '...' : ''}} + {{user.url | slice:0:30}}{{user?.url_endpoint?.length > 30 ? '...' : ''}} @@ -445,10 +445,17 @@ Blending Data Lakes - - {{ dataLake.name }} - - Hold Ctrl/Cmd to select multiple data lakes + + + + {{ dataLake.name }} + + + Select data lakes to blend @@ -591,10 +598,17 @@ Blending Data Lakes - - {{ dataLake.name }} - - Hold Ctrl/Cmd to select multiple data lakes + + + + {{ dataLake.name }} + + + Select data lakes to blend diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.scss b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.scss index 2dc4aeb..dac22f3 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.scss +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.scss @@ -397,3 +397,28 @@ height: auto !important; min-height: 80px; } + +/* Checkbox Styles for Blending Data Lakes */ +.checkbox-container { + border: 1px solid #ccc; + border-radius: 4px; + padding: 10px; + max-height: 200px; + overflow-y: auto; + background-color: #f9f9f9; +} + +.checkbox-item { + display: flex; + align-items: center; + margin-bottom: 8px; +} + +.checkbox-item input[type="checkbox"] { + margin-right: 8px; +} + +.checkbox-item label { + margin-bottom: 0; + cursor: pointer; +} diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.ts index 7021b72..525a440 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/Data_lake/Data_lake.component.ts @@ -105,6 +105,10 @@ export class Data_lakeComponent implements OnInit { selectedAggregationFields: { field: string; operation: string }[] = []; + // New property to store selected blending lake IDs as string + selectedBlendingLakeIds: string[] = []; + editSelectedBlendingLakeIds: string[] = []; + constructor( private extensionService: ExtensionService, private userInfoService: UserInfoService, @@ -686,8 +690,16 @@ export class Data_lakeComponent implements OnInit { this.editCronExpression = row.cron_job || ''; // Set the selected SureConnect for edit form this.selectedSureConnect = row.sure_connect_id || null; - // Set the selected Data Lake for edit form - this.selectedDataLake = row.ref_datalake_id || null; + + // 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() !== ''); + } else if (row.blending_lakeids && Array.isArray(row.blending_lakeids)) { + this.editSelectedBlendingLakeIds = row.blending_lakeids.map(id => id.toString()); + } else { + this.editSelectedBlendingLakeIds = []; + } + // Use setTimeout to ensure the component has time to initialize setTimeout(() => { this.modalEdit = true; @@ -838,18 +850,22 @@ export class Data_lakeComponent implements OnInit { } goToAdd(row) { - this.modalAdd = true; + this.modalAdd = false; this.addCronExpression = ''; this.selectedSureConnect = null; // Reset SureConnect selection - this.selectedDataLake = null; // Reset Data Lake selection this.submitted = false; + // Reset blending lake IDs for add form + this.selectedBlendingLakeIds = []; + // Reset the form control for cron_job and sure_connect_id if (this.entryForm) { if (this.entryForm.get('cron_job')) { this.entryForm.get('cron_job')?.setValue(''); } - + // Reset blending_lakeids to empty string + this.entryForm.get('blending_lakeids')?.setValue(''); } + this.modalAdd = true; } submitted = false; onSubmit() { @@ -1290,4 +1306,54 @@ export class Data_lakeComponent implements OnInit { return []; } } + + // Method to handle checkbox change for blending lakes (ADD form) + onBlendingLakeCheckboxChange(event: any, lakeId: number) { + const lakeIdStr = lakeId.toString(); + if (event.target.checked) { + // Add to selected blending lake IDs + if (!this.selectedBlendingLakeIds.includes(lakeIdStr)) { + this.selectedBlendingLakeIds.push(lakeIdStr); + } + } else { + // Remove from selected blending lake IDs + const index = this.selectedBlendingLakeIds.indexOf(lakeIdStr); + if (index > -1) { + this.selectedBlendingLakeIds.splice(index, 1); + } + } + + // Update the form control value as a comma-separated string + this.entryForm.get('blending_lakeids')?.setValue(this.selectedBlendingLakeIds.join(',')); + } + + // Method to check if a blending lake is selected (ADD form) + isBlendingLakeSelected(lakeId: number): boolean { + return this.selectedBlendingLakeIds.includes(lakeId.toString()); + } + + // Method to handle checkbox change for blending lakes (EDIT form) + onEditBlendingLakeCheckboxChange(event: any, lakeId: number) { + const lakeIdStr = lakeId.toString(); + if (event.target.checked) { + // Add to selected blending lake IDs + if (!this.editSelectedBlendingLakeIds.includes(lakeIdStr)) { + this.editSelectedBlendingLakeIds.push(lakeIdStr); + } + } else { + // Remove from selected blending lake IDs + const index = this.editSelectedBlendingLakeIds.indexOf(lakeIdStr); + if (index > -1) { + this.editSelectedBlendingLakeIds.splice(index, 1); + } + } + + // Update the rowSelected value as a comma-separated string + this.rowSelected.blending_lakeids = this.editSelectedBlendingLakeIds.join(','); + } + + // Method to check if a blending lake is selected (EDIT form) + isEditBlendingLakeSelected(lakeId: number): boolean { + return this.editSelectedBlendingLakeIds.includes(lakeId.toString()); + } }