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
base: master
Are you sure you want to change the base?
deposit form: add sharing of drafts #2668
Conversation
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.
Clean PR, good job! 👏🏼 If you have time, you might want to clean up some of the other linting issues reported in the PR ;)
{%- if config %} | ||
<input type="hidden" name="deposits-groups-enabled" | ||
value='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }}'> | ||
{%- endif %} | ||
|
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.
Config is always there, and I would also change the name:
{%- 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"; |
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.
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) && ( |
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.
Can it be null
? Shouldn't it be true/false?
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.
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")} |
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.
groupsEnabled={getInputFromDOM("deposits-groups-enabled")} | |
groupsEnabled={getInputFromDOM("config-groups-enabled")} |
b461d11
to
feffe77
Compare
feffe77
to
a9ec4d5
Compare
Updated dropdowns:
Share button on the deposit form:
enabled:
disabled: