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

refactor(web): remove jwt-decode and refactor auth logic #5620

Merged
merged 2 commits into from
May 22, 2024

Conversation

rifont
Copy link
Contributor

@rifont rifont commented May 21, 2024

What changed? Why was the change needed?

  • Refactor useAuthController hook
    • Remove provision of jwtPayload, which isn't a frontend concern. Replace with attached context to IUserEntity
    • Decode JWT only in this hook. Marked for removal, as browser-side decoding is security risk
  • Simplify RequiredAuth HoC and rename to EnsureOnboardingComplete
  • Move the splashback loading screen from LaunchDarklyProvider to AuthProvider
  • Temporarily add hardcoded ColorSchemeProvider to resolve broken build

Screenshots

Sign In flow
https://www.loom.com/share/458cbb702fa6402ba755a39ae6d65a16?sid=19ee1b65-2a35-408e-b709-39be1865fc12

Sign Out flow
https://www.loom.com/share/3d57d99ad9ec4321a4a8e48fe7b1a033?sid=d054a08a-159a-4f1e-b17f-ceaae29e64b1

Sign Up & Onboarding flow
TBhttps://www.loom.com/share/744b64f31f99470a821afc2a8823b813?sid=67512526-b096-449b-aa61-6daf8444f8e3

Expired token flow
https://www.loom.com/share/3caef12c15114ddab9f45aaa1d2001f5?sid=829def88-61e2-4188-8ca1-2a235bfe015a

Forgot Password flow
https://www.loom.com/share/0030be17c78545ac928283aa871863b8?sid=1dc2c8f8-a321-48b6-9a86-5968a0008592

Vercel Sign Up flow
TBC - how to test this?

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented May 21, 2024

Deploy Preview for novu-design ready!

Name Link
🔨 Latest commit 6ee46fe
🔍 Latest deploy log https://app.netlify.com/sites/novu-design/deploys/664cfbb6e67e36000852e173
😎 Deploy Preview https://deploy-preview-5620--novu-design.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

netlify bot commented May 21, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 6ee46fe
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/664cfbb6690ab60008f9949c
😎 Deploy Preview https://deploy-preview-5620--dev-web-novu.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.

</BrowserRouter>
</QueryClientProvider>
</SegmentProvider>
<ColorSchemeProvider colorScheme={'dark'} toggleColorScheme={() => {}}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporarily adding this to fix the broken next.

/** Renders when LaunchDarkly is enabled and is awaiting initialization */
fallbackDisplay: ReactNode;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed, this is moved to the AuthProvider. This is suitable because Launch Darkly was actually dependent on auth context being available, now it will always be there.

@@ -22,7 +22,7 @@ export function selectShouldInitializeLaunchDarkly(userCtx: UserContext): boolea
* have an organizationId yet that we can use for org-based feature flags. To prevent from blocking this page
* from loading during this "limbo" state, we should initialize LD with the anonymous context.
*/
if (!selectHasUserCompletedSignUp(userCtx)) {
if (!currentUser?.organizationId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Available through user context now.

} else {
return children;
}
}
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 file's contents came from RequiredAuth, and is heavily simplified (expand diff below). The useBlueprint hook call here is uncomfortable, but I've left it to avoid further scope in this PR.


const { code, next, configurationId } = useVercelParams();

const canStartSetup = Boolean(code && next && isLoggedIn && isAxiosAuthorized);
const canStartSetup = Boolean(code && next && isLoggedIn);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isLoggedIn takes care of authorization concerns by itself.

export interface IUserWithContext extends IUserEntity {
organizationId?: string;
environmentId?: string;
}
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 object now contains the current context for the User's active Organization & Environment identifiers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-picky comment: I'd love us to have an AuthContext object that contains:

{
  user,
  user_id,
  organization,
  org_id,
  environment,
  ...roles,
  ...
}```

That way, we will be set for an easier auth migration/integration and we will have everything in one place.

@@ -18,56 +26,61 @@ function getOrganizations() {
}

export function applyToken(token: string | null) {
if (token) {
localStorage.setItem('auth_token', token);
axios.defaults.headers.common.Authorization = `Bearer ${token}`;
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 relied on an axios singleton and can be problematic under some circumstances. We don't need to mutate the axios module, instead we are already fetching from localStorage in api.client.ts for each request.

@@ -10,7 +10,7 @@ import { useNavigate } from 'react-router-dom';
import { ROUTES } from '../constants/routes.enum';
import { api } from '../api';
import { IS_DOCKER_HOSTED } from '../config';
import { BaseEnvironmentEnum } from 'src/constants';
import { BaseEnvironmentEnum } from '../constants';
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 was causing build issues, it needed fixing anyway.

organizations,
organization,
token,
logout,
jwtPayload,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer expose the full JWT payload here. It's not a frontend concern.

organizationId: jwtPayload?.organizationId,
environmentId: jwtPayload?.environmentId,
} satisfies IUserWithContext,
isUserLoading: isUserLoading && isLoggedIn,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Loading state is now additionally determined by whether the user is logged in. A user cannot be loading if they are not logged in.

@rifont
Copy link
Contributor Author

rifont commented May 21, 2024

We need to test the Vercel integration. @LetItRock do you have some ideas about how to do this?

@rifont
Copy link
Contributor Author

rifont commented May 21, 2024

There are still a number of places using the token in the Auth context, it would be great to remove depending on token entirely from the Web app. Only the API client should be responsible for interacting with the localStorage.

Let's deal with this cleanup in another PR.

@rifont rifont requested a review from LetItRock May 21, 2024 20:02
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 change removes the jwt-decode from relevant packages.

const user = jwtDecode<IJwtPayload>(token);

if (!invitationToken && (!user.organizationId || !user.environmentId)) {
if (!invitationToken && currentUser?._id && (!currentUser?.organizationId || !currentUser?.environmentId)) {
Copy link
Contributor Author

@rifont rifont May 21, 2024

Choose a reason for hiding this comment

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

The additional check here for currentUser?._id ensures that the User is updated in Auth Context (it's null by default) before a redirection can take place, otherwise the page will flicker to ROUTES.AUTH_APPLICATION when loading.

@@ -1,3 +1,3 @@
import { useAuthController, applyToken, getTokenPayload, getToken } from '@novu/shared-web';
import { useAuthController, applyToken } from '@novu/shared-web';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { useAuthController, applyToken } from '@novu/shared-web';
export { useAuthController, applyToken } from '@novu/shared-web';

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 have a bunch of these import/re-export patterns for @novu/shared-web, I'll suggest we handle them separately in batch.

export interface IUserWithContext extends IUserEntity {
organizationId?: string;
environmentId?: string;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-picky comment: I'd love us to have an AuthContext object that contains:

{
  user,
  user_id,
  organization,
  org_id,
  environment,
  ...roles,
  ...
}```

That way, we will be set for an easier auth migration/integration and we will have everything in one place.

@rifont rifont merged commit 7624ab3 into next May 22, 2024
32 checks passed
@rifont rifont deleted the refactor-auth-controller branch May 22, 2024 08:28
SokratisVidros pushed a commit that referenced this pull request May 27, 2024
* refactor(web): remove jwt-decode and refactor auth logic

* refactor(hooks): use constant for unauthorized routes
SokratisVidros pushed a commit that referenced this pull request Jun 13, 2024
* refactor(web): remove jwt-decode and refactor auth logic

* refactor(hooks): use constant for unauthorized routes
github-actions bot added a commit that referenced this pull request Jun 13, 2024
* fix(codespaces): exclude apps projects

* fix(web): Align version of internal packages (#5602)

* Revert "fix(web): Align version of internal packages (#5602)"

This reverts commit db9f2de.

* chore: Upgrade to pnpm 9, add conventional commit PR title linting (#5598)

* chore: Upgrde pnpm engine & corepack version

* chore: Use workspace protocol

* chore: Upgrade lockfile

* chore: Use consistent version for @novu/novui

* build: Add convention commit PR title linter workflow

* test: PR title lint workflow

* fix: copy

* test: action

* test: wf

* fix: add missing id

* fix: workflow

* fix: wf

* fix: scopes

* test: logging

* fix: checkout code

* fix: command

* fix: pnpm

* fix: action

* fix: scopes

* fix: redudnancy

* fix: review action

* fix: add release version

* fix: spelling

* revert: test

* chore: release

* feat: add from package script

* Revert "chore: release"

This reverts commit 9696a96.

* refactor: Remove redundant pnpm version from gh actions

* chore: Upgrade all Dockerfile pnpm versions

* chore: auto commit

* chore: auto commit

* chore: auto commit

* chore: update publish and release scripts

* chore: remove dry-run flag from publish command

* ci: remove duplicate pull_request trigger

* ci: update workflow to trigger on pull request actions

---------

Co-authored-by: Dima Grossman <[email protected]>

* fix(echo): Use dist for Echo artifacts (#5590)

* fix(sdk): Use dist for sdk files

* chore(sdk): Revert package version

* chore(sdk): Remove dry-run flag

* chore(sdk): Move h3 to dev deps

* chore(sdk): Add more relevant tags

* chore(sdk): Fix comment for workaround

* chore(sdk): Bump prerelease version

* chore: Update pnpm-lock

* fix(api): Echo version dependency

* revert: lockfile

* refactor(echo): Rename directory to echo

* chore(deps): update workspace dependency versions

* test(api): Update import path for Echo serve function

* fix(echo.server): correct subpath import issue

* Inf 371 community release workflow (#5595)

* feat(ci): Community releases

* feat(ci): REGISTRY_OWNER change

* feat(ci): WF name has been changed

* feat(ci): Option to choose a service

* fix(ci): Fix condition

* fix(ci): Embed service ahs been added

* feat(ci): No environment

* feat(ci): Getting a release version from Lerna

* feat(ci): Environment has been added

* feat(ci): Another way to get Lerna release version

* feat(ci): Echo LERNA_RELEASE_VERSION

* feat(ci): Echo LERNA_RELEASE_VERSION

* feat(ci): Output fix

* feat(ci): GH_PACKAGES secret

* feat(ci): Matrix name instead of service name

* feat(ci): Tag option and timeout update

* feat(ci): Free space action has been added

* feat(ci): EE for the community releases

* fix(ci): Service path fix

* fix(ci): Service path fix

* fix(ci): Rename variable

* fix(ci): Submodules fix

* fix(ci): Submodules fix

* fix(ci): Submodules fix

* fix(ci): Submodules condition

* fix(ci): Branch has been deleted

* fix(ci): Condition update

* fix(ci): Condition update

* fix(ci): Condition update

* fix(ci): Pawel's recommendations

* fix(ci): Full matrix + latest tag for community releases

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update .github/workflows/community-releases.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* fix(ci): Variable renaming

* fix(ci): Syntax fix

* fix(ci): Job renaming

* fix(ci): Environment + ws-ee and webhook-ee have been added in the matrix

* fix(ci): Link submodules after pnpm install

* fix(ci): PNPM version update

* feat(ci): A new approach without tagging of a git repository during WF running

* feat(ci): Output has been deleted

* fix(ci): Fix of check

---------

Co-authored-by: Sokratis Vidros <[email protected]>

* chore(repo): Do not run prebuild on clean

It doesn't seem to be necessary anymore.

* fix(ci): Fix of actions/download-artifact version (#5608)

* feat(api): add channel preference type validation (#5603) nv-3827

* feat(api): add enable type validation

* feat: add preferences test

* chore(Repo): Add repo to scopes (#5609)

This scope is required for global repo-level changes, not directly linked to a single package

* chore(root): Rename GH action for uniformity

* Refactor [@novu/client] : remove axios dependency and use fetch instead (#5554)

* refactor: Update HttpClient to use fetch API instead of axios

* refactor: Remove axios dependency from shared package.json and pnpm-lock.yaml

* feat: add apiversion option

* refactor: move http-client to @novu/client

* feat: move http-client to @novu/client

* feat: add error handling and update the constructor params

* feat: overload constructor

* ci(root): require scope in conventional commit config (#5611)

* chore(root): Point to latest ee

* fix(worker): template fallback for empty string

* chore(root): Fix for prepare-cloud-release checkout (#5615)

Checkout only the last commit.  0 indicates all history for all branches and tags creating the wrong prod history.

* ci(root): Better readability of PR title linting comment (#5616)

* ci(workflow): Remove redundant code blocks from yaml

* ci: Enable PR events in conventional-commit.yml

* style: Update formatting in CI workflow file

* ci: Comment out pull_request_target event

* ci: update workflow to use pull_request_target

* chore(root): Set NOVU_ENTERPRISE to doppler (#5618)

Local development environment for novu-team should operate with NOVU_ENTERPRISE=true by default.

* chore(root): Move @novu/application generic under libs (#5612)

This package contains shared code for Novu services. It is considered an internal library and should be deprecated from NPM as well

* fix(web): Email add-logo to brand page redirect (#5610)

* ci(root): Check of EE files within community docker images (#5617)

* feat(ci): Check of EE files within community docker images

* Update .github/workflows/prepare-self-hosted-release.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* fix(ci): A single echo output

* feat(ci): Annotation

---------

Co-authored-by: Sokratis Vidros <[email protected]>

* refactor(web): remove jwt-decode and refactor auth logic (#5620)

* refactor(web): remove jwt-decode and refactor auth logic

* refactor(hooks): use constant for unauthorized routes

* refactor(web): Single theme entry point & ensure Mantine singletons (#5624)

* refactor(web): Single theming entry point and pin @types/react to ensure mantine singleton

* refactor(theme): remove redundant color scheme code

* refactor(routes): rename layout components for clarity

* refactor(auth): simplify conditional rendering in pages

* fix(web): Update copywriting (#5627)

The word "down" might make customers think there is a downtime.

* chore(web): Information Architecture Feedback (#5591)

* feat: Add spacing between sidebar items

* fix: Label change per Sok

* perf(web): Convert image assets to `webp` & skip flaky tests (#5570)

* perf: Change assets to webp, fix brand redirect

* fix: Update new layout comp with webp

* chore(repo): Restore prepare-self-hosted-release.yml

It was deleted accidentally

* chore(root): Update .source submodule pointer

* fix translation error in french (#5629)

* chore(web): Refactor auth logic (#5626)

* chore(web): Refactor auth logic

1. Introduce useAuth() to simplify auth state management for the web-app. This work is necessary to support multiple auth providers for SSO features.
2. Apply a minor refactoring to LaunchDarkly handling, aiming for a simple implementation in the next commit.

* chore(web): Polish LaunchDarky async integration

1. Show the loader immediately as part of custom Skeleton CSS.
2. Prevent any flickering until auth and feature flags are resolved.

* fix(web): Polish ApplicationReadyGuard

* fix(web): Respect color-scheme in skeleton CSS

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix: Missed has change (#5630)

* fix: correct dark mode background color (#5631)

* ci(root): Run CSpell only on community PRs (#5633)

* Add team members check to GitHub workflow

Introduced a new step in the GitHub Actions workflow which checks if the PR creator is part of the team. If they aren't, a spell check is performed. This step makes sure that the member's work gets auto-approved without need for a spell check.

* Remove GitHub token login step in test workflow

Removed the step that logs into GitHub using a token in the test workflow. The change simplifies the workflow, as authentication is not necessary for the subsequent operations.

* Remove authentication step from test workflow

The authentication step using `gh auth login --with-token` has been removed from the Github Action's test workflow(.github/workflows/test.yml). This change simplifies the workflow process by relying solely on the GH_TOKEN environment variable for authentication.

* Update GitHub token and simplify team member check

The workflow file has been updated to use a different GitHub token and the check for team member list has been condensed, improving efficiency. A login step using the new token has also been added. Redundant steps checking for team members have been removed.

* Set environment to Production for spellcheck workflow

The spellcheck workflow in GitHub actions is now set to run in the Production environment. This update helps ensure the workflow executes in the correct context.

* Update test workflow environments

The testing workflows have been modified to improve code quality. Specifically, the 'Dependency review' and 'Spell check' tasks in the GitHub Actions workflow (test.yml), now run in the 'Linting' environment instead of 'Production'.

* Update GitHub token reference in test workflow

The GitHub token reference in .github/workflows/test.yml has been updated. The previous token, GITHUB_TOKEN, has been replaced with a new token named GH_TOKEN. This is a simple change that aligns the token name with our new naming conventions.

* Update environmental variable in GitHub workflow

The environmental variable name for storing the GitHub token in GitHub Actions workflow file (test.yml) has been changed from GH_TOKEN to GITHUB_TOKEN. Additionally, the explicit GitHub login command using the stored token has been removed.

* fix(web): Workflow trigger on-click sidebar render loop (#5634)

* fix(web): workflow run test tab and failing e2e tests (#5637)

* chore(web): More auth refactoring (#5636)

* chore(web): More auth refactoring

- Simplify useAuth storage and only use local storage
- Load useBlueprint only in one place

* style: Remove unnecessary comment

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix(echo): add server options handlers option (#5640)

* fix(sdk): add missing export

* refactor(sdk): rename the i server interface

* test(echo): Mvp test suite (#5583) [nv-3672]

* refactor(echo-cli,echo-sdk): relocate to monorepo

* Merge remote-tracking branch 'origin/next' into NV-3670/relocate-echo-packages-to-the-monorepo

* fix: lock file conflict

* feat: test pipeline

* feat: lock file conflict

* fix: spell and eslint command

* fix: spell disable block

* fix: jest export

* test: fix sdk tests

* feat: remove insecure domain

* fix: update c spell comment

* test(wip): initial addition of test suite

* test(wip): initial addition of test suite

* fix: update c spell comment

* test(wip): ignore console warnings

* test(wip): try without cspell ignore

* test(wip): disable cspell

* fix: update c spell comment

* fix: update c spell comment

* feat: create reusable logo

* refactor: remove redundant code

* fix(next-cli): studio npm hoist packages

* feat(cli-next): add cli tests suit

* feat: bring latest sdk changes

* feat(sdk): add sdk client test suite

* fix(sdk): remove duplicated description after next merge

* feat: update dot source hash

---------

Co-authored-by: ainouzgali <[email protected]>
Co-authored-by: Richard Fontein <[email protected]>

* ci(root): add feature flag checker (#5642)

* Add LaunchDarkly flag finder workflow

A new Github Actions workflow for finding LaunchDarkly feature flags was added to the codebase. Now we have better visibility regarding any feature flags that get introduced or removed with any PRs, helping maintain code quality. The spell check step has been temporarily disabled.

* Add team membership check to workflow

The commit adds a new step to the GitHub Actions workflow that checks if the creator of a pull request (PR) is a member of the specified team. If the PR creator is a team member, the workflow step for running the spell checker is skipped. This check is done using the GitHub API and the 'jq' command-line tool.

* ci(root): Run CSpell only on web app (#5639)

* Have CSpell only run on web app

* Remove team member check in test workflow

The code previously checked whether the PR creator was a team member and skipped the spell check if so. We've now removed this check. As a result, the spell check will run for every PR regardless of who the creator is.

* test(api): Echo server mvp test suite (#5584)

* chore: run deploy dev on app generic changes

* test: add e2e tests for echo server

* feat: lock file

* fix: lock file conflict

* fix(send-message): remove null type from content variable

* chore: Update submodule to latest commit

* chore: fix

---------

Co-authored-by: Richard Fontein <[email protected]>

* feat(echo): sync version with package json (#5625)

* feat(echo): sync version with package json

* refactor(package.json): update file paths in exports

* test(api): add echo health check e2e tests

* style: Fix extra space in test description

* test(content-templates): update assertion syntax

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix: export claims orgid and env id (#5643)

* fix(api): Remove faker (#5645)

Faker is used from API only for testing purposes. It causes issues with dockerization.

* chore(web): Migrate cypress web e2e suite to playwright (#5555)

* chore(root): Update EE pointer

* fix: Fix deployment.yaml indent error after adding google bucket support (#5635)

* chore(root): Upgrade all projects to React 18 (#5641)

* build: Update packages w/o peers

* build: Upgrade react & dev deps

* chore: Delete Ant Icons!

* refactor: Use design system icons instead

* chore(worker): Fix EE port

* feat(novui,web): Setup Mantine v7 and demonstrate ability to style in lib and app (#5651)

* feat: Add mantine7

* feat: Centralized core type

* chore(root): Bump pnpm to its latest version (#5652)

* chore(root): Bump pnpm to its latest version (#5653)

* chore(root): Remove conventional commits

This is a small quality-of-life change for contributors. Since the introduction of the conventional commit PR title Github action and the introduction of squashed merges, there is no need to enforce conventional commits in our everyday commits before pushing them to the branch.

This will also speed up the husky hooks that take place locally.

* chore(web): Update Calendly link

* fix(web): Restore broken Github sign-in

* chore(root): Fix for get-remote-env-files

Download secrets in .env.local for the web app to ensure that the secrets override the committed `.env` file for the Novu team.

* build(echo): Use tsup for building distributable (#5658)

* refactor(build): migrate to tsup and update configs

* refactor: Rename config files to .mjs format

* fix: correct type entry in package.json

* chore: remove redundant npm scripts

* refactor(echo): Remove unnecessary splitting option

* chore: Update package paths and dependencies

* feat(echo): add SvelteKit serve function (#5650)

* feat: add `serve` handler for svelte-kit

* feat: Add sveltekit export in package.json

* build: update pnpm-lock.yaml dependencies

* feat(sveltekit): add support for sveltekit framework

* style(sveltekit): correct comment typo

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix(api): tenant field description in event trigger api (#5647)

* fix: tenant field description in event trigger api

* fix: spell check

* Update apps/api/src/app/events/dtos/trigger-event-request.dto.ts

Co-authored-by: Sokratis Vidros <[email protected]>

---------

Co-authored-by: Richard Fontein <[email protected]>
Co-authored-by: Sokratis Vidros <[email protected]>

* feat(root): NV-3847 include create-novu-app to monorepo (#5664)

Moved to monorepo from dedicated repository
Named properly
Readme cleaned up
Included cspell config and eslint disabled for problematic files temporarily

* chore(web): Stabilize PW E2E (#5656)

* chore(web): Stabilize team-members E2E

* chore(web): Do not throw an error on empty feature flags in PW

* chore(root): Increase the number of retries

Try once more for flaky tests

* chore(web): Stabilize e2e for API Keys page

* Simplify blueprint mock data for E2E

* Apply better naming to test utility function

* Consolidate Activity Feed page specs

* Remove the TODO - prefix in skipped E2E specs

* Polish Playwright tests for the invitation flow

* Skip one more flaky test

* chore(root): Tweak test.yml (#5667)

* chore(root): Tweak test.yml

- Restore affected checks
- Polish step definitions

* fixup! chore(root): Tweak test.yml

* feat(echo): add support for Remix framework (#5666)

* chore(root): Fix type for test.yml

* chore(web): Apply a stability fix for an Playwright e2e spec

* chore(web): Temporarily disable invitations specs

They still unstable on CI

* feat(js): the base js sdk package scaffolding (#5654)

* refactor(root): Nv 3846 consolidate env file behavior (#5662)

- Add env example files to web and widget
- Add web and widget to list of projects requiring .env file setup in setup script
- Rename files to align with expectations
- Remove .env from repo for web and widget
- Consolidate .gitignore config

* refactor(automation): Simplify docker compose files (#5657)

* Remove redis cluster docker files

* Remove unused Docker Compose files

These Docker Compose files are no longer in use by the application. It is beneficial to maintain clarity and cleanliness of the repository by removing them.

* Update docker compose and environment files for development setup

The docker compose file for local development setup now utilizes environment variables for port numbers. This makes it easier for developers to use custom port numbers without modifying the docker-compose file directly. Moreover, a readme file was updated to provide instructions for setting up the local development environment. The name of the docker compose file was also changed for consistency.

* Move docker-compose.monitoring.yml to deployment directory

The docker-compose file specific for monitoring has been relocated from the development directory to the deployment directory. This reorganization reflects its purpose more accurately.

* Update docker/local/development/docker-compose.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update docker/local/development/docker-compose.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Update docker/local/development/docker-compose.yml

Co-authored-by: Sokratis Vidros <[email protected]>

* Refactor and clean up Docker configuration files

This commit streamlines Docker configuration files by consolidating and removing redundant docker-compose.yml from specific subdirectories. Also, the README.md files have been updated to reflect the changes made to the .env file path and docker-compose command. Necessary information about running Docker in ARM only mode has been added to the enterprise Readme file.

---------

Co-authored-by: Sokratis Vidros <[email protected]>

* feat(design-system,web): Move icons (#5677)

* feat: Add react-icons

* docs: Deprecate all the things!

* refactor: Move icons export to `@novu/novui/icons`

* fix(echo): Replace faulty instanceof check with static code check (#5678)

* chore: update prerelease script to use rimraf

* refactor(handler): add error type guard for better handling

* fix(ci): update docker-compose path in action.yml

* ci(localstack): use e2e docker-compose for localstack

* refactor(docker): rename compose file and update config

* refactor(docker): use extends in docker-compose.yml

* ci: Update docker-compose file for localstack

* refactor(ci): rename docker-compose file and update usage

* chore: Update package version and repository info

* Updated GitHub Actions to use latest versions (#5669)

Upgraded various GitHub actions to their latest versions for improved performance and features. The upgrades include actions for setting up node, checkout, AWS credentials configuration, and terraform setup. The changes pertain to various workflows and actions across the repository.

* refactor(automation): Add Check to ensure only next moves code to prod (#5676)

* Rename test workflow and clean up code

The test workflow file has been renamed to 'on-pr.yml' to better reflect its usage. Extra space within the workflow file has also been removed for neatness and readability.

* Add Github action to validate PR source branch

This commit introduces a new Github Action workflow that checks the source branch of pull requests. The action ensures that only changes from the "next" branch can enter the "prod" branch.

* Add validation for branch names in Github action

In the "on-pr-change" Github action, additional validation checks have been added to ensure the HEAD_REF and BASE_REF branch names do not contain invalid characters. Now, the script checks for invalid characters in branch names and restricts merge requests to the prod branch only from the next branch.

* Refactor branch character check in workflow file

Removed the previously defined environmental variables for checking branch names in the .github/workflows/on-pr-change.yml file. The branch character validation has been removed as this is already done by Github. The same check was simplified using Github context variables directly.

* Update branch check logic in Github Actions workflow

The commit adds environment variables to store HEAD_REF and BASE_REF in the Github Actions workflow for checking branches in .github/workflows/on-pr-change.yml file. Using these variables should improve the readability and maintainability of the branch comparison logic.

* Refactored GitHub Actions workflow conditions

The commit refactors the conditional check in the on-pr-change.yml GitHub Actions workflow. It introduces new variables: HEAD and BASE to replace the direct usage of env.HEAD_REF and env.BASE_REF in the condition check, enhancing readability and maintainability.

* Simplify conditional statement in GitHub Action

This commit streamlines the conditional statement in the on-pr-change.yml GitHub Action script. The previous version unnecessarily assigned HEAD_REF and BASE_REF environment variables to local variables, which were subsequently used in the branch comparison checks. The updated version directly uses these environment variables.

* Update .github/workflows/on-pr.yml

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix(web): Fix component type for `VariableManagement` (#5679)

* fix: Translations upgrade banner

* refactor: Narrow type to FC to match enterprise

* feat(web): Local sidebar (#5673)

* feat: Add New EnvironmentSelector

* refactor(api): improve notification and email handling (#5683)

* refactor(api): improve notification and email handling

* refactor(invites): update webhook DTO and use typed headers

* feat(env): add HubSpot environment variables

* refactor(invites): rename invite-nudge-webhook to invite-nudge

* fix(web): add redirect to page after login (#5668)

* fix: add redirect to team page after login

* fix: changed to _organization

* refactor(invite-nudge): simplify logger message string

* refactor(auth): make redirectTo pathname optional

---------

Co-authored-by: Richard Fontein <[email protected]>

* fix: wrap invite nudge in try catch (#5686)

* feat(novui,web): V2 flow list (#5682)

* feat: Define `Table` component
* feat: Setup basis for Workflows list page
* feat: Add semantic tokens

* build(root): Update Jarvis to run docker infra instead of through brew (#5659)

* Refactor database setup to utilize Docker

The previous code that checked homebrew and installed databases if not found has been modified. Now, the script checks if MongoDB and Redis are installed, and if they aren't, it starts Docker Compose to run the databases. It also copies the example environment file to a specified location and starts up the Docker Compose. This improves the local dev environment setup by using Docker for database management.

* Refactor dev environment setup script

The script for setting up the development environment has been updated for better readability and organization. Changes include removing redundant messages, moving Docker start-up into a designated function, and changing the Docker Compose command to start in detached mode. The script also includes success messages after starting Docker and verifying git installation.

* Update dev environment setup script for MongoDB and Redis checks

The development environment setup script has been updated to handle scenarios where MongoDB and Redis have already been installed. Rather than exiting, it now sets a flag and proceeds if both services aren't installed already, copying the environment file and starting Docker Compose accordingly.

* Add brew installation check before starting database

The updated developer environment setup script now checks for availability of the brew command before trying to start the database. This provides cleaner handling for environments where brew is not available. If brew command is not found, the script checks the default ports for MongoDB and Redis instead.

* Add brew installation check before starting database

The updated developer environment setup script now checks for availability of the brew command before trying to start the database. This provides cleaner handling for environments where brew is not available. If brew command is not found, the script checks the default ports for MongoDB and Redis instead.

* Update dev-environment-setup.sh to add messaging for manual database start

Updated the dev-environment-setup.sh script to include messages for manual database start. This includes a recommendation for removing mongodb and redis databases from brew and instructions on how to manually start the containerized databases in the project.

* Remove local dev domain setup from dev environment script

This commit removes the function create_local_dev_domain from the development environment setup script. It was no longer necessary as it was causing conflicts with other processes. This would ensure the script runs smoother and cause less conflicts while setting up the development environment.

* Reformatted code and updated Homebrew upgrade command

The code in the dev-environment-setup.sh script has been reformatted for more readability and consistency. Additionally, the command for upgrading Homebrew has been simplified. The previous version was tapping into Homebrew cask unnecessarily before updating, this step has now been removed.

* fix(api): invite nudge members count (#5690)

* fix: add organizationId in payload

* fix: add logs for hubspot

* fix(ee-echo-web): Inherit input styling for inputs component (#5691)

* chore: Update submodule pointer

* chore: update submodule to latest commit

* ci(root): Create New Cloud Deployment  (#5693)

* temp

* Refactor GitHub actions for deployment process

The GitHub actions for the deployment process has been refactored. This included renaming the deployment steps, restructuring the workflow, and moving related files into the cloud-deploy directory. Each part of the application now has a dedicated release step for better structure and maintainability.

* Add failure and success notifications to cloud deployment workflow

This update enhances the cloud deployment workflow by adding provisions for both successful and failed release notifications. Now, if any of the previous jobs fail, a 'Release has failed' message will be posted on the '#eng-feed-deployments' Slack channel. Likewise, if all previous jobs succeed, a success notification will be sent to the same channel.

* Update deployment workflows in GitHub Actions

The cloud deployment workflows are updated in the GitHub Actions configuration to correctly match each workflow with its corresponding deployment script. This includes updates for 'embed', 'web', 'web-components', 'webhook', 'widget', 'worker', and 'ws' workflows.

* Update deployment workflows and reduce timeout

Reduced the timeout for several workflow runs from 80 to 15 minutes. The dependency on test jobs before deployment was also removed in various workflows to streamline the deployment process. These changes speed up the deployment process and make it more efficient.

* Remove --skip-nx-cache option from build commands

The --skip-nx-cache option has been removed from the pnpm build calls in the 'cloud-deploy-api' and 'cloud-deploy-worker' workflows. This change assumes that the tool will use its default configuration, which includes leveraging cache to improve build time.

* chore(web): Remove unused multi-provider from example env (#5695)

* chore(web): Remove translation manager feature flag (#5696)

* refactor(worker): add job (#5663)

* refactor(worker): add job

* fix(worker): remove duplicated execution detail log

* fix(root): Update Dockerfile ag path (#5702)

* Update Dockerfile ag path

* Update apps/ws/Dockerfile

Co-authored-by: Biswajeet Das <[email protected]>

---------

Co-authored-by: Biswajeet Das <[email protected]>

* feat(client): add novu user agent (#5671)

* feat: add novu user agent

* Update packages/client/src/http-client/http-client.ts

Co-authored-by: Sokratis Vidros <[email protected]>

* Update packages/client/src/index.ts

Co-authored-by: Sokratis Vidros <[email protected]>

* refactor: user agent

* fix: typo

---------

Co-authored-by: Richard Fontein <[email protected]>
Co-authored-by: Sokratis Vidros <[email protected]>

* feat(novui): Map panda values to mantine theme (#5692)

* feat: Map Mantine config

* fix: Use gradient default

* feat: Add WIP button

* feat: Include mantine styles & use example

* feat(js): lazy session initialization and interface fixes (#5665)

* fix(web): Hubspot onboarding invite member flow (#5674)

* fix: handle user invite redirect to hubspot question form

* fix: handle github sign in redirect

* fix: invitation login and sign up cases

* fix: spell check error

* Update apps/web/src/pages/auth/components/LoginForm.tsx

Co-authored-by: Sokratis Vidros <[email protected]>

---------

Co-authored-by: Sokratis Vidros <[email protected]>

* chore(root): Skip some unstable e2e tests

Unblock the CICD for now, get back to them later.

* chore(root): Skip more unstable e2e tests

* chore(root): More effort on e2e stabilization

* feat(root): include local tunnel work (#5698)

* feat: include local tunnel work

Add local tunnel script to novu app
Add storage of local tunnel url

* feat: include local tunnel work

Add test for user registration case in enterprise

* feat: include local tunnel work

Consolidate scripts to one source

* feat: include local tunnel work

Update modules to be typescript instead of javascript
Update output package json command
Update build command to clean dist before building

* feat: include local tunnel work

Update formatting
Add tunnel interface to conform to

* feat: include local tunnel work

Adjust per PR comments and discussion

* feat: include local tunnel work
Subdomain calculated from ApiKey on launch instead on scaffold
Run script with tsx

* feat: include local tunnel work

Adjust how concurrently handles tasks
Adjust text in output

* feat: include local tunnel work

Regenerate echo url on api key rotation

* feat: include local tunnel work

Remove unused package

* feat: include local tunnel work

Update lock file

* feat: include local tunnel work

Update lock file

* feat: include local tunnel work

Update lock file

* feat: include local tunnel work

Update lock file

* feat: include local tunnel work

PR suggestions

* feat: include local tunnel work

Update restart cooldown to be 1sec

* feat: include local tunnel work

Add error handler logic that enables restart on tunnel fail

* feat: include local tunnel work

update ee package reference

* feat(root) update ee package reference (#5707)

* chore(create-novu-app): Update README with quickstart guide and release (#5709)

* docs(create-novu-app): update README with quickstart guide

* style: Remove unnecessary eslint-disable comments

* chore: Add ESLint config for create-novu-app

* style: Remove eslint-disable comments

* chore: bump version to 0.24.3-alpha.4

* refactor(worker): Local instance selection handlebars (#5622)

* feat: add i18n instance

* feat: add workers

* feat: instance selection

* feat: add compilation

* fix: update source file

* chore(root): rename chimera to bridge (#5711)

* chore(root): rename chimera to bridge

* chore(root): rename chimera to bridge

Update ee reference

* chore(root): rename chimera to bridge

Update ee reference

* chore(root): rename chimera to bridge

Update ee reference

* chore(root): rename chimera to bridge

Update ee reference

* feat(echo): add skip support (#5619)

* feat: add skip support

* fix: after next merge

* fix(worker): remove tenant repository in tests

* feat: refactor after next merge

* feat: update after pr review

* fix(api): remove faker dep

* fix(api): faker import

* refactor(api,echo-api): rename chimera url to url

* feat: update submodule hash

* feat: update submodule hash

* refactor(app-gen,echo-sdk): update after pr comments

* revert(echo): change skip to be function again

* chore(echo): update submodule hash

* feat(echo): refactor after pr comments

* feat: update hash

* fix(cli-next): sync request

* feat: update hash

* fix(echo): add skip inputs validation compilation

* refactor(echo): after pr comments

* fix: package name

* fix: ee source

* fix: still show preview for skipped steps

* tests: add test for preview mode

* fix: skip tests

* fix: resolve app

---------

Co-authored-by: Dima Grossman <[email protected]>

* fix(node): Fixing chat missing in events interface (#5661)

* adding chat to overrides interface

* feat(providers): adding mobishastra sms provider

* fix(node): remove code unrelated to fix

* fix(node): Add missing 'chat' property to ITriggerOverrides interface

* fix(events): Add 'whatsapp' property to ITriggerOverrides interface

* refactor(events): Update IWhatsappOverrides interface to use IWhatsappComponent type

* chore(deps): update react monorepo (#5713)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: bring back comunity self hostdocker compose file (#5718)

* feat(web,design-system,novui): Add embeddable docs (#5513)

* fix: semantic colors tokens for table (#5721)

* chore(web): More e2e stability fixes (#5712)

* chore(api): Consolidate email normalization service

Use the same email normalization across the API and the e2e seeding so as to get predictable E2E tests.

* fixup! chore(api): Consolidate email normalization service

* fix(web): Stabilize E2E tests

Never clean the database in e2e tests. Just append so that parallel runs work.

* chore(testing): Clean up password handling in mocks

Make it more predictable with the necessary utilities

* chore(web): Clean up the logic of the invitation page

* fix typo

* chore(root): Polish web e2e scripts

Also, fix conditional running logic that ensures Web E2E tests run only if web files are affected.

* Don't fail fast

* Skip E2E tests for community contributions

* fix

* fixup! fix

* Tweak on-pr workflow name

* fix

* fix

* Improve on-pr step naming

* Try without the feature flag.

* Revert "Try without the feature flag."

This reverts commit fa3d9a9.

* Update playwright.config.ts

* Remove billing feature flags

* Remove IA feature flags

* Simplify launch darkly management

Make it easier to bypass in testing environments as it introduces too much flakiness in tests.

* Revert "Remove IA feature flags"

This reverts commit e8de7c5.

* Update .source

* Update .source

* Add some polish to e2e utilities

1. Simplify feature flag mocking in tests drastically. Read apps.web.test/README for more information.
2. Clean up e2e utils folder
3. Remove isPlaywright
4. Format files accordin to ESLint

* Update reusable-web-e2e.yml

* Triple the default timeout of a slow test

* Update .env.test

* More e2e fixes

* Update README.md

* More fixes

* Update templates-store.spec.ts

* Update reusable-web-e2e.yml

* chore(web): Consolidate all web code into a single app (#5716)

* chore(web): Consolidate all web code into a single app

- Simplify development experience, simplify imports, fix live reload issues, and reduce package dependencies
- Enforce TS strict mode that wasn't previously enforced in EE code, although tsconfig.json had strict: true.
- Add the necessary Novu license under the apps/web/ee folder

* Update License files

* feat(echo): add regular delay step feature parity (#5670)

* refactor(worker): add job

* feat(echo): add support for regular delay

* refactor(echo): after pr comments

* fix: update ref

* feat: add default type

* fix: types

* fix: frontend display

* fix: test definition for subscriber

---------

Co-authored-by: Dima Grossman <[email protected]>

* chore(web): Consolidate web and shared web (#5722)

* chore(root): Consolidate web and shared web - part 2 (#5723)

* WIP

* Replace @novu/shared-web with local imports

* Apply strict TS fixes

* Update pnpm-lock.yaml

* More fixes

* Apply final touches after merging web and shared-web packages

* chore(web): Fix failing assertion.

* chore(web): Apply ESlint fixes

Warnings in CI are errors, making the CICD to fail.

* feat(framework): add access control max age header

* chore(web): Increase retries on CI

* chore(web): Reduce the number of PW shards

Try to see if it's faster this way as PW install takes a lot of time in each shard.

* chore(root): Merge cloud release with squash, not rebase

Teach the daily release Github action to conform to the new repo rules

---------

Co-authored-by: Dima Grossman <[email protected]>
Co-authored-by: Sokratis Vidros <[email protected]>
Co-authored-by: Sokratis Vidros <[email protected]>
Co-authored-by: Richard Fontein <[email protected]>
Co-authored-by: Alex Ryzhou <[email protected]>
Co-authored-by: George Djabarov <[email protected]>
Co-authored-by: Biswajeet Das <[email protected]>
Co-authored-by: Adam Chmara <[email protected]>
Co-authored-by: Joel Anton <[email protected]>
Co-authored-by: Gab <[email protected]>
Co-authored-by: Zac Clifton <[email protected]>
Co-authored-by: Paweł Tymczuk <[email protected]>
Co-authored-by: ainouzgali <[email protected]>
Co-authored-by: GalTidhar <[email protected]>
Co-authored-by: Pedro Havay <[email protected]>
Co-authored-by: Abdelhadi Sabani <[email protected]>
Co-authored-by: Pawan Jain <[email protected]>
Co-authored-by: Denis Kralj <[email protected]>
Co-authored-by: Amin Mahfouz <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Söderberg <[email protected]>
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