Skip to content

Commit 3cc7098

Browse files
Merge pull request #975 from rocket-admin/mobile-version-dashboard
Mobile version dashboard
2 parents 57e891f + 9a55d78 commit 3cc7098

File tree

18 files changed

+247
-70
lines changed

18 files changed

+247
-70
lines changed

frontend/src/app/app.component.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
transition: outline 0.2s;
6060
}
6161

62+
@media (prefers-color-scheme: dark) {
63+
.nav-bar__button {
64+
color: #fff;
65+
}
66+
}
67+
6268
.nav-bar__account-button ::ng-deep .mat-badge-content {
6369
top: 14px;
6470
left: 32px;
@@ -81,6 +87,12 @@
8187
font-weight: 500 !important;
8288
}
8389

90+
@media (prefers-color-scheme: dark) {
91+
.nav-bar__button_active {
92+
--mdc-text-button-label-text-color: var(--color-accentedDarkPalette-500) !important;
93+
}
94+
}
95+
8496
@media screen and (max-width: 600px) {
8597
.nav-bar__button_active {
8698
color: inherit;

frontend/src/app/components/connect-db/connect-db.component.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@
181181
text-decoration: none;
182182
}
183183

184+
@media (prefers-color-scheme: dark) {
185+
.instruction-step__link {
186+
color: var(--color-accentedDarkPalette-500);
187+
}
188+
}
189+
184190
.instruction-step__link:hover {
185191
color: #FE5E85;
186192
text-decoration: underline;

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

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
max-width: 240px;
99
}
1010

11-
/* .mat-sidenav {
12-
padding-bottom: 16px;
13-
width: clamp(200px, 15%, 280px);
14-
} */
11+
@media (width <= 600px) {
12+
.table-list-sidenav {
13+
display: none;
14+
}
15+
}
1516

1617
.side-bar_collapsed {
1718
position: static;
@@ -25,7 +26,7 @@
2526

2627
@media (width <= 600px) {
2728
.side-bar_collapsed {
28-
margin-left: -65px;
29+
display: none;
2930
}
3031
}
3132

@@ -44,13 +45,6 @@
4445
margin-top: 24px;
4546
}
4647

47-
@media (width <= 600px) {
48-
.toggle-button-position {
49-
margin-bottom: -8px;
50-
margin-top: 0;
51-
}
52-
}
53-
5448
.toggle-button {
5549
background-color: var(--mat-sidenav-content-background-color);
5650
border-radius: 4px 0 0 4px !important;
@@ -60,13 +54,6 @@
6054
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);
6155
}
6256

63-
@media (width <= 600px) {
64-
.toggle-button {
65-
min-width: 0 !important;
66-
width: 36px !important;
67-
}
68-
}
69-
7057
.toggle-button::ng-deep .mat-button-wrapper {
7158
padding: 0;
7259
}
@@ -79,12 +66,6 @@
7966
margin-left: -2px;
8067
}
8168

82-
@media (width <= 600px) {
83-
.toggle-button-position__opened::ng-deep .material-icons {
84-
margin-right: -2px;
85-
}
86-
}
87-
8869
.toggle-button-position__closed::ng-deep .material-icons {
8970
margin-left: 2px;
9071
}
@@ -125,12 +106,6 @@
125106
overflow-x: hidden;
126107
}
127108

128-
@media (width <= 600px) {
129-
.table-preview {
130-
padding-top: 36px;
131-
}
132-
}
133-
134109
.table-preview-content {
135110
flex-grow: 1;
136111
width: 100%;
@@ -140,24 +115,3 @@
140115
display: none !important;
141116
}
142117

143-
@media (width <= 600px) {
144-
.sidenav-content__toggle-button {
145-
/* margin-top: 24px; */
146-
position: relative;
147-
margin-bottom: -36px;
148-
z-index: 2;
149-
}
150-
151-
.sidenav-content__toggle-button::ng-deep .material-icons {
152-
margin-right: -4px;
153-
}
154-
155-
.sidenav-content__toggle-button_shown-mobile {
156-
display: block !important;
157-
}
158-
159-
.sidenav-content__toggle-button_shown-mobile::ng-deep .material-icons {
160-
margin-left: -2px;
161-
}
162-
}
163-

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ <h3 class='mat-subheading-2'>Rocketadmin can not find any tables</h3>
8181
[connectionID]="connectionID"
8282
[isTestConnection]="currentConnectionIsTest"
8383
[accessLevel]="currentConnectionAccessLevel"
84+
[tables]="tablesList"
8485
(openFilters)="openTableFilters($event)"
8586
(removeFilter)="removeFilter($event)"
8687
(resetAllFilters)="clearAllFilters()"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
.location-link {
22
color: var(--color-accentedPalette-500);
3+
}
4+
5+
@media (prefers-color-scheme: dark) {
6+
.location-link {
7+
color: var(--color-accentedDarkPalette-500);
8+
}
39
}

frontend/src/app/components/dashboard/db-table-actions/db-table-actions.component.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@
116116
padding: 4px;
117117
}
118118

119+
@media (prefers-color-scheme: dark) {
120+
.text_highlighted {
121+
background: var(--color-accentedDarkPalette-200);
122+
color: var(--color-accentedDarkPalette-200-contrast);
123+
}
124+
}
125+
126+
119127
.event {
120128
display: flex;
121129
align-items: center;
@@ -151,6 +159,14 @@
151159
--mdc-list-list-item-focus-label-text-color: var(--color-accentedPalette-500);
152160
}
153161

162+
@media (prefers-color-scheme: dark) {
163+
.list-action-list-item_active {
164+
--mdc-list-list-item-label-text-color: var(--color-accentedDarkPalette-500);
165+
--mdc-list-list-item-hover-label-text-color: var(--color-accentedDarkPalette-500);
166+
--mdc-list-list-item-focus-label-text-color: var(--color-accentedDarkPalette-500);
167+
}
168+
}
169+
154170
/* .actions-icon-selector {
155171
display: flex;
156172
align-items: center;

frontend/src/app/components/dashboard/db-table-ai-panel/db-table-ai-panel.component.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
transition: width 400ms ease, transform 400ms ease, opacity 400ms ease;
99
}
1010

11+
@media (width <= 600px) {
12+
.ai-panel-sidebar {
13+
width: 100vw;
14+
z-index: 10;
15+
}
16+
}
17+
1118
.ai-panel-sidebar_open {
1219
opacity: 1;
1320
transform: translateX(24px);
@@ -34,6 +41,14 @@
3441
z-index: 0;
3542
}
3643

44+
@media (width <= 600px) {
45+
.ai-panel-sidebar-content {
46+
left: 0;
47+
width: 100vw;
48+
z-index: 5;
49+
}
50+
}
51+
3752
.ai-panel-sidebar__header {
3853
display: flex;
3954
align-items: center;
@@ -165,4 +180,10 @@
165180

166181
.link {
167182
color: var(--color-accentedPalette-500);
183+
}
184+
185+
@media (prefers-color-scheme: dark) {
186+
.link {
187+
color: var(--color-accentedDarkPalette-500);
188+
}
168189
}

frontend/src/app/components/dashboard/db-table/db-table.component.css

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,38 @@
3333
}
3434
}
3535

36-
.db-table-title .mat-h2 {
37-
margin-bottom: 0;
38-
margin-right: 8px;
36+
.table-name {
37+
margin-bottom: 0 !important;
38+
margin-right: 8px !important;
39+
}
40+
41+
@media (width <= 600px) {
42+
.table-name {
43+
display: none;
44+
}
45+
}
46+
47+
.table-switcher {
48+
display: none;
49+
}
50+
51+
@media (width <= 600px) {
52+
.table-switcher {
53+
display: initial;
54+
margin-top: 12px;
55+
}
56+
}
57+
58+
.table-switcher-option ::ng-deep .mdc-list-item__primary-text {
59+
width: 100%;
60+
}
61+
62+
.table-switcher-link {
63+
display: inline-block;
64+
color: inherit;
65+
line-height: 48px;
66+
text-decoration: none;
67+
width: 100%;
3968
}
4069

4170
.db-table-bulk-actions {
@@ -130,6 +159,12 @@
130159
pointer-events: none;
131160
}
132161

162+
@media (prefers-color-scheme: dark) {
163+
.ai-icon ::ng-deep svg path {
164+
fill: #fff;
165+
}
166+
}
167+
133168
.db-table-manage-columns-button {
134169
display: inline-block;
135170
}
@@ -452,6 +487,12 @@ tr.mat-row:hover {
452487
color: var(--color-accentedPalette-500);
453488
}
454489

490+
@media (prefers-color-scheme: dark) {
491+
.foreign-key-link {
492+
color: var(--color-accentedDarkPalette-500);
493+
}
494+
}
495+
455496
.empty-table {
456497
display: flex;
457498
flex-direction: column;

frontend/src/app/components/dashboard/db-table/db-table.component.html

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
<div class="db-table-header" #focus>
22
<div class="db-table-title">
3-
<h2 class="mat-h2">{{ displayName }}</h2>
3+
<h2 class="mat-h2 table-name">{{ displayName }}</h2>
4+
5+
<mat-form-field appearance="outline" class="table-switcher">
6+
<mat-label>Table</mat-label>
7+
<input type="text"
8+
placeholder="Select a table"
9+
matInput
10+
[value]="name"
11+
[matAutocomplete]="auto"
12+
(focus)="onInputFocus()"
13+
(input)="onInput($event.target.value)">
14+
<mat-autocomplete autoActiveFirstOption
15+
#auto="matAutocomplete">
16+
<mat-option *ngFor="let table of filteredTables"
17+
class="table-switcher-option"
18+
[value]="table.table">
19+
<a class="table-switcher-link"
20+
routerLink="/dashboard/{{connectionID}}/{{table.table}}"
21+
[queryParams]="{page_index: 0, page_size: 30}">
22+
{{table.normalizedTableName}}
23+
</a>
24+
</mat-option>
25+
</mat-autocomplete>
26+
</mat-form-field>
427

528
<button mat-icon-button (click)="loadRowsPage()">
629
<mat-icon>refresh</mat-icon>
@@ -42,8 +65,8 @@ <h2 class="mat-h2">{{ displayName }}</h2>
4265
angulartics2On="click"
4366
angularticsAction="Dashboard: AI is clicked"
4467
(click)="handleViewAIpanel()">
45-
<mat-icon svgIcon="ai_rocket"></mat-icon>
46-
AI
68+
<mat-icon svgIcon="ai_rocket" class="ai-icon"></mat-icon>
69+
AI insights
4770
</button>
4871

4972
<a mat-button *ngIf="tableData && tableData.permissions && tableData.permissions.add && (!tableData.isEmptyTable || searchString || getFiltersCount(activeFilters))"

0 commit comments

Comments
 (0)