Skip to content

Commit cbcb83d

Browse files
Merge pull request #1172 from rocket-admin/url-widget-table-view
Url widget table view
2 parents cab53ac + 6e2ce00 commit cbcb83d

4 files changed

Lines changed: 35 additions & 10 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
display: flex;
309309
align-items: center;
310310
background-color: rgba(0,0,0,0.04);
311-
color: rgba(0,0,0,0.87);
311+
color: rgba(0,0,0,0.64);
312312
padding: 8px 16px;
313313
}
314314

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ <h1 class="mat-h1">Rules</h1>
1212
</button>
1313
</div>
1414
<div class="no-actions" *ngIf="rulesData && rules && rules.length === 0 && !newRule">
15-
<button mat-stroked-button color="primary" type="button"
16-
angulartics2On="click"
17-
angularticsAction="Actions: add action is clicked"
18-
(click)="addNewRule()">
19-
<mat-icon>add</mat-icon>
20-
Add first rule
21-
</button>
15+
<span>No added rules</span>
2216
</div>
2317
<mat-action-list *ngIf="rulesData && rules && rules.length">
2418
<button mat-list-item *ngFor="let rule of rules; let i = index"
@@ -198,6 +192,12 @@ <h1 class="mat-h1">Rules</h1>
198192
<strong class="actions-hint__title">Configure custom triggers and actions for database records</strong>
199193
<span class="actions-hint__text">React to standard operations like create, update, delete, or define your own.</span>
200194
</p>
195+
<button mat-flat-button color="accent"
196+
angulartics2On="click"
197+
angularticsAction="Actions: add first action is clicked"
198+
(click)="addNewRule()">
199+
Add first rule
200+
</button>
201201
<div class="rules-examples">
202202
<div class="rule-example">
203203
<div class="rule-example__row">

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,24 @@ th.mat-header-cell, td.mat-cell {
468468
margin: 12px 0;
469469
}
470470

471+
.field-link {
472+
display: flex;
473+
align-items: center;
474+
gap: 4px;
475+
color: var(--color-primaryPalette-500);
476+
}
477+
478+
.field-link__icon {
479+
flex-shrink: 0;
480+
margin-bottom: -2px;
481+
width: 16px;
482+
height: 16px;
483+
font-size: 16px;
484+
}
485+
471486
.field-value-copy-button {
472487
position: absolute;
473-
right: 0;
488+
right: -6px;
474489
top: 50%;
475490
display: none;
476491
transform: translate(0, -50%) scale(0.85);

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,17 @@ <h2 class="mat-h2 table-name">{{ displayName }}</h2>
238238
[style.--height.px]="tableData.widgets[column].widget_params.height"
239239
class="field-image">
240240

241-
<span>{{ getWidgetValue(column, element[column]) }}</span>
241+
<a *ngIf="tableData.widgets[column].widget_type === 'URL' && element[column]"
242+
target="_blank"
243+
[href]="element[column]"
244+
class="field-link"
245+
(click)="$event.stopPropagation()"
246+
>
247+
<mat-icon class="field-link__icon" fontSet="material-icons-outlined">link</mat-icon>
248+
<span>{{element[column]}}</span>
249+
</a>
250+
251+
<span *ngIf="tableData.widgets[column].widget_type !== 'URL'">{{ getWidgetValue(column, element[column]) }}</span>
242252

243253
<button type="button" mat-icon-button
244254
class="field-value-copy-button"

0 commit comments

Comments
 (0)