feat: Implement youtube, citation, and input/output data schema additions#874
Draft
Karthik99999 wants to merge 1 commit into
Draft
feat: Implement youtube, citation, and input/output data schema additions#874Karthik99999 wants to merge 1 commit into
Karthik99999 wants to merge 1 commit into
Conversation
| value = value[4:].strip() | ||
| if value.lower().startswith("http://") or value.lower().startswith("https://"): | ||
| parsed = urlparse(value) | ||
| if parsed.netloc.endswith("doi.org") and parsed.path: |
| raise ValidationError(_(f"Invalid DOI link: {value}")) | ||
| if value.lower().startswith("http://") or value.lower().startswith("https://"): | ||
| parsed = urlparse(value) | ||
| if parsed.netloc.endswith("doi.org") and parsed.path: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the codebase/release metadata model to support (1) an optional YouTube video alongside release images, (2) structured “associated publications” (DOI links with a “include in citation” flag), and (3) a new release-level inputDataUrl in addition to outputDataUrl, with corresponding updates across the Django API, templates, and Vue UI.
Changes:
- Add
youtubeUrlto codebases and render it in the release detail media gallery (plus a new “Add Media” modal in the release editor). - Replace freeform
associatedPublicationTextwith structuredassociatedPublications[]and update citation/rendering behavior to use the new structure. - Add
inputDataUrlto releases and include it in both the release editor metadata form and CodeMeta “supportingData”.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/types.ts | Adds new TS types/fields for YouTube, associated publications, and input data URL. |
| frontend/src/stores/releaseEditor.ts | Wires inputDataUrl, youtubeUrl, and associatedPublications into the editor store state/metadata mapping. |
| frontend/src/components/releaseEditor/MetadataFormPage.vue | Adds an “Input Data URL” field + validation (but includes a stray console log). |
| frontend/src/components/releaseEditor/CommonMediaModal.vue | New modal combining image upload with optional YouTube URL saving. |
| frontend/src/components/releaseEditor/CommonImagesModal.vue | Removed in favor of the combined media modal. |
| frontend/src/components/releaseEditor/App.vue | Switches UI from images-only modal to the new media modal. |
| frontend/src/components/ImageGallery.vue | Extends gallery to support a video item + embed modal. |
| frontend/src/components/form/AssociatedPublicationListField.vue | New form field for managing/sorting DOI links and citation inclusion. |
| frontend/src/components/CodebaseEditForm.vue | Replaces old textarea with the new structured associated publications field. |
| frontend/src/apps/image_gallery.ts | Passes videoUrl from server-rendered data attributes into the Vue gallery app. |
| e2e/cypress/tests/codebase.spec.ts | Updates Cypress selector for the renamed “add media” button. |
| django/library/serializers.py | Adds validation/serialization for associated publications and exposes youtube_url + input_data_url. |
| django/library/permissions.py | Whitespace-only change. |
| django/library/models.py | Adds new DB fields + updates citation assembly and draft creation behavior. |
| django/library/migrations/0038_codebase_associated_publications_and_more.py | Adds DB fields for associated publications, preferred citation, YouTube URL, and release input data URL. |
| django/library/metadata.py | Updates CodeMeta conversion to include associated publication links and both input/output supporting data. |
| django/library/jinja2/library/codebases/releases/retrieve.jinja | Updates release detail rendering for associated publications, YouTube gallery, input data URL, and DOI citation formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| initialValues: {}, | ||
| showPlaceholder: isLoading, | ||
| onSubmit: async () => { | ||
| console.log(values); |
Comment on lines
+3
to
+6
| <slot name="label"> | ||
| <FieldLabel v-if="label" :label="label" :id-for="id" :required="required" /> | ||
| </slot> | ||
| <FormPlaceholder v-if="showPlaceholder" /> |
Comment on lines
+9
to
+13
| <input | ||
| v-model="candidateDoi" | ||
| :id="`${id}-candidate-doi`" | ||
| :class="['form-control', { 'is-invalid': localErrors.doi }]" | ||
| :placeholder="placeholder" |
Comment on lines
+164
to
+168
| const mediaItems = computed<MediaItem[]>(() => { | ||
| const items: MediaItem[] = props.images.map(src => ({ type: "image", src })); | ||
| if (props.videoUrl) { | ||
| items.unshift({ type: "video", src: props.videoUrl }); | ||
| } |
| @@ -1529,7 +1569,6 @@ def get_or_create_draft(self, initial_version: str | None = None): | |||
| # reset fields that should not be copied over to a new draft | |||
| draft_release.doi = None | |||
| draft_release.release_notes = "" | |||
Comment on lines
+13
to
+17
| migrations.AddField( | ||
| model_name="codebase", | ||
| name="associated_publications", | ||
| field=models.JSONField( | ||
| blank=True, |
| @@ -3378,10 +3420,9 @@ def __init__(self, release: CodebaseRelease): | |||
| release.citation_text, | |||
| codebase.references_text, | |||
| codebase.replication_text, | |||
Comment on lines
80
to
+82
| <h2>Associated Publications</h2> | ||
| <p>{{ markdown(codebase.associated_publication_text) }}</p> | ||
| {% if codebase.associated_publications %} | ||
| <ul> |
| data-cy="codebase-associated-publications" | ||
| :rows="3" | ||
| help="Add DOI links for publications related to this model. Check the box to include a publication in the citation area alongside the main model citation." | ||
| placeholder="https://doi.org/10.1234/example" |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
comses/planning#332
Currently does not include changes to the Upload Form Page to include fields to edit input/output urls, still figuring out issues with actually saving the data on that page.