Skip to content

Commit

Permalink
#1296 Separate rows and column into different line
Browse files Browse the repository at this point in the history
  • Loading branch information
paigechoi committed Jan 28, 2019
1 parent 1c70892 commit d0053c8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</div>

<dl class="ddp-dl-detail" *ngFor="let item of datasetInformationList">
<dt>
<dt [ngStyle]="{'color': item.name === 'S' ? '#f6f6f7' : null } ">
{{item.name}}
</dt>
<dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,12 @@ export class DatasetInfoPopupComponent extends AbstractComponent implements OnIn
/** get rows */
public get getRows() {
let rows = '0';

if(true==Number.isInteger(this.selectedDataSet.totalLines)) {
if(Number.isInteger(this.selectedDataSet.totalLines)) {
if (this.selectedDataSet.totalLines === -1) {
rows = '(counting)';
} else {
rows = new Intl.NumberFormat().format(this.selectedDataSet.totalLines);
rows = new Intl.NumberFormat().format(this.selectedDataSet.totalLines) + ' row(s)';
this.clearExistingInterval();
if (rows === '0' || rows === '1') {
rows = rows + ` row`;
} else {
rows = rows + ` rows`;
}
}
}
return rows;
Expand Down Expand Up @@ -693,8 +687,10 @@ export class DatasetInfoPopupComponent extends AbstractComponent implements OnIn

// WRANGLED
if (dataset.dsType === DsType.WRANGLED) {
this.datasetInformationList = [{ name : this.translateService.instant('msg.comm.th.type') , value : dataset.dsType },
{name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${cols } ${ cols === '1' || cols === '0' ? 'column': 'columns'}` }
this.datasetInformationList = [
{ name : this.translateService.instant('msg.comm.th.type') , value : dataset.dsType },
{name : this.translateService.instant('msg.dp.th.summary'), value :this.getRows},
{name : 'S', value : cols + ' column(s)'}
];

// FILE
Expand All @@ -714,7 +710,10 @@ export class DatasetInfoPopupComponent extends AbstractComponent implements OnIn
this.datasetInformationList.push({name : this.translateService.instant('msg.comm.detail.size'), value : this.getTotalBytes });
}

this.datasetInformationList.push({name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${ cols } ${ cols === '1' || cols === '0' ? 'column': 'columns'}`})
this.datasetInformationList.push(
{name : this.translateService.instant('msg.dp.th.summary'), value :this.getRows},
{name : 'S', value : cols + ' column(s)'}
)


// STAGING OR DB
Expand Down Expand Up @@ -747,7 +746,8 @@ export class DatasetInfoPopupComponent extends AbstractComponent implements OnIn
}

this.datasetInformationList.push(
{ name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${ cols } ${ cols === '1' || cols === '0' ? 'column': 'columns'}` })
{name : this.translateService.instant('msg.dp.th.summary'), value :this.getRows},
{name : 'S', value : cols + ' column(s)'})

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,7 @@ export class DatasetDetailComponent extends AbstractComponent implements OnInit,
if (this.dataset.totalLines === -1) {
rows = '(counting)';
} else {
rows = new Intl.NumberFormat().format(this.dataset.totalLines);
if (rows === '0' || rows === '1') {
rows = rows + ' row';
} else {
rows = rows + ' rows';
}
rows = new Intl.NumberFormat().format(this.dataset.totalLines) + ' row(s)';
clearInterval(this.interval);
this.interval = undefined;
}
Expand Down Expand Up @@ -472,9 +467,9 @@ export class DatasetDetailComponent extends AbstractComponent implements OnInit,
// WRANGLED
if (dataset.dsType === DsType.WRANGLED) {
this.datasetInformationList = [{ name : this.translateService.instant('msg.comm.th.type') , value : dataset.dsType },
{name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${this.dataset.gridResponse.colCnt } ${this.dataset.gridResponse.colCnt === '1' || this.dataset.gridResponse.colCnt === '0' ? 'column': 'columns'}` }
]

{name : this.translateService.instant('msg.dp.th.summary'), value : this.getRows },
{name : '', value : this.dataset.gridResponse.colCnt + ' column(s)' }
]
// FILE
} else if (dataset.importType === ImportType.UPLOAD || dataset.importType === ImportType.URI) {
let filepath : string = dataset.importType === ImportType.UPLOAD? dataset.filenameBeforeUpload : dataset.storedUri;
Expand All @@ -489,8 +484,11 @@ export class DatasetDetailComponent extends AbstractComponent implements OnInit,
this.datasetInformationList.push({name : this.translateService.instant('msg.dp.th.sheet'), value : this.getSheetName() })
}

this.datasetInformationList.push({name : this.translateService.instant('msg.comm.detail.size'), value : this.getTotalBytes },
{name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${this.dataset.gridResponse.colCnt} ${this.dataset.gridResponse.colCnt === '1' || this.dataset.gridResponse.colCnt === '0' ? 'column': 'columns'}`})
this.datasetInformationList.push(
{name : 'URI', value : this.dataset.storedUri},
{name : this.translateService.instant('msg.comm.detail.size'), value : this.getTotalBytes },
{name : this.translateService.instant('msg.dp.th.summary'), value : this.getRows },
{name : '', value : this.dataset.gridResponse.colCnt + ' column(s)' })


// STAGING OR DB
Expand Down Expand Up @@ -523,7 +521,8 @@ export class DatasetDetailComponent extends AbstractComponent implements OnInit,
}

this.datasetInformationList.push(
{ name : this.translateService.instant('msg.dp.th.summary'), value : `${this.getRows} / ${ this.dataset.gridResponse.colCnt } ${ this.dataset.gridResponse.colCnt === '1' || this.dataset.gridResponse.colCnt === '0' ? 'column': 'columns'}` })
{name : this.translateService.instant('msg.dp.th.summary'), value : this.getRows },
{name : '', value : this.dataset.gridResponse.colCnt + ' column(s)' })

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<col width="100px">
<col width="*">
<col width="10%">
<col width="15%">
<col width="20%">
<col width="20%">
</colgroup>
<thead>
Expand Down

0 comments on commit d0053c8

Please sign in to comment.