-
Notifications
You must be signed in to change notification settings - Fork 714
Stage #8905
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
Conversation
…mands run successfully
…tionship for tasks with filterable parent
[Feat] Implement parent-child relationship for tasks
* feat: added agent auth login page and setting page * feat: enhance setting page agent and other app * fix: auth and setting page enchancement * fix: handle event ipc missing this * feat: agent auth and setting page enhancement * fix: styling and handle some error * fix: styling and handle some error * fix: styling and handle some error * fix: styling and handle some error * fix: styling and handle some error
…mes (#8890) * fix:Added a check to ensure policy names are unique before saving or editing. The check compares the new or updated policy name with existing ones to avoid duplicates. * fix: toast message * feedback integration
…00 error on recurring expenses
* fix: task status creation * remove unnecessary modif * feedback integration
…8896) * Fix:Unable to remove selection when user use “Select All” Option in “Invite Employee” Popup Window * fix:form
This reverts commit 5294539.
[Feat] 1691 feature zapier plugin integration
[Fix] Recurring Expenses: Disable "All Employees" Option to Avoid HTTP 400 (#8889)
…expense-400 Revert "[Fix] Recurring Expenses: Disable "All Employees" Option to Avoid HTTP 400 (#8889)"
* feat(plugin-registry): add plugin registry module This commit introduces the plugin registry module, which includes: - Entities for plugins, plugin versions, and plugin sources. - Repositories for managing these entities. - A basic module structure for future development. This module will allow users to manage plugins, their versions, and sources from different locations like CDN, NPM, and file uploads. It lays the groundwork for plugin management within the application. * feat(plugin-registry): add path alias Adds a path alias for `@gauzy/plugin-registry` to simplify imports. This change allows developers to import modules from the plugin registry using the shorter alias `@gauzy/plugin-registry` instead of relative paths, improving code readability and maintainability. * feat: adds relation IDs for `uploadedBy` and `source` Adds `uploadedById` and `sourceId` relation IDs to the `Plugin` entity. This improves performance by allowing direct access to the IDs of the related entities without needing to load the entire objects. It also adds corresponding column indexes for these new fields. * refactors: Plugin repositories Migrates `PluginInstallation` and `Plugin` repositories to TypeORM. Removes the MikroORM implementation for these repositories. Renames some repository files to adhere to naming conventions. * fix: plugin relationships Adds `pluginId` to `PluginSource` and `PluginVersion` entities and configures bi-directional relationships between `Plugin`, `PluginSource`, and `PluginVersion`. This ensures correct database relationships and improves data consistency. * feat: adds plugin management services Introduces services for managing plugins, plugin installations, plugin sources, and plugin versions. These services provide CRUD operations and utilize both TypeORM and MikroORM repositories for data access. * feat(plugins): add plugin management commands This commit introduces several new commands for managing plugins: - CreatePluginCommand - InstallPluginCommand - UninstallPluginCommand - ActivatePluginCommand - DeactivatePluginCommand - UpdatePluginCommand - DeletePluginCommand These commands provide a foundation for implementing plugin management functionality within the application. * feat(plugin-registry): Add plugin management models Introduces new data models for managing plugins, versions, sources, and installations. These models provide the necessary structure for tracking plugin metadata, installation status, and source information. This lays the foundation for the plugin registry feature. * feat(plugin-registry): Add DTOs for plugin creation Introduces `CreatePluginDTO` and `PluginVersionDTO` for creating new plugins. These DTOs utilize `class-transformer` and `class-validator` for data validation and transformation, ensuring data integrity. They omit unnecessary fields like IDs and timestamps, which are handled automatically by the system. The `CreatePluginDTO` nests `PluginVersionDTO` to manage plugin version information during creation. * refactor: Implement interfaces for plugin entities Implements interfaces for `Plugin`, `PluginVersion`, `PluginSource`, and `PluginInstallation` entities to improve type safety and code maintainability. This change ensures consistent data structures across the application. * feat(plugin-registry): adds input to CreatePluginCommand Adds `CreatePluginDTO` as input to the `CreatePluginCommand`. * feat(plugins): adds create plugin functionality This commit introduces the ability to create plugins, including their source and version information. It uses a database transaction to ensure data consistency during the creation process. Error handling is implemented to rollback the transaction in case of failure. * refactor: renames CreatePluginHandler Renames `CreatePluginHandler` to `CreatePluginCommandHandler` for consistency with the naming convention of other command handlers. * feat: adds DTO for updating plugins Introduces `UpdatePluginDTO` which extends `CreatePluginDTO` using `PartialType`. This allows for partial updates of plugin information. * feat: adds `UpdatePluginCommand` This change introduces the `UpdatePluginCommand` along with its required DTO and dependencies. It allows updating plugin information. * feat: Implements plugin update functionality Adds a new command handler to update plugin information, including its source and version. Uses a database transaction to ensure data consistency during the update process. Handles potential errors and includes robust error handling for missing plugins, sources, or versions. * fix: removes unnecessary @Injectable() decorator Removes the `@Injectable()` decorator from the `UpdatePluginCommandHandler` as it's not required for command handlers. * feat: adds pluginId to DeletePluginCommand Adds `pluginId` to the `DeletePluginCommand` constructor to specify which plugin should be deleted. * feat: implements delete plugin command Adds a command handler to delete a plugin by ID. Includes transaction management to ensure data consistency. Handles potential errors like invalid plugin IDs and non-existent plugins. * fix: removes unused `@Injectable` decorator The `@Injectable` decorator is unnecessary in a CQRS handler class as NestJS already handles dependency injection for these types of classes. This change removes the redundant decorator. * feat: adds plugin activation command handler Implements the `ActivatePluginCommandHandler` to handle plugin activation requests. Includes permission checks to ensure only authorized users can activate plugins. A plugin can only be activated if it's not already active. * feat(plugins): add command handler to deactivate plugin Adds a command handler to deactivate a plugin. The handler checks if the current user has permission to deactivate the plugin and throws a `ForbiddenException` if they do not. It also ensures the plugin exists and throws a `NotFoundException` if it does not. * fix: typo in filename Corrects the filename of the `uninstall-plugin` command. * feat: adds DTO for plugin installation Introduces a data transfer object (DTO) for handling plugin installation requests, specifying the plugin and version IDs. * refactor: InstallPluginCommand input Changes the `InstallPluginCommand` to accept an `InstallPluginDTO` object instead of just the plugin ID. This allows for more flexibility and potential future expansion of the install plugin functionality. * feat(plugins): add plugin installation command handler Adds a command handler for installing plugins. This handler allows installing a specific version of a plugin and saves the installation record with the installer's ID, plugin ID, version ID, and installation timestamp. * feat(plugins): add plugin uninstallation functionality Implements the ability to uninstall plugins. This includes updating the plugin installation status and recording the uninstallation date. * feat: adds `GetPluginQuery` This query retrieves a plugin by ID, allowing for flexible retrieval options. * feat: add handler for retrieving a plugin This commit introduces a new query handler, `GetPluginQueryHandler`, responsible for retrieving a plugin by its ID. The handler fetches the plugin from the database and returns it. If the plugin is not found, a `NotFoundException` is thrown. * feat: adds plugin listing functionality Implements a query handler and query for retrieving a paginated list of plugins. This allows clients to request and display available plugins with pagination support. * fix: plugin reinstallation issue Updates plugin installation logic to handle reinstallations. Prevents creating duplicate installation records when a user reinstalls a plugin. If an installation record already exists for the given plugin ID, user ID, and version ID, the existing record is updated instead of creating a new one. The `uninstalledAt` field is also set to null during reinstallation. * fix: plugin activation/deactivation permissions Uses `uploadedById` instead of `updatedByUserId` to determine plugin ownership for activation and deactivation. This ensures that only the user who uploaded the plugin can activate or deactivate it. * feat: enhances plugin deletion with deactivation and permission checks Deactivates a plugin before deletion to ensure a clean removal process. Implements permission checks to restrict plugin deletion to the uploader, preventing unauthorized removals. This addresses potential security vulnerabilities and ensures data integrity. * feat: adds file storage metadata to PluginSource Adds `fileKey` and `storageProvider` fields to the `PluginSource` model. This allows storing metadata about the storage location of the plugin source file, enabling support for different storage providers. * feat: adds file storage support to plugin sources Adds `fileKey` and `storageProvider` fields to the `PluginSource` entity. This allows storing plugin files and specifying the storage provider used. The `fileKey` field stores the unique identifier of the plugin file, validated for ZIP format and allowed characters. The `storageProvider` field indicates where the file is stored. * feat(plugin-registry): Add FileDTO for plugin uploads Introduces a new Data Transfer Object (DTO) for handling file uploads related to plugins. This DTO enforces data integrity and validation for uploaded plugin files, including type, size, and naming conventions. It also provides a structured format for managing file metadata. * feat(plugins): Adds plugin creation endpoint Implements a new endpoint for creating plugins, allowing users to upload plugin files along with metadata. Handles file uploads using a lazy file interceptor and supports different plugin source types. Includes validation and cleanup for uploaded files. * feat: adds registry plugin Adds the registry plugin to the application. Includes the necessary module, controller, services, handlers, and entities for the plugin to function. Updates the plugin list to include the new registry plugin. * refactor: removes plugin owner restriction Removes the owner restriction on plugin activation, deactivation, and deletion. This allows any user to manage plugins, simplifying the plugin management process. * feat: adds plugin ownership guard This change introduces a guard to protect plugin routes based on ownership. It verifies that the currently authenticated employee is the owner of the plugin before allowing access to plugin-related operations. This prevents unauthorized users from modifying or activating plugins they do not own. * feat(plugins): Implement plugin management API Implements API endpoints for managing plugins, including: - Creating new plugins with file upload. - Updating existing plugin metadata. - Activating and deactivating plugins. - Retrieving plugins by ID with optional relations. - Deleting plugins. Adds authorization and validation to ensure secure plugin management. * feat: registers subscribers in PluginRegistryModule Includes subscribers in the providers array of the PluginRegistryModule. This allows them to be properly registered and utilized within the application. * feat: adds basic properties to Plugin model Adds `name`, `description`, `type`, and `status` properties to the `IPlugin` model. These fields provide essential information for managing and identifying plugins. * feat: adds checksum and signature to PluginVersion Adds `checksum` and `signature` fields to the `PluginVersion` entity and model. These fields will be used for verifying the integrity and authenticity of plugin versions. * feat: adds plugin security service Introduces a new service to manage plugin security. This service provides functionalities for generating and verifying checksums and digital signatures for plugin versions, ensuring the integrity and authenticity of installed plugins. It uses SHA-256 hashing and RSA-SHA256 signing/verification. * feat: adds plugin version subscriber This adds a new subscriber for `PluginVersion` entities to automatically generate security credentials (checksum and signature) upon creation. It also prevents subsequent modification of these credentials to ensure integrity. * refactor: plugin download count Removes explicit database column and associated decorators for the `downloadCount` property of the `Plugin` entity. This field will now be calculated rather than stored directly. * feat: adds plugin download tracking Tracks plugin and plugin version download counts. Updates plugin's `lastDownloadedAt` timestamp on installation. Calculates total downloads for a plugin across all versions. * refactor: imports in Plugin entity Reorders imports in `Plugin` entity for better readability and consistency. * feat: optimizes plugin download count calculation Uses a direct database query to sum download counts for a plugin, replacing the previous less efficient method. This improves performance by reducing database operations. * feat: adds plugin verification endpoint Adds a new endpoint to verify a plugin using its ID and verification input. This allows users to verify the authenticity and integrity of plugins before installation or usage. * feat: adds type property to command classes Adds a static `type` property to all command classes in the plugin registry module. This type property will be used for identifying commands within the application. * refactor: plugin management and introduces versioning Introduces a new `PluginVersion` entity to manage plugin versions separately. Adds versioning support to plugins, allowing multiple versions per plugin. Refactors plugin source management for greater flexibility. Includes fields for tracking plugin uploads, downloads, and installation status. This change improves plugin management by providing a more structured and organized approach to handling different plugin versions and their associated metadata. * refactor: plugin management for versioning Handles plugin versions more robustly by using an object instead of a simple string. This allows storing additional information like changelog and release date for each version. Updates plugin installation status check to rely on the presence of a version object, indicating an installed plugin. Modifies plugin upload and display components to accommodate version objects and display version numbers correctly. Adds necessary form validation for new version fields during plugin upload. * fix: plugin creation with source Associates plugin source with plugin during creation to ensure correct linking. Updates plugin creation logic to save the plugin before creating the source and version. This ensures the plugin ID is available for association. Modifies plugin source entity to include a direct relation to the plugin entity. Adjusts DTOs and controllers to support this change. Removes unnecessary file storage provider from plugin source. * refactor: plugin version source referencing Moves the `source` and `sourceId` properties from the `IPlugin` interface to the `IPluginVersion` interface. This change clarifies the relationship between plugin versions and their sources. Removes the redundant `sourceId` and `pluginId` from the `IPlugin` interface. * fix: plugin form pre-population and form data handling Sets default release date to today if no previous date exists to avoid validation errors. Improves form error handling by creating a generic helper function to reduce code duplication. Fixes an issue where plugin source details were not included in the form data when updating a plugin, resulting in incomplete updates. Ensures all necessary data is correctly included when submitting the plugin form. * refactor: plugin management Moves plugin source to version level, simplifying the plugin model and improving data organization. Updates related services, commands, handlers, DTOs, entities, and subscribers to reflect this change. Improves plugin installation and uninstallation logic by directly managing installation status and dates. Includes plugin validation improvements and computed fields for download counts and latest version. * feat: adds release date and changelog translations Adds translations for "Release Date" and "Changelog" fields and placeholders across multiple languages (ar, bg, de, en, es, fr, he, it, nl, pl, pt, ru, zh). * feat: adds endpoint to list plugin versions This change introduces a new endpoint to retrieve a paginated list of plugin versions for a given plugin ID. It includes filtering and pagination capabilities to manage large result sets. This allows clients to easily access and manage different versions of installed plugins. * feat: adds endpoint to create plugin versions Adds a new endpoint and command handler to create new versions for existing plugins. This allows users to manage different versions of their plugins within the registry. * refactor: PluginController and module Removes unused imports and logic related to plugin creation, updating, activation, deactivation, installation, uninstallation, verification, and version management from `PluginController`. Updates `PluginRegistryModule` imports and adds `RolePermissionModule`. This change simplifies the controller and module by removing obsolete code. * feat: refactors plugin ID handling in controllers Standardizes plugin ID parameter name to `pluginId` across controllers and updates related logic. Improves consistency and clarifies the purpose of the ID parameter. Refactors the `PluginOwnerGuard` to handle various request parameter names for plugin ID, improving flexibility and reducing code duplication. Updates error messages for clarity and consistency. * refactor: plugin upload form to use a stepper Breaks down the plugin upload form into a multi-step stepper component for improved user experience. This enhances clarity and simplifies the upload process by grouping related fields into logical steps. The stepper includes sections for basic information, version details, source configuration, and metadata. This change also extracts reusable components for each step to improve code organization and maintainability. * feat: adds form validation to plugin upload stepper Adds stepControl to the first step of the plugin upload stepper. This connects the stepper navigation to the form validation of the basic information step, preventing advancement to the next step until the required fields are valid. * fix: plugin version and author display Handles plugin versioning to correctly display version numbers. Displays the uploader's name accurately in the plugin details. Updates plugin loading logic to include necessary relations for proper data fetching. * feat: Implement plugin version management Allows users to add new versions to existing plugins. Updates the plugin details view to display source information for each version. Adds a button to add new versions, edit existing versions, and delete plugins. Removes the version field from the NPM source interface. Adds an "installed" flag to the plugin interface. Updates the plugin installation and uninstallation logic to use the selected version. * fix: plugin update functionality Updates the plugin update method to require a plugin ID. This change ensures that the correct plugin is updated and prevents unintended modifications to other plugins. * refactor: plugin details view Improves the plugin details view with a tabbed interface for better organization and readability. Introduces separate tabs for "Overview" and "Source Code", categorizing information effectively. The Overview tab now includes plugin description, basic info, what's new, metadata, and usage statistics. The Source Code tab displays source details and security information. Updates styling for improved visual appeal and consistency. * refactor: plugin form handling Moves plugin source control inside the version group to reflect the backend data structure. This adjusts how the form is patched and updated, simplifying the data mapping and ensuring consistency. The source type listener is also updated to reflect this change. * feat(plugins): Add DTOs for updating plugin entities Introduces new Data Transfer Objects (DTOs) for updating plugin sources, versions, and plugins themselves. These DTOs allow for partial updates of plugin-related information, enhancing flexibility and control over plugin management. They include validation and type enforcement for data integrity. * fix: plugin activation/deactivation status update Updates plugin status to INACTIVE when activating and ACTIVE when deactivating. Includes plugin id in update payload and uses service update method instead of save. This ensures correct status updates during plugin activation and deactivation. * feat: plugin update endpoint to handle file uploads Handles file uploads for Gauzy plugin updates. Includes validation, metadata extraction, and cleanup on error. Updates the plugin record with the extracted metadata. * feat: adds plugin version history navigation Adds a button to navigate to the version history page from the plugin details page. Includes API changes to retrieve plugin versions and UI changes to display the navigation button and the version history page. Orders versions by creation date descending. * refactor: plugin update logic Updates plugin, version, and source update logic to use partial updates instead of full object assignment. This prevents unintended overwrites of existing data and improves the overall update process. Adds unique indexes to plugin name and version number to prevent duplicates. Refactors DTOs to implement interfaces for better type safety and consistency. * feat: adds "Installed" and "Hidden for security" translations Adds translations for "Installed" and "Hidden for security reasons" across multiple languages (ar, bg, de, en, es, fr, he, it, nl, pl, pt, ru, zh). * fix: duplicate plugin entries in marketplace Prioritizes marketplace plugins over locally installed plugins when duplicates are found. This ensures the latest version from the marketplace is displayed. * refactor: plugin marketplace item UI Updates the plugin marketplace item UI to improve user experience. - Styles action buttons with consistent classes and colors. - Improves uninstall flow with a confirmation dialog. - Updates button styles for better visual consistency. - Refactors plugin installation and uninstallation logic for improved UI updates. - Adds tooltip for delete button in version history. - Minor styling and text updates for consistency. * fix: plugin installation check Removes unnecessary versionId check when retrieving a plugin installation. This check prevented proper retrieval of the installation record. * feat: adds marketplaceId to plugin metadata This change introduces a new `marketplaceId` field to the plugin metadata. This allows associating plugins with their corresponding marketplace entries, enabling features like installation checks and updates based on marketplace IDs. A new database migration is included to add the `marketplaceId` column to the plugins table. The plugin manager, metadata service, and related components are updated to handle this new field. An IPC handler is also added to allow checking plugin installation status by marketplace ID. * fix: plugin version management and installation Updates plugin installation to include marketplace ID for tracking. Adds plugin version editing and deletion functionality. Improves plugin version history display and actions. Fixes plugin installation check to use marketplace ID. Updates plugin marketplace loading logic to prioritize marketplace plugins and display installed status. * feat: adds loading indicator to plugin marketplace Displays a loading message while the plugin marketplace retrieves plugins. This improves the user experience by providing feedback during the loading process. * feat: adds `withDeleted` option for soft delete queries. Improves type handling and consistency within the CRUD service. Fixes some minor formatting inconsistencies. * fix: plugin version restore/delete actions Swaps the logic for the restore and delete actions in the plugin version history. The previous implementation incorrectly called the delete endpoint when restoring a version and the restore endpoint when deleting. This commit corrects this behavior. It also removes the `withDeleted` flag from the version query as it is no longer needed. * refactor: plugin ownership validation Moves plugin ownership validation logic from the `PluginOwnerGuard` to the `PluginService`. This improves code organization and allows for reuse of the validation logic. The guard now simply calls the service's validation method and handles the result. * feat(plugins): add delete plugin version functionality Adds a new command and handler to delete a specific plugin version. Includes API endpoint, service logic, and necessary guards to ensure only authorized users can delete plugin versions. Updates plugin version listing to include deleted versions when appropriate. * feat: adds plugin version recovery Implements the ability to recover a soft-deleted plugin version. Adds a new command and handler for recovering plugin versions. Exposes a new API endpoint to trigger the recovery process. * feat: improves plugin version management Adds loading and action indicators for version history actions (remove/restore). Refreshes the version list after updating, removing, or restoring a version. Changes "Restore" button text to "Recover". * fix: spinner display in plugin version actions Shows the spinner only for the selected version's action button when recovering or removing a plugin version. Previously, the spinner was displayed for all version actions, even if the action was not being performed on that specific version. This change improves the user experience by providing more accurate visual feedback during these operations. * feat: allows editing existing plugin versions Adds the ability to edit existing plugin versions, including their source and version number. Improves the version history view by adding an edit button and disabling actions while other operations are in progress. * feat: adds update plugin version endpoint This change introduces a new endpoint and command handler for updating existing plugin versions. It allows updating plugin metadata and supports file uploads for Gauzy source plugins. The update process includes validation and cleanup for uploaded files. * feat: orders plugin versions by release date Changes the ordering of plugin versions from `createdAt` to `releaseDate` for a more accurate representation of version history. This affects the plugin details view and the version history modal. * refactor: plugin marketplace item component Improves the plugin marketplace item component by consolidating the disable logic for plugin actions. This simplifies the template and ensures consistent behavior across different actions. Adds loading spinners to action buttons to provide visual feedback during asynchronous operations. This enhances the user experience by clearly indicating when an action is in progress. Styles action buttons to improve layout and visual appeal. * fix: plugin installation status handling Ensures correct installation status updates by using `finalize` to always reset the installing/uninstalling flags after the operation completes. Improves error handling when checking local plugin installations by logging a warning instead of an error and correctly setting the installed state. * feat: adds read-more directive for long text Implements a new directive to truncate long text blocks and provide a "read more" button to expand the content. This improves the user experience by preventing long text descriptions from overflowing their containers and cluttering the UI. The directive is applied to plugin descriptions and changelogs in the plugin marketplace. * fix: plugin installation and editing process Handles plugin installation and uninstallation status updates from Electron. Displays a loading indicator during plugin installation, uninstallation, and editing. Updates plugin details to display the latest version number during upload. Fixes a gap issue in plugin actions. * fix: plugin installation rollback on failure Rolls back plugin installation if it fails. This ensures a clean state after a failed installation by uninstalling the partially installed plugin. Adds error handling to both the plugin detail and plugin item components. * fix: plugin installation check Adds `status` check to plugin installation queries to ensure only installed plugins are considered. This prevents scenarios where uninstalled plugins are incorrectly treated as installed. * fix: plugin installation check Ensures the plugin installation check accurately reflects the locally installed plugins. Handles cases where the plugin information might be outdated or incorrect, preventing potential issues during installation or uninstallation. * feat: silently handles missing plugin installations No longer throws an exception when attempting to uninstall a plugin that isn't installed. Instead, the handler now simply returns without taking any action. * fix: plugin installation check error handling Handles potential errors during plugin installation check by setting the checked state to false and preventing further emissions. This ensures the UI reflects the correct installation status even if the check fails. * refactor: imports in plugin marketplace item component Moves the import of `IPlugin as IPluginInstalled` from the bottom of the import list to be closer to other related imports. This improves code readability and organization. * feat: adds CUSTOM_ELEMENTS_SCHEMA to PluginsModule This allows the use of custom elements within the plugin system without Angular throwing errors. * fix: refreshes plugin list after upload Reloads the plugin list after a successful plugin upload to immediately reflect the change in the UI. * fix: unique constraint on plugin versions Changes the unique constraint on `PluginVersion` from `plugin.name` to `number`, `pluginId`, `tenantId`, and `organizationId`. This ensures that plugin versions are unique within a plugin, tenant, and organization, based on their version number. The previous implementation incorrectly used the plugin name, which could lead to conflicts when different plugins shared the same name across tenants or organizations. Also adds a unique constraint to the `Plugin` entity on `name`, `tenantId`, and `organizationId` to ensure plugin names are unique within a tenant and organization. * refactor: plugin marketplace forms Removes unnecessary ChangeDetectorRef usages and improves form handling logic. Improves form patching by creating a copy of the version object to avoid modifying the original object. Adds conditional rendering to form fields based on source type to prevent errors. Removes debounceTime operator to improve responsiveness. * refactor: plugin management logic Removes unnecessary try-catch blocks from plugin activation and deactivation handlers. Simplifies the logic by directly checking plugin status before updating. Removes an unused import from the plugin owner guard and fixes optional chaining in the plugin manager. * fix: regex for URL validation Corrects the regular expression used for validating URLs to allow paths with hyphens. * chore: docker build * feat: adds "uninstallation" to cspell dictionary Adds "uninstallation" to the list of recognized words in the cspell configuration file to prevent it from being flagged as a spelling error. * fix: incorrect FormData initialization Initializes FormData within the functions instead of outside, preventing potential data corruption when handling multiple requests concurrently. * fix: plugin registry path in tsconfig.json Adds missing `./` to the path for `@gauzy/plugin-registry` to ensure consistency with other plugin paths. * fix: validation messages for plugin ZIP files Clarifies the validation error messages for plugin ZIP files to accurately reflect the required format and allowed characters. Removes erroneous references to video formats. * fix: plugin marketplace and versioning issues Corrects typographical errors in variable names related to marketplace IDs. Improves plugin version handling and validation, including source type handling and form validation. Updates plugin version number type and adds a check for plugin ownership before editing or removing versions. Refines plugin source entity by removing unnecessary size validation and improves latest version computation. Fixes plugin deletion logic and updates command type for clarity. Adjusts plugin creation validation to handle missing version data. Handles potential not found exceptions during plugin version deletion. Ensures plugin ownership validation is asynchronous. * fix: plugin version release date validation Removes the validation rule that restricted the release date to be in the past. This allows for future release dates to be set. * fix: plugin toggle during installation Disables the plugin toggle while installation or uninstallation is in progress. This prevents users from interacting with the toggle while the operation is ongoing, avoiding unexpected behavior and improving the user experience. Also fixes an issue where the toggle state was incorrectly reverted after a failed installation or uninstallation. * fix: plugin install/uninstall toast notifications Moves toast notifications for successful plugin installation and uninstallation to the `finalize` block. This ensures the notification is displayed after the operation completes, even if an error occurs during the process. Prevents duplicate toast notifications when installing or uninstalling plugins. Adds toast notifications for errors during plugin installation or uninstallation. Adds a check to prevent multiple clicks on the install/uninstall buttons while the operation is in progress. * fix: clarifies `installed` property description Updates the description of the `installed` property in the `IPlugin` interface to clearly indicate that it represents whether the plugin is currently installed. * feat(plugins): Adds plugin management functionality This commit introduces actions, effects, a store, and a query for managing plugins. It provides functionality to get, select, activate, deactivate, install, and uninstall plugins. Loading and error handling are also implemented. * feat: adds plugin progress reporting Introduces a new method to report plugin installation progress to the UI. This allows users to track the installation process and receive updates on its status. * chore: adds @ngneat/effects-ng dependency Adds the `@ngneat/effects-ng` package to the `desktop-ui-lib` project. * feat: adds Akita state management for plugins Introduces Akita for managing plugin state, including effects, queries, and a store. This provides a more robust and scalable solution for handling plugin data. * refactor: plugin installation process Moves plugin installation logic to ng-effects. This simplifies the component logic and improves state management. * refactor: plugin management using Akita state management Moves plugin management logic to Akita, simplifying component logic and improving state handling. Adds loading indicator for plugins. Disables actions while plugin operations are in progress to prevent conflicts. * feat: refines plugin progress event handling Simplifies the data structure for plugin progress updates. Progress events now pass the message directly as a string instead of within an object, streamlining communication between the electron service and the UI effect. * feat: return plugin metadata after download Modifies the plugin download process to return the metadata of the newly downloaded plugin. This allows the caller to immediately access plugin details (like name, version, etc.) upon successful download without needing a separate query. Updates the corresponding event handler to forward this metadata in the success response. * feat: removes plugin install/uninstall actions and effects Removes the `install` and `uninstall` NgRx actions and their corresponding effects. Updates the `handleProgress` method signature to accept an object parameter for the message. * feat: adds state management for plugin marketplace Implements Akita stores, queries, and NgNeat effects for managing plugin state within the desktop UI. Handles asynchronous operations for: - Plugin installation and uninstallation via Electron service. - Plugin marketplace CRUD operations (upload, fetch, update, delete). - Plugin version management (CRUD, restore, selection). Provides state tracking for loading, progress, and errors, integrating with notification services for user feedback. * feat: updates plugin components to use installation actions Replaces the use of generic `PluginActions` with the more specific `PluginInstallationActions` for install and uninstall operations within the `AddPluginComponent` and `PluginListComponent`. This change isolates plugin installation and uninstallation logic into dedicated state management actions, improving code organization. * refactor: plugin marketplace to use state management Replaces direct service calls and local state (`BehaviorSubject`) in plugin marketplace components (list, item, detail, version history) with dedicated NgRx-style actions and queries. Centralizes logic for plugin operations like installation, uninstallation, updates, deletion, and version management within the state layer. This simplifies component responsibilities and improves overall state handling consistency. * feat: adds plugin marketplace effects and upload progress Integrates NgRx effects for plugin marketplace, installation, and version management. Updates plugin service methods (`getAll`, `getVersions`) to return full pagination objects instead of just item arrays. Implements upload progress reporting in the plugin upload service method. Enhances Electron IPC progress communication to potentially include data payloads alongside messages. * feat: adds versionId field for plugin management Introduces a `versionId` field to the plugin database schema and metadata interface. Updates the plugin download, installation, and update processes to handle and persist the `versionId`. This allows tracking specific plugin versions, potentially linked to marketplace releases. * feat: refines plugin marketplace state management and UX Centralizes plugin install/uninstall toggle state using Akita store and effects for improved consistency and reactivity across components. Refines loading indicators (spinners) on buttons to activate only for the specific plugin being installed, uninstalled, or modified, preventing simultaneous activation across all items. Ensures state immutability by consistently using the spread operator when updating plugin and version arrays within Akita stores. Corrects state property updates during plugin uninstallation (`uninstalling` flag) and fixes payload data (`versionId`) used during installation. Adds a reset action to clear the plugin version history state when the relevant component is destroyed, preventing stale data display. Passes the specific version ID during plugin installation actions and updates version history display to use `releaseDate` instead of `createdAt`. Refactors plugin effects slightly by using `from()` to handle async operations and scoping `finalize`/`catchError` more closely. * fix: plugin version management and UI stability Corrects state updates in effects when deleting or restoring plugin versions, ensuring the correct version ID is used. Switches from `switchMap` to `mergeMap` in version effects to allow concurrent operations without cancellation. Improves error handling and user feedback messages for plugin version restoration failures. Adds null checks in plugin marketplace templates to prevent potential errors when accessing plugin properties. Refines spinner display logic in the plugin detail view during editing. * feat: improves plugin marketplace state management and UX Resets selected plugin state in the plugin list component on initialization and destruction. Navigates back to the marketplace list and clears the selected plugin state after successful deletion in the marketplace effects. Merges updated plugin data with existing state instead of overwriting during marketplace updates. Dispatches an installation toggle action immediately when initiating plugin install, uninstall, update, or delete operations in the marketplace item component for better UI feedback. * feat: uses state management for plugin version selection Refactors plugin version selection within the marketplace item to utilize the central state store instead of local component state. Dispatches an action upon initial load and when the user selects a different version via the dropdown. The selected version is now read reactively from the state store for display and logic. Updates the state store effect to include the plugin ID when selecting a version. Removes local component state management for the selected version. * refactor: plugin install/uninstall state Move the 'installing' and 'uninstalling' state management from the main PluginQuery and PluginStore to the dedicated PluginInstallationQuery. This change isolates installation-specific state, improving modularity and clarifying the responsibilities of each state management slice. Components involved in installation now correctly source this state from PluginInstallationQuery. * feat(utils): add coalesceValue utility function Introduce a `coalesceValue` utility function. This function allows handling potentially null or undefined values by returning a default value or executing custom handler functions for null/undefined if provided. * feat(plugin-marketplace): show progress for plugin upload and version add Modify plugin upload and version addition services to report upload progress events. Update plugin marketplace and version effects/stores to handle progress information. Display the upload progress percentage in the UI during plugin uploads and new version additions to improve user feedback. * style(plugin-marketplace): remove left margin from upload progress indicator Removes the unnecessary left margin (ml-2) from the upload progress percentage display in the plugin marketplace header and item views for better visual consistency. Additionally, updates the conditional display logic in the item view to use the 'uploading' state variable for consistency. * feat(plugin-registry): prevent deleting last plugin version Introduce a check in the DeletePluginVersion command handler. Before attempting to delete a specific plugin version, the handler now verifies the total number of versions associated with the parent plugin. If deleting the target version would leave the plugin with no versions remaining (i.e., count <= 1), the deletion is prohibited, and a ForbiddenException is thrown. This ensures that a plugin entity always retains at least one version. BREAKING CHANGE: Deleting the last remaining version of a plugin is no longer permitted and will result in a 403 Forbidden error. * fix(plugin-registry): throw error for missing Gauzy plugin file key Previously, creating a plugin with source type 'GAUZY' without providing a file resulted in a console warning and an undefined return value. This change replaces the warning with a `BadRequestException` to ensure the client receives an appropriate HTTP 400 error response when the file key is missing. BREAKING CHANGE: Creating a plugin with source type 'GAUZY' without a file now returns a 400 Bad Request instead of potentially succeeding with a warning. * fix(plugin): fix issues in plugin creation and upload - Corrects the handling of `releaseDate` by using ISO string format before sending to the backend and standardizes max date selection in UI using NbDateService. - Fixes the incorrect step order (Source/Version) in the plugin upload stepper component. - Resolves an error where the uploaded file was not correctly extracted from the form data structure. - Adds error handling to plugin upload and version creation requests. * refactor(plugin-marketplace): reuse deletion timestamp when updating plugin version state Generate the deletion timestamp once before updating the plugin version store state. This ensures the exact same timestamp is used for both the single version view and the list view update, promoting consistency and slightly improving code clarity by avoiding redundant `new Date()` calls. * feat(plugin-marketplace): add infinite scrolling Implement infinite scrolling for the plugin marketplace list. This improves performance and user experience by loading plugins in batches as the user scrolls down, instead of loading all plugins at once. - Add `NbInfiniteListDirective` to the marketplace template. - Implement `loadMore` logic in the component to fetch subsequent pages. - Introduce a `reset` action and effect to clear the plugin list from the store when the component is destroyed, ensuring a fresh load on revisit. * feat(plugin-marketplace): add infinite scroll to plugin version history Implements infinite scrolling for the plugin version history list within the marketplace item view. This improves performance and user experience when viewing plugins with numerous versions. Also refactors plugin ID management in the parent component to utilize the state store consistently. * fix(plugin-marketplace): remove reset action dispatch on destroy Removes the dispatch of the `PluginMarketplaceActions.reset()` action within the `ngOnDestroy` lifecycle hook. This prevents the plugin marketplace state from being automatically cleared when the component instance is destroyed. * refactor(plugins/routing): organize plugin routes into child modules Extract routes for installed plugins and the marketplace into separate lazy-loaded routing modules (`plugin-installed-routing.module.ts` and `plugin-marketplace-routing.module.ts`). This improves code organization and separation of concerns within the plugin settings feature. Also includes fixes for pagination logic (`skip` initialization corrected to 1) and ensures state reset actions (`PluginVersionActions.reset`, `PluginMarketplaceActions.reset`) are dispatched on component destroy for related components. * refactor(plugins-state): make plugin action identifiers more specific Update the descriptive type strings for NgRx/Effects actions related to plugins. Replace the generic `[Plugin]` prefix with more specific domains: - `[Plugin Installed]` - `[Plugin Installation]` - `[Plugin Marketplace]` - `[Plugin Version]` This improves clarity and aids debugging by providing better context for actions, especially in state management developer tools. * fix(plugin-marketplace): load plugins on component initialization Call the load method during ngOnInit to ensure the plugin list is fetched when the component is displayed. Additionally, remove the 'versions' relation and its specific ordering from the data retrieval action as it is not required for the initial marketplace view. This simplifies the query. * fix(plugin-marketplace): correct plugin state update after install/uninstall Ensure the plugin's installed status is correctly reflected in both the main plugin list and the individual plugin state within the PluginMarketplaceStore after installation or uninstallation. Previously, the state update logic did not handle cases where the plugin being acted upon might only exist in the installation state (e.g., viewed directly) and not in the main marketplace list. This change uses the `PluginInstallationQuery` as a fallback to retrieve plugin details if necessary and updates both `plugins` array and the singular `plugin` state property consistently. * feat(plugin-marketplace): include relations in plugin fetch Fetch plugin versions, source, and uploader information alongside the main plugin data when listing plugins in the marketplace. This optimizes data loading and enables richer display of plugin details. * fix(plugins): improve loading state and infinite scroll logic - Reorder loading indicator display in plugin marketplace and version history templates to potentially show content sooner if available. - Refactor `hasNext` calculation for infinite scroll in both marketplace and version history components for clarity and efficiency. - Prevent `loadMore` in version history from triggering prematurely before initial data is loaded. - Add missing `NbListModule` import. * fix(plugins): fix plugin upload form state and backend error handling Mark the plugin upload form in the desktop UI as touched and dirty when a file is selected. This ensures the form state correctly reflects user interaction, enabling proper validation and UI updates. Additionally, improve backend error handling in the plugin version controller. Throw a BadRequestException instead of logging a warning when the file key is missing for a GAUZY source type plugin upload. This provides clearer and more appropriate error feedback. * refactor(plugin-system): improve structure of plugin download strategies Break down the monolithic `execute` methods in both CDN and Local download strategies into smaller, more focused private methods. This improves code clarity, maintainability, and testability. Key changes include: - Introduce separate methods for validation, directory preparation, download/file handling, unzipping, manifest processing, and cleanup. - Enhance error handling with more specific messages and dedicated cleanup logic on failure. - Add explicit validation for URLs (CDN) and selected files (Local). - Implement streaming download for the CDN strategy to reduce memory usage. - Improve logic for locating the plugin directory within the unzipped archive, including searching for `manifest.json`. - Introduce constants for retry logic and file extensions. * feat(desktop): enhance server connection detection and feedback Introduce a dedicated `serverConnection` state (0 for down, 200 for up) in the store, updated consistently by the app component and the server error interceptor upon successful pings or HTTP errors. Redesign the 'Server Down' page with improved visuals, animations, and a connecting status indicator. Refactor its connection checking logic using RxJS interval and switchMap for better reliability and resource management. Update the Plugin Marketplace to display an explicit offline message when the application detects a lost connection. * feat(i18n): add server down translations Add translations for messages displayed when the backend server is unavailable (HTTP 503). This includes keys for title, description, connecting status, and a hint with the error code across all supported languages. * refactor(plugin-marketplace): inject Store service Inject the global Store service into the PluginMarketplaceComponent. This makes the application's central store accessible within the component for potential future use, such as selecting state or dispatching actions. * feat(auth): add connection guard to block routes when offline Introduces the `AuthConnectionGuard` to prevent navigation to main application routes when the server connection is unavailable (status 0), unless the user already has an active session (userId exists in store). - Created `AuthConnectionGuard` checking `serverConnection` and `userId`. - Added the guard to `/auth`, `/time-tracker`, and the default route. - Provided default configuration for the guard's redirect behavior. - Refactored `ServerConnectionService` for improved reliability, error handling, and async/await usage. - Updated `AuthGuard` and `NoAuthGuard` to set connection status to 0 if authentication checks fail due to connection issues. - Refined server check logic on `ServerDownPage` to navigate away once connection or session is restored. - Standardized initial `serverConnection` state to 0. - Refactored common SCSS styles into `_reusable.scss`. * fix(plugins): refine error message display and IPC property access Simplify fallback error message construction for plugin uploads. Remove unnecessary optional chaining for Electron IPC message properties (`message`, `data`). Includes minor import order adjustment. * style(desktop-ui-lib): organize imports and remove unused code Remove unused imports (HttpErrorResponse, Http2ServerResponse, throwError) from the plugin service. Alphabetize RxJS imports in the server-down page for consistency and remove an unused RxJS operator import (take). * refactor(auth): use format specifiers for console logs Update console.warn and console.error calls in AuthConnectionGuard to utilize format specifiers (%s) rather than string concatenation. This improves the readability and consistency of log output, potentially aiding debugging and integration with logging tools that parse format strings. * fix(plugin-installation): reset toggle state on installation error When a plugin installation fails, the associated UI toggle element was not being reset to its previous state. This could leave the toggle in an active state despite the failed operation. This commit modifies the installation error handler to explicitly read the current toggle state via a new query getter and then updates the store with the inverted state, effectively resetting the toggle visually upon failure. * fix(plugins): fix version selection in plugin marketplace item Add a compareWith function to the version select dropdown in the plugin marketplace item component. This ensures that the correct version is highlighted in the dropdown, as Angular needs guidance on how to compare the IPluginVersion objects (by ID) rather than by object reference. * fix(plugin-marketplace): ensure correct plugin version selection and state update Update the plugin marketplace store immediately after a new version is created to include the new version in the plugin details. Prevent the marketplace item component from automatically selecting the latest version if a version is already selected, preserving the current selection state. * refactor(plugin-marketplace): extract version selector component Extract the plugin version selection logic from PluginMarketplaceItemComponent into a new dedicated VersionSelectorComponent. This new component utilizes the `gauzy-select` component instead of `nb-select` and introduces infinite scrolling for loading plugin versions. Adjusted the PluginVersionEffects to correctly update the version list in the store when creating or updating versions. The state update now modifies the existing version in the list if found, or prepends it otherwise, improving consistency. Additionally, the VersionHistoryComponent now fetches deleted versions. * feat(plugin-marketplace): add skeleton loaders and defer loading for plugins Implement skeleton placeholders for the plugin list and version history using Angular's `@defer` block with `@placeholder`. This improves the user experience by showing a structured loading state instead of a blank area or simple text message while data is being fetched. The `isLoading` condition is refined to only show the main loading indicator before the initial data arrives. Deferred loading (`@defer on viewport`) is used for the lists to potentially improve initial render performance. The plugin upload button is also deferred (`@defer on idle`) and disabled when the application is offline. * chore(plugin-marketplace): remove console warning for missing local installation Remove the console warning that appears when a plugin is not found locally during the marketplace check. This warning is redundant as it represents an expected state (plugin not installed) rather than an actual problem. * style(plugin-list): update uninstall icon Replace 'trash-2-outline' icon with 'slash-outline' for the plugin uninstall button. * fix(plugin-registry): update enum types and version index for db compatibility Update ORM entity definitions to use 'simple-enum' instead of 'enum' for better cross-database compatibility and simpler management. Add default values to several enum columns for consistency. Adjust the unique index definition on the PluginVersion entity to correctly handle differences between MySQL and other database systems regarding unique constraints involving tenant/organization IDs. * feat(plugin-registry): add plugin registry database tables Introduce a new TypeORM migration to establish the database schema for the plugin registry feature. This migration creates the following tables: - plugin: Stores core plugin metadata. - plugin_source: Details the source location (CDN, NPM, Gauzy) and storage details for plugin assets. - plugin_version: Manages different versions of each plugin, including changelogs and checksums. - plugin_installation: Tracks the installation status of plugins within tenants/organizations. The migration includes specific implementations for PostgreSQL, SQLite, and MySQL databases. * perf(plugin-registry): eagerly load version source Join the 'source' relation when querying for all plugin versions within the PluginSubscriber. This avoids potential N+1 query issues when accessing the source information for each version later in the process, improving database query performance. * feat(plugin-marketplace): select version on detail open and fix count Dispatch the PluginVersionActions.selectVersion action when navigating to the plugin detail page. This ensures the correct version context is set for subsequent operations. Fixes an issue where the total plugin count in the marketplace state was not incremented after a successful plugin upload. Also refactors the `plugin` getter in PluginMarketplaceItemComponent to be private. * feat(plugins): add plugin-registry dependency Add the @gauzy/plugin-registry package as a dependency to the desktop, server-api, and server applications. This prepares the applications for dynamic plugin loading and management capabilities. Add the @gauzy/plugin-videos dependency to the server-api and server applications to incorporate video-related features. Update productName and description in apps/server/package.json for consistency. * fix(plugins): remove success toast from upload/version dialogs The plugin upload and create version dialogs were showing a success message immediately upon form submission, before the parent component confirmed the success of the actual operation. This removes the premature success toasts. The responsibility for notifying the user of success now lies with the component that handles the dialog result. --------- Co-authored-by: Rahul R. <[email protected]>
* build(plugin-registry): integrate plugin into build process Add build scripts for the plugin-registry package. Updates the main build scripts (`build:package:plugins:post*`) in the root package.json to include the new plugin-registry. Also adds build scripts (`lib:build*`) to the plugin-registry package.json itself. * fix(build): add missing yarn run for registry plugin build scripts The `build:package:plugin:registry:prod` and `build:package:plugin:registry:docker` commands within the `build:package:plugins:post:prod` and `build:package:plugins:post:docker` scripts were missing the required `yarn run` prefix. This prevented the registry plugin build step from being executed correctly in the production and docker build workflows.
* feat(api): add registry plugin dependency * chore(plugin-registry): bump version to 0.1.0
…-migration [Fix] Zapier Webhook Subscription Entity/Migration
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here: https://app.greptile.com/review/github.
319 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
|
View your CI Pipeline Execution ↗ for commit 9928850.
☁️ Nx Cloud last updated this comment at |
PR
Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.