Skip to content

Commit

Permalink
Reorganize Phoenix Editor files to be a little more discoverable (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
duranb authored Feb 26, 2025
1 parent 0d1b419 commit 320fcf2
Show file tree
Hide file tree
Showing 69 changed files with 507 additions and 394 deletions.
18 changes: 9 additions & 9 deletions src/components/parcels/DictionaryTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import { createEventDispatcher } from 'svelte';
import type { User } from '../../types/app';
import type { DataGridColumnDef, DataGridRowSelection, RowId } from '../../types/data-grid';
import type { DictionaryType } from '../../types/sequencing';
import type { DictionaryMetadata } from '../../types/sequencing';
import DataGridActions from '../ui/DataGrid/DataGridActions.svelte';
import SingleActionDataGrid from '../ui/DataGrid/SingleActionDataGrid.svelte';
import Panel from '../ui/Panel.svelte';
import SectionTitle from '../ui/SectionTitle.svelte';
export let dictionaries: DictionaryType[];
export let dictionaries: DictionaryMetadata[];
export let selectedDictionaryIds: Record<number, boolean> = {};
export let isEditingDictionaries: boolean = false;
export let isEditingParcel: boolean = false;
Expand All @@ -22,7 +22,7 @@
export let user: User | null;
let columnDefs: DataGridColumnDef[];
let dictionaryDataGrid: SingleActionDataGrid<DictionaryType> | undefined = undefined;
let dictionaryDataGrid: SingleActionDataGrid<DictionaryMetadata> | undefined = undefined;
let dictionaryColumnDefs: DataGridColumnDef[];
let displayText: string = '';
let displayTextPlural: string = '';
Expand All @@ -37,9 +37,9 @@
}>();
type CellRendererParams = {
deleteDictionary?: (dictionary: DictionaryType) => void;
deleteDictionary?: (dictionary: DictionaryMetadata) => void;
};
type DictionaryCellRendererParams = ICellRendererParams<DictionaryType> & CellRendererParams;
type DictionaryCellRendererParams = ICellRendererParams<DictionaryMetadata> & CellRendererParams;
$: isSequenceAdaptation = type === 'Sequence';
$: displayText = isSequenceAdaptation ? `${type} Adaptation` : `${type} Dictionary`;
Expand Down Expand Up @@ -90,7 +90,7 @@
headerName: '',
suppressAutoSize: true,
suppressSizeToFit: true,
valueGetter: (params: ValueGetterParams<DictionaryType>) => {
valueGetter: (params: ValueGetterParams<DictionaryMetadata>) => {
const { data } = params;
if (data) {
Expand Down Expand Up @@ -150,7 +150,7 @@
...(isEditingDictionaries ? editingDictionariesColumnDefs : []),
];
function deleteDictionary({ id }: Pick<DictionaryType, 'id'>) {
function deleteDictionary({ id }: Pick<DictionaryMetadata, 'id'>) {
dispatch('delete', { id });
}
Expand All @@ -162,7 +162,7 @@
* Called when a row is clicked on.
* @param event
*/
function onRowClicked(event: CustomEvent<DataGridRowSelection<DictionaryType>>) {
function onRowClicked(event: CustomEvent<DataGridRowSelection<DictionaryMetadata>>) {
const currentValue = selectedDictionaryIds[event.detail.data.id];
selectRow(event.detail.data.id, currentValue === undefined ? true : !currentValue);
Expand All @@ -172,7 +172,7 @@
* Called when a checkbox is selected.
* @param event
*/
function onToggle(event: CustomEvent<CellEditingStoppedEvent<DictionaryType, boolean>>) {
function onToggle(event: CustomEvent<CellEditingStoppedEvent<DictionaryMetadata, boolean>>) {
const {
detail: { data, newValue },
} = event;
Expand Down
2 changes: 1 addition & 1 deletion src/components/sequencing/CommandPanel/CommandArg.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
isFswCommandArgumentRepeat,
isNumberArg,
isStringArg,
} from '../../../utilities/codemirror/codemirror-utils';
} from '../../../utilities/sequence-editor/sequence-utils';
import CommandBooleanArgDef from './CommandBooleanArgDef.svelte';
import CommandEnumArgDef from './CommandEnumArgDef.svelte';
import CommandNumberArgDef from './CommandNumberArgDef.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import SearchIcon from '@nasa-jpl/stellar/icons/search.svg?component';
import CopyIcon from 'bootstrap-icons/icons/copy.svg?component';
import { createEventDispatcher } from 'svelte';
import { isFswCommand, isFswCommandArgumentEnum } from '../../../utilities/codemirror/codemirror-utils';
import { getTarget } from '../../../utilities/generic';
import { isFswCommand, isFswCommandArgumentEnum } from '../../../utilities/sequence-editor/sequence-utils';
import { showFailureToast, showSuccessToast } from '../../../utilities/toast';
import { tooltip } from '../../../utilities/tooltip';
import Input from '../../form/Input.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
isFswCommandArgumentInteger,
isFswCommandArgumentNumeric,
isFswCommandArgumentUnsigned,
} from '../../../utilities/codemirror/codemirror-utils';
} from '../../../utilities/sequence-editor/sequence-utils';
import Collapse from '../../Collapse.svelte';
import CommandArgUnit from './CommandArgUnit.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/components/sequencing/CommandPanel/CommandPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { CommandDictionary, FswCommand, HwCommand } from '@nasa-jpl/aerie-ampcs';
import type { EditorView } from 'codemirror';
import type { ArgTextDef, TimeTagInfo } from '../../../types/sequencing';
import type { CommandInfoMapper } from '../../../utilities/codemirror/commandInfoMapper';
import type { CommandInfoMapper } from '../../../utilities/sequence-editor/command-info-mapper';
import Tab from '../../ui/Tabs/Tab.svelte';
import TabPanel from '../../ui/Tabs/TabPanel.svelte';
import Tabs from '../../ui/Tabs/Tabs.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<script lang="ts">
import type { FswCommandArgumentFixedString, FswCommandArgumentVarString } from '@nasa-jpl/aerie-ampcs';
import { isFswCommandArgumentVarString } from '../../../utilities/codemirror/codemirror-utils';
import { isFswCommandArgumentVarString } from '../../../utilities/sequence-editor/sequence-utils';
import Collapse from '../../Collapse.svelte';
import CommandArgUnit from './CommandArgUnit.svelte';
Expand Down
4 changes: 2 additions & 2 deletions src/components/sequencing/CommandPanel/SelectedCommand.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import { debounce } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import type { ArgTextDef, TimeTagInfo } from '../../../types/sequencing';
import type { CommandInfoMapper } from '../../../utilities/codemirror/commandInfoMapper';
import type { CommandInfoMapper } from '../../../utilities/sequence-editor/command-info-mapper';
import { addDefaultArgs, getMissingArgDefs } from '../../../utilities/sequence-editor/sequence-utils';
import { tooltip } from '../../../utilities/tooltip';
import AddMissingArgsButton from '../form/AddMissingArgsButton.svelte';
import ArgEditor from '../form/ArgEditor.svelte';
import StringEditor from '../form/StringEditor.svelte';
import { addDefaultArgs, getMissingArgDefs } from './../../../utilities/codemirror/codemirror-utils';
export let argInfoArray: ArgTextDef[] = [];
export let commandDef: (FswCommand | HwCommand) | null = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<svelte:options immutable={true} />

<script lang="ts">
import { SeqLanguage } from '../../../utilities/codemirror';
import { SeqLanguage } from '../../../utilities/sequence-editor/languages/seq-n/seq-n';
export let initVal: string;
export let setInEditor: (val: string) => void;
Expand Down
Loading

0 comments on commit 320fcf2

Please sign in to comment.