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: split mine and shared with me uploads #2982

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

zzacharo
Copy link
Member

@zzacharo zzacharo commented Feb 15, 2025

@zzacharo zzacharo marked this pull request as draft February 17, 2025 10:44
@zzacharo zzacharo force-pushed the uploads-shared-mine branch 2 times, most recently from 621d567 to f65c9ac Compare February 20, 2025 13:20
* If upload is published redirect user to published record
* If upload is draft redirect user to upload or preview depending on their permission
@zzacharo zzacharo force-pushed the uploads-shared-mine branch from f65c9ac to 318fc6b Compare February 20, 2025 13:24
@zzacharo zzacharo force-pushed the uploads-shared-mine branch from 166e432 to dbdc623 Compare February 20, 2025 15:47
@zzacharo zzacharo marked this pull request as ready for review February 20, 2025 15:47
Copy link
Member

@ptamarit ptamarit left a 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?

Copy link
Contributor

@jrcastro2 jrcastro2 left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright (C) 2023 CERN.
// Copyright (C) 2025 CERN.

@@ -109,6 +110,8 @@ export const RDMRecordSearchBarElement = withState(
onInputChange,
updateQueryState,
currentQueryState,
showSharedDropdown = false,
mineLabel = "",
Copy link
Contributor

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?

Suggested change
mineLabel = "",
mineLabel = undefined,

compact
size="small"
floated="right"
onClick={() => viewDraft()}
Copy link
Contributor

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?

Copy link
Member Author

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

@zzacharo
Copy link
Member Author

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 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 :)

@zzacharo
Copy link
Member Author

#2982 (comment) : I can have a look yes!

import { withState } from "react-searchkit";
import { Dropdown, Button } from "semantic-ui-react";

class SharedOrMineFilterComponent extends Component {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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) {
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[`${appName}.SearchBar.element`]: RequestsSearcBarElement,
[`${appName}.SearchBar.element`]: RequestsSearchBarElement,

@zzacharo zzacharo force-pushed the uploads-shared-mine branch 6 times, most recently from a5725a8 to f4d2424 Compare March 4, 2025 13:17
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.

Sharing a draft/record doesn't give access to corresponding record requests
4 participants