Skip to content

Commit

Permalink
#627 bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arawinters committed May 28, 2024
1 parent cc481f9 commit 4e54454
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/scss/data-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ sz-cross-source-results {
border: none;
font-size: 8px;
color: var(--sz-sample-table-cell-color);
background-color: rgb(255 255 255 / 37%);
background-color: rgb(255 255 255 / 30%);
/*border-top: 1px solid #bdbdbd;*/
width: 100%;
/*text-align: left;*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
[cdkContextMenuTriggerData]="{$implicit: {cell: cellRef, row: rowRef, col: col, cellData: rowQ[col.key], rowData: rowQ, entityData: row}}"
(click)="onCellClick(col.key, rowQ[col.key], $event, cellRef)"
>
<div *ngIf="col.key === 'entityId' && recordIndex === 0" class="cell-content"
<div *ngIf="col.key === 'entityId'" class="cell-content"
matTooltip="Click to view Entity Detail page"
matTooltipPosition="right"
[innerHTML]="cellValue(row[col.key], col.key)" [attr.cell-key]="col.key"></div>
Expand Down Expand Up @@ -313,7 +313,7 @@
(click)="onCellClick(col.key, rowY[col.key], $event, cellRef)"
>
<div class="cell-content"
*ngIf="col.key === 'entityId' || (col.key === 'relatedEntityId' && recordIndex === 0)"
*ngIf="col.key === 'entityId' || (col.key === 'relatedEntityId')"
matTooltip="Click to view Entity Detail page"
[matTooltipPosition]="col.key === 'entityId' ? 'right':'above'"
[innerHTML]="cellValue(row.relatedEntity[col.key], col.key)" [attr.cell-key]="col.key"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@
.sz-dt-entity-id-cell {
display: none;
}
/* by default hide all "relatedEntityId" content cells */
.sz-dt-related-entity-id-cell .cell-content {
display: none;
}

.row-related-record .sz-dt-entity-id-cell .cell-content {
display: none;
}

/**
Sometimes the very first visible row is not the same thing as the first row
Expand All @@ -293,18 +301,37 @@

.sz-dt-entity-id-cell {
grid-row: span var(--selected-datasources-related-row-count);
display: grid;
display: block;
}
/* show the content only in the very first visible cell */
.sz-dt-related-entity-id-cell .cell-content {
display: block;
}
}
&.expanded {
/* first unset the row-span(s) for "first row in selected datasources"*/
:nth-child(1 of .data-source-selected),
:nth-child(1 of .row-related-record.data-source-selected) {
.sz-dt-entity-id-cell { grid-row: unset; }
.sz-dt-entity-id-cell {
/* by default hide all the "entityId" cells (we'll enable just the first one below) */
grid-row: unset;
display: none;
}
.sz-dt-related-entity-id-cell .cell-content {
display: none;
}
}
.row-record .sz-dt-entity-id-cell {
display: none;
}
/* by default hide all "relatedEntityId" content elements (well enable just the fist one below */
/*
.row-record .sz-dt-related-entity-id-cell {
.cell-content {
display: none;
}
}*/

/* since everything should be visible now just apply the rowspan to the
first row entity id cell*/
.row-record:first-child {
Expand All @@ -317,10 +344,28 @@
* related record entity id cell */
:nth-child(1 of .row-related-record) .sz-dt-entity-id-cell {
grid-row: span var(--related-row-count) !important;
display: grid !important;
}
/* now show the "relatedEntityId" content for just the first row */
:nth-child(1 of .row-related-record) .sz-dt-related-entity-id-cell .cell-content {
display: block;
}
}

.sz-dt-entity-id-cell {
.cell-content {
/*color: var(--sz-sample-dt-primary-color);*/
font-size: 16px;
font-weight: bold;
align-items: center;
text-align: center;

&:hover {
text-decoration: underline;
cursor: pointer;
}
}

.more-button {
font-size: 10px;
height: 22px;
Expand Down Expand Up @@ -406,6 +451,24 @@
}
tr:first-child td {
border-top: 2px solid #666 !important;
.sz-dt-entity-id-cell {
/*grid-row: span var(--selected-datasources-entity-row-count);*/
max-height: unset;
border-bottom: none;
.cell-content {
/*color: var(--sz-sample-dt-primary-color);*/
font-size: 16px;
font-weight: bold;
align-items: center;
text-align: center;

&:hover {
text-decoration: underline;
cursor: pointer;
}
}

}
}
.row-record:nth-child(even) td {
/*background-color: #f2f2f2;*/
Expand Down Expand Up @@ -434,6 +497,17 @@
.row-record.data-source-not-selected {
display: contents;
}
:nth-child(1 of .row-related-record) {
.sz-dt-entity-id-cell {
overflow: visible;
/* when the more button is in the lower cell we want to straddle the line */
.more-button {
position: absolute;
top: -13px;
margin-top: 0px;
}
}
}

}
&:nth-of-type(1) tr {
Expand Down

0 comments on commit 4e54454

Please sign in to comment.