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(api): wip fix framework workflow issues #7147

Conversation

djabarovgeorge
Copy link
Contributor

@djabarovgeorge djabarovgeorge commented Nov 27, 2024

What changed? Why was the change needed?

now framework workflow has issues ;)
image

https://www.loom.com/share/ae23d0ef53ff455a8f5fe5b521674308

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 3360af5
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/674dd94cb79f4b000873c2a5
😎 Deploy Preview https://deploy-preview-7147.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.

Comment on lines +169 to 191
const validatedWorkflowWithIssues = await this.workflowUpdatePostProcess.execute({
user: {
_id: command.userId,
environmentId: command.environmentId,
organizationId: command.organizationId,
} as UserSessionData,
workflow: {
...savedWorkflow,
userPreferences: null,
defaultPreferences: this.getWorkflowPreferences(workflow),
},
});

savedWorkflow = await this.updateWorkflowUsecase.execute(
UpdateWorkflowCommand.create({
...validatedWorkflowWithIssues,
id: validatedWorkflowWithIssues._id,
type: WorkflowTypeEnum.BRIDGE,
environmentId: command.environmentId,
organizationId: command.organizationId,
userId: command.userId,
})
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this part is responsible for updating the issues on the workflow

image

Comment on lines 178 to 180
if (children === PreviewIssueEnum.PREVIEW_ISSUE_REQUIRED_CONTROL_VALUE_IS_MISSING) {
return null;
}
Copy link
Contributor Author

@djabarovgeorge djabarovgeorge Nov 27, 2024

Choose a reason for hiding this comment

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

this part ensures that the issue returned by the API from the backend is not rendered.

https://www.loom.com/share/ae23d0ef53ff455a8f5fe5b521674308

I have two questions:

  1. Is this the correct approach to render null it in the new dashboard?
  2. Why are we returning this value from the backend in the first place? Don’t we already use issues to inform the frontend when there’s a problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

My main problem with it, is that the preview will not indicate any error state on the tab. This at least shows you that something is wrong.

@djabarovgeorge djabarovgeorge marked this pull request as ready for review November 27, 2024 16:12
Copy link

pkg-pr-new bot commented Nov 27, 2024

Open in Stackblitz

@novu/client

npm i https://pkg.pr.new/novuhq/novu/@novu/client@7147

@novu/headless

npm i https://pkg.pr.new/novuhq/novu/@novu/headless@7147

@novu/framework

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@7147

@novu/js

npm i https://pkg.pr.new/novuhq/novu/@novu/js@7147

@novu/nextjs

npm i https://pkg.pr.new/novuhq/novu/@novu/nextjs@7147

@novu/node

npm i https://pkg.pr.new/novuhq/novu/@novu/node@7147

@novu/notification-center

npm i https://pkg.pr.new/novuhq/novu/@novu/notification-center@7147

novu

npm i https://pkg.pr.new/novuhq/novu@7147

@novu/providers

npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7147

@novu/react

npm i https://pkg.pr.new/novuhq/novu/@novu/react@7147

@novu/react-native

npm i https://pkg.pr.new/novuhq/novu/@novu/react-native@7147

@novu/shared

npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7147

commit: 3360af5

…rkflows-show-preview-issuerequired-control-value-is

# Conflicts:
#	apps/api/src/app/workflows-v2/generate-preview.e2e.ts
Copy link

netlify bot commented Dec 1, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 3360af5
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/674dd94cb79f4b000873c2a1
😎 Deploy Preview https://deploy-preview-7147.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 1, 2024

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

Name Link
🔨 Latest commit 3360af5
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/674dd94cd8fad200071594af
😎 Deploy Preview https://deploy-preview-7147--dashboard-v2-novu-staging.netlify.app
📱 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
Contributor

@scopsy scopsy left a comment

Choose a reason for hiding this comment

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

Looks good, let's just restore the issue rendering behaviour as per the slack thread https://github.com/novuhq/novu/pull/7147/files#r1865851863

@djabarovgeorge djabarovgeorge merged commit eb330bb into next Dec 2, 2024
46 of 47 checks passed
@djabarovgeorge djabarovgeorge deleted the nv-4813-code-first-workflows-show-preview-issuerequired-control-value-is branch December 2, 2024 16:56
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.

2 participants