feat: show dsnote on hover title
Build / Build-and-ng-test (pull_request) Failing after 18s Details

This commit is contained in:
Sabir Hassan 2024-02-12 11:30:59 +05:00
parent 837821fd01
commit 6565834ad4
4 changed files with 102 additions and 42 deletions

View File

@ -186,24 +186,37 @@
} as libdsParsed"
class="editor-title text-center mt-0-i"
>
<clr-icon
(click)="datasetInfo = true"
shape="info-circle"
class="is-highlight cursor-pointer"
size="24"
></clr-icon>
<clr-tooltip>
<clr-icon
clrTooltipTrigger
(click)="datasetInfo = true"
shape="info-circle"
class="is-highlight cursor-pointer"
size="24"
></clr-icon>
<clr-icon
*ngIf="libdsParsed.tableName.includes('-FC')"
shape="bolt"
class="color-yellow"
></clr-icon>
<clr-icon
*ngIf="libdsParsed.tableName.includes('-FC')"
shape="bolt"
class="color-yellow"
></clr-icon>
<span clrTooltipTrigger>
{{ libdsParsed.libName }}.<a
class="mr-10"
[routerLink]="'/view/data/' + libds!"
>{{ libdsParsed.tableName.replace('-FC', '') }}</a
>
</span>
<clr-tooltip-content
clrPosition="bottom-left"
clrSize="lg"
*clrIfOpen
>
{{ this.dsNote }}
</clr-tooltip-content>
</clr-tooltip>
{{ libdsParsed.libName }}.<a
class="mr-10"
[routerLink]="'/view/data/' + libds!"
>{{ libdsParsed.tableName.replace('-FC', '') }}</a
>
<ng-container *ngIf="dataSource">
<ng-container *ngIf="!zeroFilterRows">
({{ dataSource.length | thousandSeparator: ',' }}

View File

@ -121,6 +121,7 @@ export class EditorComponent implements OnInit, AfterViewInit {
datasetInfo: boolean = false
dsmeta: DSMeta[] = []
dsNote = ''
viewboxes: boolean = false
@ -2986,6 +2987,20 @@ export class EditorComponent implements OnInit, AfterViewInit {
this.cols = response.data.cols
this.dsmeta = response.data.dsmeta
const notes = this.dsmeta.find((item) => item.NAME === 'NOTES')
const longDesc = this.dsmeta.find((item) => item.NAME === 'DD_LONGDESC')
const shortDesc = this.dsmeta.find((item) => item.NAME === 'DD_SHORTDESC')
if (notes && notes.VALUE) {
this.dsNote = notes.VALUE
} else if (longDesc && longDesc.VALUE) {
this.dsNote = longDesc.VALUE
} else if (shortDesc && shortDesc.VALUE) {
this.dsNote = shortDesc.VALUE
} else {
this.dsNote = ''
}
const hot: Handsontable = this.hotInstance
const approvers: Approver[] = response.data.approvers

View File

@ -358,36 +358,49 @@
</section>
<div class="title-col clr-col-auto clr-flex-column clr-flex-sm-row">
<clr-icon
(click)="datasetInfo = true"
shape="info-circle"
class="is-highlight cursor-pointer"
size="24"
></clr-icon>
<clr-icon
*ngIf="tableTitle?.includes('-FC')"
shape="bolt"
class="color-yellow mt-5 mr-5"
></clr-icon>
<h3
*ngIf="tableTitle && tableTitle.length > 0"
class="viewerTitle clr-flex-column d-flex clr-flex-sm-row clr-align-items-center"
class="viewerTitle clr-flex-column d-flex clr-flex-sm-row clr-align-items-center clr-justify-content-center"
>
{{ tableTitle?.replace('-FC', '') }}
<clr-tooltip class="d-flex">
<clr-icon
clrTooltipTrigger
(click)="datasetInfo = true"
shape="info-circle"
class="is-highlight cursor-pointer"
size="24"
></clr-icon>
<span *ngIf="numberOfRows !== null">
({{ numberOfRows | thousandSeparator: ',' }}
{{ numberOfRows! === 1 ? 'row' : 'rows' }}, {{ filterCols.length
}}{{ filterCols.length === 1 ? ' col' : ' cols' }})
</span>
<clr-icon
*ngIf="tableTitle?.includes('-FC')"
shape="bolt"
class="color-yellow mt-5 mr-5"
></clr-icon>
<clr-icon
(click)="reloadTableData()"
class="refresh-table"
shape="refresh"
></clr-icon>
<span clrTooltipTrigger *ngIf="tableTitle && tableTitle.length > 0">
{{ tableTitle?.replace('-FC', '') }}
</span>
<clr-tooltip-content
clrPosition="bottom-left"
clrSize="lg"
*clrIfOpen
>
{{ this.dsNote }}
</clr-tooltip-content>
</clr-tooltip>
<ng-container *ngIf="tableTitle && tableTitle.length > 0">
<span *ngIf="numberOfRows !== null">
({{ numberOfRows | thousandSeparator: ',' }}
{{ numberOfRows! === 1 ? 'row' : 'rows' }}, {{ filterCols.length
}}{{ filterCols.length === 1 ? ' col' : ' cols' }})
</span>
<clr-icon
(click)="reloadTableData()"
class="refresh-table"
shape="refresh"
></clr-icon>
</ng-container>
</h3>
</div>

View File

@ -95,6 +95,7 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
public $dataFormats: $DataFormats | null = null
public datasetInfo: boolean = false
public dsmeta: DSMeta[] = []
public dsNote = ''
public licenceState = this.licenceService.licenceState
public Infinity = Infinity
@ -246,6 +247,7 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.hotTable.data = res.viewdata
this.$dataFormats = res.$viewdata
this.dsmeta = res.dsmeta
this.setDSNote()
this.numberOfRows = res.sasparams[0].NOBS
this.queryText = res.sasparams[0].FILTER_TEXT
this.headerPks = res.sasparams[0].PK_FIELDS.split(' ')
@ -803,6 +805,7 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.hotTable.data = res.viewdata
this.$dataFormats = res.$viewdata
this.dsmeta = res.dsmeta
this.setDSNote()
this.queryText = res.sasparams[0].FILTER_TEXT
let columns: any[] = []
let colArr = []
@ -1016,6 +1019,22 @@ export class ViewerComponent implements AfterContentInit, AfterViewInit {
this.sasStoreService.removeClause()
}
private setDSNote() {
const notes = this.dsmeta.find((item) => item.NAME === 'NOTES')
const longDesc = this.dsmeta.find((item) => item.NAME === 'DD_LONGDESC')
const shortDesc = this.dsmeta.find((item) => item.NAME === 'DD_SHORTDESC')
if (notes && notes.VALUE) {
this.dsNote = notes.VALUE
} else if (longDesc && longDesc.VALUE) {
this.dsNote = longDesc.VALUE
} else if (shortDesc && shortDesc.VALUE) {
this.dsNote = shortDesc.VALUE
} else {
this.dsNote = ''
}
}
private setupHot() {
setTimeout(() => {
if (!this.loadingTableView && this.libDataset) {