-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: 15.2.3 bug fix release #370
Conversation
Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again! |
Reviewer's Guide by SourceryThis PR implements bug fixes for version 15.2.3, focusing on two main areas: dataset name validation and guided mode progress saving. The changes improve the handling of forbidden characters in dataset names and enhance the reliability of progress saving in guided mode by consolidating the save logic and ensuring it's called after successful page transitions. Sequence diagram for guidedSaveProgress invocationsequenceDiagram
participant User
participant App
participant guidedSaveProgress
User->>App: Navigate to a new page
App->>guidedSaveProgress: Call guidedSaveProgress()
guidedSaveProgress-->>App: Save progress
App-->>User: Page transition complete
Class diagram for dataset name validationclassDiagram
class App {
+evaluateStringAgainstSdsRequirements(stringToTest, stringCase)
}
class DatasetNameValidation {
+check_forbidden_characters_ps(datasetNameInput)
+evaluateStringAgainstSdsRequirements(datasetNameInput, "string-contains-forbidden-characters")
}
App <|-- DatasetNameValidation
note for DatasetNameValidation "Updated to use evaluateStringAgainstSdsRequirements for forbidden character check"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @aaronm-2112 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -3000,9 +3006,14 @@ const guidedTransitionFromDatasetNameSubtitlePage = () => { | |||
$("#guided-footer-div").css("display", "flex"); | |||
}; | |||
|
|||
const saveGuidedProgress = async (guidedProgressFileName) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider consolidating duplicate save operations and simplifying async flow patterns.
The code has accumulated unnecessary complexity that can be simplified while maintaining functionality:
- Consolidate duplicate save functions:
// Remove saveGuidedProgress and update guidedSaveProgress
const guidedSaveProgress = async () => {
const fileName = window.sodaJSONObj?.["digital-metadata"]?.["name"];
if (!fileName || typeof fileName !== "string" || !fileName.length) {
return;
}
window.sodaJSONObj["last-modified"] = new Date();
const currentVersion = document.getElementById("version").innerHTML;
window.sodaJSONObj["last-version-of-soda-used"] = currentVersion;
try {
await window.fs.mkdir(guidedProgressFilePath, { recursive: true });
await window.fs.writeFile(
guidedFilePath,
JSON.stringify(window.sodaJSONObj, null, 2)
);
} catch (error) {
window.log.error(error);
throw error;
}
};
- Remove unnecessary async conversion:
const guidedGetPageToReturnTo = (sodaJSONObj) => {
const firstPageID = getNonSkippedGuidedModePages(document)[0].id;
if (window.sodaJSONObj["previous-guided-upload-dataset-name"]) {
return "guided-dataset-dissemination-tab";
}
const currentVersion = document.getElementById("version").innerHTML;
if (window.sodaJSONObj["last-version-of-soda-used"] !== currentVersion) {
// Show version change message where needed, e.g. in openPage
return firstPageID;
}
return window.sodaJSONObj["page-before-exit"] || firstPageID;
};
These changes simplify the code by:
- Eliminating duplicate save functions
- Removing unnecessary async/await
- Centralizing error handling
- Making the code flow more linear and easier to follow
Quality Gate passedIssues Measures |
Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help! |
Summary by Sourcery
Release version 15.2.3 with bug fixes for forbidden characters in dataset names and improved save progress handling in Guided Mode.
Bug Fixes:
Enhancements: