Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(createWorkflow): cleanup create workflow to prevent re-renders#607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a4fa6ca
fix(createWorkflow): no more client side id, duplicate schedules calls
eeb677d
fix lint
ea5dfa1
more cleanup
8ce5b51
fix lint
3b1e822
fix spamming of create button causing issues
248d0f2
fix lint
48f9d2b
add more colors + default workflow name changed
f5c53e9
Update apps/sim/stores/workflows/registry/utils.ts
icecrasher321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 14 additions & 13 deletions
27 ...d]/components/workflow-block/components/sub-block/components/schedule/schedule-config.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 22 additions & 7 deletions
29 ...m/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 15 additions & 3 deletions
18 ...m/app/workspace/[workspaceId]/w/components/sidebar/components/create-menu/create-menu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -15,9 +15,14 @@ import { useFolderStore } from '@/stores/folders/store' | ||
| interface CreateMenuProps { | ||
| onCreateWorkflow: (folderId?: string) => void | ||
| isCollapsed?: boolean | ||
| isCreatingWorkflow?: boolean | ||
| } | ||
| export function CreateMenu({ onCreateWorkflow, isCollapsed }: CreateMenuProps) { | ||
| export function CreateMenu({ | ||
| onCreateWorkflow, | ||
| isCollapsed, | ||
| isCreatingWorkflow = false, | ||
| }: CreateMenuProps) { | ||
| const [showFolderDialog, setShowFolderDialog] = useState(false) | ||
| const [folderName, setFolderName] = useState('') | ||
| const [isCreating, setIsCreating] = useState(false) | ||
| @@ -73,6 +78,7 @@ export function CreateMenu({ onCreateWorkflow, isCollapsed }: CreateMenuProps) { | ||
| onClick={handleCreateWorkflow} | ||
| onMouseEnter={() => setIsHoverOpen(true)} | ||
| onMouseLeave={() => setIsHoverOpen(false)} | ||
| disabled={isCreatingWorkflow} | ||
| > | ||
| <Plus | ||
| className={cn( | ||
| @@ -101,11 +107,17 @@ export function CreateMenu({ onCreateWorkflow, isCollapsed }: CreateMenuProps) { | ||
| onCloseAutoFocus={(e) => e.preventDefault()} | ||
| > | ||
| <button | ||
| className='flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground' | ||
| className={cn( | ||
| 'flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors', | ||
| isCreatingWorkflow | ||
| ? 'cursor-not-allowed opacity-50' | ||
| : 'hover:bg-accent hover:text-accent-foreground' | ||
| )} | ||
icecrasher321 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| onClick={handleCreateWorkflow} | ||
| disabled={isCreatingWorkflow} | ||
| > | ||
| <File className='h-4 w-4' /> | ||
| New Workflow | ||
| {isCreatingWorkflow ? 'Creating...' : 'New Workflow'} | ||
| </button> | ||
| <button | ||
| className='flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground' | ||
18 changes: 17 additions & 1 deletion
18 apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are unused -- but I wasn't sure why they were ever passed in and didn't want to remove them rn. So using underscore to indicate unused and not get a linter unused warning.