756 Commits

Author SHA1 Message Date
giancarlo
dbdccc59bc Refactor subscription and order retrieval methods
The changes refactor how subscription and order data is retrieved throughout the codebase. This includes renaming methods from 'getSubscriptionData' and 'getOrdersData' to 'getSubscription' and 'getOrder' respectively. The code for obtaining these subscriptions and orders has been rewritten for improved clarity and error handling.
2024-04-24 12:07:09 +07:00
giancarlo
a004cbae63 Modify language identification in locale handling
The update changes the way locales are checked against the list of accepted languages. Now, instead the full locale, only the language segment is considered when determining if the locale is accepted. Additionally, a check in 'getPreferredLanguageFromBrowser' was added to ensure 'acceptLanguage' is not undefined before attempting to parse it.
2024-04-23 23:04:17 +07:00
giancarlo
448fee01c4 Add language priority feature flag
This commit adds a new 'languagePriority' key to the feature flags configuration. It determines whether to use user's preferred language or the application's default language. Adjustments to the language selection process according to new flag have been made in the 'createInstance' function in 'i18n.server.ts'. Additionally, updates have been made to 'README.md' and '.env' files to reflect these changes.
2024-04-23 22:51:45 +07:00
giancarlo
e19af9af52 Refactor content fetching and enhance UI mods
Refactored content fetching in the docs and blog pages to use a new 'getDocs' function to improve code reuse. Made minor adjustments to the UI in 'makerkit/page.tsx'. This involved modifying the layout and adding conditionals to tackle optional props. Also added a new textarea component reference in the UI package.
2024-04-23 11:30:32 +08:00
giancarlo
6814cc7089 Fix linting 2024-04-23 00:15:41 +08:00
giancarlo
17e0781581 Refactored classes according to new convention 2024-04-23 00:10:12 +08:00
giancarlo
70da6ef1fa Adjusted Per seat billing and added example to the sample schema 2024-04-22 22:48:02 +08:00
giancarlo
b96d4cf855 Update localization text across multiple files
Removed obsolete localization fields and updated layout descriptions in account.json, corrected a spelling mistake in common.json, and increased the minimum required password length hint in auth.json. The changes reflect current features and improve user readability.
2024-04-22 20:46:42 +08:00
giancarlo
8e1d7ad1f5 Refactor admin dashboard loader and update translations
The admin-dashboard.loader file was refactored to use a newly created AdminDashboardService. This service encapsulates the logic for fetching dashboard data. Translations related to account settings, privacy policy, terms of service, and cookie policy were updated for better readability. Changes also include minor reorganizing of code files for clearer structure.
2024-04-22 20:30:21 +08:00
giancarlo
8c5b0496da Refactor authentication listener to be a hook
The previous authentication listener component was transformed into a `useAuthChangeListener` hook. All relevant functionality was preserved in this transition. The purpose of this change was to improve flexibility and code reusability by enabling the auth listener to be integrated in various parts of the application as needed. The old component was also removed from the exported packages in the `package.json`.
2024-04-22 19:46:45 +08:00
giancarlo
a074e1ec3b Implement Baselime monitoring and update error handling
This commit introduces the integration of Baselime for monitoring, accounting for various error scenarios and improved console error logging. Request handling has been updated to assign unique IDs for each request, aiding in tracing/logs. The environment variable key was updated, and the `MonitoringProvider` was nested in the root providers. In the base monitoring service, a function to format errors for logging was added. The provider logic was updated to create a new instance of service for each request, improving memory efficiency.
2024-04-22 18:41:38 +08:00
giancarlo
5fd3d49780 Remove test error from Home function
The test error that was thrown in the Home function was removed. This error was previously used for testing purposes and is no longer needed in the live code.
2024-04-22 15:24:56 +08:00
giancarlo
b6d303f90e Refactor monitoring package and improve error handling
The monitoring package has been significantly refactored to improve the granularity of error capture. Code from the 'capture-exception.ts' files in different locations have been deleted and replaced by a more unified approach in the 'use-baselime.ts' and 'use-sentry.ts' hooks. The README documentation has also been updated to reflect these changes and provide additional information about error monitoring setup and usage.
2024-04-22 15:24:01 +08:00
giancarlo
3ce6c62425 Update Zod and Lucide-react version in all packages
The Zod and Lucide-react libraries have been updated to version ^3.23.0 and ^0.372.0, respectively, in all packages. This change ensures that all packages are using the latest stable versions of these libraries, keeping the codebase up-to-date and minimizing potential compatibility issues.
2024-04-22 14:03:03 +08:00
giancarlo
7020e21193 Refactor join service and fix imports
Join service was deleted and its functionality was integrated into the team-accounts API. General rearrangement and renaming of server-related files were made, particularly for billing-related services to ensure consistency. This made it necessary to fix import paths across multiple files.
2024-04-22 12:52:09 +08:00
giancarlo
56d532ab61 Update dependency from edge-csrf to @edge-csrf/nextjs
The previous edge-csrf library has been replaced by the newer @edge-csrf/nextjs with updated configurations in `pnpm-lock.yaml`. Also, removed some unnecessary dependencies for cleaner and more efficient code deployment.
2024-04-22 12:17:08 +08:00
giancarlo
e2503333e2 Update CSRF protection and modify database types
The CSRF protection in middleware has been re-implemented with `@edge-csrf/nextjs`, to catch and handle CSRF errors more effectively. Additionally, some parameters are renamed and functions are added in `database.types.ts` for better role management. The dependency in `package.json` has also been updated to reflect the changes.
2024-04-22 11:27:54 +08:00
giancarlo
acd5ad08f9 Update several package versions in pnpm-lock.yaml file
This commit updates various package versions in the pnpm-lock.yaml file. The updated packages include tailwind-merge, zod, recharts, and '@sentry/nextjs' among others. This is a part of regular maintenance and ensuring that the project dependencies are up-to-date.
2024-04-22 01:52:02 +08:00
giancarlo
99fe547f5b Update README and refactor import path
Enhanced the README file with additional sections explaining import paths, non-route folders, server-side code, and updating packages. Additionally, the import path for 'UserAccountHeader' in the billing page file was refactored to a relative import for better readability and maintenance.
2024-04-22 01:48:55 +08:00
giancarlo
866b9888f7 Refactor billing services with new AccountsApi
The billing services have been refactored to use the new AccountsApi and TeamAccountsApi. All methods that were previously defined in each billing service, including getting customer ID, getting permissions, etc., have been transferred to these APIs. This change improves the modularity and organization of the code.
2024-04-22 01:35:15 +08:00
giancarlo
75c438a5f2 Update file inclusion in tsconfig.json
This update modifies the tsconfig.json in the web app. It changes the file inclusion from specific '.tsx' and '.ts' files in 'components' to all files within the 'components' directory. This change will enhance the efficiency of TypeScript configuration.
2024-04-22 00:56:05 +08:00
giancarlo
0a28e22eb1 Add support for viewing lifetime orders
The commit introduces the ability to view lifetime orders on the billing page. It has updated the logic in both account and user billing pages to accommodate this change. Now, instead of only dealing with subscriptions, the pages can also cater to lifetime orders.
2024-04-22 00:50:08 +08:00
giancarlo
ecb20b8917 Refactor billing data loading and schema configuration
This update enhances the capability of the billing system to handle different types of billing modes (subscription-based or one-time payments) and introduces an environment variable for configuring the preferred billing mode. It also refactors the data fetching process in the `loadPersonalAccountBillingPageData` and `loadTeamAccountBillingPageData` to retrieve the proper data depending on the chosen billing mode. Detailed documentation was added in README.md to guide the configuration of the billing schema.
2024-04-22 00:35:03 +08:00
giancarlo
7cbbae9fef Remove Suspense from root-providers and refine route checks
The Suspense wrapper was removed from root-providers.tsx to simplify code. For the Privacy Path Checking, a property was added to 'AuthRedirectListener' to allow customization of 'privatePathPrefixes', and the prefixes list was moved to the top. Also, explicit constant assertions were added in 'create-i18n-settings.ts' to ensure the types correctness.
2024-04-21 19:53:16 +08:00
giancarlo
ae10f7b142 Refactor i18n settings and improve language load handling
This update separates the creation of i18n settings into its own function (@kit/i18n) and enhances the handling of language and namespace loading in i18n.client. It tracks loaded languages and namespaces, and prevents rendering if none are loaded or after a maximum number of iterations. The usage of Suspense has also been modified in root-providers to employ a null fallback.
2024-04-21 18:40:12 +08:00
giancarlo
562db0058e Refactor UI components and replace PageHeader with AccountLayoutHeader
This commit includes a major refactor of UI components to enhance the overall look and feel of the platform. The PageHeader component has been replaced by AccountLayoutHeader across multiple pages including settings, members, and billing. The new AccountLayoutHeader also includes an additional `account` prop, enhancing the component's functionality. Furthermore, this commit includes modifications to the marketing page styling, ensuring better spacing and alignment of features.
2024-04-21 00:20:46 +08:00
giancarlo
ce38bdd36a Update tests for order and subscription updates
Added comprehensive tests for the functionality of creating, updating, and verifying billing orders and subscriptions in the Supabase database. Tests now ensure appropriate behavior of upsert operations, validation of inserted or updated data, and proper calculation of derived fields. This contributes to better coverage and confidence in the production-ready status of these features.
2024-04-20 23:58:51 +08:00
giancarlo
c6bb9f0758 Update tests for order and subscription updates
Added comprehensive tests for the functionality of creating, updating, and verifying billing orders and subscriptions in the Supabase database. Tests now ensure appropriate behavior of upsert operations, validation of inserted or updated data, and proper calculation of derived fields. This contributes to better coverage and confidence in the production-ready status of these features.
2024-04-20 23:48:03 +08:00
giancarlo
97ea6e87fb Update translation keys and clean scripts
This commit updates translation keys across multiple components, changing the connector from dot to colon. Additionally, the clean scripts in the README.md have been corrected to `pnpm run clean:workspaces` and `pnpm run clean` from their previous erroneous state.
2024-04-20 23:24:01 +08:00
giancarlo
f7fe67f7f7 Update test cases and improve account actioning
This commit refactors Supabase test cases to reflect the updated account actioning mechanism. The "makerkit.get_user_id" function calls were replaced with the new "tests.get_supabase_uid" function, aligning with the testing structure update. It also introduces new policies which further refine user role actions with more precise checks, replacing the old 'delete' policy with the more comprehensive 'can_action_account_member' function. New test cases for updating memberships and deleting memberships have also been added.
2024-04-20 23:22:18 +08:00
giancarlo
a55655a61a Improve owner transfer process and member sorting
Extended the account ownership transfer tests and implemented several updates. This includes transferring the ownership only to an existing account member, sorting team members based on role hierarchy and whether a member is the primary owner. In the permissions check, prevented non-members from creating invitations and enhanced the styling of role badges depending on if they are custom or not.
2024-04-20 20:33:19 +08:00
giancarlo
4195697b54 Add new tests and update schema.sql and account permissions
New test files for database functionalities like transfer of ownership, schema conditions, and updating roles have been added. Changes have also been made in the schema.sql file for checking the role hierarchy levels and updating rules for permissions. Modifications in account permissions test have also been performed for more accuracy.
2024-04-20 19:37:39 +08:00
giancarlo
bf0d2e1c87 Fixed bugs in memberships management 2024-04-20 18:12:04 +08:00
giancarlo
efd27aa7de Update localization texts, add permissions check, and seed data
This commit removes the membersTabDescription, updates the deleteAccountDescription text in the localization files, and adds a condition to check permissions in account invitation component. It also includes test credentials in README and provides a significant amount of seed data for testing the database.
2024-04-20 16:53:54 +08:00
giancarlo
0148265b5f Add TurboPack details to README and update Next.js config
The README.md was updated with information about TurboPack which is now used by default and still experimental. The Next.js configuration was also modified to support this. Instructions on how to switch back to the default bundler in case of any issues were added as well.
2024-04-20 15:17:34 +08:00
giancarlo
fb8e091043 Refactor UI component and improve configuration handling
Refactored the components in the site header account section and page.tsx to improve readability. Updated the WordPress client to handle date types correctly. Adjusted the keystatic storage kind to default to 'local' if not specified in the environment variables.
2024-04-20 13:31:07 +08:00
giancarlo
8281de12a0 Update i18n settings and upgrade dependencies in lockfile
This commit refactors the i18n settings in `i18n.settings.ts` to improve language handling. In addition, it updates the `pnpm-lock.yaml` file to upgrade the lockfile version and several package dependencies. Most notably, it integrates `tailwind-merge` and `@tanstack/react-table` into various packages.
2024-04-20 13:17:38 +08:00
giancarlo
6ff82ec5ef Improve site header account and navigation item styling
The styling of the site header account sign-up button and navigation items has been updated. Class names and transition durations were adjusted for better visualization and usability. The changes particularly enhance the hover effect on the sign-up button and navigation items.
2024-04-20 02:24:00 +08:00
giancarlo
b71b580331 Optimize content fetching and update configurations
Content fetching in the marketing section has been refactored to utilize the Next.js cache, which significantly improves performance. The date format of publishedAt has been updated to be more consistent across files. Code related to CSRF token, fonts, and metadata has been refactored into separate files for easier maintenance and readability.
2024-04-19 19:21:54 +08:00
giancarlo
c121a3bdad Update "Password Reset" to "Update Password"
The code changes correspond to the rebranding of "Password Reset" to "Update Password". The names of components, functions, and routes have been updated to reflect this change. Also, a minor code optimization has been made in the i18n.server file for the creation of i18n server instances.
2024-04-19 17:27:11 +08:00
giancarlo
cc80b26117 Update README and refine UI elements and localization
This commit introduces updates to the README file, specifically focusing on authentication emails. Minor UI adjustments have been made to various layout spacings and image attributes in some pages for better design consistency. Localization has also been improved by introducing translation keys for error and not-found pages in the common JSON file.
2024-04-19 17:14:43 +08:00
giancarlo
92f0ba4dd5 Create auth confirmation route
Added a new route for authentication confirmation that uses OTP verification. If successful, it redirects the user to the specified next path; otherwise, it navigates them to an error page. This is part of implementing more robust user authentication.
2024-04-19 16:00:40 +08:00
giancarlo
667f9cbb57 Integrate i18n into AuthCallbackErrorPage
Added i18n support to the AuthCallbackErrorPage. This ensures consistent internationalization and localization across all pages, helping deliver proper error messages in different languages.
2024-04-19 15:54:24 +08:00
giancarlo
b99295b364 Update error and not-found page styles
Removed unused import from error page and adjusted the heading styles on both the 500 error page and the 404 not-found page. By increasing the size of the text headings and updating the font to 'font-heading', the pages are now more consistent with the overall design layout.
2024-04-19 15:38:28 +08:00
giancarlo
19b8cc793e Update Supabase version and improve Keystatic's configurations
This commit updates the version of Supabase in multiple packages. It also introduces specificity to environment variables in Keystatic configuration and adds a method to create a 'KeyStatic' reader based on the storage kind. Furthermore, minor adjustments have been made to keep the environment variable names consistent.
2024-04-19 14:40:11 +08:00
giancarlo
f58d2e364f Update UI elements and refine billing schema
Several changes were made to improve UI consistency across various components. Styling updates and enhancements were applied to elements including but not limited to, the SiteHeader, SiteNavigationItem, and ModeToggle components. Additionally, a refinement was made to the billing schema to enforce only having one per-seat and one flat line item per plan.
2024-04-19 00:04:37 +08:00
giancarlo
4914a56460 Refactor webhook signature verification process
The signature verification process for webhooks has been abstracted. Instead of performing the check directly in the handleWebhook method, it has been moved to a separate service class: PostgresDatabaseWebhookVerifierService. This refactor improves modularity and enables extending or replacing the verification logic more comfortably. The WEBHOOK_SENDER_PROVIDER environment variable is used to determine which verifier service to use.
2024-04-18 21:03:36 +08:00
giancarlo
903733ad60 Rearrange CSS classes in various components
This commit reorders CSS classes in multiple files to maintain consistent code style. The switch does not change any style attribute's functionality or the display, but assists in code readability and organization.
2024-04-18 19:59:55 +08:00
giancarlo
427ea2f845 Update UI styling and add checkout redirect ability
This commit does two main things. First, it refactors UI styling in the alert component, changing the location of some utility classes and enhancing color gradients for different alert variants. Second, it introduces the ability to specify whether to redirect to checkout on the pricing page, thereby improving user experience. This adds more flexibility to the 'PricingTable' and 'CheckoutButton' components, allowing for optional redirection and enhanced configurability.
2024-04-18 19:59:28 +08:00
giancarlo
44fc04e3ea Update site navigation and header styling
The styling for various components including site navigation and the site header has been updated. Changes include amendments to layout options, color, spacing, and border adaptations to provide better visibility and user interaction. The shadow on the top loading bar indicator has also been relocated to enhance the bar's visibility.
2024-04-18 19:31:37 +08:00