xuang7 commented on code in PR #7043:
URL: https://github.com/apache/texera/pull/7043#discussion_r3677060889
##########
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html:
##########
Review Comment:
The hint says "Shown on cards and the Metadata tab", but this PR has no
Metadata tab (Data Card, Versions & Files, Settings). Please change it to "Data
Card" or drop the tab reference.
##########
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html:
##########
@@ -82,375 +82,415 @@ <h2>Dataset: {{datasetName}}</h2>
[src]="coverImageUrl"
alt="Dataset cover" />
</div>
-
- <div class="description-section">
- <texera-markdown-description
- [description]="datasetDescription"
- [editable]="false"
- [enableViewMore]="true">
- </texera-markdown-description>
- </div>
</nz-card>
</div>
-
<nz-tabs>
<nz-tab nzTitle="Data Card">
- <nz-layout>
- <nz-content
- [ngClass]="{'grayed-out': false, 'disabled-click': false}"
- style="background-color: white">
- <nz-card>
- <div style="display: flex; justify-content: space-between;
align-items: center">
- <div class="file-info">
- <h3 class="file-title">
- <span class="file-title-main">
- <b>{{ currentDisplayedFileName }}</b>
-
- <button
- nz-button
- nzType="text"
- nzSize="small"
- class="copy-path-btn"
- nz-tooltip
- nzTooltipTitle="Copy file path"
- *ngIf="currentDisplayedFileName"
- (click)="copyCurrentFilePath()">
- <i
- nz-icon
- nzType="copy"
- nzTheme="twotone">
- </i>
- </button>
- </span>
+ <div class="data-card-tab-content">
+ <div class="data-card-columns">
+ <nz-card class="data-card data-card-main">
+ <h3 class="data-card-heading">Description</h3>
+ <div class="data-card-description">
+ <texera-markdown-description
+ *ngIf="datasetDescription; else noDescription"
+ [description]="datasetDescription"
+ [editable]="false"
+ [enableViewMore]="true">
+ </texera-markdown-description>
+ <ng-template #noDescription>
+ <span class="empty-description">No description provided</span>
+ </ng-template>
+ </div>
+ </nz-card>
- <span
- *ngIf="currentFileSize"
- class="file-size">
- <i
- nz-icon
- nzType="file"
- nzTheme="outline"
- class="icon-file"></i>
- {{ formatSize(currentFileSize) }}
- </span>
- </h3>
+ <nz-card class="data-card data-card-details">
+ <div class="data-card-stats">
+ <div class="stat-row">
+ <span class="stat-label">Created</span>
+ <span class="stat-value">{{ datasetCreationTime }}</span>
+ </div>
+ <div class="stat-row">
+ <span class="stat-label">Last updated</span>
+ <span class="stat-value">{{ latestVersionCreationTime }}</span>
+ </div>
+ <div class="stat-row">
+ <span class="stat-label">Versions</span>
+ <span class="stat-value">{{ versions.length }}</span>
</div>
- <div style="display: flex">
- <button
- nz-button
- *ngIf="selectedVersion"
- nz-tooltip="Download the file"
- [disabled]="!isLogin || !isDownloadAllowed()"
- (click)="onClickDownloadCurrentFile()">
- <i
- nz-icon
- nzTheme="outline"
- nzType="download">
- </i>
- </button>
- <button
- nz-button
- *ngIf="!isMaximized && selectedVersion"
- nz-tooltip="Maximize View"
- (click)="onClickScaleTheView()">
- <i
- nz-icon
- nzTheme="outline"
- nzType="expand">
- </i>
- </button>
- <button
- nz-button
- *ngIf="isMaximized && selectedVersion"
- nz-tooltip="Minimize View"
- (click)="onClickScaleTheView()">
- <i
- nz-icon
- nzTheme="outline"
- nzType="compress">
- </i>
- </button>
- <button
- *ngIf="!isRightBarCollapsed"
- nz-button
- nz-tooltip="Hide the right bar"
- (click)="onClickHideRightBar()">
- <i
- nz-icon
- nzTheme="outline"
- nzType="right">
- </i>
- </button>
- <button
- *ngIf="isRightBarCollapsed"
- nz-button
- nz-tooltip="Show Tree"
- (click)="onClickHideRightBar()">
- <i
- nz-icon
- nzTheme="outline"
- nzType="left">
- </i>
- </button>
+ <div class="stat-row">
+ <span class="stat-label">Latest version file</span>
+ <span class="stat-value">{{ latestVersionFileName }}</span>
+ </div>
+ <div class="stat-row">
Review Comment:
"Selected version size" tracks whichever version is picked in Versions &
Files. After the user selects a non-latest version, this overview shows a value
that no longer matches the rest of the card. Consider showing the latest
version's size here, or relabeling it so the selection-dependence is clear.
##########
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts:
##########
@@ -414,13 +422,31 @@ export class DatasetDetailComponent implements OnInit {
// by default, the selected version is the 1st element in the
retrieved list
// which is guaranteed(by the backend) to be the latest created
version.
if (this.versions.length > 0) {
+ const latestVersion = this.versions[0];
+ if (typeof latestVersion.creationTime === "number") {
+ this.latestVersionCreationTime = format(new
Date(latestVersion.creationTime), "MM/dd/yyyy HH:mm:ss");
+ }
this.selectedVersion = this.versions[0];
this.onVersionSelected(this.selectedVersion);
}
});
}
}
+ // Fetches the latest version (with its file tree) independently of the
current
+ // selection, then derives a representative file name for the Data Card.
+ retrieveLatestVersionFile() {
Review Comment:
retrieveDatasetLatestVersion already returns the version's creationTime, so
"Last updated" could come from here too instead of versions[0]. That would drop
one request and avoid the two showing different versions if the endpoints ever
diverge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]