Skip to content

Commit

Permalink
fix: 🐛 Added method to determine origin of generated manifest files
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Aug 17, 2023
1 parent 8f8c29f commit 65d6817
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -7415,6 +7415,9 @@ const patchPreviousGuidedModeVersions = async () => {
sodaJSONObj["digital-metadata"]["license"] = "";
}

if (!sodaJSONObj["curation-mode"]) {
sodaJSONObj["cuartion-mode"] = "guided";
}
// If no other conditions are met, return the page the user was last on
return sodaJSONObj["page-before-exit"];
};
Expand Down Expand Up @@ -7625,6 +7628,7 @@ guidedCreateSodaJSONObj = () => {
sodaJSONObj = {};

sodaJSONObj["guided-options"] = {};
sodaJSONObj["cuartion-mode"] = "guided";
sodaJSONObj["bf-account-selected"] = {};
sodaJSONObj["dataset-structure"] = { files: {}, folders: {} };
sodaJSONObj["generate-dataset"] = {};
Expand Down
15 changes: 10 additions & 5 deletions scripts/metadata-files/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1335,13 +1335,18 @@ const initiate_generate_manifest_bf = async () => {

// Verify the origin of dataset for kombucha tracking
let origin = "";
if ("local-path" in sodaJSONObj["starting-point"]) {
origin = "Local";
if (document.getElementById("create_manifest-section").classList.contains("is-shown")) {
// If the standalone manifest generator tab is currently shown
origin = "standalone-manifest-generator";
} else if (sodaJSONObj?.["cuartion-mode"] === "guided") {
// If the special guided mode curation-mode key is found
origin = "guided-mode-manifest-generator";
} else {
// Otherwise the manifest files were generated in FFM
origin = "free-form-mode-manifest-gerator";
}

if ("bf" in sodaJSONObj["starting-point"]["type"]) {
origin = "Pennsieve";
}
console.log("origin", origin);

// log the manifest file creation to analytics
logMetadataForAnalytics(
Expand Down

0 comments on commit 65d6817

Please sign in to comment.