Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(viewer): add checkbox for every resource in list and grid view (D…
…SP-1711) (#311) * feat(resource viewer): add checkbox for every resouce * feat(resource viewer): add function to list and count selected resources * feat(resource viewer): add functionality to grid view * feat(resource viewer): update testcases * feat(resource viewer): add interface for filtered resources * feat(resource viewer): display checkbox at right side in grid view * feat(resource viewer): add two cases - to select single resource or multiple resources * feat(resource viewer): create separate component resource-list-content * feat(resource viewer): update component resource-list-content * feat(resource viewer): create separate component resource-grid-content * feat(resource viewer): cleanup * feat(resource viewer): cleanup, highlight selected resource(s) * feat(resource viewer): update tests * feat(resource viewer): added deprecated warning for resourceSelected event * feat(resource viewer): update multiple selection case - when withMultipleSelection is true and clicked on the resource, it will go to the resource details page - when withMultipleSelection is true and checkbox(s) is selected, it will go to the resource comparison page - resource-grid-content component is deleted - resource-list-content component is deleted * feat(resource viewer): small changes
- Loading branch information
Snehal Kumbhar
committed
Jul 9, 2021
1 parent
74f1cb9
commit 1e0381a
Showing
13 changed files
with
400 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
<!-- When withMultipleSelection is false and user can select only one resource at a time to view --> | ||
<div class="resource-grid"> | ||
<mat-card | ||
<div | ||
class="grid-card link" | ||
[class.selected-resource]="selectedResourceIdx === i" | ||
*ngFor="let res of resources.resources; let i = index;" | ||
(click)="resourceSelected.emit(res.id)"> | ||
<!-- TODO: add the representation preview here, mat-card-image can be used for images --> | ||
<mat-card-header class="grid-card-header"> | ||
<mat-card-subtitle class="res-class-label">{{ res.entityInfo.classes[res.type].label }}</mat-card-subtitle> | ||
<mat-card-title class="res-class-value">{{ res.label }}</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content class="grid-card-content" *ngFor="let prop of res.properties | keyvalue"> | ||
<div *ngFor="let val of prop.value"> | ||
<span class="res-prop-label"> | ||
{{ res.entityInfo.properties[val.property].label }} | ||
</span> | ||
*ngFor="let resource of resources.resources; let i = index;"> | ||
<mat-card [class.selected-resource]="selectedResourceIdx.indexOf(i) > -1"> | ||
<!-- TODO: add the representation preview here, mat-card-image can be used for images --> | ||
<mat-card-header class="grid-card-header"> | ||
<mat-card-title-group class="res-class-header-text" (click)="viewResource({ checked: true, resListIndex: i, resId: resource.id, isCheckbox: false})"> | ||
<mat-card-subtitle class="res-class-label">{{ resource.entityInfo.classes[resource.type].label }}</mat-card-subtitle> | ||
<mat-card-title class="res-class-value">{{ resource.label }}</mat-card-title> | ||
</mat-card-title-group> | ||
<div fxFlex></div> | ||
<!-- if withMultipleSelection is true, we display checkbox --> | ||
<mat-card-title-group *ngIf="withMultipleSelection" class="res-class-header-actions"> | ||
<mat-checkbox #gridCkbox | ||
id="{{ i }}" | ||
(change)="viewResource({ checked: $event.checked, resListIndex: i, resId: resource.id, isCheckbox: true})" | ||
class="res-checkbox"> | ||
</mat-checkbox> | ||
</mat-card-title-group> | ||
|
||
<div class="res-prop-value"> | ||
{{ val.strval | dspTruncate: 256:"..." }} | ||
</div> | ||
</mat-card-header> | ||
<div (click)="viewResource({ checked: true, resListIndex: i, resId: resource.id, isCheckbox: false})"> | ||
<mat-card-content class="grid-card-content" *ngFor="let prop of resource.properties | keyvalue"> | ||
<div *ngFor="let val of prop.value"> | ||
<span class="res-prop-label"> | ||
{{ resource.entityInfo.properties[val.property].label }} | ||
</span> | ||
|
||
<div class="res-prop-value"> | ||
{{ val.strval | dspTruncate: 256:"..." }} | ||
</div> | ||
</div> | ||
</mat-card-content> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
</mat-card> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.