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

Dashboard uploads: refactor uploads view #1778

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

Pineirin
Copy link
Contributor

@Pineirin Pineirin commented Jul 4, 2022

Remove empty content.
Create a custom mobile interface.
Fix request_items naming.
closes: #1771

Computer:
Screenshot from 2022-07-05 15-37-44

Tablet:
Screenshot from 2022-07-05 15-37-53

Mobile:
Screenshot from 2022-07-05 15-38-04

@Pineirin Pineirin force-pushed the uploads_refactor branch 2 times, most recently from 964f5db to 87a2bbb Compare July 4, 2022 16:04
@alejandromumo
Copy link
Member

LGTM, left smaller comments / suggestions.

Good work! Views are looking good 👍

@Pineirin Pineirin force-pushed the uploads_refactor branch 2 times, most recently from d4aee10 to 6d27c71 Compare July 5, 2022 13:38
@@ -108,7 +106,7 @@ export function SearchItemCreators({ creators }) {
return link;
}
return creators.map((creator, index) => (
<span className="creatibutor-wrap separated" key={index}>
<span className={spanClass} key={index}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span className={spanClass} key={index}>
<span className={`creatibutor-wrap separated ${className}`} key={index}>

Can we keep "creatibutor-wrap separated" always by default, then we don't need to add these classes to the mobile view.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it would be best to allow the component to have all it's className overridden, as it would make it more reusable. I've made the change but I would like if others in the team give their opinion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they should always have this class and will otherwise break the component ui then it makes sense to always pass it, otherwise i would prefer to make it completely overridable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the classes belong to the component and should not be overridden. It is the name with connected identifier icon which we want to keep consistent in styling across the entire site.


export const MobileUploadsItem = ({ result, index, editRecord, statuses }) => {
const access_status_id = _get(
result,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could maybe all these shared variables be collected in the parent and passed down to the computer/mobile component, so that we don't need to define them twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, but I got some backlash in another similar PR about having components with a huge number of parameters passed. I would say we need to establish clearly what should and should not get duplicated @kpsherva.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be an utility function, it is basically serializing the result object, so it could be a serializer. Just a suggestion.

@Pineirin Pineirin force-pushed the uploads_refactor branch 10 times, most recently from 9fb3051 to 8a4eeca Compare July 8, 2022 14:34
import { i18next } from "@translations/invenio_app_rdm/i18next";
import _get from "lodash/get";

export const uploadsResultProps = (result) => {
Copy link
Contributor

@kpsherva kpsherva Jul 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's quite unorthodox in our code base to separate a function to provide the props
additionally, as a developer I wouldn't like to jump to another file to find out how my props are calculated.
most of these statements can be simplified, let me know if you need hints on how - please place them in the components in which they are used

@Pineirin Pineirin force-pushed the uploads_refactor branch 2 times, most recently from be16f09 to c671d06 Compare July 25, 2022 17:13
@Pineirin Pineirin force-pushed the uploads_refactor branch 2 times, most recently from 96bd36e to 9e10e00 Compare July 26, 2022 08:27
* remove empty content.
* create a custom mobile interface.
* fix request_items naming.
* closes: inveniosoftware#1771
</Label>
))}
<div>
{}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this do anything?

onClick={() => editRecord()}
className="fluid-responsive"
>
<Icon name="edit" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there is a difference in how it looks but otherwise you can also pass the icon prop to the button 😄 . Same as below

@kpsherva kpsherva merged commit 9d6dcef into inveniosoftware:master Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

record list item: improve mobile view
5 participants