Skip to content

Commit

Permalink
Feature/seq editor cleanup (#1338)
Browse files Browse the repository at this point in the history
* Cleanup NumEditor and convert value to a number

* Added tooltip support for repeat args

* Removed utils.ts again

* Cleaned up DictionaryTable so theres only one selection type now

* Cleaned up dictionary permissions

* Removed aerie-phoenix-wordmark

* Disable seqn and seqjson exports when there is no sequence

* Added styles to the selected command section

* Converted fswCommandArgDefault to use a switch

* Renamed parcel to parameter dictionaries

* Some more cleanup

* Fixed toggling by clicking a row on the parcel page

* Fixed an issue where changing selected parameter dictionaries for a parcel wasn't enabling the save button

* Fixed an issue where selecting remove in the command editor panel didn't remove the broken argument

* Added st-typography-body to the no selected command text

* Fixed an issue where the delete button was showing on dictionaries on the parcel page

* Added some hint text to the Selected Command panel when there isn't a parcel selected

* Fixed an issue with the selected command panel wasn't propagating changes

* Removed the shared dictionary permission for creation

* Changed permissions for the dictionary create button to check every upload permission

* Fixed one more permission issue and added a div to support selected command testing

* Added back in the missing seq adaptation name field

* Removed unnecessary part of a regex

* Fixed some styling issues with the selected command panel

* Fixed an issue where the upload file button wasn't being disabled after
upload

* allow for panel body to show up when SeqJson editor is "hidden"

* Cleaned up the sequence store and removed all the parcel and parcel id weirdness

* Fixed an issue when creating a new parcel is another user adds one it reset changes

* Fixed an issue where parcels never became saveable

* Selected Command styling, fixes, range display

* Range display tweak

* NumEditor input validation fix

* Refactor

* Feature/remove sequence lang specifics (#1372)

* Moved to a more general seq editor and adaptation

* Fixed an issue where you could save a parcel without a name, fixed being able to upload multiple dictionaries at a time

* Fix plan metadata name input reset on snapshot preview (#1358)

* fix table action icons staying disabled when no longer in snapshot preview
* make table components less plan specific

* Add plan JSON export (#1357)

* add plan JSON export

* Hide plan export button (#1374)

* Release v2.15.0 (#1377)

Co-authored-by: joswig <[email protected]>

* Cleanup NumEditor and convert value to a number

Added tooltip support for repeat args

Removed utils.ts again

Cleaned up DictionaryTable so theres only one selection type now

Cleaned up dictionary permissions

Removed aerie-phoenix-wordmark

Disable seqn and seqjson exports when there is no sequence

Added styles to the selected command section

Converted fswCommandArgDefault to use a switch

Renamed parcel to parameter dictionaries

Some more cleanup

Fixed toggling by clicking a row on the parcel page

Fixed an issue where changing selected parameter dictionaries for a parcel wasn't enabling the save button

Fixed an issue where selecting remove in the command editor panel didn't remove the broken argument

Added st-typography-body to the no selected command text

Fixed an issue where the delete button was showing on dictionaries on the parcel page

Added some hint text to the Selected Command panel when there isn't a parcel selected

Fixed an issue with the selected command panel wasn't propagating changes

Removed the shared dictionary permission for creation

Changed permissions for the dictionary create button to check every upload permission

Fixed one more permission issue and added a div to support selected command testing

Added back in the missing seq adaptation name field

Removed unnecessary part of a regex

Fixed some styling issues with the selected command panel

Fixed an issue where the upload file button wasn't being disabled after
upload

allow for panel body to show up when SeqJson editor is "hidden"

Cleaned up the sequence store and removed all the parcel and parcel id weirdness

Fixed an issue when creating a new parcel is another user adds one it reset changes

Fixed an issue where parcels never became saveable

Moved to a more general seq editor and adaptation

Added more generic calling of to output and from input, tried to remove most of the referencs to seqjson

Renamed new-sequence-editor dir to sequence-editor

Fixed a whole bunch of broken imports

Added a helper function to get sequence adaptation globals

---------

Co-authored-by: Bryan <[email protected]>
Co-authored-by: Chet Joswig <[email protected]>
Co-authored-by: joswig <[email protected]>

* Fixed an issue where renaming the parcel and then saving wasn't setting parcelModified back to false

* Fixed some tests I broke

* Fixed all the to and from seq json unit tests

* Fixed an issue where the save button was flickering on the parcel page

* Removed unused var

* Added a max-width for the sequence editor tooltips

---------

Co-authored-by: bduran <[email protected]>
Co-authored-by: Aaron Plave <[email protected]>
Co-authored-by: Chet Joswig <[email protected]>
Co-authored-by: joswig <[email protected]>
  • Loading branch information
5 people authored and JosephVolosin committed Oct 21, 2024
1 parent 4147216 commit f3ca42f
Show file tree
Hide file tree
Showing 47 changed files with 1,625 additions and 1,394 deletions.
2 changes: 1 addition & 1 deletion e2e-tests/fixtures/Sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class Sequence {
this.editor = page.locator('.cm-activeLine').first();
this.command = this.editor.getByText(/C\s+FSW_CMD_0.*/);
this.jsonEditor = page.getByText(`{ "id": "${this.sequenceName}`);
this.jsonImport = page.locator('input[name="seqJsonFile"]');
this.jsonImport = page.locator('input[name="outputFile"]');
this.linter = page.locator('.cm-lint-marker');
this.page = page;
this.parcel = page.locator('select[name="parcel"]');
Expand Down
57 changes: 34 additions & 23 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* eslint-disable no-var */
/* eslint @typescript-eslint/no-unused-vars: 0 */
import type { ParameterDictionary } from '@nasa-jpl/aerie-ampcs';
import type { SeqJson } from '@nasa-jpl/seq-json-schema/types';
import type { GlobalType } from './types/global-type';
import type { ArgDelegator } from './utilities/new-sequence-editor/extension-points';

declare global {
namespace App {
Expand Down Expand Up @@ -49,28 +45,43 @@ declare global {
export default content;
}

var CONDITIONAL_KEYWORDS: { ELSE: string; ELSE_IF?: string[]; END_IF: string; IF: string[] } | undefined;
var LOOP_KEYWORDS:
var SequenceAdaptation:
| {
BREAK: string;
CONTINUE: string;
END_WHILE_LOOP: string;
WHILE_LOOP: string[];
ARG_DELEGATOR?: ArgDelegator;
CONDITIONAL_KEYWORDS?: { ELSE?: string; ELSE_IF?: string[]; END_IF?: string; IF: string[] };
GLOBALS?: GlobalType[];
INPUT_FORMAT?: {
NAME: string;
TO_INPUT_FORMAT?: (input: string) => Promise<string>;
};
LINT?: (commandDictionary, view, node) => any;
LOOP_KEYWORDS?: {
BREAK: string;
CONTINUE: string;
END_WHILE_LOOP: string;
WHILE_LOOP: string[];
};
MODFIY_OUTPUT?: (
output: SeqJson | any,
parameterDictionaries: ParameterDictionary[],
channelDictionary: ChannelDictionary | null,
) => any;
MODIFY_OUTPUT_PARSE?: (
output: SeqJson | any,
parameterDictionaries: ParameterDictionary[],
channelDictionary: ChannelDictionary | null,
) => any;
OUTPUT_FORMAT?: {
NAME: string;
TO_OUTPUT_FORMAT?: (
tree: Tree | any,
sequence: string,
commandDictionary: CommandDictionary | null,
sequenceName: string,
) => Promise<string>;
};
}
| undefined;
var GLOBALS: GlobalType[] | undefined;
var ARG_DELEGATOR: ArgDelegator | undefined;
function LINT(commandDictionary, view, node);
function TO_SEQ_JSON(
seqJson: SeqJson,
parameterDictionaries: ParameterDictionary[],
channelDictionary: ChannelDictionary | null,
);
function FROM_SEQ_JSON(
seqJson: SeqJson,
parameterDictionaries: ParameterDictionary[],
channelDictionary: ChannelDictionary | null,
);
}

export {};
8 changes: 0 additions & 8 deletions src/assets/aerie-phoenix-wordmark.svg

This file was deleted.

31 changes: 19 additions & 12 deletions src/components/expansion/ExpansionRuns.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import { base } from '$app/paths';
import type { ICellRendererParams } from 'ag-grid-community';
import { expansionRunsColumns } from '../../stores/expansion';
import { parcel, parcelId } from '../../stores/sequencing';
import { parcels } from '../../stores/sequencing';
import type { User } from '../../types/app';
import type { DataGridColumnDef, DataGridRowSelection } from '../../types/data-grid';
import type { ActivityInstanceJoin, ExpandedSequence, ExpansionRun } from '../../types/expansion';
import { seqJsonToSequence } from '../../utilities/new-sequence-editor/from-seq-json';
import type { Parcel } from '../../types/sequencing';
import { seqJsonToSequence } from '../../utilities/sequence-editor/from-seq-json';
import SequenceEditor from '../sequencing/SequenceEditor.svelte';
import CssGrid from '../ui/CssGrid.svelte';
import CssGridGutter from '../ui/CssGridGutter.svelte';
Expand All @@ -20,6 +21,18 @@
export let expansionRuns: ExpansionRun[] = [];
export let user: User | null;
let parcel: Parcel | null;
let selectedSequence: ExpandedSequence | null = null;
let selectedSequenceIds: number[] = [];
let selectedExpansionRun: ExpansionRun | null = null;
let sequenceDefinition: string;
$: convertOutputToSequence(selectedSequence);
async function convertOutputToSequence(sequence: ExpandedSequence | null): Promise<void> {
sequenceDefinition = (await seqJsonToSequence(sequence?.expanded_sequence)) ?? 'No Sequence Selected';
}
const columnDefs: DataGridColumnDef[] = [
{
field: 'id',
Expand Down Expand Up @@ -91,10 +104,7 @@
},
];
let selectedSequence: ExpandedSequence | null = null;
let selectedSequenceIds: number[] = [];
let selectedExpansionRun: ExpansionRun | null = null;
$: parcel = $parcels.find(p => p.id === selectedExpansionRun?.expansion_set.parcel_id) ?? null;
$: selectedSequenceIds = selectedSequence ? [selectedSequence.id] : [];
function toggleRun(event: CustomEvent<DataGridRowSelection<ExpansionRun>>) {
Expand All @@ -106,11 +116,8 @@
if (isSelected) {
selectedExpansionRun = clickedRun;
$parcelId = selectedExpansionRun.expansion_set.parcel_id;
} else if (selectedExpansionRun?.id === clickedRun.id) {
selectedExpansionRun = null;
$parcelId = null;
}
}
Expand Down Expand Up @@ -177,10 +184,10 @@
<CssGridGutter track={1} type="column" />

<SequenceEditor
parcel={$parcel}
sequenceDefinition={seqJsonToSequence(selectedSequence?.expanded_sequence, [], null) ?? 'No Sequence Selected'}
{parcel}
{sequenceDefinition}
sequenceName={selectedSequence?.seq_id}
sequenceSeqJson={selectedSequence ? JSON.stringify(selectedSequence.expanded_sequence, null, 2) : undefined}
sequenceOutput={selectedSequence ? JSON.stringify(selectedSequence.expanded_sequence, null, 2) : undefined}
readOnly={true}
title="Sequence - Definition Editor (Read-only)"
{user}
Expand Down
Loading

0 comments on commit f3ca42f

Please sign in to comment.