Skip to content

Commit 0eb35d2

Browse files
merge main and update sidebar collapse UI
1 parent 9fc922a commit 0eb35d2

6 files changed

Lines changed: 21 additions & 44 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
.addConnectionLink {
5555
display: flex;
5656
align-items: center;
57-
gap: 8px;
57+
gap: 6px;
5858
border-radius: 4px;
5959
box-shadow:
6060
0px 1px 3px 0px rgba(0, 0, 0, 0.2),
@@ -63,7 +63,7 @@
6363
color: inherit;
6464
font-weight: 600;
6565
height: 48px;
66-
padding-left: 4px;
66+
padding-left: 6px;
6767
text-decoration: none;
6868
transition: box-shadow 200ms, background 200ms, border 200ms;
6969
}

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

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,12 @@
5050

5151
.toggle-button-position {
5252
display: flex;
53-
justify-content: flex-end;
54-
margin-bottom: -48px;
53+
justify-content: center;
5554
margin-top: 24px;
5655
}
5756

58-
.toggle-button {
59-
background-color: var(--mat-sidenav-content-background-color);
60-
border-radius: 4px 0 0 4px !important;
61-
color: inherit;
62-
line-height: 24px;
63-
min-width: 52px !important;
64-
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.1),0px 6px 8px 0px rgba(0, 0, 0, 0.07),0px 1px 8px 0px rgba(0, 0, 0, 0.06);
65-
}
66-
67-
.toggle-button::ng-deep .mat-button-wrapper {
68-
padding: 0;
69-
}
70-
71-
.toggle-button::ng-deep .material-icons {
72-
line-height: 22px;
73-
}
74-
75-
.toggle-button-position__opened::ng-deep .material-icons {
76-
margin-left: -2px;
77-
}
78-
79-
.toggle-button-position__closed::ng-deep .material-icons {
80-
margin-left: 2px;
57+
.toggle-button_opened {
58+
width: calc(100% - 32px);
8159
}
8260

8361
.dashboard {

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,31 @@ <h3 class='mat-subheading-2'>Rocketadmin can not find any tables</h3>
4747
<mat-sidenav #sideList mode="side" [(opened)]="shownTableTitles"
4848
class="table-list-sidenav"
4949
[ngClass]="{'side-bar_collapsed': !shownTableTitles}">
50-
<div class="toggle-button-position"
51-
[ngClass]="(shownTableTitles)?'toggle-button-position__opened':'toggle-button-position__closed'">
52-
<button mat-button type="button" class="toggle-button" (click)="toggleSideBar()"
50+
<div class="toggle-button-position">
51+
<button mat-button type="button" *ngIf="shownTableTitles; else collapsedButton"
52+
class="toggle-button_opened"
53+
(click)="toggleSideBar()"
5354
angulartics2On="click"
5455
angularticsAction="Dashboard: toggle sidebar"
5556
[angularticsProperties]="{'collapsed': !shownTableTitles}">
56-
<mat-icon>{{ shownTableTitles ? 'chevron_left' : 'chevron_right' }} </mat-icon>
57+
Collapse
58+
<mat-icon>chevron_left</mat-icon>
5759
</button>
60+
61+
<ng-template #collapsedButton>
62+
<button mat-icon-button type="button"
63+
(click)="toggleSideBar()"
64+
angulartics2On="click"
65+
angularticsAction="Dashboard: toggle sidebar"
66+
[angularticsProperties]="{'collapsed': !shownTableTitles}">
67+
<mat-icon>chevron_right</mat-icon>
68+
</button>
69+
</ng-template>
5870
</div>
5971
<app-db-tables-list
6072
[collapsed]="!shownTableTitles"
6173
[tables]="tablesList"
6274
[connectionID]="connectionID"
63-
[connectionTitle]="currentConnectionTitle"
6475
[selectedTable]="selectedTableName">
6576
</app-db-tables-list>
6677
</mat-sidenav>

frontend/src/app/components/dashboard/dashboard.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
120120
return this._connections.currentConnectionAccessLevel
121121
}
122122

123-
get currentConnectionTitle () {
124-
return this._connections.currentConnection.title || this._connections.currentConnection.database || 'Tables'
125-
}
126-
127123
get currentConnectionIsTest () {
128124
return this._connections.currentConnection.isTestConnection
129125
}

frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
<div class="sidenav-header">
2-
<mat-icon *ngIf="collapsed; else tableHeader">table_view</mat-icon>
3-
<ng-template #tableHeader>
4-
<h1 class="mat-h2 connection-title">{{connectionTitle}}</h1>
5-
</ng-template>
6-
</div>
7-
81
<app-content-loader *ngIf="tables === null; else tablesList"></app-content-loader>
92

103
<ng-template #tablesList>

frontend/src/app/components/dashboard/db-tables-list/db-tables-list.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { TableStateService } from 'src/app/services/table-state.service';
3030
})
3131
export class DbTablesListComponent {
3232
@Input() connectionID: string;
33-
@Input() connectionTitle: string;
3433
@Input() tables: TableProperties[];
3534
@Input() selectedTable: string;
3635
@Input() collapsed: boolean;

0 commit comments

Comments
 (0)