diff --git a/src/components/TimelineItemList.svelte b/src/components/TimelineItemList.svelte index 882ddac249..40e366afdc 100644 --- a/src/components/TimelineItemList.svelte +++ b/src/components/TimelineItemList.svelte @@ -127,9 +127,7 @@ } function onIndividualLayerPicked(event: CustomEvent<{ item?: TimelineItemType; layer?: Layer; row?: Row }>) { - console.log('event :>> ', event); if (event.detail.item) { - console.log('object :>> ', event.detail.item); viewAddFilterToRow([event.detail.item], typeName, {}, event.detail.row?.id, event.detail.layer); } } diff --git a/src/components/form/Input.svelte b/src/components/form/Input.svelte index 345e7aa6f4..8d14dfb63a 100644 --- a/src/components/form/Input.svelte +++ b/src/components/form/Input.svelte @@ -66,7 +66,6 @@ } // because the content of the slot might not have been fully rendered by the time this function is called // we must kick it out to a timeout to wait for it to be rendered - // await tick(); if (left !== null) { left.style.left = `${padLeft}px`; @@ -89,7 +88,6 @@ } // because the content of the slot might not have been fully rendered by the time this function is called // we must kick it out to a timeout to wait for it to be rendered - // await tick(); if (right !== null) { right.style.right = `${padRight}px`; diff --git a/src/components/timeline/Row.svelte b/src/components/timeline/Row.svelte index 359fe98d11..826712dd42 100644 --- a/src/components/timeline/Row.svelte +++ b/src/components/timeline/Row.svelte @@ -202,7 +202,6 @@ let hasActivityLayer: boolean = false; let hasExternalEventsLayer: boolean = false; let hasResourceLayer: boolean = false; - let associatedActivityTypes: number; $: if ($selectedRow?.id === id && rowRef) { rowRef.scrollIntoView({ block: 'nearest' }); @@ -342,24 +341,13 @@ discreteOptions?.activityOptions?.composition === 'both' || discreteOptions?.activityOptions?.composition === 'directives'; - // helper for hasExternalEventsLayer; counts how many external event types are associated with this row (if all layers have 0 event types, we - // don't want to allocate any canvas space in the row for the layer) - - // TODO figure out what it means for new activities here - // $: associatedActivityTypes = activityLayers - // .map(layer => - // layer.filter.activity - // ? (layer.filter.activity.dynamic_type_filters?.length || layer.filter.activity.static_types?.length) ?? 0 - // : 0, - // ) - // .reduce((currentSum, newValue) => currentSum + newValue, 0); - $: associatedActivityTypes = 1; + // helper for hasExternalEventsLayer; counts how many external event types are associated with this row + // (if all layers have 0 event types, we don't want to allocate any canvas space in the row for the layer) $: associatedEventTypes = externalEventLayers .map(layer => (layer.filter.externalEvent ? layer.filter.externalEvent.event_types.length : 0)) .reduce((currentSum, newValue) => currentSum + newValue, 0); // only consider a layer to be present if it is defined AND it actually has types/values selected. - $: hasActivityLayer = activityLayers.length > 0 && associatedActivityTypes > 0; $: hasExternalEventsLayer = externalEventLayers.length > 0 && associatedEventTypes > 0; $: hasResourceLayer = lineLayers.length + xRangeLayers.length > 0; @@ -495,6 +483,8 @@ timeFilteredActivityDirectives = []; timeFilteredSpans = []; } + + hasActivityLayer = timeFilteredActivityDirectives.length > 0 || timeFilteredActivityDirectives.length > 0; } if (hasExternalEventsLayer) { @@ -732,8 +722,6 @@ // Determine if the row will visualize all requested activities let activitiesInRow = new Set(); activityLayers.forEach(layer => { - // TODO should we consider dynamic types here? Or just static? - // TODO could this be cached from the reactive statement above? let spansList = Object.values(spansMap); const { directives: layerActivities } = applyActivityLayerFilter( layer.filter.activity, diff --git a/src/components/timeline/form/TimelineEditor/ActivityFilterBuilder.svelte b/src/components/timeline/form/TimelineEditor/ActivityFilterBuilder.svelte index 0929fcd70b..d2a95f8e99 100644 --- a/src/components/timeline/form/TimelineEditor/ActivityFilterBuilder.svelte +++ b/src/components/timeline/form/TimelineEditor/ActivityFilterBuilder.svelte @@ -419,6 +419,7 @@ does_not_include: { type: 'tag', values: $subsystemTags }, includes: { type: 'tag', values: $subsystemTags }, }, + // TODO make this a searchable dropdown, same for parameter variants? Type: { does_not_equal: { type: 'variant', values: $activityTypes.map(type => type.name) }, does_not_include: { type: 'string' }, diff --git a/src/components/timeline/form/TimelineEditor/DynamicFilter.svelte b/src/components/timeline/form/TimelineEditor/DynamicFilter.svelte index c8d218bb8c..cb85ee8354 100644 --- a/src/components/timeline/form/TimelineEditor/DynamicFilter.svelte +++ b/src/components/timeline/form/TimelineEditor/DynamicFilter.svelte @@ -53,8 +53,9 @@ if (schemaField) { operatorKeys = Object.keys(schemaField) as (keyof typeof FilterOperator)[]; - currentType = Object.values(schemaField)[0].type; - currentValuePossibilities = Object.values(schemaField)[0].values || []; + const firstSchemaField = Object.values(schemaField)[0]; + currentType = firstSchemaField.type; + currentValuePossibilities = firstSchemaField.values || []; if (currentOperator) { const schemaOperator = schemaField[currentOperator]; if (schemaOperator !== undefined) {