Skip to content

Commit a9fa79e

Browse files
Merge pull request #1079 from rocket-admin/mongo-add-auth-db
add/edit db: add Authentication database field to mongoDB creds fieldset
2 parents 1c2b87f + cbd342b commit a9fa79e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

frontend/src/app/components/connect-db/db-credentials-forms/mongodb-credentials-form/mongodb-credentials-form.component.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
<mat-hint *ngIf="connection.id && (hostname.dirty || port.dirty)">Password needed due to hostname/port change.</mat-hint>
6464
</mat-form-field>
6565

66-
<mat-form-field appearance="outline" class="credentials-fieldset__1-4-columns">
67-
<mat-label>Database Name</mat-label>
66+
<mat-form-field appearance="outline" class="credentials-fieldset__1-2-columns">
67+
<mat-label>Database name</mat-label>
6868
<input matInput name="database" #database="ngModel"
6969
data-testid="connection-database-input"
7070
angulartics2On="change"
@@ -76,6 +76,18 @@
7676
<mat-error *ngIf="database.errors?.required && (database.invalid && database.touched)">Name should not be empty.</mat-error>
7777
</mat-form-field>
7878

79+
<mat-form-field appearance="outline" class="credentials-fieldset__3-4-columns">
80+
<mat-label>Authentication database</mat-label>
81+
<input matInput name="authsource" #authsource="ngModel"
82+
data-testid="connection-database-input"
83+
angulartics2On="change"
84+
angularticsAction="Connection creds {{ connection.id ? 'edit' : 'add' }}: database authSource is edited"
85+
[readonly]="(accessLevel === 'readonly' || connection.isTestConnection) && connection.id"
86+
[disabled]="submitting"
87+
[(ngModel)]="connection.authSource">
88+
<!--<mat-error *ngIf="database.errors?.required && (database.invalid && database.touched)">Name should not be empty.</mat-error>-->
89+
</mat-form-field>
90+
7991
<mat-expansion-panel class="credentials-fieldset__1-4-columns">
8092
<mat-expansion-panel-header data-testid="connection-advanced-settings-expansion-panel-header">
8193
<mat-panel-title>

frontend/src/app/models/connection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export enum ConnectionType {
1818
export interface Connection {
1919
id: string | null,
2020
database: string,
21+
authSource?: string,
2122
​​ title: string,
2223
host: string,
2324
port: string,

frontend/src/app/services/connections.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class ConnectionsService {
3636
username: '',
3737
password: '',
3838
database: '',
39+
authSource: '',
3940
title: '',
4041
ssh: false,
4142
privateSSHKey: '',

0 commit comments

Comments
 (0)