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

deposit form: add sharing of drafts #2668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anikachurilova
Copy link
Contributor

@anikachurilova anikachurilova commented May 8, 2024

Updated dropdowns:
Screenshot 2024-05-08 at 17 24 49
Screenshot 2024-05-08 at 17 25 12
Screenshot 2024-05-08 at 17 25 24

Share button on the deposit form:
enabled:
Screenshot 2024-05-08 at 17 26 20
disabled:
Screenshot 2024-05-08 at 17 26 47

Copy link
Contributor

@ntarocco ntarocco left a comment

Choose a reason for hiding this comment

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

Clean PR, good job! 👏🏼 If you have time, you might want to clean up some of the other linting issues reported in the PR ;)

Comment on lines 44 to 50
{%- if config %}
<input type="hidden" name="deposits-groups-enabled"
value='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }}'>
{%- endif %}

Copy link
Contributor

Choose a reason for hiding this comment

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

Config is always there, and I would also change the name:

Suggested change
{%- if config %}
<input type="hidden" name="deposits-groups-enabled"
value='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }}'>
{%- endif %}
<input type="hidden" name="config-groups-enabled"
value='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }}'>

@@ -43,6 +43,7 @@ import { FundingField } from "@js/invenio_vocabularies";
import { Card, Container, Grid, Ref, Sticky } from "semantic-ui-react";
import PropTypes from "prop-types";
import Overridable from "react-overridable";
import { ShareDraftButton } from "../landing_page/ShareOptions/ShareDraftButton";
Copy link
Contributor

Choose a reason for hiding this comment

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

We should maybe move the button away from landing_page/, to a more generic/global components module

@@ -614,6 +621,16 @@ export class RDMDepositForm extends Component {
<Grid.Column width={16} className="pt-10">
<PublishButton fluid />
</Grid.Column>

<Grid.Column width={16} className="pt-0">
{(record.is_draft === null || permissions.can_manage) && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be null? Shouldn't it be true/false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is_draft is null after just clicking on the "New upload" and rendering an empty deposit form

@@ -22,6 +22,7 @@ ReactDOM.render(
config={getInputFromDOM("deposits-config")}
permissions={getInputFromDOM("deposits-record-permissions")}
filesLocked={getInputFromDOM("deposits-record-locked-files")}
groupsEnabled={getInputFromDOM("deposits-groups-enabled")}
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
groupsEnabled={getInputFromDOM("deposits-groups-enabled")}
groupsEnabled={getInputFromDOM("config-groups-enabled")}

@kpsherva
Copy link
Contributor

  1. The view goes blank if I try to share metadata only unsaved draft
  2. while granting access:
    Screenshot 2024-05-14 at 14 51 44

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.

deposit form: share draft deposit: sharing of uploads
3 participants