Skip to content

Commit 6fdf403

Browse files
committed
updated folder multi select, updated calcom and github tools and docs generator script
1 parent 76b5028 commit 6fdf403

File tree

80 files changed

+3473
-1825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3473
-1825
lines changed

apps/docs/content/docs/en/tools/calcom.mdx

Lines changed: 303 additions & 28 deletions
Large diffs are not rendered by default.

apps/docs/content/docs/en/tools/github.mdx

Lines changed: 445 additions & 491 deletions
Large diffs are not rendered by default.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,10 +1701,6 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
17011701
return list
17021702
}, [variableTags, nestedBlockTagGroups])
17031703

1704-
/**
1705-
* Map from tag string to its index in flatTagList for O(1) lookups.
1706-
* Replaces O(n) findIndex calls throughout the component.
1707-
*/
17081704
const flatTagIndexMap = useMemo(() => {
17091705
const map = new Map<string, number>()
17101706
flatTagList.forEach((item, index) => {
@@ -1911,28 +1907,20 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
19111907
}
19121908
}, [visible, onClose])
19131909

1914-
/**
1915-
* Memoized caret position and side calculation.
1916-
* getCaretViewportPosition does DOM manipulation, so we avoid calling it on every render.
1917-
*/
1918-
const { caretViewport, side } = useMemo(() => {
1919-
const inputElement = inputRef?.current
1920-
if (!inputElement) {
1921-
return { caretViewport: { left: 0, top: 0 }, side: 'bottom' as const }
1922-
}
1923-
1924-
const viewport = getCaretViewportPosition(inputElement, cursorPosition, inputValue)
1925-
const margin = 8
1926-
const spaceAbove = viewport.top - margin
1927-
const spaceBelow = window.innerHeight - viewport.top - margin
1928-
const computedSide: 'top' | 'bottom' = spaceBelow >= spaceAbove ? 'bottom' : 'top'
1929-
1930-
return { caretViewport: viewport, side: computedSide }
1931-
}, [cursorPosition, inputValue, inputRef])
1932-
19331910
if (!visible || tags.length === 0 || flatTagList.length === 0) return null
19341911

19351912
const inputElement = inputRef?.current
1913+
let caretViewport = { left: 0, top: 0 }
1914+
let side: 'top' | 'bottom' = 'bottom'
1915+
1916+
if (inputElement) {
1917+
caretViewport = getCaretViewportPosition(inputElement, cursorPosition, inputValue)
1918+
1919+
const margin = 8
1920+
const spaceAbove = caretViewport.top - margin
1921+
const spaceBelow = window.innerHeight - caretViewport.top - margin
1922+
side = spaceBelow >= spaceAbove ? 'bottom' : 'top'
1923+
}
19361924

19371925
return (
19381926
<NestedNavigationContext.Provider value={nestedNavigationValue}>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/delete-modal/delete-modal.tsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ interface DeleteModalProps {
2121
isDeleting: boolean
2222
/**
2323
* Type of item being deleted
24+
* - 'mixed' is used when both workflows and folders are selected
2425
*/
25-
itemType: 'workflow' | 'folder' | 'workspace'
26+
itemType: 'workflow' | 'folder' | 'workspace' | 'mixed'
2627
/**
2728
* Name(s) of the item(s) being deleted (optional, for display)
2829
* Can be a single name or an array of names for multiple items
@@ -54,7 +55,9 @@ export function DeleteModal({
5455
if (itemType === 'workflow') {
5556
title = isMultiple ? 'Delete Workflows' : 'Delete Workflow'
5657
} else if (itemType === 'folder') {
57-
title = 'Delete Folder'
58+
title = isMultiple ? 'Delete Folders' : 'Delete Folder'
59+
} else if (itemType === 'mixed') {
60+
title = 'Delete Items'
5861
} else {
5962
title = 'Delete Workspace'
6063
}
@@ -85,6 +88,18 @@ export function DeleteModal({
8588
}
8689

8790
if (itemType === 'folder') {
91+
if (isMultiple) {
92+
return (
93+
<>
94+
Are you sure you want to delete{' '}
95+
<span className='font-medium text-[var(--text-primary)]'>
96+
{displayNames.join(', ')}
97+
</span>
98+
? This will permanently remove all workflows, logs, and knowledge bases within these
99+
folders.
100+
</>
101+
)
102+
}
88103
if (isSingle && displayNames.length > 0) {
89104
return (
90105
<>
@@ -97,6 +112,23 @@ export function DeleteModal({
97112
return 'Are you sure you want to delete this folder? This will permanently remove all associated workflows, logs, and knowledge bases.'
98113
}
99114

115+
if (itemType === 'mixed') {
116+
if (displayNames.length > 0) {
117+
return (
118+
<>
119+
Are you sure you want to delete{' '}
120+
<span className='font-medium text-[var(--text-primary)]'>
121+
{displayNames.join(', ')}
122+
</span>
123+
? This will permanently remove all selected workflows and folders, including their
124+
contents.
125+
</>
126+
)
127+
}
128+
return 'Are you sure you want to delete the selected items? This will permanently remove all selected workflows and folders, including their contents.'
129+
}
130+
131+
// workspace type
100132
if (isSingle && displayNames.length > 0) {
101133
return (
102134
<>

0 commit comments

Comments
 (0)