Skip to content

Commit

Permalink
feat: enforce PI to be added
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronm-2112 committed Oct 23, 2024
1 parent e25600b commit 270ccab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,16 @@ const savePageChanges = async (pageBeingLeftID) => {
throw errorArray;
}

// Ensure at least one PI is assigned
const piContributors = contributors.filter((contributor) => contributor["role"] === "PI");
if (piContributors.length === 0) {
errorArray.push({
type: "notyf",
message: "Please assign at least one PI to your dataset",
});
throw errorArray;
}

// Make sure that all contributors have a valid fields
for (const contributor of contributors) {
if (!window.contributorDataIsValid(contributor)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2798,8 +2798,9 @@ <h1 class="text-sub-step-title">Contributor information</h1>
<ul class="help-text">
<li class="help-text text-left mb-2">
<b>Principal Investigator: </b>One and only one Principal Investigator is required
before the dataset can be published. However, please note that you may upload your
dataset before officially designating a Principal Investigator.
before the dataset can be published. You must assign one now.
However, please note that your Principal Investigator will not
automatically be made the owner of the dataset.
</li>
</ul>
</div>
Expand Down

0 comments on commit 270ccab

Please sign in to comment.