Skip to content

Pinelab-studio/pinelab-vendure-plugins / .agents/skills

migrating-vendure-admin-ui-to-react-dashboard

Verified

Migrates Vendure Admin UI extensions (legacy Angular-based) to the new React Dashboard.

FileKindSize
01-general.mdmarkdown6.0 KB
01a-common-tasks.mdmarkdown1.1 KB
01b-tsconfig-setup.mdmarkdown1.5 KB
01c-common-pitfalls.mdmarkdown3.9 KB
02-forms.mdmarkdown1.5 KB
03-custom-field-inputs.mdmarkdown3.6 KB
04-list-pages.mdmarkdown8.7 KB
05-detail-pages.mdmarkdown10.5 KB
06-adding-nav-menu-items.mdmarkdown1.1 KB
07-action-bar-items.mdmarkdown983 B
08-custom-detail-components.mdmarkdown2.2 KB
09-page-tabs.mdmarkdown481 B
10-widgets.mdmarkdown2.8 KB
SKILL.mdskill md1.0 KB

08-custom-detail-components.md

View on GitHub
## Custom Detail Components

### Old (Angular)

```ts title="src/plugins/cms/ui/components/product-info/product-info.component.ts"
import { Component, OnInit } from '@angular/core';
import { Observable, switchMap } from 'rxjs';
import { FormGroup } from '@angular/forms';
import {
  DataService,
  CustomDetailComponent,
  SharedModule,
} from '@vendure/admin-ui/core';
import { CmsDataService } from '../../providers/cms-data.service';

@Component({
  template: ` <vdr-card title="CMS Info">
    <pre>{{ extraInfo$ | async | json }}</pre>
  </vdr-card>`,
  standalone: true,
  providers: [CmsDataService],
  imports: [SharedModule],
})
export class ProductInfoComponent implements CustomDetailComponent, OnInit {
  // These two properties are provided by Vendure and will vary
  // depending on the particular detail page you are embedding this
  // component into. In this case, it will be a "product" entity.
  entity$: Observable<any>;
  detailForm: FormGroup;

  extraInfo$: Observable<any>;

  constructor(private cmsDataService: CmsDataService) {}

  ngOnInit() {
    this.extraInfo$ = this.entity$.pipe(
      switchMap((entity) => this.cmsDataService.getDataFor(entity.id))
    );
  }
}
```

### New (React Dashboard)

```tsx title="src/plugins/my-plugin/dashboard/index.tsx"
import { defineDashboardExtension } from '@vendure/dashboard';

defineDashboardExtension({
  pageBlocks: [
    {
      id: 'related-articles',
      title: 'Related Articles',
      location: {
        // This is the pageId of the page where this block will be
        pageId: 'product-detail',
        // can be "main" or "side"
        column: 'side',
        position: {
          // Blocks are positioned relative to existing blocks on
          // the page.
          blockId: 'facet-values',
          // Can be "before", "after" or "replace"
          // Here we'll place it after the `facet-values` block.
          order: 'after',
        },
      },
      component: ({ context }) => {
        // In the component, you can use the `context` prop to
        // access the entity and the form instance.
        return (
          <div className="text-sm">
            Articles related to {context.entity.name}
          </div>
        );
      },
    },
  ],
});
```
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall