Setting the file. One moment.
Subchapter 2.8
references/auto-patterns-dashboard/app-config-structure.mdMarkdown7 KBView on GitHub
export interface AppConfig {
pages: PageConfig[];
}
type PageConfig = CollectionPageConfig | EntityPageConfig;
interface PageBase {
id: string; // Unique across app
appMainPage?: boolean; // ONE page must be true
}
interface CollectionPageConfig extends PageBase {
type
entityTypeSource is 'custom' THEN custom: { id: "..." } is REQUIRED.type: 'collectionPage' THEN collectionPage object is REQUIRED, entityPage object is FORBIDDEN.type: 'entityPage' THEN entityPage object is REQUIRED, collectionPage object is FORBIDDEN.type: 'action' THEN action property is REQUIRED.type: 'menu' THEN menu property is REQUIRED.'create' THEN create config is REQUIRED.'update' THEN update config is REQUIRED.'delete' THEN delete config is REQUIRED.biName in EVERY action configuration (format: kebab-case, {action-purpose}-action).appMainPage: true.stickyColumns to negative, zero, or > column count.import React from 'react';
import { WixDesignSystemProvider } from '@wix/design-system';
import '@wix/design-system/styles.global.css';
import { WixPatternsProvider } from '@wix/patterns/provider';
import { PatternsWizardOverridesProvider, AutoPatternsApp, type AppConfig } from '@wix/auto-patterns';
import { withDashboard } from '@wix/patterns';
import config from './patterns.json';
const Index: React.FC = () => {
return (
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
<WixPatternsProvider>
<PatternsWizardOverridesProvider value={{}}>
<AutoPatternsApp configuration={config as AppConfig} />
</PatternsWizardOverridesProvider>
</WixPatternsProvider>
</WixDesignSystemProvider>
);
};
export default withDashboard(Index);export const config: AppConfig = {
pages: [
{
id: "product-list",
type: "collectionPage",
appMainPage: true,
collectionPage: {
route: { path: "/" },
title: { text: "Products" },
actions: {
primaryActions: {
type: "action",
action: {
item: {
id: "create-product",
type: "create",
label: "Add Product",
biName: "create-product-action",
collection: {
collectionId: "products",
entityTypeSource: "cms"
},
create: {
mode: "page",
page: { id: "product-details" }
}
}
}
}
},
components: [
{
type: "collection",
entityPageId: "product-details",
collection: {
collectionId: "products",
entityTypeSource: "cms"
},
layout: [
{
type: "Table",
table: {
columns: [
{ id: "name", name: "Name", width: "200px" },
{ id: "price", name: "Price", width: "100px" }
]
}
},
{
type: "Grid",
grid: {
item: { titleFieldId: "name" }
}
}
]
}
]
}
},
{
id: "product-details",
type: "entityPage",
entityPage: {
route: { path: "/product/:id", params: { id: "id" } },
collectionId: "products",
entityTypeSource: "cms",
layout: {
main: [
{
type: "card",
card: {
title: { text: "Basic Info" },
children: [
{ type: "field", field: { fieldId: "name" } }
]
}
}
]
}
}
}
]
};