Skip to content

Commit

Permalink
refactor: check if PS acct before guest check + move editor to pennsi…
Browse files Browse the repository at this point in the history
…eve ds flow
  • Loading branch information
aaronm-2112 committed Dec 16, 2024
1 parent bb71fca commit b80dd42
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -7983,6 +7983,21 @@ window.guidedResumeProgress = async (datasetNameToResume) => {
`);
}

// check if the user is an editor
let userDatasetRole = await api.getDatasetRole(
window.sodaJSONObj["digital-metadata"]["name"]
);

if (userDatasetRole === "editor") {
guidedSkipPage("guided-banner-image-tab");
guidedSkipPage("guided-designate-permissions-tab");
guidedSkipPage("guided-assign-license-tab");
} else {
guidedUnSkipPage("guided-banner-image-tab");
guidedUnSkipPage("guided-designate-permissions-tab");
guidedUnSkipPage("guided-assign-license-tab");
}

if (Object.keys(datasetResumeJsonObj["previously-uploaded-data"]).length > 0) {
await Swal.fire({
icon: "info",
Expand Down Expand Up @@ -8048,26 +8063,13 @@ window.guidedResumeProgress = async (datasetNameToResume) => {
guidedSkipPage(pageID);
}

// check if the user is an editor
let userDatasetRole = await api.getDatasetRole(
window.sodaJSONObj["bf-dataset-selected"]["dataset-name"]
);

if (userDatasetRole === "editor") {
guidedSkipPage("guided-banner-image-tab");
guidedSkipPage("guided-designate-permissions-tab");
guidedSkipPage("guided-assign-license-tab");
} else {
guidedUnSkipPage("guided-banner-image-tab");
guidedUnSkipPage("guided-designate-permissions-tab");
guidedUnSkipPage("guided-assign-license-tab");
}

let guest = await window.isWorkspaceGuest();
if (!guest) {
guidedUnSkipPage("guided-designate-permissions-tab");
} else {
guidedSkipPage("guided-designate-permissions-tab");
if (hasConnectedAccountWithPennsieve()) {
let guest = await window.isWorkspaceGuest();
if (!guest) {
guidedUnSkipPage("guided-designate-permissions-tab");
} else {
guidedSkipPage("guided-designate-permissions-tab");
}
}

// Skip this page incase it was not skipped in a previous session
Expand Down

0 comments on commit b80dd42

Please sign in to comment.