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

Added the ability to define multiple output formats for sequence adap… #1410

Merged
merged 6 commits into from
Aug 20, 2024

Conversation

cohansen
Copy link
Contributor

@cohansen cohansen commented Aug 1, 2024

…tations

Allows sequences to have multiple output formats.

Sample adaptation to test with:

(() => {
  globalThis.SequenceAdaptation = {
    outputFormat: [
      {
        linter: function outputLinter(
          diagnostics: Diagnostic[],
          commandDictionary: CommandDictionary,
          view: EditorView,
          node: SyntaxNode,
        ): Diagnostic[] {
          diagnostics = [];

          return diagnostics;
        },
        name: 'Output 1',
        toOutputFormat: async function sequenceToSasf(
          node: Tree,
          sequence: string,
          commandDictionary: CommandDictionary | null,
          sequenceName: string,
        ): Promise<string> {
          return 'Output 1 Format.';
        },
      },
      {
        linter: function outputLinter(
          diagnostics: Diagnostic[],
          commandDictionary: CommandDictionary,
          view: EditorView,
          node: SyntaxNode,
        ): Diagnostic[] {
          diagnostics = [];

          return diagnostics;
        },
        name: 'Output 2',
        toOutputFormat: async function sequenceToSasf(
          node: Tree,
          sequence: string,
          commandDictionary: CommandDictionary | null,
          sequenceName: string,
        ): Promise<string> {
          return 'Output 2 Format';
        },
      },
    ],
  };
})();

@cohansen cohansen self-assigned this Aug 1, 2024
@cohansen cohansen requested a review from a team as a code owner August 1, 2024 00:25
Copy link
Collaborator

@duranb duranb left a comment

Choose a reason for hiding this comment

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

I think this is good to go! This doesn't include any of the followup changes that we discussed yet, right? Also I just noticed that when I download the outputs, it's just the file extension repeated twice (e.g. txt.txt or json.json). Is that intended? For the dropdown, how does one specify the file extension in the adaptation?

@cohansen
Copy link
Contributor Author

cohansen commented Aug 7, 2024

I think this is good to go! This doesn't include any of the followup changes that we discussed yet, right? Also I just noticed that when I download the outputs, it's just the file extension repeated twice (e.g. txt.txt or json.json). Is that intended? For the dropdown, how does one specify the file extension in the adaptation?

  1. Correct, none of the followup changes. Those will come after Ryan's next PR.
  2. I'll look into this, but you bring up a good point that we need to be able to specify the file type so I'll fix this and make that change.

@cohansen cohansen force-pushed the feature/multiple-output-formats branch from 89b3e83 to 1f0981e Compare August 15, 2024 16:23
@cohansen cohansen force-pushed the feature/multiple-output-formats branch from 1f0981e to a7e0ac4 Compare August 19, 2024 23:46
@cohansen cohansen merged commit baed513 into develop Aug 20, 2024
5 checks passed
@cohansen cohansen deleted the feature/multiple-output-formats branch August 20, 2024 00:17
JosephVolosin pushed a commit that referenced this pull request Oct 21, 2024
#1410)

* Added the ability to define multiple output formats for sequence adaptations

* Fixed an issue with the sequence file upload

* Fixed an issue when loading the sequence editor page

* Added fileExtension to each sequence adaptation output format

* Updated the sequence adaptation so it's executed directly rather than checking globalThis for state

* Updated SequenceEditor to use the new downloadJSON and downloadBlob functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants