Commit Graph

343 Commits

Author SHA1 Message Date
Giancarlo Buomprisco
ba6e649461 Refactored Supabase Clients using the new recommended approach by Supabase by centralizing all clients around one single implementation. (#51)
The previous clients have been marked as deprecated and will be removed at some point.
2024-08-14 17:13:59 +08:00
gbuomprisco
085980316c Enable conditional password update card in settings page
Added a conditional check for displaying the password update card in the account settings page based on the new `enablePasswordUpdate` feature flag. This ensures the card is shown only if the password update feature is supported.
2024-08-13 12:58:24 +02:00
gbuomprisco
3d7a7c6ce8 Set limit to Infinity in getContentItems calls
Added a limit parameter with a value of Infinity to the getContentItems calls for 'posts' and 'documentation' collections. This ensures all items are retrieved without any restrictions.
2024-08-11 12:15:33 +02:00
gbuomprisco
babdecb78f Refactor code and update dependencies
Rearranged imports for better organization and readability across multiple files. Updated the `react-i18next` dependency to version 15.0.1 in various `package.json` files. Adjusted formatting in multiple TypeScript files to ensure code style consistency.
2024-08-11 12:04:49 +02:00
Giancarlo Buomprisco
e696f1aed0 Design Updates: Breadcrumbs, Empty State, new Charts and new colors
Design Updates: Breadcrumbs, Empty State, new Charts and new colors

* Add Breadcrumb component to UI package

* Add AppBreadcrumbs for improved navigation: Replaced static text descriptions with the new AppBreadcrumbs component across multiple pages to enhance navigation. Addressed an issue with Supabase client warnings by temporarily suppressing getSession warnings. Also made minor UI adjustments, including adjustments to heading styles and layout features.

* Enhance UI styling and configuration settings: Updated various UI components and global styles to improve styling consistency and responsiveness.

* Update global styles and adjust padding: Updated several CSS variables for improved color accuracy and appearance. Added padding to admin account page body for better layout consistency.

* Refactor UI components and adjust styling: Replaced Heading tags in Plan Picker with span for consistency. Added active and hover states to buttons in the sidebar. Refined background, layout styling, and color schemes across various components. Removed sidebar case in Page component switch statement.

* Add Chart Components and Integrate into Dashboard: Introduced `recharts` library and created `Chart` components. Updated dashboard to use the new components and enhanced UI/UX with descriptions and restructured cards.
* Enhance dashboard demo UI layout: Refactor the layout by adjusting flex properties and spacing classes to improve component alignment. Update dummy data generation and Figure font size for better visual consistency.

* Update localization keys for navigation labels: Changed localization keys for tab labels to use 'routes' prefix for consistency. Adjusted corresponding component references and added missing keys for routes. This ensures better organization and uniformity in the code.

* Add EmptyState component and enhance account handling: Introduced a new EmptyState component for UI consistency and updated JSON locales with 'account' route. Modified HomeAddAccountButton to accept className prop and refactored HomeAccountsListEmptyState to use the new EmptyState component. Updated navigation config to align labels in locales.

* Add locale support and enhance currency formatting: This commit introduces locale-based currency formatting across billing components by utilizing the `useTranslation` hook to fetch the current language. It also refactors the `formatCurrency` function to accept an object parameter for better readability and reusability.

* Fix typo in devDependencies section of template generator: Corrected a syntax error in `package.json.hbs` template affecting the `@kit/tsconfig` entry. The change ensures that the dependency is properly defined and prevents potential issues during package management.

* Update heading levels and add tracking-tight class in auth shell: Changed Heading components from level 4 to level 5 and added the 'tracking-tight' class in multiple auth-related pages. This improves visual consistency and better aligns the typography across the application.
2024-08-04 23:25:28 +08:00
gbuomprisco
84f838d3a1 Add feature flag for team account deletion
Updated the team account settings page to support a new feature flag for enabling team deletion. Only the primary user can delete the account if this feature is enabled. Also, corrected the required error message in feature-flags.config.ts file for more clarity.
2024-07-22 19:14:48 +02:00
Giancarlo Buomprisco
5eefa7ff16 Add events handling and enhance analytics tracking (#47)
* Add events handling and enhance analytics tracking

Added a new events system to track user actions throughout the application. Specific significant events such as user signup, sign-in, and checkout have dedicated handlers. Updated the analytics system to handle these event triggers and improved analytics reporting. An analytics provider has been implemented to manage event subscriptions and analytics event mappings.

* Remove unused dependencies from package.json files

Unused packages "@tanstack/react-table" and "next" have been removed from the packages/shared and tooling directories respectively. These changes help ensure that only needed packages are included in the project, reducing potential security risks and unnecessary processing overhead.

* Update dependencies

Multiple package versions were updated including "@tanstack/react-query" and "lucide-react"
2024-07-22 14:03:03 +08:00
Giancarlo Buomprisco
86d82d889c Add Analytics package (#46)
* Add Analytics package

Created a new analytics package with a manager to handle tracking of events and page views. The package includes a default provider that can be switched out and uses a NullAnalyticsService if no provider is registered. Additional types, scripts, and package configuration are also provided to support development.

* Add marketing components for UI package

Introduced new React components under "marketing" for the UI package. These include 'Pill', 'GradientSecondaryText', 'Hero', 'CtaButton', 'FeatureCard', 'FeatureGrid', 'FeatureShowcase', 'GradientText', 'Header', and 'SecondaryHero'. Updated 'package.json' to export these components. Replaced the implementation of 'Home', 'SiteHeader', and 'SiteFooter' with these components for cleaner code and better reusability.
2024-07-19 23:33:52 +08:00
gbuomprisco
5ee7bacb2a Update site navigation styles and cleanup page imports
The navigation menu item styles were adjusted for better appearance. Also, the spacing in the NavigationMenuList was increased for better user experience. Moreover, a few unused imports in page.tsx were removed to clean up the code. Additionally, the button class formatting was adjusted for better readability and consistency.
2024-07-19 00:00:57 +02:00
gbuomprisco
1510ddec09 Update CSS classes for multiple components
The commit refactors CSS classes of multiple components to improve the visual consistency across different resolutions. The changes include adjusting margin, padding, fonts, and adding hover states to some elements. Furthermore, the logo size has been made responsive for both small and large views.
2024-07-18 19:39:09 +02:00
gbuomprisco
3fbb4f7b97 Update visuals and improve readability on marketing pages
The visuals on the marketing pages are updated and readability is improved by tightening up the text tracking. Title sizes in several components are adjusted to be more consistent. The duration and appearance of various animations and transitions are also changed for an enhanced user experience. New image assets and additional UI elements are added to provide more detailed information.
2024-07-18 16:58:44 +02:00
gbuomprisco
1876bbd9e4 Update error handling and UI design across multiple files
Enhanced error handling in documentation and blog pages, to ensure smoother running and user experience. This also includes additional UI updates related to font selection, layout arrangement, and interactive elements on error pages, marketing pages, and general site navigation components. Moreover, a "contact us" feature has been added to error pages to help users seek assistance more conveniently.
2024-07-18 09:18:16 +02:00
gbuomprisco
342c96abfa Update UI and improve i18n loading logic
Major changes include enhancements to the UI and modifications to the i18n loading logic to more effectively handle namespaces. Several components were updated to improve readability and layout consistency. The i18n loading logic now includes additional handling for waiting until all namespaces are loaded before the i18n instance is returned, with a warning if it takes longer than expected. Furthermore, code have been refactored for fonts, buttons, and other UI elements.
2024-07-18 04:01:45 +08:00
gbuomprisco
35717c79f7 Update package versions and improve code handling
Multiple package versions have been updated to their latest versions for better compatibility and stability. In addition, modifications were made to the `getGitHash` function in `route.ts` to handle potential failures more gracefully.
2024-07-17 18:43:57 +08:00
Giancarlo Buomprisco
a75f7c576d Add terms and conditions checkbox to sign-up methods (#45)
A checkbox has been added for user acceptance of terms and conditions during sign-up. This change includes adding a new adjustable flag in the configuration to control the display of the checkbox. A new file "terms-and-conditions-form-field.tsx" is added to handle the checkbox UI part. Also, localization support has been added for the feature.
2024-07-12 14:32:02 +08:00
Giancarlo Buomprisco
21f42f14ce Invite prefill email (#43)
* Add prepopulation of email field in sign-up form
* Updated packages
2024-07-11 13:59:14 +08:00
gbuomprisco
27533c94e6 Refactor user authorization in AdminSidebar
The commit simplifies user authorization in 'AdminSidebar' component by removing unnecessary imports and functions and passing user directly as a prop instead. This change optimizes code readability and makes user authorization more efficient.
2024-07-10 09:26:25 +08:00
gbuomprisco
4c392e02fe Replace Accounts API with Team Accounts API in billing page loader
The commit modifies the teamAccountBillingPageLoader by swapping out the previously used Accounts API for the Team Accounts API. This change includes adjustments in the import statement and the creation of the api variable, aligning better with the team account related functionalities.
2024-07-08 19:36:35 +08:00
Giancarlo Buomprisco
8f097a4016 Add workspace context and custom hooks for user and team accounts (#41)
* Add workspace context and custom hooks for user and team accounts

The commit introduces a new workspace context for both user and team accounts. New custom hooks, useUserWorkspace and useAccountWorkspace, were created to access this context data. These changes allow for more streamlined data access and manipulation, enabling features that depend on account context information to function more efficiently.

* Upgrade pnpm action-setup to version 4

The commit updates the version of pnpm action-setup used in GitHub workflows from v2 to v4. This upgrade can provide enhancements and improved features offered by the newer version.

* Update pnpm/action-setup version in workflow

The commit removes the explicit "version: 8" specifier in the Github Action workflow for "pnpm/action-setup". The updated workflow now points to "pnpm/action-setup@v4" instead of "pnpm/action-setup@v2", aligning it with usage elsewhere in the workflow.

* Refactor magic link auth container for URL handling

The magic link auth container has been updated to use a standard URL interface for managing URL and query parameters. This improves readability and error handling in the code.URL-related operations are now conducted via the URL object.
2024-07-05 00:28:06 +08:00
gbuomprisco
6e218dc47b Update multiple packages and fix warning logs indentation
This commit includes the upgrade of multiple packages to their latest versions, including "@supabase/ssr", "stripe", "@playwright/test", "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser". It also ensures consistent warning logs indentation in route.ts.
2024-06-25 09:43:17 +08:00
gbuomprisco
6ea75bf10a Update Keystatic version and refactor version updater
This commit updates the Keystatic version to 0.5.23 and changes the interval for version refetching. The environment variable used for the refetch interval has been modified to NEXT_PUBLIC_VERSION_UPDATER_REFETCH_INTERVAL_SECONDS. Additionally, the code for checking for new version has been refactored and a visual change has been implemented to include a RocketIcon in the dialog header.
2024-06-24 12:38:21 +08:00
gbuomprisco
a3e5f928c4 Add guard clauses in getHashFromProcess
Additional logic has been introduced to the getHashFromProcess function. It will now exit early if the runtime is not Node.js or if the environment is not a development environment to prevent calling a Node.js command. This is done to avoid potential issues in the edge runtime and non-development environments.
2024-06-23 21:09:00 +08:00
gbuomprisco
6b48778753 Add version updater feature
Added a version updater component that frequently checks for updates to the app and alerts the user if necessary. This requires a new route, config changes, and additional UI resources. A new feature flag 'enableVersionUpdater' has been added in the feature-flags.config.ts file to toggle this feature.
2024-06-22 20:21:08 +08:00
gbuomprisco
9294e1c823 Refactor code for readability and order
Made several changes across different files primarily focusing on readability. Arranged CSS classes in a standardized order for easier reading and maintenance. Arranged and formatted import lines, function declarations, and component return statements for legibility. Removed unnecessary React imports in some files.
2024-06-21 17:58:20 +08:00
gbuomprisco
b288bca6b8 Update documentation loader limit and optimize sitemap generation
The documentation loader has been updated to limit the number of items to 500 from the previous limit of 'Number.MAX_SAFE_INTEGER'. Additionally, the handling of URL generation and item retrieval in 'server-sitemap.xml/route.ts' has been refactored for more effective sitemap generation. A new 'robots.ts' file was created to set up default rules for web robots accessing the site.
2024-06-20 19:28:47 +08:00
gbuomprisco
f15e92a306 Adjust MFA factor fetching and verification process
This commit refines the Multi-Factor Authentication (MFA) handling by removing 'requireUser' method, optimizing 'useFetchMfaFactors' hook to avoid fetching stale data, and improving error logging. The changes enhance the system's user session management and the MFA challenge response, ensuring smoother user experience and potential troubleshooting.
2024-06-17 12:30:20 +08:00
gbuomprisco
fb104e0b7f Simplify team account layout sidebar
The team account layout sidebar has been simplified by removing collapsible functionality and unneeded dependencies. The changes aim to improve clarity and reduce complexity in the codebase. With a lesser number of dependencies, future updates or improvements should be easier.
2024-06-13 22:28:15 +08:00
gbuomprisco
134eeb2400 Fixed documentation navigation overflow 2024-06-09 00:10:00 +08:00
giancarlo
2e7e289495 Fixed sign in with an invite token when user is signed out 2024-06-07 01:23:16 +07:00
giancarlo
d203c9782d Remove redundant loaders and update styling
Deleted the previously redundant loaders from blog and docs sections. Updated the loading.tsx files in home to utilize the GlobalLoader component with improved styling. Additionally, styling in global-loader.tsx from the ui package has been modified to ensure better visibility.
2024-06-04 17:46:40 +07:00
giancarlo
e2112eefee Update UI styling and Spinner component
Several updates have been made to UI components across various packages. Styling changes have been made in 'global-loader.tsx', 'docs-card.tsx', and 'pricing-table.tsx'. The Spinner component in 'spinner.tsx' has been updated to adjust size and animation properties. Addition of a new prop 'spinnerClassName' in 'loading-overlay.tsx' allows dynamic class assignment. The 'loading.tsx' now exports GlobalLoader directly instead of wrapping it in a function. 'pnpm-lock.yaml' has been updated with a new specifier.
2024-06-04 17:17:12 +07:00
giancarlo
ab1e09cbc1 Update packages and refactored code for improved performance
Updated versions of various packages including "@tanstack/react-query", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", and "@marsidev/react-turnstile".

 Additionally, refactored the code in several files including package.json, members-page.loader.ts, page.tsx to ensure proper import statements and optimal function execution order.
2024-06-04 16:03:31 +07:00
giancarlo
3261f2b582 Add more efficient authentication check function to server components.
Added request logging to Next.js config.

This commit introduces a new function 'requireUserInServerComponent' which checks for user authentication and is used in multiple server components. The aim is to enhance efficiency by caching the function so that data is only fetched once per request, preventing unnecessary database hits. Existing components were modified accordingly to incorporate this new method.
2024-06-04 11:54:04 +07:00
giancarlo
16c0f07e59 Update collection type for content retrieval
Changed the collection type from 'pages' to 'documentation' when getting content by slug in the marketing docs page. This change is intended to target the correct content segment in the CMS client function.
2024-06-04 02:12:39 +07:00
giancarlo
bf7e3185de Refactor cache functions to use explicit loaders
The commit refactors the previous implementation of using cache functions across several modules. They are now explicitly defined as loaders to improve readability and maintain a consistent style. This prevents the cache function calls from getting too nested and difficult to understand, especially in asynchronous cases. Additionally, the user session related hooks are deleted which were not used anymore.
2024-06-04 01:03:57 +07:00
giancarlo
b1c3f12721 Fixed React Query provider. Removed getSession and replaced with getUser to make Supabase happy. Fixed Stepper's responsiveness. 2024-06-03 16:13:55 +07:00
giancarlo
d0c6981e78 New Tailwind CSS formatter run 2024-06-03 00:35:09 +07:00
giancarlo
cbf116c688 Add user id parameter to multi-factor authentication functions
The multi-factor authentication functions have been modified to accept a user id as a parameter. This provides more flexibility as it allows a more specific targeting of users. The `useFetchAuthFactors` function has been updated to export the function rather than default, and the `useFactorsMutationKey` function has been updated to take a user id.
2024-05-28 21:13:36 +07:00
Giancarlo Buomprisco
127ad5a315 Force no cache in Supabase clients with Next.js (#27)
* Update navigation menu text color and disable caching in Supabase clients

Updated the active and hover text colors for the navigation menu in the UI package. Also, added prevention of any sort of caching in the Supabase clients (server-actions.client.ts, route-handler.client.ts, server-component.client.ts) to be eventually removed in Next v15. Automatic token refresh is also turned off in the server-component client.

* Increase content items limit in docs loader

The content items limit in the documentation loader has been increased to the maximum safe integer. This ensures that all documentation entries are retrieved from the CMS, avoiding any potential omissions due to arbitrary limits.
2024-05-26 14:44:43 +07:00
giancarlo
a115e37535 Update error handling and function calls in billing services
Minor modifications made to the billing service handlers to improve data interpretation and error processing. The 'getLineItemTypeById' function now uses 'item.variant' for more accurate line item type identification. Unnecessary 'Crypto' object instantiation has been removed in 'createHmac', while improved formatting applied to the error logging within the billing webhook.
2024-05-21 20:41:41 +07:00
giancarlo
9107e31921 Rename 'subscription' path to 'return' in pricing components
The path referred to by "subscription" in the pricing table and pages has been updated to "return". This will redirect users back to the home page instead of the previously configured personalAccountBilling page after signing up or selecting a plan.
2024-05-21 13:50:30 +07:00
Giancarlo Buomprisco
048ab96cbc Add AuthCallbackService to handle auth callbacks in Supabase (#25)
* Add AuthCallbackService to handle auth callbacks in Supabase

Created a new service, AuthCallbackService, in the Supabase package to centralize the handling of authentication callbacks. This service handles two main tasks: verifying the token hash for user email verification and exchanging the authentication code for a session. Code in the web app routes were updated to utilize this new service, improving code organization and reusability.

* Remove CSRF Token Meta component and add Jaeger exporter

The CSRF Token Meta component was removed from the application. Instead, CSRF tokens are now included in the root metadata of the application. Additionally, the "@opentelemetry/exporter-jaeger" package was added as a dependency to the Sentry monitoring package. This enables the tracing of application requests via Jaeger.

* Refactor README.md and remove redundant content

Removed the excessive content and detailed instruction from the README.md file. The documentation has been moved to a more suitable and detailed location elsewhere.

* Update package dependencies in sentry/package.json

An ordering change has been made in the dependencies within the sentry/package.json file. The "@opentelemetry/exporter-jaeger" dependency was moved to its correct alphabetical order. No version changes were made.
2024-05-19 23:45:12 +07:00
giancarlo
9d30039ba8 Update package versions and optimize URL generation
Updated the versions of several packages including pino and pnpm. Also, the generation of URLs in the pricing-table.tsx file has been optimized by implementing URLSearchParams. A new global error page was also added.
2024-05-13 21:47:51 +07:00
giancarlo
a75009c0df Update route check and add PageBody wrapper
Updated the `isRouteActive` check in the sidebar component to ensure it doesn't falsely identify nested routes as active. Additionally, introduced a `PageBody` wrapper in the account page component for consistent styling and padding.
2024-05-13 19:51:33 +07:00
giancarlo
6ab4558691 Refactor page layout in admin accounts component
The layout of the admin accounts component has been refactored. The "Accounts" heading has been removed from the 'admin-accounts-table.tsx' component and placed as a PageHeader in the 'page.tsx'. A description has also been added to the PageHeader, and the content was wrapped in a PageBody component for better structure and readability.
2024-05-13 19:27:25 +07:00
giancarlo
741d54b994 Handle API error in team account retrieval
This update adds error handling for the API call in 'join' page while retrieving the team account information. If the call fails, it will catch the error and return undefined avoiding potential crashes.
2024-05-13 14:43:51 +07:00
giancarlo
f7be3e84f4 Add localization for teams-related strings in home component
Support for internationalization was added to the account components related to teams. This includes localizing messages prompting a user to create a team which were previously hardcoded. Additionally, `Trans` components from '@kit/ui/trans' has been imported and used to enable this.
2024-05-13 14:17:25 +07:00
giancarlo
43bfa16db2 Improved CardButton component; Fixrd translation 2024-05-13 11:23:21 +07:00
giancarlo
84271a31a8 Add card button component and enhance routing
This commit introduces the Card Button component to the UI package and improves URL matching by allowing end to be a boolean or function. Navigation menu components now support both cases. Additionally, changes have been made to improve the visual and functional aspects of various components throughout the application. This includes changes in pricing display, route active checking, and the introduction of new files such as HomeAddAccountButton and HomeAccountsList.
2024-05-13 02:09:28 +07:00
giancarlo
9d3f6eee92 Rename "user-workspace.loader" to "load-user-workspace"
The file "user-workspace.loader.ts" was renamed to "load-user-workspace.ts", in order to better reflect its purpose. All imports across different components and settings pages were updated accordingly. The changes ensure the application adheres to naming conventions, enhancing code readability and maintainability.
2024-05-10 20:53:14 +07:00