mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
feat(tag-dropdown): added start block to tag dropdown by default (#1922)
This commit is contained in:
+5
-2
@@ -639,7 +639,8 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
}
|
||||
|
||||
blockTags = ensureRootTag(blockTags, normalizedBlockName)
|
||||
const shouldShowRootTag = sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK
|
||||
const shouldShowRootTag =
|
||||
sourceBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK || sourceBlock.type === 'start_trigger'
|
||||
if (!shouldShowRootTag) {
|
||||
blockTags = blockTags.filter((tag) => tag !== normalizedBlockName)
|
||||
}
|
||||
@@ -951,7 +952,9 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
}
|
||||
|
||||
blockTags = ensureRootTag(blockTags, normalizedBlockName)
|
||||
const shouldShowRootTag = accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK
|
||||
const shouldShowRootTag =
|
||||
accessibleBlock.type === TRIGGER_TYPES.GENERIC_WEBHOOK ||
|
||||
accessibleBlock.type === 'start_trigger'
|
||||
if (!shouldShowRootTag) {
|
||||
blockTags = blockTags.filter((tag) => tag !== normalizedBlockName)
|
||||
}
|
||||
|
||||
+3
-1
@@ -27,7 +27,9 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
|
||||
const accessibleIds = new Set<string>(ancestorIds)
|
||||
accessibleIds.add(blockId)
|
||||
|
||||
const starterBlock = Object.values(blocks).find((block) => block.type === 'starter')
|
||||
const starterBlock = Object.values(blocks).find(
|
||||
(block) => block.type === 'starter' || block.type === 'start_trigger'
|
||||
)
|
||||
if (starterBlock) {
|
||||
accessibleIds.add(starterBlock.id)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,9 @@ function normalizeInputFormatValue(inputFormatValue: any): InputFormatField[] {
|
||||
return []
|
||||
}
|
||||
|
||||
return inputFormatValue.filter((field) => field && typeof field === 'object')
|
||||
return inputFormatValue.filter(
|
||||
(field) => field && typeof field === 'object' && field.name && field.name.trim() !== ''
|
||||
)
|
||||
}
|
||||
|
||||
function applyInputFormatFields(
|
||||
|
||||
Reference in New Issue
Block a user