-
Notifications
You must be signed in to change notification settings - Fork 173
feat: file modification #3204
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
Open
carlinmack
wants to merge
8
commits into
inveniosoftware:master
Choose a base branch
from
carlinmack:file-mod-req
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: file modification #3204
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4228922
fix: align selector with semantic-ui
carlinmack 5fd8bca
feat: pass file modification eval to deposit form
carlinmack 6f11303
chore: relax proptypes
carlinmack 31b134c
fix: set files_locked to .locked rather than permission
carlinmack 726cf9c
request: add file mod request template
carlinmack 80b1fb2
chore: refactor to reduce indentation
carlinmack 217bf3e
UI: add info message about remaining days to publish changes
carlinmack 9f01b4c
chore: improve code from review
carlinmack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...o_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/file-modification/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| {# -*- coding: utf-8 -*- | ||
|
|
||
| This file is part of Invenio. | ||
| Copyright (C) 2016-2025 CERN. | ||
|
|
||
| Invenio is free software; you can redistribute it and/or modify it | ||
| under the terms of the MIT License; see LICENSE file for more details. | ||
| #} | ||
|
|
||
| {% extends "invenio_requests/details/index.html" %} | ||
|
|
||
| {% set active_dashboard_menu_item = 'requests' %} | ||
| {% set active_community_header_menu_item = 'requests' %} | ||
|
|
||
| {%- block request_header %} | ||
| {% set back_button_url = url_for("invenio_app_rdm_users.requests") %} | ||
| {% from "invenio_requests/macros/request_header.html" import inclusion_request_header %} | ||
| {{ inclusion_request_header( | ||
| request=invenio_request, | ||
| record=record, | ||
| accepted=request_is_accepted, | ||
| back_button_url=back_button_url, | ||
| back_button_text=_("Back to requests") | ||
| ) }} | ||
| {%- endblock request_header %} | ||
|
|
||
| {% block request_timeline %} | ||
| <div | ||
| class="ui container rdm-tab-container fluid rel-pt-2 ml-0-mobile mr-0-mobile" | ||
| id="request-request-deletion-tab-container" | ||
| > | ||
| <div | ||
| class="ui secondary pointing menu rdm-tab-menu" | ||
| id="request-deletion-request-tab" | ||
| > | ||
| <a | ||
| class="active item" | ||
| data-tab="conversation" | ||
| role="tab" | ||
| aria-selected="true" | ||
| aria-controls="conversation-tab-panel" | ||
| id="conversation-tab" | ||
| > | ||
| {{ _("Conversation") }} | ||
| </a> | ||
|
|
||
| {% if record_ui %} | ||
| <a | ||
| role="tab" | ||
| class="item" | ||
| data-tab="record" | ||
| aria-selected="false" | ||
| aria-controls="record-tab-panel" | ||
| id="record-tab" | ||
| > | ||
| {{ _("Record") }} | ||
| </a> | ||
| {% endif %} | ||
| </div> | ||
|
|
||
| <div | ||
| class="ui bottom attached tab segment active borderless p-0" | ||
| data-tab="conversation" | ||
| role="tabpanel" | ||
| aria-labelledby="conversation-tab" | ||
| id="conversation-tab-panel" | ||
| > | ||
| {{ super() }} | ||
| </div> | ||
|
|
||
| {# The record tab content needs to be last since the HTML structure is complex and breaks following tab contents #} | ||
| {% if record_ui %} | ||
| <div | ||
| class="ui bottom attached tab segment borderless" | ||
| data-tab="record" | ||
| role="tabpanel" | ||
| aria-labelledby="record-tab" | ||
| id="record-tab-panel" | ||
| hidden="hidden" | ||
| > | ||
| {% set use_theme_basic_template = false %} | ||
| {% set preview_submission_request = true %} | ||
| {% include config.APP_RDM_RECORD_LANDING_PAGE_TEMPLATE %} | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| </div> | ||
| {% endblock request_timeline %} |
45 changes: 45 additions & 0 deletions
45
...o_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // This file is part of InvenioRDM | ||
| // Copyright (C) 2025 CERN. | ||
| // | ||
| // Invenio RDM Records is free software; you can redistribute it and/or modify it | ||
| // under the terms of the MIT License; see LICENSE file for more details. | ||
|
|
||
| import React, { Component } from "react"; | ||
| import PropTypes from "prop-types"; | ||
| import { i18next } from "@translations/invenio_app_rdm/i18next"; | ||
|
|
||
| export class FileModificationUntil extends Component { | ||
| render() { | ||
| const { filesLocked, fileModification, record } = this.props; | ||
|
|
||
| if (!fileModification.fileModification?.enabled) { | ||
| return null; | ||
| } | ||
|
|
||
| const isPublished = record.is_published; | ||
| const filesUnlocked = !filesLocked; | ||
| const daysUntil = fileModification.context?.days_until; | ||
| if (isPublished && filesUnlocked && daysUntil) { | ||
| return ( | ||
| <> | ||
| {" "} | ||
| {i18next.t("– Unlocked, {{ daysUntil }} days to publish changes", { | ||
| daysUntil: fileModification.context.days_until, | ||
| })} | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
| } | ||
|
|
||
| FileModificationUntil.propTypes = { | ||
| filesLocked: PropTypes.bool.isRequired, | ||
| fileModification: PropTypes.object, | ||
| record: PropTypes.object.isRequired, | ||
| }; | ||
|
|
||
| FileModificationUntil.defaultProps = { | ||
| fileModification: {}, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Could you share why was this required here?
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.
for when we were having different behaviour for internal vs external DOIs. Lars has said we're changing policy and treating them all the same and now no longer required