-
-
Notifications
You must be signed in to change notification settings - Fork 18
Redis db #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Redis db #1444
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ddbe8fd
add redis
lyubov-voloshko 7d24bef
edit creds: fix credsCorrect chain operator
lyubov-voloshko 0b3da28
Merge branch 'main' into redis-db
lyubov-voloshko ab4d85b
fix unit tests
lyubov-voloshko b41e32c
Merge branch 'redis-db' of github.com:Rocket-admin/rocketadmin into r…
lyubov-voloshko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...nnect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| .connectForm__hostname, | ||
| .connectForm__port { | ||
| padding-bottom: 20px; | ||
| } | ||
|
|
||
| @media (width <= 600px) { | ||
| .connectForm__hostname { | ||
| padding-bottom: 44px; | ||
| } | ||
|
|
||
| .connectForm__port { | ||
| padding-bottom: 0; | ||
| } | ||
| } |
175 changes: 175 additions & 0 deletions
175
...nect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,175 @@ | ||||||
| <mat-form-field appearance="outline" class="connectForm__hostname credentials-fieldset__1-3-columns"> | ||||||
| <mat-label>Hostname</mat-label> | ||||||
| <input matInput name="hostname" #hostname="ngModel" | ||||||
| data-testid="connection-hostname-input" | ||||||
| angulartics2On="change" | ||||||
| angularticsAction="Connection creds {{ connection.id ? 'edit' : 'add' }}: hostname is edited" | ||||||
| required hostnameValidator="mongodb" | ||||||
| [readonly]="(accessLevel === 'readonly' || connection.isTestConnection) && connection.id" | ||||||
| [disabled]="submitting" | ||||||
| [(ngModel)]="connection.host"> | ||||||
| <mat-hint> | ||||||
| E.g. <strong><code>mongodb+srv://my-test-db.8a8grvb.mongoconnection.net</code></strong><br> | ||||||
|
||||||
| E.g. <strong><code>mongodb+srv://my-test-db.8a8grvb.mongoconnection.net</code></strong><br> | |
| E.g. <strong><code>redis.example.com</code></strong> or <strong><code>my-redis-instance.cache.amazonaws.com</code></strong><br> |
61 changes: 61 additions & 0 deletions
61
...t-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
|
||
| import { Angulartics2Module } from 'angulartics2'; | ||
| import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
| import { FormsModule } from '@angular/forms'; | ||
| import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
| import { RedisCredentialsFormComponent } from './redis-credentials-form.component'; | ||
| import { provideHttpClient } from '@angular/common/http'; | ||
|
|
||
| describe('RedisCredentialsFormComponent', () => { | ||
| let component: RedisCredentialsFormComponent; | ||
| let fixture: ComponentFixture<RedisCredentialsFormComponent>; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| imports: [ | ||
| FormsModule, | ||
| MatCheckboxModule, | ||
| BrowserAnimationsModule, | ||
| Angulartics2Module.forRoot({}), | ||
| RedisCredentialsFormComponent | ||
| ], | ||
| providers: [provideHttpClient()] | ||
| }) | ||
| .compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(RedisCredentialsFormComponent); | ||
| component = fixture.componentInstance; | ||
|
|
||
| component.connection = { | ||
| id: "12345678" | ||
| } as any; | ||
|
|
||
| // component.connection = { | ||
| // "title": "Test connection via SSH tunnel to mySQL", | ||
| // "masterEncryption": false, | ||
| // "type": DBtype.MySQL, | ||
| // "host": "database-2.cvfuxe8nltiq.us-east-2.rds.amazonaws.com", | ||
| // "port": "3306", | ||
| // "username": "admin", | ||
| // "database": "testDB", | ||
| // "schema": null, | ||
| // "sid": null, | ||
| // "id": "9d5f6d0f-9516-4598-91c4-e4fe6330b4d4", | ||
| // "ssh": true, | ||
| // "sshHost": "3.134.99.192", | ||
| // "sshPort": '22', | ||
| // "sshUsername": "ubuntu", | ||
| // "ssl": false, | ||
| // "cert": null, | ||
| // "connectionType": ConnectionType.Direct, | ||
| // "azure_encryption": false, | ||
| // "signing_key": '' | ||
| // }; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
31 changes: 31 additions & 0 deletions
31
...onnect-db/db-credentials-forms/redis-credentials-form/redis-credentials-form.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { Angulartics2Module } from 'angulartics2'; | ||
| import { BaseCredentialsFormComponent } from '../base-credentials-form/base-credentials-form.component'; | ||
| import { Component } from '@angular/core'; | ||
| import { FormsModule } from '@angular/forms'; | ||
| import { HostnameValidationDirective } from 'src/app/directives/hostnameValidator.directive'; | ||
| import { MasterEncryptionPasswordComponent } from '../../master-encryption-password/master-encryption-password.component'; | ||
| import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
| import { MatExpansionModule } from '@angular/material/expansion'; | ||
| import { MatFormFieldModule } from '@angular/material/form-field'; | ||
| import { MatInputModule } from '@angular/material/input'; | ||
| import { NgIf } from '@angular/common'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-redis-credentials-form', | ||
| templateUrl: './redis-credentials-form.component.html', | ||
| styleUrls: ['../base-credentials-form/base-credentials-form.component.css', './redis-credentials-form.component.css'], | ||
| imports: [ | ||
| NgIf, | ||
| FormsModule, | ||
| MatFormFieldModule, | ||
| MatInputModule, | ||
| MatCheckboxModule, | ||
| MatExpansionModule, | ||
| HostnameValidationDirective, | ||
| MasterEncryptionPasswordComponent, | ||
| Angulartics2Module | ||
| ] | ||
| }) | ||
| export class RedisCredentialsFormComponent extends BaseCredentialsFormComponent { | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hostnameValidator attribute should not specify "mongodb" as the value. Based on other database forms (e.g., MySQL, Cassandra), this should be either
hostnameValidatorwithout a value, orhostnameValidator="redis"if Redis requires special hostname validation.