Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Search UI Updates #1764

Merged
merged 3 commits into from
Apr 28, 2023
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
10 changes: 7 additions & 3 deletions src/app/containers/list/list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
</ng-container>
<ng-container matColumnDef="stars">
<mat-header-cell *matHeaderCellDef mat-sort-header fxHide.xs>Stars</mat-header-cell>
<mat-cell class="description-cell" *matCellDef="let tool" fxHide.xs>
{{ tool?.starredUsers.length === 0 ? '' : tool?.starredUsers.length }}
<mat-cell class="description-cell weight-bold" *matCellDef="let tool" fxHide.xs>
<mat-icon class="star-icon" *ngIf="tool?.starredUsers?.length > 0">star_rate</mat-icon>
{{ tool?.starredUsers.length === 0 ? '' : tool?.starredUsers.length }}
</mat-cell>
</ng-container>
<ng-container matColumnDef="author">
Expand All @@ -58,7 +58,11 @@
</ng-container>
<ng-container matColumnDef="format">
<mat-header-cell *matHeaderCellDef>Format</mat-header-cell>
<mat-cell *matCellDef="let tool">{{ tool?.descriptorType ? (tool?.descriptorType.toString() | uppercase) : '' }}</mat-cell>
<mat-cell *matCellDef="let tool">
<span *ngFor="let language of tool?.descriptorType" class="nonclick-badge m-1">
{{ language ? (language.toString() | uppercase) : '' }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="projectLinks">
<mat-header-cell *matHeaderCellDef>Links</mat-header-cell>
Expand Down
2 changes: 2 additions & 0 deletions src/app/search/search-results/search-results.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</div>
</div>
</div>
<mat-divider></mat-divider>
<app-search-workflow-table></app-search-workflow-table>
</div>
</div>
Expand Down Expand Up @@ -77,6 +78,7 @@
</div>
</div>
</div>
<mat-divider></mat-divider>
<app-search-tool-table></app-search-tool-table>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
display: block;
background-color: #fff;
margin: 1rem 1rem 2rem;
padding: 0.8rem;
padding: 2.5rem;
border: 0.0625rem solid mat.get-color-from-palette($dockstore-app-gray, 7);
border-radius: 0.3rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
matSortDisableClear
>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header>Name and Description</mat-header-cell>
<!-- the wrap causes slightly odd behavior with the mat-icon but is needed for the topic -->
<mat-cell data-cy="toolNames" *matCellDef="let tool">
<div>
Expand Down Expand Up @@ -100,12 +100,12 @@
<ng-container matColumnDef="starredUsers">
<mat-header-cell *matHeaderCellDef mat-sort-header>Stars</mat-header-cell>
<mat-cell class="description-cell" *matCellDef="let tool"
>{{ !tool?.starredUsers || tool?.starredUsers.length === 0 ? '' : tool?.starredUsers.length }}
<mat-icon class="star-icon" *ngIf="tool?.starredUsers?.length > 0">star_rate</mat-icon>
><mat-icon class="star-icon" *ngIf="tool?.starredUsers?.length > 0">star_rate</mat-icon>
{{ !tool?.starredUsers || tool?.starredUsers.length === 0 ? '' : tool?.starredUsers.length }}
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
<mat-row *matRowDef="let row; columns: displayedColumns" class="py-2"></mat-row>
</mat-table>
<mat-paginator
data-cy="search-tool-table-paginator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
data-cy="search-workflow-results-table"
>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header>Name and Description</mat-header-cell>
<mat-cell data-cy="workflowColumn" *matCellDef="let workflow">
<div>
<a [matTooltip]="workflow?.full_workflow_path" [routerLink]="'/workflows/' + workflow?.full_workflow_path">{{
Expand Down Expand Up @@ -61,13 +61,13 @@
</ng-container>
<ng-container matColumnDef="starredUsers">
<mat-header-cell *matHeaderCellDef mat-sort-header>Stars</mat-header-cell>
<mat-cell class="description-cell" *matCellDef="let workflow"
>{{ !workflow?.starredUsers || workflow?.starredUsers.length === 0 ? '' : workflow?.starredUsers?.length }}
<mat-icon class="star-icon" *ngIf="workflow?.starredUsers?.length > 0">star_rate</mat-icon>
<mat-cell class="starred-cell weight-bold" *matCellDef="let workflow"
><mat-icon class="star-icon" *ngIf="workflow?.starredUsers?.length > 0">star_rate</mat-icon>
{{ !workflow?.starredUsers || workflow?.starredUsers.length === 0 ? '' : workflow?.starredUsers?.length }}
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
<mat-row *matRowDef="let row; columns: displayedColumns" class="py-2"></mat-row>
</mat-table>
<mat-paginator
data-cy="search-workflow-table-paginator"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.mat-column-descriptorType {
max-width: 90px;
}

.mat-column-projectLinks {
max-width: 80px;
}

td.mat-cell {
border-bottom-style: none;
max-width: 10rem;
}
24 changes: 15 additions & 9 deletions src/app/shared/styles/entry-table.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
@use '@angular/material' as mat;
@import '/src/materialColorScheme.scss';

// Material Datatable for both tool and workflow list components
.mat-column-starredUsers,
.mat-column-stars {
max-width: 75px;
max-width: 6rem;
justify-content: flex-end;
color: mat.get-color-from-palette($dockstore-app-accent-1, darker);
}

.mat-column-all_authors {
max-width: 20rem;
}

.mat-column-descriptorType,
.mat-column-format {
max-width: 100px;
min-width: min-content;
max-width: 14rem;
}

.mat-column-projectLinks {
justify-content: center;
max-width: 115px;
}

.mat-column-starredUsers,
.mat-column-stars {
justify-content: flex-end;
max-width: 8rem;
}

.mat-column-verified {
justify-content: center;
flex: 0 0 75px;
flex: 0 0 7.5rem;
align-items: center;
}

Expand Down
10 changes: 7 additions & 3 deletions src/app/workflows/list/list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
</ng-container>
<ng-container matColumnDef="stars">
<mat-header-cell *matHeaderCellDef mat-sort-header fxHide.xs>Stars</mat-header-cell>
<mat-cell class="description-cell" *matCellDef="let workflow" fxHide.xs>
{{ workflow?.starredUsers.length === 0 ? '' : workflow?.starredUsers.length }}
<mat-cell class="description-cell weight-bold" *matCellDef="let workflow" fxHide.xs>
<mat-icon class="star-icon" *ngIf="workflow?.starredUsers?.length > 0">star_rate</mat-icon>
{{ workflow?.starredUsers.length === 0 ? '' : workflow?.starredUsers.length }}
</mat-cell>
</ng-container>
<ng-container matColumnDef="author">
Expand All @@ -55,7 +55,11 @@
</ng-container>
<ng-container matColumnDef="descriptorType">
<mat-header-cell *matHeaderCellDef mat-sort-header>Format</mat-header-cell>
<mat-cell *matCellDef="let workflow">{{ workflow?.descriptorType | uppercase }}</mat-cell>
<mat-cell *matCellDef="let workflow">
<span class="nonclick-badge">
{{ workflow?.descriptorType | descriptorLanguage }}
</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="projectLinks">
<mat-header-cell *matHeaderCellDef>Links</mat-header-cell>
Expand Down
11 changes: 6 additions & 5 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,9 @@ app-select.longer {
}

mat-icon.star-icon {
font-size: 16px;
height: 16px;
font-size: 1.6rem;
height: 1.6rem;
width: 1.6rem;
}

.date-display {
Expand Down Expand Up @@ -1026,11 +1027,11 @@ mat-tab-group.no-pagination {
// These badges are not clickable, thus different from Material Design Chips
.nonclick-badge {
display: inline-flex;
border-radius: 8px;
border-radius: 0.8rem;
background-color: mat.get-color-from-palette($dockstore-app-gray, lighter);
padding: 5px 8px;
padding: 0.2rem 0.8rem;
color: $header-color;
font-size: 1.3rem;
font-size: 1.2rem;
font-weight: 500;
}

Expand Down