Skip to content

The open alternative to Salesforce, designed for AI.

fix(frontend):Prevent record type select dropdown from opening when viewing a workflow version (#12495)

Naifer78d63a3fe87b
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
index 35b16c30876..dd2f9c2c3db 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
@@ -198,66 +198,67 @@ export const WorkflowEditTriggerDatabaseEventForm = ({
}
dropdownComponents={
<>
- {isSystemObjectsOpen ? (
- <DropdownContent>
- <DropdownMenuHeader
- StartComponent={
- <DropdownMenuHeaderLeftComponent
- onClick={handleBack}
- Icon={IconChevronLeft}
- />
- }
- >
- <Trans>Advanced</Trans>
- </DropdownMenuHeader>
- <DropdownMenuSearchInput
- autoFocus
- value={searchInputValue}
- onChange={handleSearchInputChange}
- />
- <DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
- {filteredSystemObjects.map((option) => (
- <MenuItem
- key={option.value}
- LeftIcon={option.Icon}
- text={option.label}
- onClick={() => handleOptionClick(option.value)}
- />
- ))}
- </DropdownMenuItemsContainer>
- </DropdownContent>
- ) : (
- <DropdownContent>
- <DropdownMenuSearchInput
- autoFocus
- value={searchInputValue}
- onChange={handleSearchInputChange}
- />
- <DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
- {filteredRegularObjects.map((option) => (
- <MenuItem
- key={option.value}
- LeftIcon={option.Icon}
- text={option.label}
- onClick={() => handleOptionClick(option.value)}
- />
- ))}
- {(!searchInputValue ||
- 'advanced'.includes(
- searchInputValue.toLowerCase(),
- )) && (
- <MenuItem
- text="Advanced"
- LeftIcon={IconSettings}
- onClick={handleSystemObjectsClick}
- hasSubMenu
- />
- )}
- </DropdownMenuItemsContainer>
- </DropdownContent>
- )}
+ {!triggerOptions.readonly &&
+ (isSystemObjectsOpen ? (
+ <DropdownContent>
+ <DropdownMenuHeader
+ StartComponent={
+ <DropdownMenuHeaderLeftComponent
+ onClick={handleBack}
+ Icon={IconChevronLeft}
+ />
+ }
+ >
+ <Trans>Advanced</Trans>
+ </DropdownMenuHeader>
+ <DropdownMenuSearchInput
+ autoFocus
+ value={searchInputValue}
+ onChange={handleSearchInputChange}
+ />
+ <DropdownMenuSeparator />
+ <DropdownMenuItemsContainer hasMaxHeight>
+ {filteredSystemObjects.map((option) => (
+ <MenuItem
+ key={option.value}
+ LeftIcon={option.Icon}
+ text={option.label}
+ onClick={() => handleOptionClick(option.value)}
+ />
+ ))}
+ </DropdownMenuItemsContainer>
+ </DropdownContent>
+ ) : (
+ <DropdownContent>
+ <DropdownMenuSearchInput
+ autoFocus
+ value={searchInputValue}
+ onChange={handleSearchInputChange}
+ />
+ <DropdownMenuSeparator />
+ <DropdownMenuItemsContainer hasMaxHeight>
+ {filteredRegularObjects.map((option) => (
+ <MenuItem
+ key={option.value}
+ LeftIcon={option.Icon}
+ text={option.label}
+ onClick={() => handleOptionClick(option.value)}
+ />
+ ))}
+ {(!searchInputValue ||
+ 'advanced'.includes(
+ searchInputValue.toLowerCase(),
+ )) && (
+ <MenuItem
+ text="Advanced"
+ LeftIcon={IconSettings}
+ onClick={handleSystemObjectsClick}
+ hasSubMenu
+ />
+ )}
+ </DropdownMenuItemsContainer>
+ </DropdownContent>
+ ))}
</>
}
dropdownHotkeyScope={{ scope: SelectHotkeyScope.Select }}