Skip to content

Commit e4e335f

Browse files
Merge pull request #1592 from karinakharchenko/profile-structure-ux
Profile structure ux
2 parents 7a1008f + 0237c9d commit e4e335f

File tree

15 files changed

+256
-112
lines changed

15 files changed

+256
-112
lines changed

frontend/src/app/components/branding/branding.component.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,45 @@
171171
background-color: var(--color-accentedPalette-700);
172172
}
173173
}
174+
175+
.upgrade-required {
176+
display: flex;
177+
flex-direction: column;
178+
align-items: center;
179+
text-align: center;
180+
padding: 48px 24px;
181+
border: 1px solid var(--color-primaryPalette-100);
182+
height: fit-content;
183+
}
184+
185+
@media (prefers-color-scheme: dark) {
186+
.upgrade-required {
187+
border-color: var(--color-primaryPalette-700);
188+
}
189+
}
190+
191+
.upgrade-required__icon {
192+
font-size: 64px;
193+
width: 64px;
194+
height: 64px;
195+
color: rgba(0, 0, 0, 0.38);
196+
margin-bottom: 24px;
197+
}
198+
199+
@media (prefers-color-scheme: dark) {
200+
.upgrade-required__icon {
201+
color: rgba(255, 255, 255, 0.38);
202+
}
203+
}
204+
205+
.upgrade-required__description {
206+
color: rgba(0, 0, 0, 0.64);
207+
margin-bottom: 24px;
208+
max-width: 400px;
209+
}
210+
211+
@media (prefers-color-scheme: dark) {
212+
.upgrade-required__description {
213+
color: rgba(255, 255, 255, 0.7);
214+
}
215+
}

frontend/src/app/components/branding/branding.component.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
1212

1313
<div class="white-label">
1414
<div class="white-label-settings">
15-
<div *ngIf="(currentPlan === 'free' || currentUser.role === 'DB_ADMIN') && isSaas && !isDemo"
15+
<div *ngIf="(currentPlan === 'free' || currentUser.role !== 'ADMIN') && isSaas && !isDemo"
1616
class="white-label-settings__overlay"
17-
[matTooltip]="currentUser.role === 'DB_ADMIN' ? 'Contact your Account Owner to set up white label settings.' : 'To white‑label your domain, please upgrade to the Team plan or higher.'">
17+
[matTooltip]="currentUser.role !== 'ADMIN' ? 'Contact your Account Owner to set up white label settings.' : 'To white‑label your domain, please upgrade to the Team plan or higher.'">
1818
</div>
1919
<form *ngIf="isSaas"
2020
class="text-filed-edit"
@@ -27,7 +27,7 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
2727
angularticsAction="Company: custom domain is edited"
2828
(change)="posthog.capture('Company: custom domain is edited')"
2929
placeholder="e.g. {{companyCustomDomainPlaceholder}}"
30-
[readonly]="currentUser.role === 'DB_ADMIN' || isCustomDomain"
30+
[readonly]="currentUser.role !== 'ADMIN' || isCustomDomain"
3131
[(ngModel)]="companyCustomDomainHostname">
3232
<mat-hint *ngIf="currentPlan !== 'free' && currentUser.role === 'ADMIN' && isCustomDomain" class="cname-hint">
3333
To change the domain, visit <a href="https://app.rocketadmin.com/company" target="_blank">app.rocketadmin.com/company</a>
@@ -48,7 +48,7 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
4848
(click)="handleDeleteDomainDialogOpen()">
4949
Delete
5050
</button>
51-
<a *ngIf="currentUser.role === 'DB_ADMIN' && companyCustomDomainHostname"
51+
<a *ngIf="currentUser.role !== 'ADMIN' && companyCustomDomainHostname"
5252
href="https://{{companyCustomDomainHostname}}"
5353
target="_blank"
5454
mat-button color="primary">
@@ -57,7 +57,7 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
5757
</div>
5858
</form>
5959

60-
<div class="white-label-settings-images">
60+
<div *ngIf="currentUser.role === 'ADMIN' && !isDemo" class="white-label-settings-images">
6161
<form #uploadLogoForm="ngForm" class="upload-logo-form">
6262
<div class="file-uploader-appearance">
6363
<button mat-stroked-button type="button" (click)="logoInput.click()">
@@ -98,7 +98,7 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
9898
angularticsAction="Company: tab title domain is edited"
9999
(change)="posthog.capture('Company: tab title domain is edited')"
100100
placeholder="e.g. {{company.name}}"
101-
[readonly]="currentUser.role === 'DB_ADMIN'"
101+
[readonly]="currentUser.role !== 'ADMIN'"
102102
[(ngModel)]="companyTabTitle">
103103
<mat-hint *ngIf="currentPlan === 'free'" class="cname-hint">
104104
Set the title that appears on the browser tab.
@@ -205,7 +205,7 @@ <h1 class="mat-h1 branding-page-header">Branding</h1>
205205
</defs>
206206
</svg>
207207
</div>
208-
<div *ngIf="isSaas" class="white-label-how-to">
208+
<div *ngIf="isSaas && currentPlan !== 'free'" class="white-label-how-to">
209209
<h3>Configure DNS Records</h3>
210210
<p>
211211
These instructions will guide you in setting up domain to have your admin panel on it.
@@ -225,6 +225,16 @@ <h3>Configure DNS Records</h3>
225225
<br/>
226226
<p>Done! Now wait for the server's updates; it might take 1-2 hours.</p>
227227
</div>
228+
<div *ngIf="isSaas && currentPlan === 'free'" class="upgrade-required">
229+
<mat-icon class="upgrade-required__icon">lock</mat-icon>
230+
<h2 class="mat-h2">White-label is available on Team plan</h2>
231+
<p class="upgrade-required__description">
232+
Upgrade to enable white-label settings for your organization.
233+
</p>
234+
<a mat-flat-button color="primary" routerLink="/upgrade">
235+
Upgrade
236+
</a>
237+
</div>
228238
</div>
229239
</div>
230240
</div>

frontend/src/app/components/company/company.component.css

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,6 @@
4848
gap: 4px;
4949
}
5050

51-
.company-plan {
52-
display: flex;
53-
align-items: center;
54-
justify-content: space-between;
55-
margin-bottom: 32px;
56-
}
57-
58-
.company-plan-name {
59-
text-transform: capitalize;
60-
}
61-
62-
.company-plan__paymnent-buttons {
63-
display: flex;
64-
gap: 12px;
65-
margin-left: auto;
66-
}
67-
68-
@media (width <= 600px) {
69-
.upgrade-button__caption_desktop {
70-
display: none;
71-
}
72-
}
73-
74-
.upgrade-button__caption_mobile {
75-
display: none;
76-
}
77-
78-
@media (width <= 600px) {
79-
.upgrade-button__caption_mobile {
80-
display: initial;
81-
}
82-
}
83-
8451
.tableHeader {
8552
display: flex;
8653
align-items: center;

frontend/src/app/components/company/company.component.html

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,8 @@ <h1 class="mat-h1 companyPageHeader">
3131
{{submittingChangedName ? 'Saving' : 'Save'}}
3232
</button>
3333
</div>
34-
3534
</form>
3635

37-
<div *ngIf="isSaas" class="company-plan">
38-
<div>
39-
<strong>Current plan: </strong>
40-
<span class="company-plan-name" data-testid="company-plan-string">{{currentPlan}}</span>
41-
</div>
42-
<div class="company-plan__paymnent-buttons">
43-
<a *ngIf="currentUser && currentUser.role === 'ADMIN' && company.portal_link"
44-
mat-button color="accent" class="upgrade-button"
45-
[href]="company.portal_link" target="_blank"
46-
data-testid="company-payment-portal-link"
47-
angulartics2On="click"
48-
angularticsAction="Company: Payment settings is clicked"
49-
(click)="posthog.capture('Company: Payment settings is clicked')">
50-
<span class="upgrade-button__caption_desktop">Payment settings</span>
51-
<span class="upgrade-button__caption_mobile">Stripe</span>
52-
</a>
53-
<a *ngIf="currentUser && currentUser.role === 'ADMIN'"
54-
mat-stroked-button color="accent" class="upgrade-button"
55-
routerLink="/upgrade"
56-
data-testid="company-payment-upgrade-link"
57-
angulartics2On="click"
58-
angularticsAction="Company: Upgrade is clicked"
59-
(click)="posthog.capture('Company: Upgrade is clicked')">
60-
{{ company.portal_link ? 'Change' : 'Upgrade'}}
61-
</a>
62-
</div>
63-
</div>
64-
6536
<div class="tableHeader">
6637
<h2 class="heading-2 tableHeader__heading">Members <span *ngIf="currentPlan === 'free' && isSaas" data-testid="company-members-max-string">(max 3)</span></h2>
6738
<div class="tableHeader__actions">

frontend/src/app/components/profile/profile-sidebar/profile-sidebar.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
<a mat-list-item
4242
*ngIf="isSaas"
4343
routerLink="/upgrade"
44-
[class.active-link]="activeTab() === 'pricing'"
44+
[class.active-link]="activeTab() === 'subscription'"
4545
class="sidebar-nav-item"
4646
[class.sidebar-nav-item_collapsed]="collapsed()"
47-
[matTooltip]="collapsed() ? 'Pricing' : ''"
47+
[matTooltip]="collapsed() ? 'Subscription' : ''"
4848
matTooltipPosition="right">
4949
<mat-icon matListItemIcon>payments</mat-icon>
50-
<span *ngIf="!collapsed()" matListItemTitle>Pricing</span>
50+
<span *ngIf="!collapsed()" matListItemTitle>Subscription</span>
5151
</a>
5252
<a mat-list-item
5353
routerLink="/branding"
@@ -60,6 +60,7 @@
6060
<span *ngIf="!collapsed()" matListItemTitle>Branding</span>
6161
</a>
6262
<a mat-list-item
63+
*ngIf="isSaas"
6364
routerLink="/saml"
6465
[class.active-link]="activeTab() === 'saml'"
6566
class="sidebar-nav-item"

frontend/src/app/components/profile/profile-sidebar/profile-sidebar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { environment } from 'src/environments/environment';
2222
],
2323
})
2424
export class ProfileSidebarComponent implements OnInit, AfterViewInit {
25-
activeTab = input<'account' | 'company' | 'pricing' | 'branding' | 'saml' | 'api' | 'secrets' | 'zapier'>('account');
25+
activeTab = input<'account' | 'company' | 'subscription' | 'branding' | 'saml' | 'api' | 'secrets' | 'zapier'>('account');
2626

2727
collapsed = signal(false);
2828
initialized = signal(false);

frontend/src/app/components/secrets/create-secret-dialog/create-secret-dialog.component.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
margin-bottom: 16px;
44
}
55

6+
.full-width:first-child {
7+
margin-top: 12px;
8+
}
9+
610
.master-encryption-section {
711
margin-top: 8px;
812
padding: 16px;

frontend/src/app/components/sso/sso.component.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,37 @@
6161
margin-top: 16px;
6262
padding-bottom: 32px;
6363
}
64+
65+
.upgrade-required {
66+
display: flex;
67+
flex-direction: column;
68+
align-items: center;
69+
text-align: center;
70+
padding: 48px 24px;
71+
}
72+
73+
.upgrade-required__icon {
74+
font-size: 64px;
75+
width: 64px;
76+
height: 64px;
77+
color: rgba(0, 0, 0, 0.38);
78+
margin-bottom: 24px;
79+
}
80+
81+
@media (prefers-color-scheme: dark) {
82+
.upgrade-required__icon {
83+
color: rgba(255, 255, 255, 0.38);
84+
}
85+
}
86+
87+
.upgrade-required__description {
88+
color: rgba(0, 0, 0, 0.64);
89+
margin-bottom: 24px;
90+
max-width: 400px;
91+
}
92+
93+
@media (prefers-color-scheme: dark) {
94+
.upgrade-required__description {
95+
color: rgba(255, 255, 255, 0.7);
96+
}
97+
}

frontend/src/app/components/sso/sso.component.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@
66

77
<app-placeholder-sso *ngIf="!company"></app-placeholder-sso>
88

9-
<div *ngIf="company" class="sso-page">
9+
<div *ngIf="company && !hasEnterprisePlan" class="sso-page">
10+
<div class="upgrade-required">
11+
<mat-icon class="upgrade-required__icon">lock</mat-icon>
12+
<h2 class="mat-h2">SAML SSO is available on Enterprise plan</h2>
13+
<p class="upgrade-required__description">
14+
Upgrade to enable SAML Single Sign-On for your organization.
15+
</p>
16+
<a mat-flat-button color="primary" routerLink="/upgrade">
17+
Upgrade to Enterprise
18+
</a>
19+
</div>
20+
</div>
21+
22+
<div *ngIf="company && hasEnterprisePlan" class="sso-page">
1023
<h1 class="mat-h1">SAML SSO Configuration</h1>
1124
<p class="sso-description">Configure SAML Single Sign-On for your organization.</p>
1225

frontend/src/app/components/sso/sso.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('SsoComponent', () => {
1616
name: 'Test Company',
1717
address: {},
1818
portal_link: '',
19-
subscriptionLevel: 'FREE_PLAN',
19+
subscriptionLevel: 'ENTERPRISE_PLAN',
2020
connections: [],
2121
invitations: [],
2222
is_payment_method_added: false,

0 commit comments

Comments
 (0)