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: add addition params for onboarding setup #2886

Merged
merged 9 commits into from
Mar 1, 2023

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

Adds addition params to run on the onboarding script.

Why was this change needed?

In order to trigger event on the demo app.

Other information (Screenshots)

function updateCodeSnipped(codeSnippet: string, environmentIdentifier: string, apiKey: string) {
return codeSnippet
.replace(APPLICATION_IDENTIFIER, environmentIdentifier)
.replace(API_KEY, apiKey ?? '')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added API key in order to pass it to the demo app.

return codeSnippet
.replace(APPLICATION_IDENTIFIER, environmentIdentifier)
.replace(API_KEY, apiKey ?? '')
.replace(ENVIRONMENT, process.env.REACT_APP_API_URL === 'https://api.novu.co' ? '' : 'dev');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need this one in order to provide a more fluent flow for the product team so they won't need to update the API and WS URLs on the demo app.

I was not sure what indication to add here at the moment I am using the API URL, if some one have any other suggestion i would love to hear about them :)

type: ChannelCTATypeEnum.REDIRECT,
data: { url: `/templates/edit/${notificationTemplate?._id}` },
},
content: 'Welcome to Novu! <b>visit the cloud admin panel</b> managing this message',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the CTA because the snippets do not have the click handlers, @scopsy let me know what you think.

apps/web/src/pages/quick-start/steps/Setup.tsx Outdated Show resolved Hide resolved
Comment on lines 157 to 158
.replace(BACKEND_API_URL, concatUrls ? process.env.REACT_APP_API_URL || 'http://localhost:3000' : '')
.replace(BACKEND_SOCKET_URL, concatUrls ? process.env.REACT_APP_WS_URL || 'http://localhost:3002' : '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use window._env_.REACT_APP_API_URL and window._env_.REACT_APP_WS_URL to avoid to have spread all the Web app the URL calculation?

export const API_ROOT =

If for any reason they are not the right variables to use here, maybe centralising in the config the calculation would be a good idea to have all that isolated in one place and not through the codebase. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel we should take values from window._env_ as these are set by our pipelines...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I will add it to the config file. Thanks!

@djabarovgeorge djabarovgeorge requested review from scopsy and removed request for scopsy March 1, 2023 08:31
Copy link
Contributor

@p-fernandez p-fernandez left a comment

Choose a reason for hiding this comment

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

🌟

@djabarovgeorge djabarovgeorge added this pull request to the merge queue Mar 1, 2023
Merged via the queue into next with commit 81435fa Mar 1, 2023
@djabarovgeorge djabarovgeorge deleted the onboarding-demo-trigger-adjustments branch March 1, 2023 15:17
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.

None yet

3 participants