Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,22 @@
margin-bottom: 16px;
}

.related-records__title {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px 0 16px;
.related-records-panel {
margin-left: 4px;
width: calc(100% - 8px);
}

.related-records__title h3 {
margin: 0 !important;
.related-records-panel__header {
height: 36px !important;
padding: 0 12px 0 8px;
}

.related-records__toggle_open {
transform: rotate(180deg);
transition: transform 200ms ease;
}

.related-records__accordion {
display: block;
margin-left: 8px;
margin-bottom: 16px;
width: calc(100% - 16px);
.related-records-panel ::ng-deep .mat-expansion-panel-body {
padding: 0;
}

.related-records__header {
padding: 0 8px;
padding: 0 12px 0 8px;
}

.related-records__table-name {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ <h2 class="mat-heading-2 row-preview-sidebar__title">Preview</h2>

<br />

<div *ngIf="selectedRow?.relatedRecords?.referenced_by?.length">
<div class="related-records__title">
<h3 class="mat-heading-3">Related records</h3>
<button mat-icon-button type="button"
(click)="toggleReferencedRecords()">
<mat-icon [ngClass]="{'related-records__toggle_open': referencedRecordsShown}">keyboard_arrow_down</mat-icon>
</button>
</div>
<mat-accordion multi="true" *ngIf="referencedRecordsShown" class="related-records__accordion">
<mat-expansion-panel *ngIf="selectedRow?.relatedRecords?.referenced_by?.length" class="related-records-panel">
<mat-expansion-panel-header class="related-records-panel__header">
Related records
</mat-expansion-panel-header>

<mat-accordion multi="true">
<mat-expansion-panel *ngFor="let referencedTable of referencedTables; let i = index" class="related-records__panel">
<mat-expansion-panel-header class="related-records__header">
<mat-panel-title class="related-records__table-name"> {{referencedTable.displayTableName}} </mat-panel-title>
Expand Down Expand Up @@ -70,7 +67,7 @@ <h3 class="mat-heading-3">Related records</h3>
</mat-nav-list>
</mat-expansion-panel>
</mat-accordion>
</div>
</mat-expansion-panel>

<div *ngIf="!selectedRow?.relatedRecords?.referenced_by">
<div class="skeleton loading-related-records">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export class DbTableRowViewComponent implements OnInit, OnDestroy {
public referencedTables: { table_name: string; displayTableName: string; columns: string[] }[] = [];
public referencedTablesURLParams: any;
public referencedRecords: {} = {};
public referencedRecordsShown: boolean = false;

constructor(
private _tables: TablesService,
Expand Down Expand Up @@ -168,10 +167,6 @@ export class DbTableRowViewComponent implements OnInit, OnDestroy {
this.selectedRowCast.unsubscribe();
}

toggleReferencedRecords() {
this.referencedRecordsShown = !this.referencedRecordsShown;
}

isForeignKey(columnName: string) {
return this.selectedRow.foreignKeysList.includes(columnName);
}
Expand Down Expand Up @@ -217,6 +212,8 @@ export class DbTableRowViewComponent implements OnInit, OnDestroy {
} else {
this._tableState.setBackUrlFilters(null);
}

this._tableState.clearSelection();
}

handleClose() {
Expand Down