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

Merged
merged 1 commit into from
May 29, 2024

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

@anikachurilova anikachurilova force-pushed the add-share-draft branch 2 times, most recently from feffe77 to a9ec4d5 Compare May 23, 2024 15:26
@@ -361,6 +361,8 @@ def new_record():
defaults = current_app.config.get("APP_RDM_DEPOSIT_FORM_DEFAULTS") or {}
for key, value in defaults.items():
set_default_value(record, value, key)

record["parent"]["access"] = {"grants": [], "links": []}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this part be handled by dump_empty in 354 line?

@anikachurilova anikachurilova force-pushed the add-share-draft branch 3 times, most recently from e60102a to 604dda2 Compare May 28, 2024 13:20
@kpsherva kpsherva merged commit badd12b into inveniosoftware:master May 29, 2024
2 checks passed
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