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

Allow adding, removing, and changing the "canonical dataset" in the Editor #2551

Merged
merged 11 commits into from
Dec 18, 2024

Conversation

robyngit
Copy link
Member

@robyngit robyngit commented Oct 15, 2024

Add an input in the Overview page of the EML Editor View that allows users to identify the authoritative version of the dataset:

image

github-actions[bot]

This comment was marked as resolved.

@robyngit
Copy link
Member Author

robyngit commented Oct 15, 2024

Left to do:

  • Validate the URI value and show validation errors
  • Update the metadataOverview template that is replicated in other themes

@robyngit robyngit linked an issue Oct 17, 2024 that may be closed by this pull request
- Add methods to add, remove, update, and find sameAs and derivedFrom annotations representing canonical datasets

Issue #2542
- Add logic to identify the canonical dataset while parsing EML
- Update the Annotations collection with the value in the canonical dataset input changes

Issue #2542
@robyngit robyngit force-pushed the feature-2542-add-source-dataset branch from 43c3062 to 4df698d Compare October 17, 2024 19:20
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

eslint

🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected method shorthand.

addBasicText: function (e) {
var category = $(e.target).attr("data-category"),
allBasicTexts = $(
".basic-text.new[data-category='" + category + "']",
);
//Only show one new row at a time
if (allBasicTexts.length == 1 && !allBasicTexts.val()) return;
else if (allBasicTexts.length > 1) return;
//We are only supporting one title right now
else if (category === "title" || category === "canonicalDataset")
return;
//Add another blank text input
var newRow = $(document.createElement("div")).addClass(
"basic-text-row",
);
newRow.append(
$(document.createElement("input"))
.attr("type", "text")
.attr("data-category", category)
.attr("placeholder", $(e.target).attr("placeholder"))
.addClass("new basic-text"),
);
$(e.target).parent().after(newRow);
$(e.target).after(
this.createRemoveButton(
null,
category,
".basic-text-row",
"div.text-container",
),
);
},


🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'var' declarations into multiple statements.

var category = $(e.target).attr("data-category"),
allBasicTexts = $(
".basic-text.new[data-category='" + category + "']",
);


🚫 [eslint] <no-var> reported by reviewdog 🐶
Unexpected var, use let or const instead.

var category = $(e.target).attr("data-category"),
allBasicTexts = $(
".basic-text.new[data-category='" + category + "']",
);


🚫 [eslint] <vars-on-top> reported by reviewdog 🐶
All 'var' declarations must be at the top of the function scope.

var newRow = $(document.createElement("div")).addClass(
"basic-text-row",
);


🚫 [eslint] <no-var> reported by reviewdog 🐶
Unexpected var, use let or const instead.

var newRow = $(document.createElement("div")).addClass(
"basic-text-row",
);

- Handle canonical dataset annotation errors specially so that they can be displayed in the new input field.
- Improve annotations validation to remove empty annotations and duplicates

Issue #2542
@robyngit robyngit force-pushed the feature-2542-add-source-dataset branch from 99cf131 to 877beac Compare November 4, 2024 15:52
github-actions[bot]

This comment was marked as duplicate.

- Fix the findDuplicates method to return the correct result

Issue #2542
@robyngit robyngit marked this pull request as ready for review November 4, 2024 19:20
Copy link
Member

@rushirajnenuji rushirajnenuji left a comment

Choose a reason for hiding this comment

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

Reviewed and tested this feature on my local instance of metacatUI. I was able to add, view and modify source dataset annotations, these changes looks good to me. Thank you @robyngit

rushirajnenuji and others added 2 commits December 17, 2024 12:44
Use DOI url as example of proper value for annotation value

Issue #2542
@@ -175,7 +174,7 @@ define(["jquery", "underscore", "backbone"], function ($, _, Backbone) {

/* Let the top level package know of attribute changes from this object */
trickleUpChange: function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected method shorthand.

Suggested change
trickleUpChange: function () {
trickleUpChange () {

@robyngit robyngit merged commit 399f5bc into develop Dec 18, 2024
1 check failed
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.

Allow editors to identify the canonical data package in the Editor
2 participants