Skip to content
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

feat(dashboard): Open step template drawer on Add Step #7406

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

desiprisg
Copy link
Contributor

@desiprisg desiprisg commented Dec 30, 2024

What changed? Why was the change needed?

To make sure that the user can focus on modifying the content immediately after adding a step and doesn't get distracted by errors for missing content, we are opening the configure drawer right after the step is added.

Screenshots

Screen.Recording.2024-12-30.at.12.09.33.PM.mov
Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Dec 30, 2024

Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 5fa1330
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/677d06e4bfc75d0008ac2eda
😎 Deploy Preview https://deploy-preview-7406.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 5fa1330
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/677d06e4975f6e00087694d1
😎 Deploy Preview https://deploy-preview-7406.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -28,6 +28,14 @@ export const STEP_TYPE_LABELS: Record<StepTypeEnum, string> = {
[StepTypeEnum.CUSTOM]: 'Custom',
};

export const AUTO_OPEN_DRAWER_AFTER_CREATION_STEP_TYPES: StepTypeEnum[] = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every TEMPLATE_CONFIGURABLE_STEP_TYPES should allow for the same behavior. So we don't need a separate enum for this.

Moreover, these enums have a bit of a code smell as the UI around drawers should work independently of the step types. We will get back to that soon; meanwhile, let's not add another constant array of array steps.

@@ -105,9 +111,13 @@ export const WorkflowProvider = ({ children }: { children: ReactNode }) => {
const isUpdatePatchPending = isPatchPending || isUpdatePending || hasPendingItems;

const update = useCallback(
(data: UpdateWorkflowDto) => {
({ data, onSuccess }: { data: UpdateWorkflowDto; onSuccess?: (workflow: WorkflowResponseDto) => void }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better DX to do

    (data: UpdateWorkflowDto, { onSuccess }: { onSuccess?: (workflow: WorkflowResponseDto) => void }) => {```

It's also a safer change and doesn't introduce the super generic data key across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants