Commit Graph

304 Commits

Author SHA1 Message Date
giancarlo
bd79563dcd Refactor and add generators for keystatic and package
The changes include refactoring the create-reader in cms keystatic and changing @keystatic/next version. Additionally, code generators for keystatic and package have been added, and corresponding templates have been organized into their respective directories.
2024-05-07 18:52:30 +07:00
giancarlo
171a404379 Integrate Markdoc library with Keystatic CMS.
The commit introduces the '@markdoc/markdoc' library to the Keystatic CMS. It modifies related functions and components such as 'KeystaticDocumentRenderer' and 'keystatic-client' to transform and render content using Markdoc. Additionally, the commit refactors 'keystatic.config.ts' file for more legible content field setup and adds related dependencies in the package.
2024-05-07 15:33:25 +07:00
giancarlo
05255cbebe Update react-query and lucide-react dependencies and improve lockfile version
This commit updates '@tanstack/react-query' from '5.32.0' to '5.35.1' and 'lucide-react' from '^0.376.0' to '^0.378.0' in package.json. Additionally, changes were made in pnpm-lock.yaml including updating the lockfile version from '9.0' to '6.0'.
2024-05-07 14:22:47 +07:00
giancarlo
b8f00f0a2d Refactor E2E tests, update utils, and modify plan-picker validation
Several changes have been made to optimize the testing and validation workflows. The end-to-end tests for user billing, invitations, account, team billing, and team accounts have been retouched for improved performance and better accuracy. There has been a minor modification in the validation rules for plan-picker in the billing component. Furthermore, modifications are made to several utility functions to fine-tune their operations.
2024-05-05 18:15:11 +07:00
giancarlo
ca4932e351 Update package versions for improved stability
This commit updates the versions of "@types/node", "react-hook-form", and "@tanstack/react-query-next-experimental" packages throughout the application. These updates include minor version changes that improve the stability and compatibility of these libraries within the app.
2024-05-05 14:39:31 +07:00
giancarlo
d7d3693f41 Refactor function components across multiple files
Function components have been refactored across the codebase. Single export-const arrow function components have been adapted into traditional function declarations. This change provides better stack trace in case of errors and better function and argument names on runtime debugging.
2024-05-05 13:31:40 +07:00
giancarlo
de15abb801 Update Supabase and Sentry dependencies
Updated dependencies for Supabase-js from version 2.43.0 to 2.43.1 and Sentry from various 7.112.2 versions to 7.113.0. It was necessary to ensure compatibility, bug fixes, and to benefit from new features and improvements.
2024-05-04 11:48:19 +07:00
giancarlo
6be43ef77c Remove console logs from webhook verifier
In the server service for verifying webhooks from the Postgres database, unnecessary console logs that were printing the header and secret were removed. This change aligns with the best practices for production code where debug logs are not expected.
2024-05-04 00:10:38 +07:00
giancarlo
08c86102d8 Refactor code and improve error handling in authentication methods
This commit contains several changes including the removal of an unused onClick event handler in remove-member-dialog.tsx. It also includes an update to the POST handler in the Webhook route of the database API where the authentication property has been updated. Lastly, it also brings improvements in error handling and logging in various areas, such as e2e authentication tests and the mailbox utility.
2024-05-03 23:56:23 +07:00
giancarlo
e159c52d41 Corrected variable name typo and updated library dependencies
An incorrect variable name in account-invitations-table.tsx was fixed, correcting `iRenewingInvite` to `isRenewingInvite`. Additionally, several dependencies across the project were updated, including `zod`, `supabase`, and `stripe`, among others. These updates ensure the project is using the most recent and secure versions of the libraries.
2024-05-03 16:33:44 +07:00
giancarlo
549097efa6 Add logging to team account creation and update
The commit enhances the team account creation and update features by adding logging capabilities. It renames createOrganizationAccountAction to createTeamAccountAction for better contextual relevance. The logging provides informative insights into the process of creating and updating the name of the team account, aiding in easier debugging in the event of an error.
2024-05-03 09:09:47 +07:00
giancarlo
468204d355 Replace useRouter with window.location in admin impersonate user dialog
Removed usage of useRouter from the admin impersonate user dialog component and replaced it with window.location.replace. This was done to ensure a hard refresh and avoid hitting cached pages after impersonating a user.
2024-05-02 17:06:27 +07:00
giancarlo
dbce7e38ae Refactor route handlers and CMS clients
Refactored the route handlers to use a new `enhanceRouteHandler` function for better control over request handlers and user authentication. CMS clients are now created using factory functions for better encapsulation and control over instance creation. Renamed `client.ts` in 'keystatic' to `keystatic-client.ts`.
2024-05-02 12:37:58 +07:00
giancarlo
be5c10f1c3 Simplified path parameter in createKeyStaticConfig function
The explicit path parameter has been removed from the createKeyStaticConfig function. It now uses direct paths for the 'posts' and 'documentation' collections, instead of constructing them through an environment variable. This could help make the code simpler and cleaner.
2024-05-02 11:29:30 +07:00
giancarlo
05fd9fcb88 Add account selection functionality to mobile navigation
Added a new type, 'Accounts', and used it to enable account selection from the mobile navigation menu. The 'Accounts' type incorporates the label, value, and image of a given account. This change will improve the app's usability, making it easier for users to navigate different accounts directly from their mobile devices. For custom plans, a null check has been implemented to avoid rendering null values.
2024-05-02 01:30:51 +07:00
giancarlo
65e8dab1b2 Update codebase to enhance debugging and improve user interface
The codebase has been updated throughout to improve debugging capabilities notably in the PostgresDatabaseWebhookVerifierService and create-reader modules. User interface has also been enhanced in the marketing layout and blog page. Minor reordering of entries in email-templates and adjustment of configurations in turbo.json has also been performed.
2024-05-02 01:16:50 +07:00
giancarlo
a161af1624 Update Supabase version to 2.43.0
The commit updates the version of Supabase from 2.42.7 to 2.43.0. It also implements the necessary changes in dependencies and packages where the updated version is being used. This was done to leverage the improvements and fixes introduced in the latest Supabase release.
2024-05-01 19:11:44 +07:00
giancarlo
591c4557c0 Update environment variable references
Environment variables in multiple files have been updated to correctly reference public variables. Moreover, the conditional check for MONITORING_INSTRUMENTATION_ENABLED has been corrected to explicitly check for the string 'true'. This change ensures that our application correctly accesses public environmental variables and behaves as expected under the conditions defined by these variables.
2024-05-01 18:59:18 +07:00
giancarlo
15f6c72c6e Add i18n support to email-templates
The email-templates package now uses the i18n (internationalization) library to translate email content based on user language preferences. This update involves changes to the email structure, the addition of translation JSON files, and modifications to the files referencing the emails. Email file locations were also restructured for better organization.
2024-05-01 17:35:48 +07:00
giancarlo
898e1c3dbb Add support for custom billing plans
This commit includes updates to the billing schema to allow for the creation of custom billing plans. These types of plans have no line items associated with them. Changes have also been made to properly handle the absence of primary line items in such plans.
2024-05-01 16:26:35 +07:00
giancarlo
97378f1369 Simplify MonitoringProvider component
The MonitoringProvider component has been simplified. The “config” prop, including 'provider' and 'providerToken', has been removed as they are no longer needed. The implementation now directly uses the getMonitoringProvider function and removed the check for 'props.config'. Conditionally rendering the BaselimeProvider component has also been simplified.
2024-05-01 14:33:32 +07:00
giancarlo
ff24c6aa6d Refactor notifications count and position
The commit primarily addresses two changes related to the notification component. It removes the unread variable that filtered non-dismissed notifications, hence directly using the total notifications count directly. This is displayed on the button. Also, the position of alerts icon was shifted closer to the edge from right-5, top-5 to right-1, top-1.
2024-05-01 12:38:54 +07:00
giancarlo
9baee90eec Update configuration settings and improve notifications
This commit updates the configuration settings and improves the notification functionality by filtering out duplicate notifications. It also includes changes to feature flag data types and removed dependencies in `package.json`, alongside updates to `pnpm-lock.yaml`.
2024-05-01 12:13:19 +07:00
Giancarlo Buomprisco
861b2130a7 New layout updates (#23)
* Remove redundant files and update pnpm lockfile

* Refactor and improve UI responsiveness

UI elements have been refactored for better responsiveness and a more consistent user interface. Changes include adjusting padding and margin in several components, altering sizes of variables like avatar and button, and repositioning notifications for better visibility. A more detailed breakdown can be found in the diffs.

* Updated UI components and page layout configurations

Enhanced UI components among different modules, adjusting their behavior and appearance. Also added logic to get layout style from cookies if available. This enables persistent interface configuration across sessions. Modified the PageStyle type renaming it as PageLayoutStyle and exported it, allowing use throughout the application.
2024-05-01 02:18:04 +07:00
Giancarlo Buomprisco
5e8e01e340 New Layout (#22)
New layout
2024-04-30 22:54:33 +07:00
giancarlo
9eded69f15 Create Switch component and update dependencies in lock file
Introduce a new Switch component in the shadcn UI package to enhance user interface capabilities. Simultaneously, the pnpm-lock.yaml file's lockfileVersion has been updated from '6.0' to '9.0'. Also, several dependencies' versions within the file are updated to ensure compatibility and security improvements.
2024-04-30 13:42:06 +07:00
giancarlo
2ff08a971d Update Zod package, improve code formatting, and add awaiting indicators
This commit includes three main changes. First, it updates the Zod library from version 3.23.4 to 3.23.5 across all relevant packages. Second, code readability has been enhanced by formatting modifications in several TypeScript files. Lastly, the user feedback on certain operations such as creating a team or charging for a payment is strengthened, by displaying an awaiting indicator until the operation is complete.
2024-04-30 13:16:51 +07:00
giancarlo
437935e492 Refactor webhook handling and router services
Webhook handling has been made more flexible with an optional custom event handler in the 'handleWebhook' function. A new 'DatabaseChangePayload' type has been created to define the payload for database change events, aiding custom webhook handling. The 'DatabaseWebhookRouterService' has been changed to a factory function. This transformation improves the service initialization, making it more readable and testing friendly. Some potential noisy logs in the default case are also removed.
2024-04-30 11:42:57 +07:00
giancarlo
14dee4f347 Refactor webhook handler service and update dependencies
Refactor to make database webhook handler service a function. This change introduces the function `getDatabaseWebhookHandlerService()` to return an instance of the service, allowing easier management of instances. Dependencies are updated as well, including bringing `react-i18next` to version 14.1.1(i18next@23.11.3) and `@react-email/components` to version 0.0.17 and others.
2024-04-30 02:36:48 +07:00
giancarlo
faaa26c4e8 Remove account id dependencies from role management
This commit refactor the role management, removing the dependencies on account ids throughout our system. Changes include removing account id related attributes in the roles table schema and functions, modifying seed data and simplifying the role data provider code. This makes role structure more generic and simplifies the role handling process.
2024-04-29 21:14:33 +07:00
giancarlo
e09a10a7f9 Update notification and membership models, add extension installing method
Several updates are made to the notification model, mainly removing the 'entity_id', 'entity_type', and 'language_code' fields from the properties. We've also updated the 'accounts_memberships' table, by preventing its updates except for 'account_role'.
2024-04-29 20:04:11 +07:00
giancarlo
820ed1f56b Add notifications feature and update feature flags
This update includes creating new files for the notifications feature along with adding two feature flags for enabling notifications and realtime notifications. All the code and package dependencies required for the notifications functionality have been added. The 'pnpm-lock.yaml' has also been updated due to the inclusion of new package dependencies.
2024-04-29 18:12:30 +07:00
giancarlo
b65e1dacc7 Refactor authentication handling and update loading components
The authentication handling logic in the middleware.ts file was refactored to improve clarity and control flow. In addition, the loading component, previously located in the main app directory, has been deleted and recreated specifically for admin use. The list of private path prefixes has been updated in the use-auth-change-listener.ts file to reflect these changes.
2024-04-28 21:09:12 +07:00
giancarlo
1009685efd Move sign out command before account deletion and modify private path prefixes
The sign out command is moved ahead of the account deletion service to ensure users are logged out before their account gets deleted. The "/join" prefix is removed from the list of private path prefixes. Additionally, a global loader component is added to the join loading page.
2024-04-28 21:00:41 +07:00
giancarlo
c11168a8c7 Refactor captcha token usage in authentication
The handling of the captcha token was decentralized and moved into each individual authentication component. All components that use a captcha token now import and use their own tokens from the 'useCaptchaToken()' hook, improving individual component autonomy. This change simplifies the hierarchical structure and reduces dependencies.
2024-04-28 13:35:55 +07:00
giancarlo
51a90bde83 Improve user session handling in middleware
The changes add user session handling directly in the middleware. This ensures the user data is fetched at the start of a request and then passed on to route handlers, reducing repeated data fetching. Also, these improvements include adjustments for how sign-out and auth-change events are managed, particularly when the user session state changes. Additionally, it corrects the error response from useUser hook to return `undefined` instead of `null`.
2024-04-28 13:20:25 +07:00
giancarlo
3efbf6029f Optimize code for accounts and roles management
The large update includes optimization for account and role management. The code has been revised for better readability and efficiency. Changes include formatting updates and enhancements to the creation and handling of accounts, roles, and memberships. Privacy settings have also been adjusted to provide more secure handling of user data. Code comments have been updated for better understanding of the functions.
2024-04-28 12:55:01 +07:00
giancarlo
2382d6485c Update '@makerkit/data-loader-supabase-nextjs' to version 1.2.0
The package '@makerkit/data-loader-supabase-nextjs' has been updated from version 1.1.0 to 1.2.0 in 'pnpm-lock.yaml', 'apps/web/package.json', and 'packages/features/admin/package.json'. The integrity has also been updated to reflect the new version in 'pnpm-lock.yaml'.
2024-04-28 10:34:49 +07:00
giancarlo
5606349627 Remove path environment variables
Paths such as SIGN_IN_PATH and SIGN_UP_PATH have been hardcoded into the application instead of being environment variables. These changes simplify the configuration of the application, making maintenance and understanding of the codebase easier.
2024-04-28 01:30:13 +07:00
giancarlo
25687bb497 Handle redirect errors in routes and actions
The commit introduces a check for redirect errors in routes and actions modules to provide better error handling. It imports `isRedirectError` from 'next/dist/client/components/redirect' and uses it to check if an error is a redirect error, in which case re-throws the error. A minor modification was also made in the creation of the team account's home path variable.
2024-04-28 01:04:55 +07:00
giancarlo
2b2977f0c8 Integrate captcha token in password sign-in process
In this update, a captcha token is introduced in the password sign-in process to improve security. A `useCaptchaToken` hook has been added to the `PasswordSignInContainer` and corresponding adjustments have been made in the `useSignInWithEmailPassword` hook. The SignInWithPasswordCredentials type is now used for credentials instead of a locally defined interface.
2024-04-28 00:04:06 +07:00
giancarlo
a2211c7e75 Update state handling in CaptchaProvider
Adjusted the way the 'instance' state is handled in CaptchaProvider by utilizing useRef and useCallback from React. Now, instead of managing 'instance' with useState, it is stored in a reference through useRef to prevent unnecessary re-renders. The 'setInstance' function has been updated to set this reference, ensuring the 'instance' is kept up-to-date.
2024-04-27 20:24:40 +07:00
giancarlo
0ee501fe9d Improve CAPTCHA handling in signup methods
This commit refines the usage of CAPTCHA in signup methods by storing the CAPTCHA token and instance, providing a reset function, and managing validation on server-side. A new context instance has been introduced to keep track of the CAPTCHA instance besides the token. Proper error reporting is now in place for CAPTCHA verification failure.
2024-04-27 20:00:28 +07:00
giancarlo
84cacb81c2 Refactor CAPTCHA setup verification
Eliminated constant verification of CAPTCHA setup across different modules and refactored the CAPTCHA token verification process. This commit relies on config parameters to decide whether to verify CAPTCHA or not, instead of environment variables. It also reforms the token submission to CAPTCHA service for consistency and clarity.
2024-04-27 19:13:11 +07:00
giancarlo
0616d3b288 Refactor account server actions using the enhanced action helper
The enhanced action helper has been utilized to refactor account-related server actions across the codebase. This change aims to streamline the server-side handling of user accounts, team accounts, and related functionality. As a result, various account-related server actions have now been wrapped with the helper, providing uniformity and consistency in action handling.
2024-04-27 18:31:11 +07:00
giancarlo
ec59d02fb0 Update auth confirmation route and enhance captcha functionality
Updated the default redirect URL in the auth confirmation route using the home URL from paths.config. Also renamed and enhanced 'CaptchaTokenSetter' to include optional Turnstile properties. This enhancement allows customization of the captcha based on the provided options while maintaining backwards compatibility.
2024-04-27 15:19:33 +07:00
giancarlo
07deb28e12 1. Updated packages
2. Added comments to schema
3. Minor API updates
2024-04-27 14:39:28 +07:00
giancarlo
259e6ba555 Add contact form, cookie banner, and update packages
This commit includes the addition of a contact form and a cookie banner to improve user experience and comply with regulations. The contact form involves email submission functionality. Several packages have also been updated and new routes have been added to the sitemap for better SEO. Environment variables have also been adjusted for email and contact form functionality.
2024-04-26 13:43:41 +07:00
giancarlo
2b3dbb4549 Add 'use client' statement to monitoring.context.ts
In this commit, the 'use client' statement has been added to the top of the 'monitoring.context.ts' file. This is to ensure that the context is properly set for further monitoring operations.
2024-04-25 23:00:23 +07:00
giancarlo
2a65cd0b95 Update UI components and styling
This commit includes overall UI and styling improvements in different areas of the application. In particular, it refactors the font usage in the tailwind configuration and modifies the Heading import path in `heading.tsx`. The pricing table and line item details in the billing gateway had been extensively updated to provide better visual representation. Finally, changes were made to the marketing page to make it more straightforward and clear.
2024-04-25 20:17:50 +07:00