From 3a825327abaa6374cda0b9c4331114da9f0f17b8 Mon Sep 17 00:00:00 2001 From: JosephVolosin Date: Mon, 7 Oct 2024 15:21:17 -0400 Subject: [PATCH] Fix formatting errors --- e2e-tests/tests/external-sources.test.ts | 1 - .../external-source/ExternalSourceManager.svelte | 6 +++++- .../external-source/ExternalSourcesPanel.svelte | 4 +--- .../modals/ManageGroupsAndTypesModal.svelte | 5 ++++- src/components/timeline/TimelinePanel.svelte | 9 ++++++++- src/utilities/generic.test.ts | 8 ++++---- src/utilities/timeline.ts | 11 ++++++----- src/utilities/view.test.ts | 15 ++++----------- 8 files changed, 32 insertions(+), 27 deletions(-) diff --git a/e2e-tests/tests/external-sources.test.ts b/e2e-tests/tests/external-sources.test.ts index a297a53413..44ce76ef87 100644 --- a/e2e-tests/tests/external-sources.test.ts +++ b/e2e-tests/tests/external-sources.test.ts @@ -5,7 +5,6 @@ let page: Page; let context: BrowserContext; let externalSources: ExternalSources; - test.beforeAll(async ({ browser }) => { context = await browser.newContext(); page = await context.newPage(); diff --git a/src/components/external-source/ExternalSourceManager.svelte b/src/components/external-source/ExternalSourceManager.svelte index dcdc4a9360..10e0650d76 100644 --- a/src/components/external-source/ExternalSourceManager.svelte +++ b/src/components/external-source/ExternalSourceManager.svelte @@ -301,7 +301,11 @@ async function onDeleteExternalSource(selectedSources: ExternalSourceSlim[] | null | undefined) { if (selectedSources !== null && selectedSources !== undefined) { - const deleteExternalSourceResult = await effects.deleteExternalSource(selectedSources, $planDerivationGroupLinks, user); + const deleteExternalSourceResult = await effects.deleteExternalSource( + selectedSources, + $planDerivationGroupLinks, + user, + ); if (deleteExternalSourceResult !== undefined && deleteExternalSourceResult !== null) { selectedSources = null; selectedSource = null; diff --git a/src/components/external-source/ExternalSourcesPanel.svelte b/src/components/external-source/ExternalSourcesPanel.svelte index 2435526f75..e061a6ebd4 100644 --- a/src/components/external-source/ExternalSourcesPanel.svelte +++ b/src/components/external-source/ExternalSourcesPanel.svelte @@ -167,9 +167,7 @@ {/each} {:else}
-

- No Derivation Groups Linked To This Plan -

+

No Derivation Groups Linked To This Plan

diff --git a/src/components/modals/ManageGroupsAndTypesModal.svelte b/src/components/modals/ManageGroupsAndTypesModal.svelte index a139f70c13..8ee2b713db 100644 --- a/src/components/modals/ManageGroupsAndTypesModal.svelte +++ b/src/components/modals/ManageGroupsAndTypesModal.svelte @@ -362,7 +362,10 @@ const derivationGroup = $derivationGroups.find( derivationGroup => derivationGroup.name === viewedDerivationGroup.name, ); - if ((selectedDerivationGroup === undefined && derivationGroup !== undefined) || selectedDerivationGroup !== derivationGroup) { + if ( + (selectedDerivationGroup === undefined && derivationGroup !== undefined) || + selectedDerivationGroup !== derivationGroup + ) { selectedDerivationGroup = derivationGroup; selectedExternalSourceType = undefined; selectedExternalEventType = undefined; diff --git a/src/components/timeline/TimelinePanel.svelte b/src/components/timeline/TimelinePanel.svelte index a2ec934dc5..a8ae246955 100644 --- a/src/components/timeline/TimelinePanel.svelte +++ b/src/components/timeline/TimelinePanel.svelte @@ -26,7 +26,14 @@ } from '../../stores/views'; import type { ActivityDirectiveId } from '../../types/activity'; import type { User } from '../../types/app'; - import type { ActivityOptions, Axis, MouseDown, MouseOver, Row, Timeline as TimelineType } from '../../types/timeline'; + import type { + ActivityOptions, + Axis, + MouseDown, + MouseOver, + Row, + Timeline as TimelineType, + } from '../../types/timeline'; import effects from '../../utilities/effects'; import { getExternalEventRowId } from '../../utilities/externalEvents'; import { featurePermissions } from '../../utilities/permissions'; diff --git a/src/utilities/generic.test.ts b/src/utilities/generic.test.ts index 2d01be2181..9df0152335 100644 --- a/src/utilities/generic.test.ts +++ b/src/utilities/generic.test.ts @@ -164,11 +164,11 @@ describe('Generic utility function tests', () => { }); test('Should not make a list of objects unique', () => { - const base = [{'a': 1}, {'a': 3}, {'a': 1}]; + const base = [{ a: 1 }, { a: 3 }, { a: 1 }]; const uniqued = unique(base); - expect(uniqued).toEqual([{'a': 1}, {'a': 3}, {'a': 1}]); - }) - }) + expect(uniqued).toEqual([{ a: 1 }, { a: 3 }, { a: 1 }]); + }); + }); describe('parseJSONStream', () => { test('Should be able to parse a really long JSON string', async () => { diff --git a/src/utilities/timeline.ts b/src/utilities/timeline.ts index 6e696f9083..b41c1d6c7c 100644 --- a/src/utilities/timeline.ts +++ b/src/utilities/timeline.ts @@ -43,7 +43,7 @@ import type { Timeline, VerticalGuide, XRangeLayer, - XRangeLayerColorScheme + XRangeLayerColorScheme, } from '../types/timeline'; import { generateRandomPastelColor } from './color'; import { getExternalEventRowId } from './externalEvents'; @@ -1134,12 +1134,13 @@ function getUniqueNodeItems(nodes: DiscreteTreeNode[]) { if (nodeItem.directive && !uniqueDirectiveLookup.has(nodeItem.directive.id)) { uniqueDirectiveLookup.add(nodeItem.directive.id); flattenedNodes.push(nodeItem); - } - else if (nodeItem.span && !uniqueSpanLookup.has(nodeItem.span.span_id)) { + } else if (nodeItem.span && !uniqueSpanLookup.has(nodeItem.span.span_id)) { uniqueSpanLookup.add(nodeItem.span.span_id); flattenedNodes.push(nodeItem); - } - else if (nodeItem.externalEvent && !uniqueExternalEventLookup.has(getExternalEventRowId(nodeItem.externalEvent.pkey))) { + } else if ( + nodeItem.externalEvent && + !uniqueExternalEventLookup.has(getExternalEventRowId(nodeItem.externalEvent.pkey)) + ) { uniqueExternalEventLookup.add(getExternalEventRowId(nodeItem.externalEvent.pkey)); flattenedNodes.push(nodeItem); } diff --git a/src/utilities/view.test.ts b/src/utilities/view.test.ts index 41a1dc7ff0..b40ddb7b5f 100644 --- a/src/utilities/view.test.ts +++ b/src/utilities/view.test.ts @@ -9,7 +9,7 @@ describe('generateDefaultView', () => { { name: 'resource1', schema: { type: 'boolean' } }, { name: 'resource2', schema: { type: 'int' } }, { name: 'resource2', schema: { items: { type: 'boolean' }, type: 'series' } }, - ] + ], ); const { valid, errors } = validateViewJSONAgainstSchema(view.definition); expect(errors).to.deep.equal([]); @@ -19,14 +19,7 @@ describe('generateDefaultView', () => { describe('generateDefaultViewWithEvents', () => { test('Should generate a valid view with events', async () => { - const view = generateDefaultView( - [], - [], - [ - {name: 'external-event-type_1'}, - {name: 'external-event-type_2'} - ] - ); + const view = generateDefaultView([], [], [{ name: 'external-event-type_1' }, { name: 'external-event-type_2' }]); // validate against schema const { valid, errors } = validateViewJSONAgainstSchema(view.definition); @@ -37,11 +30,11 @@ describe('generateDefaultViewWithEvents', () => { const timelines = view.definition.plan.timelines; expect(timelines.length).toBe(1); expect(timelines[0].rows.length).toBe(2); - expect(timelines[0].rows[1].name).toBe("External Events"); + expect(timelines[0].rows[1].name).toBe('External Events'); const layers = timelines[0].rows[1].layers; expect(layers.length).toBe(1); expect(layers[0].filter.externalEvent).toBeDefined(); expect(layers[0].filter.externalEvent?.event_types).toEqual(['external-event-type_1', 'external-event-type_2']); }); -}); \ No newline at end of file +});