Ui5 Best Practices Integration Cards

作者 UI5a99b882ce364無授權條款收錄於 2026年10月8日更新於 2026年10月8日

MUST be loaded before any UI Integration Cards (also called UI5 Integration Cards) task — creating, modifying, validating, previewing, or reviewing a card, its `manifest.json`, its Configuration Editor (`dt/Configuration.js`), or any analytical chart configuration. Provides the official guidelines, validation rules, supported chart types, and Configuration Editor patterns.

AI 產生的概覽

用於建置、驗證與預覽 SAP UI5 整合卡片及其資訊清單的準則與驗證規則。

功能
提供代理在建立、修改、驗證、預覽或審查 UI 整合卡片時必須遵循的規則。內容涵蓋 manifest.json 結構、資料放置、參數與目的地綁定語法、i18n、驗證步驟、預覽設定、設定編輯器模式以及分析圖表設定。兩個參考檔案分別提供圖表類型目錄與成對的設定編輯器範例。
適用情境
在涉及 UI 整合卡片的任何工作之前使用,包括建立或編輯卡片、其 manifest.json、其 dt/Configuration.js 編輯器或分析圖表設定。也適用於驗證或預覽現有卡片。
執行需求
僅為指示性內容,未隨附指令碼。它引用兩個隨附的 Markdown 參考檔案,並需要名為 create_integration_card 與 run_manifest_validation 的 MCP 工具,以及用於預覽卡片的 http 伺服器。

Best practices for UI Integration Cards development

Rules an agent must follow when creating, modifying, validating, or previewing a UI Integration Card. Adherence is critical for working cards.

When to load each reference

TriggerLoad
Working on or planning an Analytical cardreferences/analytical_chart_types.md [blocked]
dt/Configuration.js exists, is being created, or is being modifiedreferences/configuration_editor_example.md [blocked]

If the trigger applies, load before producing any output. Do not work from memory.

1. Core rules

RuleDetail
Prefer declarative cardsTypes: List, Table, Calendar, Timeline, Object, Analytical. Create an Extension only in exceptional cases.
Use create_integration_card MCP toolWhen creating a new declarative card.
Parameter binding syntax{parameters>/parameterKey/value} — single braces, > separator, value suffix.
Destination binding syntax{{destinations.destinationName}} — double braces, dot. Configure under sap.card/configuration/destinations/. Reference by name; never replace with raw URL.
Use destinations for service URLsWrap every external service URL in a destination under sap.card/configuration/destinations/ and reference it as {{destinations.name}}.
i18n bindingBind every non-data, user-visible string to the i18n model.
LinksUse the actions property; never inline <a> or hand-rolled URL handlers.
Validate before declaring doneSee 3. Validation.
Show preview when requestedSee 4. Preview.
Don't modify provided dataUse it as supplied.
JSON responses onlyThe endpoint behind sap.card/data/request must return JSON. For OData services, append $format=json to the request URL or parameters.

2. Data placement

sap.card/data/ is the only correct top-level location for the data request.

PathPurpose
sap.card/data/pathPrimary data path
sap.card/content/data/pathContent-specific path; overrides the primary path if set
sap.card/header/data/pathHeader-specific path; overrides the primary path if set

Forbidden: putting the request itself under sap.card/content/data/ or sap.card/header/data/.

Symptom — "No data to display": typically caused by a content/data block that overrides the primary data path. Verify 2. Data placement before debugging anything else.

3. Validation

RuleDetail
Valid JSONmanifest.json must parse.
sap.app/typeMust be "card".
Schema validationUse run_manifest_validation MCP tool.
No deprecated propertiesIn manifest.json or elsewhere.
Not a UI5 projectExcept for Component-type cards.

4. Preview

If asked to preview, first check the card folder for an existing preview entry point — package.json start script, README.md, or an existing HTML file. Reuse it if present. Otherwise create an HTML page with a <ui-integration-card> element pointing at the manifest, and serve via an http server.

5. Configuration Editor

The editor lets the Administrator, Page/Content Administrator, and Translator personas customize a card without editing manifest.json directly.

Two pieces:

  1. dt/Configuration.js — exports a function that returns new Designtime({ form: {...} }).
  2. manifest.json — references the file at sap.card/configuration/editor.

Design as the Administrator persona.

RuleDetail
Mirror the manifestEditor reflects the current structure and parameters of manifest.json exactly. manifestpath can target any existing path — a configuration/parameters/*/value for parameterized fields, or a direct path like /sap.card/header/icon/shape for static manifest properties.
All existing fields editableTitle, subtitle, header icon, parameters — make them configurable.
Ask the userBefore deciding which fields to expose, ask: "Make all manifest fields editable? Anything else to add?"
No invented fieldsNever add an editor field that does not exist in manifest.json.
Keep in syncAdd to or remove from the editor when adding to or removing from manifest.json.

Load references/configuration_editor_example.md [blocked] for the canonical paired example.

6. Analytical cards

Load references/analytical_chart_types.md [blocked] for the full chart-type catalog (UIDs and per-type examples).

RuleDetail
Set chartTypesap.card/content/chartType is required.
Match feeds to chart typemeasures, dimensions, and feeds must match the UIDs the chart type expects. The reference file lists them per chart.
Each feed needs three keystype (Dimension|Measure), uid, values.
chartPropertiesUse it for labels, colors, legend, etc. Do not invent keys. Omit entirely if defaults are fine.

Minimal feeds example (donut/pie):

json
"feeds": [  { "type": "Dimension", "uid": "color", "values": ["Store Name"] },  { "type": "Measure", "uid": "size", "values": ["Revenue"] }]

7. Card Explorer (reference)

來源與署名

來源:UI5/plugins-coding-agents位於plugins/ui5/skills/ui5-best-practices-integration-cards提交a99b882

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架