Skip to content

Commit d6a16b2

Browse files
Merge pull request #1138 from rocket-admin/fixes
Fixes
2 parents e8ff741 + 153cfab commit d6a16b2

10 files changed

Lines changed: 252 additions & 180 deletions

frontend/src/app/app-routing.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { UpgradeSuccessComponent } from './components/upgrade-success/upgrade-su
2929
import { UserDeletedSuccessComponent } from './components/user-deleted-success/user-deleted-success.component';
3030
import { UserSettingsComponent } from './components/user-settings/user-settings.component';
3131
import { UsersComponent } from './components/users/users.component';
32+
import { ZapierComponent } from './components/zapier/zapier.component';
3233

3334
const routes: Routes = [
3435
{path: '', redirectTo: '/connections-list', pathMatch: 'full'},
@@ -60,6 +61,7 @@ const routes: Routes = [
6061
{path: 'dashboard/:connection-id/:table-name/settings', pathMatch: 'full', component: DbTableSettingsComponent, canActivate: [AuthGuard]},
6162
{path: 'dashboard/:connection-id/:table-name/actions', pathMatch: 'full', component: DbTableActionsComponent, canActivate: [AuthGuard]},
6263
{path: 'permissions/:connection-id', component: UsersComponent, canActivate: [AuthGuard]},
64+
{path: 'zapier', component: ZapierComponent, canActivate: [AuthGuard]},
6365
{path: '**', component: PageNotFoundComponent},
6466
];
6567

frontend/src/app/components/connection-settings/connection-settings.component.html

Lines changed: 140 additions & 149 deletions
Large diffs are not rendered by default.

frontend/src/app/components/connection-settings/connection-settings.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ import { normalizeTableName } from '../../lib/normalize'
2323
import { BannerComponent } from '../ui-components/banner/banner.component';
2424
import { PlaceholderConnectionSettingsComponent } from '../skeletons/placeholder-connection-settings/placeholder-connection-settings.component';
2525
import { AlertComponent } from '../ui-components/alert/alert.component';
26-
import { ZapierComponent } from './zapier/zapier.component';
27-
import { MatTabsModule } from '@angular/material/tabs';
26+
2827
import { CompanyService } from 'src/app/services/company.service';
2928

3029
@Component({
@@ -33,7 +32,6 @@ import { CompanyService } from 'src/app/services/company.service';
3332
styleUrls: ['./connection-settings.component.css'],
3433
imports: [
3534
CommonModule,
36-
MatTabsModule,
3735
FormsModule,
3836
MatFormFieldModule,
3937
MatInputModule,
@@ -45,8 +43,7 @@ import { CompanyService } from 'src/app/services/company.service';
4543
BannerComponent,
4644
PlaceholderConnectionSettingsComponent,
4745
AlertComponent,
48-
Angulartics2Module,
49-
ZapierComponent
46+
Angulartics2Module
5047
]
5148
})
5249
export class ConnectionSettingsComponent implements OnInit {

frontend/src/app/components/connection-settings/zapier/zapier.component.css

Whitespace-only changes.

frontend/src/app/components/connections-list/connections-list.component.css

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030

3131
.pageTitleHeader {
3232
position: relative;
33-
align-self: center;
33+
text-align: center;
3434
margin-bottom: 54px;
35+
width: 100%;
3536
}
3637

3738
@media (width <= 600px) {
@@ -41,6 +42,11 @@
4142
}
4243

4344
.pageTitleHeader .pageTitle {
45+
position: relative;
46+
display: inline-block;
47+
}
48+
49+
.pageTitleHeader .pageTitle__name {
4450
font-weight: 600;
4551
margin-bottom: 0;
4652
}
@@ -60,7 +66,7 @@
6066
}
6167
}
6268

63-
.pageTitleHeader:hover .companyEditLink {
69+
.pageTitle:hover .companyEditLink {
6470
opacity: 1;
6571
}
6672

@@ -99,15 +105,56 @@
99105
height: 40px;
100106
}
101107

102-
.fabAddButton {
108+
.fabActions {
109+
display: flex;
110+
align-items: center;
111+
gap: 12px;
103112
align-self: flex-end;
113+
margin-top: 20px;
114+
}
115+
116+
.zapier-link {
117+
display: flex;
118+
align-items: center;
119+
justify-content: center;
120+
gap: 4px;
121+
border: 1px solid rgba(0, 0, 0, 0.12);
122+
border-radius: 24px;
123+
box-shadow:
124+
0px 1px 10px 0px rgba(0, 0, 0, 0.08),
125+
0px 4px 5px 0px rgba(0, 0, 0, 0.05),
126+
0px 2px 4px 0px rgba(0, 0, 0, 0.06);
127+
color: var(--color-accentedPalette-500);
128+
text-decoration: none;
129+
height: 48px;
130+
padding: 8px;
131+
width: 140px;
132+
}
133+
134+
.zapier-link__caption {
135+
font-size: 12px;
136+
}
137+
138+
.zapier-link__logo {
139+
border-radius: 8px;
140+
height: 32px;
141+
width: 32px;
142+
}
143+
144+
.zapier-link__icon {
145+
color: var(--mat-sidenav-content-text-color);
146+
font-size: 16px;
147+
height: 16px;
148+
width: 16px;
149+
}
150+
151+
.fabAddButton {
104152
border-radius: 24px;
105153
box-shadow:
106154
0px 1px 10px 0px rgba(0, 0, 0, 0.2),
107155
0px 4px 5px 0px rgba(0, 0, 0, 0.12),
108156
0px 2px 4px 0px rgba(0, 0, 0, 0.14);
109157
height: 48px !important;
110-
margin-top: 20px;
111158
width: 178px;
112159
}
113160

frontend/src/app/components/connections-list/connections-list.component.html

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
<app-alert></app-alert>
22
<div class="wrapper">
3-
<div *ngIf="companyName" class="pageTitleHeader">
4-
<h1 class="mat-headline-4 pageTitle">{{companyName}}</h1>
5-
<a mat-icon-button *ngIf="currentUser.role === 'ADMIN'"
6-
routerLink="/company"
7-
class="companyEditLink">
8-
<mat-icon>edit</mat-icon>
9-
</a>
3+
<div *ngIf="companyName; else companyNameLoader" class="pageTitleHeader">
4+
<div class="pageTitle">
5+
<h1 class="mat-headline-4 pageTitle__name">{{companyName}}</h1>
6+
<a mat-icon-button *ngIf="currentUser.role === 'ADMIN'"
7+
routerLink="/company"
8+
class="companyEditLink">
9+
<mat-icon>edit</mat-icon>
10+
</a>
11+
</div>
12+
1013
</div>
14+
<ng-template #companyNameLoader>
15+
<div class="skeleton" style="width: auto;">
16+
<div class="bone" style="height: 40px; width: 18vw; margin-bottom: 54px;"></div>
17+
</div>
18+
</ng-template>
1119

1220
<ng-container *ngIf="connections; else loader">
1321
<div *ngIf="!connections.length && connections !== null" class="empty-state">
@@ -185,16 +193,40 @@ <h2 class="connectionInfo__connectionTitle">{{ titles[connectionItem.connection.
185193
Show less
186194
</button>
187195

188-
<a mat-flat-button *ngIf="currentUser.role === 'ADMIN' || currentUser.role === 'DB_ADMIN'"
189-
data-testid="add-connection-button"
190-
color="primary"
191-
[ngClass]="connections.length ? 'fabAddButton' : 'addButton'"
192-
routerLink="/connect-db"
193-
angulartics2On="click"
194-
angularticsAction="Connections: Add connection button is clicked">
195-
<mat-icon *ngIf="connections?.length">add</mat-icon>
196-
Add database
197-
</a>
196+
<div [ngClass]="connections.length ? 'fabActions' : null">
197+
<a routerLink="/zapier" *ngIf="connections.length && (currentUser.role === 'ADMIN' || currentUser.role === 'DB_ADMIN')" class="zapier-link">
198+
<svg class="zapier-link__logo" width="401" height="400" viewBox="0 0 401 400" fill="none" xmlns="http://www.w3.org/2000/svg">
199+
<rect x="0.526367" width="400" height="400" fill="#FF4F00"/>
200+
<rect x="0.526367" width="400" height="400" rx="200" fill="#FF4F00"/>
201+
<path d="M56.8003 220.362L56.7432 220.181L92.8062 187.166V171.258H34.9491V187.166H69.5072L69.5643 187.318L33.8536 220.362V236.269H93.3873V220.362H56.8003Z" fill="#FFFDF9"/>
202+
<path d="M128.897 169.748C122.223 169.748 116.784 170.754 112.58 172.767C108.664 174.522 105.365 177.412 103.112 181.064C100.956 184.74 99.6023 188.83 99.1397 193.066L116.695 195.533C117.33 191.793 118.6 189.142 120.505 187.579C122.671 185.946 125.339 185.12 128.049 185.246C131.612 185.246 134.196 186.198 135.803 188.103C137.394 190.008 138.203 192.647 138.203 196.124V197.857H121.324C112.732 197.857 106.56 199.762 102.807 203.573C99.0539 207.383 97.1806 212.412 97.1869 218.661C97.1869 225.062 99.0603 229.825 102.807 232.949C106.554 236.073 111.265 237.626 116.943 237.607C123.985 237.607 129.402 235.184 133.193 230.339C135.432 227.361 137.031 223.953 137.889 220.328H138.527L140.947 236.235H156.854V195.952C156.854 187.627 154.66 181.178 150.272 176.606C145.884 172.034 138.759 169.748 128.897 169.748ZM134.46 219.404C131.935 221.509 128.63 222.557 124.515 222.557C121.124 222.557 118.768 221.963 117.447 220.775C116.804 220.214 116.292 219.517 115.948 218.735C115.604 217.953 115.436 217.105 115.457 216.251C115.419 215.445 115.546 214.641 115.829 213.886C116.112 213.131 116.546 212.442 117.105 211.86C117.708 211.294 118.42 210.856 119.198 210.572C119.976 210.289 120.803 210.166 121.629 210.212H138.232V211.307C138.265 212.856 137.943 214.391 137.289 215.795C136.635 217.199 135.667 218.433 134.46 219.404Z" fill="#FFFDF9"/>
203+
<path d="M253.012 171.258H234.218V236.279H253.012V171.258Z" fill="#FFFDF9"/>
204+
<path d="M364.046 171.258C358.738 171.258 354.553 173.132 351.492 176.878C349.295 179.571 347.625 183.549 346.482 188.814H345.929L343.472 171.258H327.421V236.269H346.215V202.93C346.215 198.726 347.199 195.504 349.168 193.262C351.136 191.02 354.769 189.9 360.065 189.9H367.199V171.258H364.046Z" fill="#FFFDF9"/>
205+
<path d="M308.708 173.379C304.32 170.769 298.786 169.468 292.106 169.474C281.59 169.474 273.36 172.468 267.416 178.456C261.472 184.445 258.5 192.7 258.5 203.222C258.349 209.584 259.738 215.888 262.548 221.597C265.121 226.684 269.128 230.906 274.074 233.742C279.053 236.618 284.974 238.06 291.839 238.066C297.777 238.066 302.736 237.152 306.718 235.323C310.461 233.68 313.721 231.106 316.186 227.845C318.533 224.645 320.277 221.042 321.33 217.215L305.136 212.681C304.455 215.17 303.143 217.44 301.326 219.273C299.497 221.101 296.433 222.016 292.134 222.016C287.022 222.016 283.212 220.552 280.704 217.625C278.884 215.51 277.741 212.491 277.237 208.576H321.577C321.758 206.747 321.853 205.213 321.853 203.975V199.927C321.961 194.488 320.837 189.096 318.567 184.152C316.442 179.649 313.006 175.894 308.708 173.379ZM291.563 184.972C299.183 184.972 303.504 188.721 304.527 196.221H277.57C277.998 193.719 279.035 191.36 280.589 189.353C283.06 186.426 286.717 184.965 291.563 184.972Z" fill="#FFFDF9"/>
206+
<path d="M243.839 145.056C242.425 145.007 241.016 145.244 239.695 145.751C238.374 146.259 237.169 147.026 236.151 148.009C235.147 149 234.36 150.19 233.841 151.502C233.321 152.814 233.079 154.22 233.131 155.63C233.081 157.049 233.323 158.464 233.843 159.785C234.364 161.107 235.151 162.307 236.155 163.311C237.16 164.315 238.361 165.101 239.683 165.62C241.005 166.139 242.42 166.38 243.839 166.328C245.249 166.381 246.655 166.14 247.967 165.62C249.28 165.1 250.469 164.313 251.46 163.308C252.443 162.293 253.211 161.089 253.717 159.77C254.222 158.45 254.456 157.042 254.404 155.63C254.469 154.226 254.24 152.824 253.733 151.513C253.226 150.203 252.451 149.012 251.457 148.018C250.464 147.024 249.274 146.248 247.964 145.74C246.654 145.231 245.243 144.992 243.839 145.056Z" fill="#FFFDF9"/>
207+
<path d="M205.013 169.474C198.612 169.474 193.469 171.484 189.582 175.503C186.706 178.482 184.594 182.927 183.248 188.839H182.648L180.19 171.284H164.14V254.955H182.934V220.492H183.619C184.193 222.79 184.997 225.024 186.02 227.16C187.61 230.639 190.217 233.555 193.497 235.523C196.899 237.379 200.73 238.302 204.604 238.199C212.472 238.199 218.463 235.135 222.578 229.008C226.693 222.88 228.751 214.329 228.751 203.356C228.751 192.757 226.76 184.46 222.778 178.466C218.797 172.471 212.875 169.474 205.013 169.474ZM206.919 216.586C204.728 219.761 201.299 221.349 196.631 221.349C194.707 221.438 192.789 221.067 191.036 220.267C189.284 219.467 187.747 218.261 186.553 216.748C184.121 213.694 182.908 209.512 182.915 204.203V202.965C182.915 197.574 184.127 193.446 186.553 190.582C188.979 187.718 192.338 186.302 196.631 186.334C201.381 186.334 204.832 187.842 206.985 190.858C209.138 193.875 210.214 198.082 210.214 203.479C210.227 209.061 209.135 213.43 206.938 216.586H206.919Z" fill="#FFFDF9"/>
208+
</svg>
209+
<mat-icon fontSet="material-icons-outlined" class="zapier-link__icon">keyboard_double_arrow_right</mat-icon>
210+
<svg class="zapier-link__logo" width="240" height="240" viewBox="0 0 240 240" fill="none" xmlns="http://www.w3.org/2000/svg">
211+
<rect width="240" height="240" transform="translate(0 0.000976562)" fill="#A664DA"/>
212+
<path d="M176.214 93.941H140.892C135.682 93.941 133.099 90.0115 135.13 85.2209L147.846 55.3742C150.738 48.5968 147.074 43.0557 139.7 43.0557H106.763C103.54 43.0557 99.8749 45.484 98.6166 48.4422L83.3178 84.3601C80.7791 90.2985 84.0022 95.1552 90.4484 95.1552H124.225C127.956 95.1552 131.333 97.3849 132.79 100.807L147.846 136.128C149.899 140.941 147.294 144.871 142.084 144.871H63.3831C60.16 144.871 56.4954 147.299 55.2371 150.257L40.5785 184.63C37.6866 191.407 41.3512 196.948 48.7246 196.948H125.329C128.552 196.948 132.216 194.52 133.475 191.562L150.517 151.56C151.952 148.204 155.22 146.041 158.862 146.041H192.131C198.82 146.041 202.131 141.007 199.504 134.87L184.36 99.3497C183.102 96.3915 179.437 93.9631 176.214 93.9631V93.941Z" fill="white"/>
213+
</svg>
214+
215+
</a>
216+
217+
<a mat-flat-button *ngIf="currentUser.role === 'ADMIN' || currentUser.role === 'DB_ADMIN'"
218+
data-testid="add-connection-button"
219+
color="primary"
220+
[ngClass]="connections.length ? 'fabAddButton' : 'addButton'"
221+
routerLink="/connect-db"
222+
angulartics2On="click"
223+
angularticsAction="Connections: Add connection button is clicked">
224+
<mat-icon *ngIf="connections?.length">add</mat-icon>
225+
Add database
226+
</a>
227+
</div>
228+
229+
198230

199231
<div *ngIf="!connections.length && connections !== null" class="empty-state_bottom">
200232
<p class="mat-body-1 empty-state__text">
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.zapier-page {
2+
padding: 32px max(calc(50vw - 325px), 10%);
3+
}

frontend/src/app/components/connection-settings/zapier/zapier.component.html renamed to frontend/src/app/components/zapier/zapier.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div>
1+
<div class="zapier-page">
22
<zapier-workflow
33
[signUpEmail]="currentUser.email"
44
[clientId]='"4MFV3OrjI8e8JkZPySqbFVbKtZUz0sV0H3XJnb6w"'

frontend/src/app/components/connection-settings/zapier/zapier.component.spec.ts renamed to frontend/src/app/components/zapier/zapier.component.spec.ts

File renamed without changes.

frontend/src/app/components/connection-settings/zapier/zapier.component.ts renamed to frontend/src/app/components/zapier/zapier.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { CommonModule } from '@angular/common';
2-
import { Component, CUSTOM_ELEMENTS_SCHEMA, OnInit } from '@angular/core';
1+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
2+
33
import { User } from '@sentry/angular-ivy';
44
import { UserService } from 'src/app/services/user.service';
55

66
@Component({
77
selector: 'app-zapier',
8+
imports: [],
89
templateUrl: './zapier.component.html',
910
styleUrl: './zapier.component.css',
10-
imports: [CommonModule],
1111
schemas: [CUSTOM_ELEMENTS_SCHEMA],
1212
})
13-
export class ZapierComponent implements OnInit {
13+
export class ZapierComponent {
1414
public currentUser: User;
1515

1616
constructor(

0 commit comments

Comments
 (0)