756 Commits

Author SHA1 Message Date
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
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
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
3f4888faa9 Add outputFileTracingIncludes to next.config.mjs
This commit includes the outputFileTracingIncludes configuration in the next.config.mjs file. This is done to specify which files should be included in the output file tracing, in this case, all files in the /content directory.
2024-05-02 01:18:00 +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
3220526a30 Add footer details in marketing component
The footer of the marketing component now includes a localized description and a copyright message that are injected into the footer. These changes were made in both the marketing.json file in the locales folder, and the site-footer.tsx in the _components folder. The year is dynamically generated based on the current year in the copyright message.
2024-05-01 16:51:14 +07:00
giancarlo
809b36dd96 Refactor code and add loading components in marketing apps
This commit alters the source of the cache module import used in [...slug]/page.tsx from 'next/cache' to 'react'. Import statements in blog/page.tsx and docs/layout.tsx have been restructured for clarity, keeping local imports separate. Added new loading.tsx files in both blog and docs directories that exports the GlobalLoader from '@kit/ui/global-loader'.
2024-05-01 16:47:25 +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
9951c82309 Adjust blog post elements styling
Adjusted the vertical space, font-size, and text color of various elements in the blog post preview for improved readability and visual flow. In addition, changed the heading level for better semantic structuring and applied styling changes to the `pre` tag in html-renderer.module.css for enhanced presentation.
2024-05-01 15:00:24 +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
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
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
26511b8886 Update database schema and add notification test
This commit updates the database schema to enhance security by revoking access of all tables from authenticated and service_role before granting select or relevant access. It further modifies SQL function syntax formatting and defines new types for notifications. Also, it adds a new test for the notification functionality to check the permission levels of different users and their ability to insert and read notifications.
2024-04-29 19:43:23 +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
b78e716298 Add child props to UserAccountHeader component
The UserAccountHeader component in the Dashboard app has been updated to include child props. Now, it allows the rendering of additional components between the PageHeader tags. This enhances its versatility and promotes code reuse in different contexts within the app.
2024-04-29 11:55:42 +07:00
giancarlo
0292cdb5b3 Refactor join page layout and enhance redirection
Removed the standalone layout and loading files in the 'join' module, integrating the layout directly into the primary page file. Also substituted 'permanentRedirect' with the less rigid 'redirect' function in navigation to better handle user flow, especially when invites are not found or have expired. This change will make the code easier to manage and will improve user experience with page redirection.
2024-04-28 21:39:17 +07:00
giancarlo
0018081f16 Refactor middleware to directly use UserResponse
The adminMiddleware and other handlers in middleware.ts have been updated to directly use UserResponse, instead of creating and using a supabase middleware client. The retrieval and handling of user data are now more direct and streamlined. The code changes also include minor syntax adjustments for style consistency.
2024-04-28 21:27:49 +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
4390f64b8a Add handling for invite tokens in authentication confirmation
Modified the GET function in the authentication confirmation route to handle invite tokens. If an invite token is detected, the user will now be redirected to the join team page rather than the default next URL. This ensures users attempting to join a team land on the correct page.
2024-04-28 20:37:32 +07:00
giancarlo
282e7d0528 Update search path in database functions and add new indices
The search path in various database functions has been updated to '' for uniformity and security reasons. Additionally, new indices were added for the 'accounts_memberships' and 'invitations' tables to improve database performance. Some references to 'app_permissions' have also been updated to 'public.app_permissions' ensuring proper data access.
2024-04-28 14:24:47 +07:00
giancarlo
0c6bdaa9e4 Update validation message for URL configuration
The commit updates the validation error message in the chat web app configuration. The new message indicates a scenario where a user has provided the URL using http instead of https during a production build, increasing clarity by hinting at possible misconfigurations due to incorrect protocol use.
2024-04-28 13:25:32 +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
70a7778d31 Refactor code and improve translations setup
The commit refactors the import paths, streamlining the file structure. Removed unused imports and shifted a few components in the modules. Also, the translation setup in the FAQ page was improved for better readability and maintainability. Placeholder content has been added to policy pages as well.
2024-04-28 00:22:44 +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
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
giancarlo
0ad26e991d Update invitation acceptance UI for clarity
Updated the invitation acceptance interface components. The 'Join Team' button text has been changed to reflect the user's email. This provides the user more clarity about which account they are accepting the invitation for. Other minor adjustments were made to the layout and heading level for consistency and improved readability.
2024-04-25 19:56:30 +07:00
giancarlo
341762b6a5 Update useBaselime hook and upgrade dependencies
Add a captureEvent function to the useBaselime hook for capturing events within the monitoring service. Multiple dependencies, including `@supabase/supabase-js` and `next`, have also been updated to newer versions. This ensures usage of the most recent and efficient versions of the tools needed in our project to resolve potential issues and benefit from recent improvements.
2024-04-25 17:37:12 +07:00
giancarlo
03d06b64ba Refactor billing code and add error monitoring
Refactored the code that retrieves the billing customer id by renaming the function getBillingCustomerId to getCustomerId. Also, bolstered error handling: implemented exception capture in particular scenarios across multiple files. If an error occurs, it's now captured and reported to the configured provider.
2024-04-25 13:19:46 +07:00
giancarlo
8d04624b1d Add queryUsage method to billing services
A new method, queryUsage, has been added to the billing strategy classes and the gateway service to offer usage querying capabilities for Stripe and Lemon Squeezy. QueryBillingUsageSchema has also been introduced in the schema-related changes. Changes also include updates to the functions' comment descriptions. A minor tweak was made to the Button and Link components in the `faq/page.tsx' file.
2024-04-25 11:34:47 +07:00
giancarlo
19332d124d Update nesting of Button and Link components
The Link component is modified to be nested within the Button component in various JSX files. This change was made with the aid of the 'asChild' property, it ensures that the link remains operable even when wrapped by the button, improving the site's semantics and accessibility.
2024-04-25 10:57:56 +07:00
giancarlo
944197b84a Update dependency versions in pnpm-lock.yaml
This commit updates the version numbers for several dependencies across multiple packages in the pnpm-lock.yaml file. Most notably, the versions for '@keystatic/core', '@opentelemetry/resources', '@opentelemetry/sdk-node' and others have been incremented for better functionality and up-to-date usage. This will ensure that the application benefits from the latest fixes and improvements in these dependencies.
2024-04-25 10:48:56 +07:00
giancarlo
cf487b74df Update status checks in billing tests
The commit updates the expected billing status from 'Trial' to 'Active' in both user-billing and team-billing end-to-end tests. Additionally, it changes the import order in both test files but doesn't affect any functionalities.
2024-04-24 20:17:20 +07:00
giancarlo
2d825b6902 Refactor invitations.spec.ts for consistency
Altered import order and formatting in the invitations.spec.ts file. Additionally, the text used for member-role-badge assertion tests has been capitalized to match the correct output. All changes were made to improve code readability and testing accuracy.
2024-04-24 20:17:04 +07:00
giancarlo
38a03b6a52 Add lucide-react library to project
The lucide-react library has been added to the project in the `accounts` and `team-accounts` package.json files, and in the pnpm-lock.yaml. Changes were made to the next.config.mjs file to reflect this. Also, the name of the `AuthRedirectListener` function in use-auth-change-listener.ts file has been changed to `useAuthChangeListener`.
2024-04-24 20:07:36 +07:00
giancarlo
452e9e3567 Update dependencies and remove unused packages
This commit updates the versions of some dependencies, removes a few unused packages, and corrects the locations of some of the dependencies. Specific changes include version updates for '@tanstack/react-query-next-experimental', 'lucide-react', and 'supabase'. Furthermore, several unnecessary '@tanstack/react-table', 'next', 'tailwind-merge', and 'zod' dependencies were removed from various packages. The exact details of these changes can be obtained by comparing the changes in the 'pnpm-lock.yaml' file.
2024-04-24 19:58:03 +07:00
giancarlo
936adc271c Add Super Admin layout and update subscription functionalities
The key changes made in this code include the addition of a Super Admin layout. Also, subscription functionalities are updated and optimized. This ensures read, write permissions are specific to the relevant user and a helper function has been implemented to check if an account has an active subscription. Furthermore, UI enhancements have been made to the accounts table in the administration section. The seed data has also been modified.
2024-04-24 19:00:55 +07:00