Skip to content
Merged

Fixes #1043

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/src/app/components/audit/audit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ <h3 class='mat-subheading-2'>Rocketadmin can not find any tables</h3>
<p class="mat-body-1">{{serverError.abstract}}</p>
</ng-template>
<div class="error-actions">
<a mat-stroked-button routerLink="/edit-db/{{connectionID}}">Connection settings</a>
<a mat-stroked-button *ngIf="accesLevel === 'edit'"
routerLink="/edit-db/{{connectionID}}">
Check database credentials
</a>
<button *ngIf="isSaas" mat-flat-button color="warn" (click)="openIntercome()">Chat with support</button>
<a *ngIf="!isSaas" mat-flat-button color="warn"
href="https://github.com/rocket-admin/rocketadmin/issues" target="_blank">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { Component, Inject, OnInit } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
import { format } from 'date-fns'
import { normalizeFieldName, normalizeTableName } from 'src/app/lib/normalize';
Expand All @@ -11,7 +12,8 @@ import { Log } from 'src/app/models/logs';
styleUrls: ['./info-dialog.component.css'],
imports: [
CommonModule,
MatDialogModule
MatDialogModule,
MatButtonModule
]
})
export class InfoDialogComponent implements OnInit {
Expand Down
15 changes: 11 additions & 4 deletions frontend/src/app/components/company/company.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ <h2 class="heading-2 tableHeader__heading">Members <span *ngIf="currentPlan ===
[(ngModel)]="element.role"
(ngModelChange)="updateRole(element.id, element.role)">
<mat-option value="ADMIN" attr.data-testid="company-member-superadmin-role-{{i}}-select-option">
Chief Account Officer
Account Owner
</mat-option>
<mat-option value="DB_ADMIN" attr.data-testid="company-member-dbadmin-role-{{i}}-select-option">
System Admin
</mat-option>
<mat-option value="USER" attr.data-testid="company-member-user-role-{{i}}-select-option">
Specialist
Member
</mat-option>
</mat-select>
<ng-template #noSelect>
<span attr.data-testid="company-member-user-role-{{i}}-cell">
{{element.role === "ADMIN" ? 'Chief Account Officer' : null}}
{{element.role === "ADMIN" ? 'Account Owner' : null}}
{{element.role === "DB_ADMIN" ? 'System Admin' : null}}
{{element.role === "USER" ? 'Specialist' : null}}
{{element.role === "USER" ? 'Member' : null}}
</span>
</ng-template>
</td>
Expand Down Expand Up @@ -204,5 +204,12 @@ <h2 class="heading-2 tableHeader__heading">Members <span *ngIf="currentPlan ===
<tr mat-header-row *matHeaderRowDef="membersTableDisplayedColumns" class="company-members-table-heading"></tr>
<tr mat-row *matRowDef="let row; columns: membersTableDisplayedColumns;" class="company-member-row"></tr>
</table>

<!--<mat-slide-toggle style="margin-top: 20px;" *ngIf="currentUser && currentUser.role === 'ADMIN'"
name="showTestConnections"
data-testid="company-test-connections-switch"
[(ngModel)]="company.show_test_connections">
Show test connections
</mat-slide-toggle>-->
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ describe('CompanyComponent', () => {
"invitedUserEmail": "admin1@test.com",
"role": CompanyMemberRole.CAO,
}
]
],
show_test_connections: false
}

const mockMembers = [
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/app/components/company/company.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { AlertComponent } from '../ui-components/alert/alert.component';
import { PlaceholderCompanyComponent } from '../skeletons/placeholder-company/placeholder-company.component';
import { PlaceholderTableDataComponent } from '../skeletons/placeholder-table-data/placeholder-table-data.component';
import { NgIf } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
selector: 'app-company',
Expand All @@ -40,6 +41,7 @@ import { NgIf } from '@angular/common';
MatSlideToggleModule,
MatTooltipModule,
MatTableModule,
RouterModule,
Angulartics2OnModule,
AlertComponent,
PlaceholderCompanyComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ <h3 class='mat-subheading-2'>Rocketadmin can not find any tables</h3>
<p class="mat-body-1">{{serverError.abstract}}</p>
</ng-template>
<div class="error-actions">
<a mat-stroked-button routerLink="/edit-db/{{connectionID}}">Connection settings</a>
<a mat-stroked-button *ngIf="accessLevel === 'edit'"
routerLink="/edit-db/{{connectionID}}">
Check database credentials
</a>
<button *ngIf="isSaas" mat-flat-button color="warn" (click)="openIntercome()">Chat with support</button>
<a *ngIf="!isSaas" mat-flat-button color="warn"
href="https://github.com/rocket-admin/rocketadmin/issues" target="_blank">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<p class="mat-body-1">{{serverError.abstract}}</p>
</ng-template>
<div class="error-actions">
<a mat-stroked-button routerLink="/edit-db/{{connectionID}}">Connection settings</a>
<a mat-stroked-button *ngIf="currentConnectionAccessLevel === 'edit'"
routerLink="/edit-db/{{connectionID}}">
Check database credentials
</a>
<button *ngIf="isSaas" mat-flat-button color="warn" (click)="openIntercome()">Chat with support</button>
<a *ngIf="!isSaas" mat-flat-button color="warn"
href="https://github.com/rocket-admin/rocketadmin/issues" target="_blank">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { NotificationsService } from 'src/app/services/notifications.service';
import { TableStateService } from 'src/app/services/table-state.service';
import { MatTooltipModule } from '@angular/material/tooltip';

@Component({
selector: 'app-db-table-row-view',
Expand All @@ -17,6 +18,7 @@ import { TableStateService } from 'src/app/services/table-state.service';
MatIconModule,
MatButtonModule,
ClipboardModule,
MatTooltipModule,
RouterModule,
CommonModule
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
grid-template-columns: 1fr 36px;
}

.foreign-key ::ng-deep .mat-mdc-form-field-subscript-wrapper {
margin-bottom: 16px;
}

.foreign-key__link {
display: flex;
/* align-items: center; */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

.foreign-key ::ng-deep .mat-mdc-form-field-subscript-wrapper {
margin-bottom: 8px;
margin-bottom: 16px;
}

.hint-link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { MatSelectModule } from '@angular/material/select';
import { MatButtonModule } from '@angular/material/button';
import { PlaceholderAddUserDialogComponent } from '../../skeletons/placeholder-add-user-dialog/placeholder-add-user-dialog.component';
import { NgForOf, NgIf } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
selector: 'app-user-add-dialog',
Expand All @@ -25,6 +26,7 @@ import { NgForOf, NgIf } from '@angular/common';
MatFormFieldModule,
MatSelectModule,
MatButtonModule,
RouterModule,
PlaceholderAddUserDialogComponent
]
})
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/models/company.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface Company {
connections: CompanyConnection[],
invitations: CompanyMemberInvitation[],
is_payment_method_added: boolean,
show_test_connections: boolean
}

export interface CompanyMember {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/services/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class PaymentService {
createIntentToSubscription(companyId: string) {
const config = this._configuration.getConfig();

return this._http.post<any>(config.saasURL + `/company/stripe/${companyId}`, {})
return this._http.post<any>(config.saasURL + `/saas/company/stripe/${companyId}`, {})
.pipe(
map(res => res),
catchError((err) => {
Expand All @@ -41,7 +41,7 @@ export class PaymentService {
createSubscription(companyId: string, defaultPaymentMethodId: string | null | PaymentMethod, subscriptionLevel: string) {
const config = this._configuration.getConfig();

return this._http.post<any>(config.saasURL + `/company/setup/intent/${companyId}`, {defaultPaymentMethodId, subscriptionLevel})
return this._http.post<any>(config.saasURL + `/saas/company/setup/intent/${companyId}`, {defaultPaymentMethodId, subscriptionLevel})
.pipe(
map(res => res),
catchError((err) => {
Expand All @@ -61,7 +61,7 @@ export class PaymentService {
changeSubscription(companyId: string, subscriptionLevel: string) {
const config = this._configuration.getConfig();

return this._http.post<any>(config.saasURL + `/company/subscription/upgrade/${companyId}`, {subscriptionLevel})
return this._http.post<any>(config.saasURL + `/saas/company/subscription/upgrade/${companyId}`, {subscriptionLevel})
.pipe(
map(res => res),
catchError((err) => {
Expand Down
Loading