-
Notifications
You must be signed in to change notification settings - Fork 152
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: split mine and shared with me uploads #2982
base: master
Are you sure you want to change the base?
Conversation
invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/user_dashboard/uploads.js
Outdated
Show resolved
Hide resolved
621d567
to
f65c9ac
Compare
* If upload is published redirect user to published record * If upload is draft redirect user to upload or preview depending on their permission
f65c9ac
to
318fc6b
Compare
166e432
to
dbdc623
Compare
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.
Since there are only two filtering options, I'm wondering if a dropdown is the best widget.
Could we maybe use a buttons group, like it's done for the "Open/Closed" requests filtering?
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.
Peer reviewed with @sakshamarora1
@@ -0,0 +1,92 @@ | |||
// This file is part of Invenio | |||
// Copyright (C) 2023 CERN. |
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.
// Copyright (C) 2023 CERN. | |
// Copyright (C) 2025 CERN. |
@@ -109,6 +110,8 @@ export const RDMRecordSearchBarElement = withState( | |||
onInputChange, | |||
updateQueryState, | |||
currentQueryState, | |||
showSharedDropdown = false, | |||
mineLabel = "", |
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.
To use the default of the child?
mineLabel = "", | |
mineLabel = undefined, |
compact | ||
size="small" | ||
floated="right" | ||
onClick={() => viewDraft()} |
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.
Question: Does this mean that from the list view for the records we cannot access the edit anymore?
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.
Yes that is one of the big changes also mentioned in inveniosoftware/invenio-rdm-records#1948
There are different ideas that I will share so we can decide on what's the best view to go ahead. Dropdown is just the less space consuming and the fact that is next to the searchbar seems quite intuitive in my optinion. But there are alternatives with exposing all options in a button group as well :) |
#2982 (comment) : I can have a look yes! |
import { withState } from "react-searchkit"; | ||
import { Dropdown, Button } from "semantic-ui-react"; | ||
|
||
class SharedOrMineFilterComponent extends Component { |
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.
would there be a better place for this component? please check my comment in invenio_requests PR
obj.includes("shared_with_me") | ||
); | ||
if (sharedWithMe) { | ||
// eslint-disable-next-line react/no-did-mount-set-state |
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 this part be moved to the constructor? you only need access to props, is it any way dependant on the fact if the component mounted or not?
The reason why eslint does not like to set state inside the DidMount: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
{ key: "shared_with_me", text: sharedWithMeLabel, value: true }, | ||
]; | ||
return ( | ||
// <Dropdown |
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.
leftovers?
const { currentQueryState, updateQueryState, keepFiltersOnUpdate } = this.props; | ||
const { sharedWithMe } = this.state; | ||
|
||
// if (sharedWithMe === sharedWithMeStatus) { |
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.
leftovers?
@@ -62,7 +69,7 @@ export const defaultComponents = { | |||
[`${appName}.ResultsGrid.item`]: () => null, | |||
[`${appName}.SearchApp.layout`]: RequestsSearchLayoutWithApp, | |||
[`${appName}.SearchApp.results`]: RequestsResults, | |||
[`${appName}.SearchBar.element`]: RDMRecordSearchBarElement, | |||
[`${appName}.SearchBar.element`]: RequestsSearcBarElement, |
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.
[`${appName}.SearchBar.element`]: RequestsSearcBarElement, | |
[`${appName}.SearchBar.element`]: RequestsSearchBarElement, |
a5725a8
to
f4d2424
Compare
f4d2424
to
b4f73a5
Compare
closes inveniosoftware/invenio-rdm-records#1948