Elasticsearch db#1446
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for Elasticsearch as a new database type to the application. The changes introduce Elasticsearch to the database type enum, add corresponding UI components for managing Elasticsearch connections, and configure appropriate display/edit components for Elasticsearch data types.
- Added Elasticsearch to the database type enum and configuration files
- Created a new ElasticCredentialsFormComponent for managing Elasticsearch connection credentials
- Configured type mappings for displaying and editing Elasticsearch data (string, number, boolean, date, object, array, binary)
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/models/connection.ts | Added Elasticsearch to the DBtype enum |
| frontend/src/app/consts/databases.ts | Added Elasticsearch to supported databases list and titles |
| frontend/src/app/consts/table-display-types.ts | Configured display components for Elasticsearch data types |
| frontend/src/app/consts/record-view-types.ts | Configured record view components for Elasticsearch data types |
| frontend/src/app/consts/record-edit-types.ts | Configured edit components for Elasticsearch data types |
| frontend/src/app/components/connect-db/db-credentials-forms/elastic-credentials-form/elastic-credentials-form.component.ts | Created TypeScript component extending BaseCredentialsFormComponent |
| frontend/src/app/components/connect-db/db-credentials-forms/elastic-credentials-form/elastic-credentials-form.component.html | Created HTML template for Elasticsearch connection form with hostname, port, username, password, and advanced settings |
| frontend/src/app/components/connect-db/db-credentials-forms/elastic-credentials-form/elastic-credentials-form.component.spec.ts | Added unit test for the ElasticCredentialsFormComponent |
| frontend/src/app/components/connect-db/db-credentials-forms/elastic-credentials-form/elastic-credentials-form.component.css | Added responsive styling for the Elasticsearch credentials form |
| frontend/src/app/components/connect-db/connect-db.component.ts | Imported ElasticCredentialsFormComponent and added default port (9200) for Elasticsearch |
| frontend/src/app/components/connect-db/connect-db.component.html | Integrated ElasticCredentialsFormComponent into the connection form |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <mat-form-field appearance="outline" class="advanced-settings__fullLine"> | ||
| <mat-label>Username</mat-label> | ||
| <input matInput name="username" #username="ngModel" | ||
| data-testid="connection-username-input" | ||
| angulartics2On="change" | ||
| angularticsAction="Connection creds {{ connection.id ? 'edit' : 'add' }}: username is edited" | ||
| [readonly]="(accessLevel === 'readonly' || connection.isTestConnection) && connection.id" | ||
| [disabled]="submitting" | ||
| [(ngModel)]="connection.username"> | ||
| <mat-error *ngIf="username.errors?.required && (username.invalid && username.touched)">Username should not be empty</mat-error> | ||
| </mat-form-field> | ||
|
|
There was a problem hiding this comment.
Duplicate "Username" field. This field is already defined at lines 38-48 with required validation. The duplicate field in the advanced settings section (lines 78-88) should be removed. For comparison, other credential forms like Postgres only have the username field once in the main form section, not duplicated in advanced settings.
| <mat-form-field appearance="outline" class="advanced-settings__fullLine"> | |
| <mat-label>Username</mat-label> | |
| <input matInput name="username" #username="ngModel" | |
| data-testid="connection-username-input" | |
| angulartics2On="change" | |
| angularticsAction="Connection creds {{ connection.id ? 'edit' : 'add' }}: username is edited" | |
| [readonly]="(accessLevel === 'readonly' || connection.isTestConnection) && connection.id" | |
| [disabled]="submitting" | |
| [(ngModel)]="connection.username"> | |
| <mat-error *ngIf="username.errors?.required && (username.invalid && username.touched)">Username should not be empty</mat-error> | |
| </mat-form-field> |
| <mat-error *ngIf="sshUsername.errors?.required && (sshUsername.invalid && sshUsername.touched)">SSH username should not be empty</mat-error> | ||
| </mat-form-field> | ||
|
|
||
| <mat-checkbox class="checkbox-line advanced-settings__fullLine" name="ssl" #ssh="ngModel" |
There was a problem hiding this comment.
Incorrect variable reference: the variable name should be #ssl but it's currently set to #ssh. This line creates a template reference variable for the SSL checkbox, so it should match the field it's referencing. Change #ssh="ngModel" to #ssl="ngModel".
| <mat-checkbox class="checkbox-line advanced-settings__fullLine" name="ssl" #ssh="ngModel" | |
| <mat-checkbox class="checkbox-line advanced-settings__fullLine" name="ssl" #ssl="ngModel" |
No description provided.