Support for adding color indicator that object is uploaded to SynBioHub - #462
Support for adding color indicator that object is uploaded to SynBioHub#462cjmyers wants to merge 2 commits into
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-hill-08172a210-462.centralus.5.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-hill-08172a210-462.centralus.5.azurestaticapps.net |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b553711326
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!objectType?.fileNameMatch) { | ||
| return false | ||
| } | ||
|
|
||
| return objectType.fileNameMatch.test(file.name) |
There was a problem hiding this comment.
Preserve content-classified XML files in the explorer
Do not require the filename matcher after classifyFile has already assigned an object type. For example, an existing SBOL document named design.xml is classified as ObjectTypes.SBOL from its contents, but this filter rejects it because it does not match _sbol.xml; arbitrary-name SBML documents behave similarly. Such files therefore disappear from both their activity and the complete local explorer after the working directory is refreshed.
Useful? React with 👍 / 👎.
| search_result = sbh_get_attachment_uri(sbh_url, sbh_token, sbh_user_graph, sbh_collection_url, resolved_name) | ||
| for binding in search_result["results"]["bindings"]: | ||
| uri = binding["s"]["value"] | ||
| uri = uri.replace(sbh_prefix,sbh_url) |
There was a problem hiding this comment.
Guard empty prefixes before rewriting attachment URLs
When an existing or manually created study.json lacks registryPrefix, CollectionWizard sends an empty string for sbh_prefix; on an update where the SPARQL query finds an existing attachment, Python's uri.replace('', sbh_url) inserts the API URL between every character and the subsequent /remove request fails. A null prefix raises a TypeError instead, so attachment updates need to fall back to the repository URL or skip replacement unless a nonempty prefix is present.
Useful? React with 👍 / 👎.
| const jsonFH = await currentDir.getFileHandle(fileName, { create: true }); | ||
| await writeToFileHandle(jsonFH, JSON.stringify(updatedJson)); |
There was a problem hiding this comment.
Delete upload sidecars with their XML files
Creating this sibling JSON file introduces persistent state that FileDelete does not remove when the user deletes the XML source. If a design/device is uploaded, deleted, and later recreated with the same filename, ExplorerListItem reads the orphaned sidecar and immediately colors the new, never-uploaded object green; the sidecar should be cleaned up with its XML file or otherwise tied to the source lifecycle.
Useful? React with 👍 / 👎.
Closes #448