Saltar al contenido principal

Plugin UI Module

The plugin management UI is an Angular 18+ module providing end users with marketplace discovery, plugin installation, configuration, and lifecycle management.

Technology Stack​

  • Angular with standalone components and OnPush change detection strategy
  • Akita for predictable, entity-oriented state management
  • @ngneat/effects and @ngneat/effects-ng for declarative side effect management
  • Nebular as the primary UI component library
  • Angular2SmartTable for tabular data presentation
  • RxJS for reactive data flow composition

Module Structure​

plugins/
β”œβ”€β”€ component/
β”‚ β”œβ”€β”€ +state/ # Cross-cutting state management
β”‚ β”œβ”€β”€ add-plugin/ # Installation source selection dialog
β”‚ β”œβ”€β”€ plugin-marketplace/ # Marketplace browser
β”‚ β”‚ β”œβ”€β”€ +state/
β”‚ β”‚ β”œβ”€β”€ plugin-marketplace-item/
β”‚ β”‚ β”œβ”€β”€ plugin-marketplace-upload/
β”‚ β”‚ β”œβ”€β”€ plugin-marketplace-filter/
β”‚ β”‚ β”œβ”€β”€ plugin-subscription-plan-selection/
β”‚ β”‚ β”œβ”€β”€ plugin-settings-management/
β”‚ β”‚ └── plugin-user-management/
β”‚ β”œβ”€β”€ plugin-list/ # Installed plugins table
β”‚ β”œβ”€β”€ plugin-layout/ # Top-level navigation
β”‚ β”œβ”€β”€ plugin/ # Plugin renderer view
β”‚ β”œβ”€β”€ upload-selection/ # Install vs. Publish intent dialog
β”‚ └── pending-installation-dialog/
β”œβ”€β”€ services/
β”‚ β”œβ”€β”€ builders/
β”‚ β”œβ”€β”€ factories/
β”‚ β”œβ”€β”€ resolvers/
β”‚ β”œβ”€β”€ strategies/
β”‚ └── *.service.ts
β”œβ”€β”€ domain/
β”‚ β”œβ”€β”€ commands/
β”‚ └── interfaces/
β”œβ”€β”€ guards/
└── shared/

Routing Topology​

/plugins
β”œβ”€β”€ /marketplace # Plugin marketplace (default)
β”‚ β”œβ”€β”€ / # Marketplace list view
β”‚ β”œβ”€β”€ /:id # Plugin detail view
β”‚ β”‚ β”œβ”€β”€ /overview # Descriptive overview tab
β”‚ β”‚ β”œβ”€β”€ /source-code # Source code tab
β”‚ β”‚ β”œβ”€β”€ /user-management # Access control tab
β”‚ β”‚ └── /settings # Configuration tab
β”‚ └── /:id/versions # Version history
└── /installed # Installed plugins list
β”œβ”€β”€ / # Installed list view
└── /:name # Plugin renderer view

State Management​

Three primary Akita stores govern the UI state:

PluginStore​

Manages the collection of locally installed plugins and their activation states, along with in-progress flags that drive loading indicators.

PluginMarketplaceStore​

export interface PluginMarketplaceState {
plugins: IPlugin[];
count: number;
filters: IPluginFilter;
appliedFilters: IPluginFilter;
viewMode: "grid" | "list";
showAdvancedFilters: boolean;
loading: boolean;
}

PluginSubscriptionStore​

Holds the current user's subscription collection and the active subscription being managed.

Effects Pattern​

export const PluginMarketplaceEffects = {
getAll$: createEffect((actions$) =>
actions$.pipe(
ofType(PluginMarketplaceActions.getAll),
switchMap(({ params }) =>
this.pluginService.getAll(params).pipe(
map(({ items, total }) =>
PluginMarketplaceActions.getAllSuccess({
plugins: items,
count: total,
}),
),
),
),
),
),
};

Principal UI Components​

ComponentDescription
PluginLayoutComponentTop-level navigation with tab-based access to marketplace and installed plugins
PluginMarketplaceComponentFull marketplace browsing with grid/list modes, multi-criteria filtering, and infinite scroll
PluginListComponentInstalled plugins as a sortable, paginated smart table with inline activation toggling
PluginMarketplaceDetailComponentTabbed deep-dive: overview, access control, configuration, subscriptions, and analytics

Dynamic Component Loading​

The PluginLoaderService enables dynamic loading of Angular components exported by installed plugins at runtime. It handles standalone and NgModule-based components uniformly, with graceful degradation through a fallback component.

Supporting Services​

ServiceResponsibility
PluginCategoryServiceManage taxonomic categories for marketplace classification
PluginTagsServiceManage keyword-based tag associations
PluginAnalyticsServiceTrack and expose usage metrics and download statistics
PluginLoaderServiceDynamically instantiate plugin-contributed Angular components
PluginEnvironmentServiceResolve environment-specific configuration parameters
PluginSettingsServicePersist and retrieve per-plugin configuration data
PluginUserAssignmentServiceManage per-user plugin access assignments
PluginSubscriptionAccessServiceEnforce subscription-tier access gates
UserSubscribedPluginsServiceAggregate the current user's active subscriptions
PluginSecurityServiceGovern permissions, API keys, and security scan orchestration

Security Service Operations​

getPluginSecurity(pluginId); // Retrieve security configuration
getPluginPermissions(pluginId); // Retrieve declared permissions
createPermission(permission); // Grant a new permission
getApiKeys(pluginId); // Retrieve API key inventory
createApiKey(pluginId, name, permissions); // Provision a scoped API key
initiateScan(pluginId, config); // Launch an asynchronous security scan
getComplianceStatus(pluginId); // Retrieve compliance assessment results

Publication Workflow​

Developers publishing a plugin complete a multi-step form:

  1. Basic Information: Display name, description, type, status, category, author, license, and URLs
  2. Version Information: Semantic version, changelog (min. 10 chars), release date, and source descriptors
  3. Platform-Specific Sources: One or more source descriptors targeting specific OS and architecture combinations
  4. Subscription Plans (conditional): Pricing, billing period, feature entitlements, and trial parameters