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

Feature/seq editor cleanup #1338

Merged
merged 40 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cf3a014
Cleanup NumEditor and convert value to a number
cohansen May 23, 2024
752ccb2
Added tooltip support for repeat args
cohansen May 23, 2024
623394e
Removed utils.ts again
cohansen May 24, 2024
fdf4710
Cleaned up DictionaryTable so theres only one selection type now
cohansen Jun 12, 2024
24fce1f
Cleaned up dictionary permissions
cohansen Jun 13, 2024
cd0ce30
Removed aerie-phoenix-wordmark
cohansen Jun 13, 2024
5ee5ef7
Disable seqn and seqjson exports when there is no sequence
cohansen Jun 13, 2024
fc4d5a0
Added styles to the selected command section
cohansen Jun 17, 2024
c582374
Converted fswCommandArgDefault to use a switch
cohansen Jun 17, 2024
c58598b
Renamed parcel to parameter dictionaries
cohansen Jun 17, 2024
73658d3
Some more cleanup
cohansen Jun 18, 2024
5673fad
Fixed toggling by clicking a row on the parcel page
cohansen Jun 20, 2024
077af54
Fixed an issue where changing selected parameter dictionaries for a p…
cohansen Jun 20, 2024
d451f93
Fixed an issue where selecting remove in the command editor panel did…
cohansen Jun 20, 2024
814e50c
Added st-typography-body to the no selected command text
cohansen Jun 20, 2024
d4a545f
Fixed an issue where the delete button was showing on dictionaries on…
cohansen Jun 20, 2024
f3a2c56
Added some hint text to the Selected Command panel when there isn't a…
cohansen Jun 20, 2024
a2fb43f
Fixed an issue with the selected command panel wasn't propagating cha…
cohansen Jun 20, 2024
b000de8
Removed the shared dictionary permission for creation
cohansen Jun 26, 2024
056348a
Changed permissions for the dictionary create button to check every u…
cohansen Jun 26, 2024
4f43488
Fixed one more permission issue and added a div to support selected c…
cohansen Jun 26, 2024
ba53cb2
Added back in the missing seq adaptation name field
cohansen Jun 27, 2024
6d6a9c9
Removed unnecessary part of a regex
cohansen Jun 27, 2024
1349335
Fixed some styling issues with the selected command panel
cohansen Jun 27, 2024
fb03d4d
Fixed an issue where the upload file button wasn't being disabled after
cohansen Jun 27, 2024
98a342b
allow for panel body to show up when SeqJson editor is "hidden"
duranb Jun 27, 2024
54a17bb
Cleaned up the sequence store and removed all the parcel and parcel i…
cohansen Jun 27, 2024
00e8032
Fixed an issue when creating a new parcel is another user adds one it…
cohansen Jul 1, 2024
32110da
Fixed an issue where parcels never became saveable
cohansen Jul 2, 2024
facfa7f
Selected Command styling, fixes, range display
AaronPlave Jul 9, 2024
a56354d
Range display tweak
AaronPlave Jul 9, 2024
033b2ea
NumEditor input validation fix
AaronPlave Jul 11, 2024
8d61e53
Refactor
AaronPlave Jul 15, 2024
ad6f3a9
Feature/remove sequence lang specifics (#1372)
cohansen Jul 16, 2024
0b4990d
Fixed an issue where renaming the parcel and then saving wasn't setti…
cohansen Jul 16, 2024
0e9d599
Fixed some tests I broke
cohansen Jul 16, 2024
541f1e3
Fixed all the to and from seq json unit tests
cohansen Jul 16, 2024
ca2300e
Fixed an issue where the save button was flickering on the parcel page
cohansen Jul 16, 2024
72d94ac
Removed unused var
cohansen Jul 17, 2024
55bc3ad
Added a max-width for the sequence editor tooltips
cohansen Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading