Skip to content

Commit 65d9617

Browse files
feat(example-starter, create-objectstack): help articles in the Starter app and the blank template (#38435)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_ Fixes #38372 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:新装基础模板应用的工作区,以及用命令行新建的项目,菜单里多一个「知识文章」入口,打开就有四篇示例帮助文章(笔记本设置、无线网络与打印常见问题、会议室参考表,以及一篇草稿);基础模板应用带中英文标签,新建项目暂时只有英文标签(中文标签另有一张卡跟进)。 - 为什么做:维护者要求模板应用自带知识文章,作为之后「知识检索」的内容基础;这次只加文章本身,不加知识源,等「未配置时不启用检索」那张卡落地后再接。 - 出错会怎样:只影响新装的模板和新建项目里多出的这一个对象和几条示例数据,已有环境不受影响;需要时整段改动可直接撤回。 - 要你做的:无。 ## What changes The Starter app (`examples/app-starter`, namespace `biz`, landed by #38371) and the blank template that `npm create objectstack` scaffolds (`packages/create-objectstack/src/templates/blank`, namespace `blank`) both gain the same help-article slice: - **Object** `biz_article` / `blank_article` (`src/objects/article.object.ts`): `title` (text, required, the `nameField`), `body` (markdown), `category` (select: `how_to`, `faq`, `reference`), `status` (select: `draft` default, `published`); one field group listing all four; `sharingModel: 'public_read_write'` like the other two objects. - **View** (`src/views/article.view.ts`): a grid of `title`, `category`, `status`. - **Menu**: an Articles entry between Contacts and Tasks. - **Labels**: the Starter's bundle gains `en` and `zh-CN` for the article's object, fields, options, view and section. The blank template carries no translation bundle: its labels are the English ones in its source, as for its companies and contacts today. This is the seat's ruling (option A, record 7249604628): a zh-CN bundle covering the article alone gives a fresh project i18n findings on `objectstack lint` and breaks the on-ramp's zero-findings pins. The template's zh-CN labels are split to #38456. - **Seed** (`src/data/articles.ts`): four generic office-help articles: setting up a laptop (how-to), a Wi-Fi and printing FAQ, a meeting rooms reference with a table and a one-line note, and a draft on sharing files. No policy or regulation text. The template gains `src/data/`, and its config lists the seed by name (`data: [articles]`). Its `./src` barrel imports stay exactly the ones `os init` wires, one per generator directory, because a seed is not generator output. - **No knowledge source** in either app, as ruled on the card. The knowledge source over these articles is #38374, which waits on #38369. - **READMEs** of both apps name the articles. - **File surface, beyond the claim** (named in the dev report): - `packages/cli/test/create-objectstack-wiring-parity.test.ts` (+1 line): the views vacuity guard names the article view's export line. - `packages/cli/test/create-objectstack-stack-reach.test.ts` (+3 -2): the on-ramp starter validates with three objects plus the generated one (`Data: 4 Objects`). - `packages/create-objectstack/src/templates/AGENTS.md`: an earlier commit on this branch named `src/data/` and `src/translations/` in the Project Structure tree; with the seed listed by name it went back to main's text, so this file is net zero in the diff. Changeset: `.changeset/38372-starter-help-articles.md` (patch for `@objectstack/example-starter` and `create-objectstack`). ## Tests - New `examples/app-starter/test/help-articles-38372.test.ts` holds every seed article to one shape: first line `# TITLE` (the record's own title), 3 to 6 `##` sections, no section without text, each section with its heading under 800 characters, nothing between the title and the first section; all three categories present; exactly one draft; one reference article with a table followed by a one-line note. A CONTROL case breaks each rule and sees it caught. - `blank-template-starter-parity.test.ts`: `PAIRS` gains the article object and the article views; a new case compares the whole `defineSeed(Article, …)` call modulo the namespace (with its own CONTROL); the menu case now expects five object entries. - Starter `test/boot.test.ts`: the install seeds the four articles (one draft), the menu lists `biz_article`, uninstall removes it. - Template `starter.test.ts`: the seed loads and the menu lists Articles. - CLI pins that read the blank template: the #20333 wiring parity and stack-reach (Test Core), and the nightly on-ramp e2e (#21325 zero findings at every gate, #21370 field consumers) were run on a fresh `create-objectstack` build. ## Acceptance notes - Carrier #38483: the scaffolder's closing summary (`packages/create-objectstack/src/index.ts`, "Your project starts with:") still names only Companies and Contacts and Tasks and Notes. This PR makes it incomplete (every new project now also starts with Articles); fixed on #38483. - Carrier #38483: the manifest descriptions (`manifest.description` in both configs, the template's `objectstack.manifest.json`, the Starter's `zh-CN` package description) still read "companies and contacts, with tasks and notes"; updated on #38483. - Carrier #38483: `platform-objects`' `managed-api-method-affordance-sweep` and `platform-admin-affordance-standing` exclude template object files by an exact path list naming only company and contact, so the template's `article.object.ts` is swept as if it were a booted definition. Their tests are green, but the file is misclassified; corrected on #38483. - The template's own `tsc` run (inside a scaffolded project) was not measured locally: its dependencies resolve only in a scaffolded project. `os validate` loads the template, and its `starter.test.ts` was run against workspace source. **Read first** (by risk): `packages/create-objectstack/src/templates/blank/objectstack.config.ts` (the `data: [articles]` key a new project starts with, beside barrel imports equal to `os init`'s); `packages/create-objectstack/src/blank-template-starter-parity.test.ts` (the new seed pair); `packages/cli/test/create-objectstack-stack-reach.test.ts` (the object count). **Two-minute check**: `pnpm --filter create-objectstack exec vitest run src/blank-template-starter-parity.test.ts` shows 13 passed. ## Verification All readings at head 7e469db (after merging `origin/main` at 16f132f), on a fresh `create-objectstack` build (`dist` removed first: the on-ramp e2e tests scaffold from the built `dist/templates`, and the build does not delete directories removed from `src`). <details><summary>Local runs</summary> - `pnpm --filter @objectstack/example-starter validate`: Validation passed (3 Objects, 3 Views, 1 Dashboard). `typecheck`: exit 0. `test`: Test Files 2 passed, Tests 14 passed. - `pnpm --filter create-objectstack typecheck`: exit 0. `test`: Test Files 26 passed, Tests 408 passed. - `objectstack validate` on the blank template: Validation passed (3 Objects, 3 Views). - The template's `starter.test.ts` against workspace source (scratch vitest config aliasing `@objectstack/verify` and `@objectstack/spec` to `src`): Tests 4 passed. - `pnpm --filter @objectstack/cli test` (the unit and integration tiers PR CI runs): Test Files 680 passed, 2 skipped; Tests 8514 passed, 10 skipped. - Nightly tier (`OS_TEST_TIERS=nightly`), every CLI e2e that scaffolds through the on-ramp: `generate-scaffold-gates`, `starter-field-consumers`, `serve-boot-diagnostics-noise-budget`, `scaffold-emission-policy`: Test Files 4 passed, Tests 92 passed. - `node scripts/pm/dispatch-gates.mjs --commands` derived 67 families; all 67 exit 0 (`check:i18n-coverage`: OK, none new; `check:dual-build-cjs-loads` and `check:type-check-debt` after building their prerequisites). `--ran`: 67 derived, 67 run, 0 NOT-MEASURED, 0 UNRUN. Derived against merge base 16f132f with no staleness warning; `origin/main` has since moved 8 commits (70d2d48), none touching this PR's 26 files; CI reads the current one. - `git grep -n "knowledge_source\|knowledgeSources"` over both apps prints nothing. - CI families: read from this PR's check-runs. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 91fc398 commit 65d9617

26 files changed

Lines changed: 797 additions & 62 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/example-starter': patch
3+
'create-objectstack': patch
4+
---
5+
6+
feat(example-starter, create-objectstack): help articles in the Starter app and the blank template
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The Starter app and the project `npm create objectstack` scaffolds now start with help articles: an Article object (`biz_article` in the Starter, `<namespace>_article` in a new project) with a title, a Markdown body, a category (How-to, FAQ, Reference) and a status (Draft by default, Published), a grid of every article, an Articles entry in the menu between Contacts and Tasks, and four sample articles of generic office help (setting up a laptop, a Wi-Fi and printing FAQ, a meeting rooms reference, and a draft on sharing files). Each sample body opens with the article's title as a `#` heading, then one `##` section per topic. The Starter labels the articles in English and Simplified Chinese; a new project's labels are the English ones in its source. A new project also gains `src/data/`, the sample rows seeded on each boot, listed by name in `data` in `objectstack.config.ts`. Neither app declares a knowledge source.

‎examples/app-starter/README.md‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
# @objectstack/example-starter — Starter app
22

33
A small, complete app an organization installs and then makes its own:
4-
companies, the people at them, and the platform's tasks and notes in one menu.
4+
companies, the people at them, help articles, and the platform's tasks and
5+
notes in one menu.
56

67
- `src/objects/` — `biz_company` (name, type, industry, website, phone,
78
address) and `biz_contact` (name, company, job title, influence, email,
89
phone). A contact is a person outside the organization, never a user.
9-
- `src/views/` — a grid and a board for each object. The create and edit form
10-
is each object's `fieldGroups`; the company's record page lists its contacts.
11-
- `src/apps/` — the menu: companies, contacts, tasks (`sys_task`), notes
10+
`biz_article` (title, Markdown body, category, status) holds help articles:
11+
how-tos, common questions and reference pages.
12+
- `src/views/` — a grid and a board for companies and for contacts, a grid of
13+
articles. The create and edit form is each object's `fieldGroups`; the
14+
company's record page lists its contacts.
15+
- `src/apps/` — the menu: companies, contacts, articles, tasks (`sys_task`), notes
1216
(`sys_note`), and the overview dashboard. Tasks and notes are platform
1317
objects every environment carries; this package declares no copy of them.
1418
- `src/datasets/`, `src/dashboards/` — one overview dashboard.
15-
- `src/data/` — five sample companies and six sample contacts.
19+
- `src/data/` — five sample companies, six sample contacts, and four help
20+
articles (setting up a laptop, a Wi-Fi and printing FAQ, a meeting rooms
21+
reference, and a draft on sharing files).
1622
- `src/translations/` — English and Simplified Chinese.
1723

1824
The API names carry the `biz_` namespace, so a tenant can install this
1925
starter beside a CRM package without a name clash. Uninstalling the package
20-
removes companies and contacts; tasks and notes stay.
26+
removes companies, contacts and articles; tasks and notes stay.
2127

2228
## How to run
2329

‎examples/app-starter/objectstack.config.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ import * as translations from './src/translations/index.js';
1111
import { StarterSeedData } from './src/data/index.js';
1212

1313
/**
14-
* Starter app — companies and the people at them, with the platform's tasks
15-
* and notes in the same menu.
14+
* Starter app — companies and the people at them, and help articles, with the
15+
* platform's tasks and notes in the same menu.
1616
*
17-
* A small, complete app an organization installs and then makes its own: two
18-
* objects (`biz_company`, `biz_contact`), a grid and a board for each,
19-
* the company's contacts on its record page, sample rows, and one dashboard.
17+
* A small, complete app an organization installs and then makes its own:
18+
* companies and contacts (`biz_company`, `biz_contact`) with a grid and a
19+
* board for each and the company's contacts on its record page, help articles
20+
* (`biz_article`) with a grid, sample rows, and one dashboard.
2021
* Tasks and notes are not part of the package: the menu points at the
2122
* platform's `sys_task` and `sys_note`, so they stay when the package goes.
2223
*/

‎examples/app-starter/src/apps/starter.app.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { App } from '@objectstack/spec/ui';
44

55
/**
6-
* The starter's menu: the package's companies and contacts, then the
7-
* platform's tasks and notes, then the overview dashboard.
6+
* The starter's menu: the package's companies, contacts and help articles,
7+
* then the platform's tasks and notes, then the overview dashboard.
88
*
99
* Tasks and notes are the platform objects `sys_task` and `sys_note`, which
1010
* every environment carries; the package declares no copy of them, so
@@ -22,6 +22,7 @@ export const StarterApp = App.create({
2222
navigation: [
2323
{ id: 'nav_companies', type: 'object', objectName: 'biz_company', icon: 'building-2' },
2424
{ id: 'nav_contacts', type: 'object', objectName: 'biz_contact', icon: 'contact' },
25+
{ id: 'nav_articles', type: 'object', objectName: 'biz_article', icon: 'book-open' },
2526
// `requiresObject` names the object again because `defineStack` refuses a
2627
// menu entry for an object the stack does not declare unless the entry
2728
// says the object comes from elsewhere — here, the platform.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
// Sample help articles, generic office help rather than policy text. Business
4+
// data like the companies and contacts (`index.ts`): no `mode`, so a replay
5+
// inserts a missing article and leaves an existing one as the organization
6+
// left it.
7+
//
8+
// Each `body` is Markdown in one shape, readable section by section: the
9+
// title as a `#` heading, then 3 to 6 `##` sections, each with its own text
10+
// and under 800 characters with its heading; the reference article carries a
11+
// table followed by a one-line note. `test/help-articles-38372.test.ts` holds
12+
// every article to that shape, and the blank template in create-objectstack
13+
// carries the same seed (its parity test compares the two).
14+
15+
import { defineSeed } from '@objectstack/spec/data';
16+
import { Article } from '../objects/article.object.js';
17+
18+
export const articles = defineSeed(Article, {
19+
externalId: 'title',
20+
records: [
21+
{
22+
title: 'Set up your new laptop',
23+
category: 'how_to',
24+
status: 'published',
25+
body: `# Set up your new laptop
26+
27+
## Before you start
28+
29+
Have your work email address and the temporary password from your welcome message at hand. Plug the laptop into power: the first start installs updates and can take up to half an hour.
30+
31+
## Sign in for the first time
32+
33+
Choose your language and keyboard, join the office Wi-Fi, then sign in with your work email and the temporary password. You are asked to choose a new password straight away; pick one you have not used anywhere else.
34+
35+
## Install the apps you need
36+
37+
Open the company app store from the start menu. Email, calendar, chat and the office suite install on their own; anything your team uses on top of that is listed under your department. Ask your manager if an app you need is missing.
38+
39+
## Turn on backup
40+
41+
Sign in to the file storage app and let it back up your Desktop and Documents folders. Files saved there follow you to a new laptop and can be restored if this one is lost.
42+
43+
## Get help
44+
45+
If something does not work, write to the IT help desk with the laptop's name, which is on the sticker underneath, and a screenshot of any error.`,
46+
},
47+
{
48+
title: 'Wi-Fi and printing FAQ',
49+
category: 'faq',
50+
status: 'published',
51+
body: `# Wi-Fi and printing FAQ
52+
53+
## How do I join the office Wi-Fi?
54+
55+
Pick the network named Office and sign in with your work email and password. Guests use the Office-Guest network; its password is on the card at reception and changes every Monday.
56+
57+
## Why does the Wi-Fi keep dropping?
58+
59+
Most drops happen when a laptop moves between floors. Turn Wi-Fi off and on again, and forget any old office network your laptop still remembers. If it keeps happening at one desk, tell the help desk which desk it is.
60+
61+
## How do I add a printer?
62+
63+
Open the printer settings, choose Add printer and pick the one whose name matches the label on the machine. Printers are named by floor, so the second-floor printer starts with F2.
64+
65+
## Why is my print job stuck?
66+
67+
A job usually waits because the printer is out of paper or needs a release at the machine. Tap your badge on the printer to release your jobs. Jobs that are not released within a day are deleted.
68+
69+
## Can I print from my phone?
70+
71+
Yes. Email the file from your work account to the print address shown on the printer's screen, then release it with your badge as usual.`,
72+
},
73+
{
74+
title: 'Meeting rooms reference',
75+
category: 'reference',
76+
status: 'published',
77+
body: `# Meeting rooms reference
78+
79+
## Rooms at a glance
80+
81+
| Room | Floor | Seats | Equipment |
82+
| --- | --- | --- | --- |
83+
| Harbor | 1 | 4 | Screen |
84+
| Summit | 2 | 8 | Screen, video bar, whiteboard |
85+
| Grove | 2 | 12 | Projector, video bar |
86+
| Atrium | 3 | 20 | Projector, microphones |
87+
88+
Seat counts are for seated meetings; a short stand-up fits a few more people.
89+
90+
## Booking a room
91+
92+
Book rooms from your calendar by adding the room as a guest. A booking longer than two hours, or one that repeats every week, needs a reason in the invitation so others know whether to ask for the room.
93+
94+
## Video calls
95+
96+
Rooms with a video bar join a call from the calendar invitation: press Join on the room's touch panel. In other rooms, connect your laptop to the screen with the cable on the table.
97+
98+
## Leaving the room
99+
100+
End the meeting on time, wipe the whiteboard, and take your cups with you. If you finish early, release the room from your calendar so someone else can use it.`,
101+
},
102+
{
103+
title: 'Share files with your team',
104+
category: 'how_to',
105+
status: 'draft',
106+
body: `# Share files with your team
107+
108+
## Pick the right place
109+
110+
Keep files your whole team works on in the team's shared folder, not in your own. A file in a shared folder stays with the team when someone leaves or changes roles.
111+
112+
## Share a file or folder
113+
114+
Right-click the file in the file storage app, choose Share, and add people by name or add the whole team. Each person gets an email with a link.
115+
116+
## Choose who can edit
117+
118+
Give edit access to the people who will change the file and view access to everyone else. Links that anyone can open are turned off for files that hold customer details.
119+
120+
## Stop sharing
121+
122+
Open Share again and remove a person, or change their access to view only. Review who has access to a folder when a project ends.`,
123+
},
124+
],
125+
});

‎examples/app-starter/src/data/index.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import { defineSeed } from '@objectstack/spec/data';
44
import { Company } from '../objects/company.object.js';
55
import { Contact } from '../objects/contact.object.js';
6+
import { articles } from './articles.js';
67

78
// Sample data, so the menu, the boards and the dashboard have something to
8-
// show on first open. Business data: no `mode`, so a replay (each boot, an
9-
// install or upgrade) inserts a missing row and leaves an existing one as the
10-
// organization left it. Delete the rows, or the whole package, when they are
9+
// show on first open; the help articles are in `articles.ts`. Business data:
10+
// no `mode`, so a replay (each boot, an install or upgrade) inserts a missing
11+
// row and leaves an existing one as the organization left it. Delete the rows, or the whole package, when they are
1112
// no longer wanted.
1213

1314
const companies = defineSeed(Company, {
@@ -33,4 +34,4 @@ const contacts = defineSeed(Contact, {
3334
],
3435
});
3536

36-
export const StarterSeedData = [companies, contacts];
37+
export const StarterSeedData = [companies, contacts, articles];
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import { ObjectSchema, Field } from '@objectstack/spec/data';
4+
5+
/**
6+
* A help article — a how-to guide, an answer to a common question, or a
7+
* reference page — written in Markdown.
8+
*
9+
* `body` opens with the article's title as a `#` heading, then one `##`
10+
* section per topic, each with its own text: the seed articles in
11+
* `src/data/articles.ts` are written that way. A draft stays a draft until
12+
* someone sets it to Published.
13+
*/
14+
export const Article = ObjectSchema.create({
15+
name: 'biz_article',
16+
// Shared inside the organization, as the companies and contacts are.
17+
sharingModel: 'public_read_write',
18+
label: 'Article',
19+
pluralLabel: 'Articles',
20+
icon: 'book-open',
21+
color: 'amber',
22+
description: 'A help article: a how-to guide, a common question, or a reference page.',
23+
nameField: 'title',
24+
highlightFields: ['category', 'status', 'owner_id'],
25+
26+
fields: {
27+
title: Field.text({
28+
label: 'Title',
29+
required: true,
30+
searchable: true,
31+
maxLength: 200,
32+
}),
33+
body: Field.markdown({
34+
label: 'Body',
35+
}),
36+
category: Field.select({
37+
label: 'Category',
38+
options: [
39+
{ label: 'How-to', value: 'how_to', color: '#3B82F6' },
40+
{ label: 'FAQ', value: 'faq', color: '#10B981' },
41+
{ label: 'Reference', value: 'reference', color: '#8B5CF6' },
42+
],
43+
}),
44+
status: Field.select({
45+
label: 'Status',
46+
options: [
47+
{ label: 'Draft', value: 'draft', color: '#6B7280', default: true },
48+
{ label: 'Published', value: 'published', color: '#10B981' },
49+
],
50+
}),
51+
},
52+
53+
// The one Details section of the record page and of the create and edit form.
54+
fieldGroups: [
55+
{ key: 'basic', label: 'Article', fields: ['title', 'category', 'status', 'body'] },
56+
],
57+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

3+
export { Article } from './article.object.js';
34
export { Company } from './company.object.js';
45
export { Contact } from './contact.object.js';

‎examples/app-starter/src/translations/starter.translation.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ export const StarterTranslationBundle = defineTranslationBundle({
3939
owner_id: { label: 'Owner' },
4040
},
4141
},
42+
biz_article: {
43+
label: 'Article',
44+
pluralLabel: 'Articles',
45+
fields: {
46+
title: { label: 'Title' },
47+
body: { label: 'Body' },
48+
category: { label: 'Category' },
49+
status: { label: 'Status' },
50+
owner_id: { label: 'Owner' },
51+
},
52+
},
4253
},
4354
apps: {
4455
biz_app: {
@@ -130,6 +141,37 @@ export const StarterTranslationBundle = defineTranslationBundle({
130141
more: { label: '更多' },
131142
},
132143
},
144+
biz_article: {
145+
label: '知识文章',
146+
pluralLabel: '知识文章',
147+
description: '帮助文章:操作指南、常见问题或参考资料。',
148+
fields: {
149+
title: { label: '标题' },
150+
body: { label: '正文' },
151+
category: {
152+
label: '分类',
153+
options: {
154+
how_to: '操作指南',
155+
faq: '常见问题',
156+
reference: '参考资料',
157+
},
158+
},
159+
status: {
160+
label: '状态',
161+
options: {
162+
draft: '草稿',
163+
published: '已发布',
164+
},
165+
},
166+
owner_id: { label: '负责人' },
167+
},
168+
_views: {
169+
all: { label: '全部文章' },
170+
},
171+
_sections: {
172+
basic: { label: '文章' },
173+
},
174+
},
133175
},
134176
apps: {
135177
biz_app: {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import { defineView } from '@objectstack/spec';
4+
5+
/**
6+
* Article list view: a grid of every help article with its category and
7+
* status.
8+
*
9+
* No `form` here: the Console's create and edit form lays a record out by the
10+
* object's `fieldGroups` (`article.object.ts`), and a declared default form is
11+
* not loaded there.
12+
*/
13+
export const ArticleViews = defineView({
14+
list: {
15+
label: 'All Articles',
16+
type: 'grid',
17+
data: { provider: 'object', object: 'biz_article' },
18+
columns: [
19+
{ field: 'title' },
20+
{ field: 'category' },
21+
{ field: 'status' },
22+
],
23+
},
24+
listViews: {
25+
all: {
26+
label: 'All Articles',
27+
type: 'grid',
28+
data: { provider: 'object', object: 'biz_article' },
29+
columns: [
30+
{ field: 'title' },
31+
{ field: 'category' },
32+
{ field: 'status' },
33+
],
34+
},
35+
},
36+
});

0 commit comments

Comments
 (0)