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
feat(viewer): add checkbox for every resource in list and grid view (DSP-1711) #311
Conversation
projects/dsp-ui/src/lib/viewer/views/list-view/list-view.component.ts
Outdated
Show resolved
Hide resolved
projects/dsp-ui/src/lib/viewer/views/list-view/resource-grid/resource-grid.component.ts
Outdated
Show resolved
Hide resolved
projects/dsp-ui/src/lib/viewer/views/list-view/resource-grid/resource-grid.component.html
Outdated
Show resolved
Hide resolved
projects/dsp-ui/src/lib/viewer/views/list-view/resource-grid/resource-grid.component.spec.ts
Outdated
Show resolved
Hide resolved
@kilchenmann I have added the interface and also moved the checkbox to the top right corner. As you said, we can work on the grid template separately to refine it further. |
I will have a look at it tomorrow morning. |
Yesterday evening I was thinking about this multiple resource selection. Why not adding an additional |
@kilchenmann It is good idea. I can update the PR. |
@waychal yes, it is fine. |
@kilchenmann I have updated the code to handle both cases of single and multiple resource selection. |
projects/dsp-ui/src/lib/viewer/views/list-view/list-view.component.ts
Outdated
Show resolved
Hide resolved
- 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works. But there are some little details that have to be fixed first
<p matLine class="res-class-label"> | ||
{{ resource.entityInfo.classes[resource.type].label }} | ||
</p> | ||
<h3 matLine class="res-class-value">{{ resource.label }}</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you set the style for res-class-label
and res-class-value
to margin: 0;
? Otherwise it needs too much space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the case only on big screens. margin:0
removes all the space and it looks crowded. I will make it margin: 5px 0
, if it ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... that's weird 😳 it looks different on the two machines. But why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using same version? I took this screenshot from https://admin.test.dasch.swiss/
server. I did not run the DSP-APP locally to check it there.
For dsp-ui-lib
server running locally, it looks like below. It does show some spacing. So I assumed that in DSP-APP there are some extra styles applied for this as I did not change this style in this PR until now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the DSP-UI lib from your branch to DSP-APP locally (with yalc) and was running your implementation there. The version on https://admin.test.dasch.swiss/
doesn't have your implementation. Of course it looks different 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your screenshot you have the same big spaces that I have in DSP-APP. This is why I wrote to set the margin to 0 pixels.
projects/dsp-ui/src/lib/viewer/views/list-view/list-view.component.ts
Outdated
Show resolved
Hide resolved
@kilchenmann @mdelez can you please review the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates. Works perfect 👍
resolves DSP-1711
In this PR, checkbox is added for every resource displayed in list and grid view. It handles 2 cases for both list and grid view:
When
withMultipleSelection
isfalse
(old functionality)When
withMultipleSelection
istrue
(new functionality)