Skip to content
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

Import SATF Library Sequence #1592

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Import SATF Library Sequence #1592

wants to merge 7 commits into from

Conversation

goetzrrGit
Copy link
Contributor

@goetzrrGit goetzrrGit commented Jan 14, 2025

Closes #1591

Library Sequence Modal:

  • Introduced a new modal for importing a library sequence file.
  • Integrated the library modal with workspaces for seamless interaction.

Linting Bugfix:

  • Fixed an issue where the linter incorrectly reported errors for values within a valid range when multiple ranges were defined.
  • Fixed an issue where the linter incorrectly reported errors for command stems with no arguments.

Autocomplete Bugfix:

  • Improved autocomplete functionality to allow completion even with invalid variable types. The user will be notified of the invalid type within the editor and will need to manually correct it.

SATF/SASF Library

  • Fixed an issue where we were not generating the @model correctly.

TESTING

  • Download the attach file (banana_library.txt)
  • Rename it to banana_library.satf
  • Create a new workspace
  • In the middle panel underneath the 'create sequence' you should see a 'import library'
  • Click on 'import library' and select a parcel and library file ex. banana_library.satf
  • Verify the library gets imported and you see 3 sequences created

banana_library.txt

@goetzrrGit goetzrrGit added feature New feature or request sequencing Anything related to the sequencing domain labels Jan 14, 2025
@goetzrrGit goetzrrGit self-assigned this Jan 14, 2025
@goetzrrGit goetzrrGit requested a review from a team as a code owner January 14, 2025 21:49
@goetzrrGit goetzrrGit requested a review from AaronPlave January 14, 2025 21:49
@cohansen
Copy link
Contributor

Is this branch supposed to merge into #1574? It looks like a lot of the same changes.

@goetzrrGit
Copy link
Contributor Author

Is this branch supposed to merge into #1574? It looks like a lot of the same changes.

Yeah it is branched from 1574 and since that was merged in the first 4 fell off. It should now all be new code

src/components/sequencing/Sequences.svelte Show resolved Hide resolved
src/components/sequencing/Sequences.svelte Outdated Show resolved Hide resolved
src/components/sequencing/Sequences.svelte Outdated Show resolved Hide resolved
src/components/sequencing/Sequences.svelte Outdated Show resolved Hide resolved
src/components/sequencing/Sequences.svelte Outdated Show resolved Hide resolved
src/utilities/codemirror/codemirror-utils.ts Outdated Show resolved Hide resolved
src/components/sequencing/Sequences.svelte Outdated Show resolved Hide resolved
duranb
duranb previously requested changes Jan 28, 2025
@@ -59,6 +61,34 @@
const workspaceId = getSearchParameterNumber(SearchParameters.WORKSPACE_ID);
goto(`${base}/sequencing/new${workspaceId ? `?${SearchParameters.WORKSPACE_ID}=${workspaceId}` : ''}`);
}

async function importLibary(): Promise<void> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in importLibary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that

@@ -120,10 +120,10 @@ export function getDefaultVariableArgs(parameters: VariableDeclaration[]): strin
return parameter.allowable_values && parameter.allowable_values.length > 0
? `"${parameter.allowable_values[0]}"`
: parameter.enum_name
? `${parameter.enum_name}`
? `"${parameter.enum_name}"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the test for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure added a unit test to test this path

src/utilities/codemirror/codemirror-utils.ts Show resolved Hide resolved
name: seqN.name,
parcel_id: parcel,
seq_json: '',
workspace_id: workspaceId ? workspaceId : -1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will use -1 if workspaceId is 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh, I fixed this.

workspace_id: workspaceId !== null ? workspaceId : -1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duranb the dismissal here was to test sonarqube, consider this unresolved

return;
}
let contents = '';
try {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this try/catch prevent the logic from proceeding if it can't read the file? The importLibrarySequences effect might be better equipped to handle this logic and also return the contents. Then it can show a failure modal as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved things into the effects.importLibrarySequences so everything is handled there. Thank you for the suggestions

This modal allows you to select a parcel and import a library sequence file
The linter incorrectly reported errors for values within a valid range when multiple ranges were defined. For example, if the ranges were 5-10 and 11-20, the linter would erroneously flag the value 8 as invalid because it falls outside the 11-20 range, even though it is valid within the 5-10 range.
…invalid variable types.

Allow autocomplete to succeed and show the ERROR parameter value. The user will see this error in the editor and manually have to fix it.
goetzrrGit and others added 2 commits January 29, 2025 13:05
There shouldn't be any parenthesis and commas in the SeqN generation
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

joswig
joswig previously approved these changes Jan 29, 2025
Copy link
Collaborator

@joswig joswig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing sonarqube gate, not inspecting contents

@joswig joswig dismissed stale reviews from duranb and themself January 29, 2025 23:47

testing sonarqube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request sequencing Anything related to the sequencing domain
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Import SATF Library Sequences Prototype
4 participants