Skip to content

Commit 123a563

Browse files
authored
Merge branch 'main' into kh-asc-intro
2 parents 21e4adc + 006708b commit 123a563

File tree

8 files changed

+191
-9
lines changed

8 files changed

+191
-9
lines changed

src/data/navigation/header.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ module.exports = [
33
title: "Extensibility",
44
path: "/",
55
},
6+
{
7+
title: "App Development",
8+
path: "/app-development"
9+
},
610
{
711
title: "Admin UI SDK",
812
path: "/admin-ui-sdk/",

src/data/navigation/sections/admin-ui-sdk.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module.exports = [
1212
path: "/admin-ui-sdk/configuration.md"
1313
},
1414
{
15-
title: "App development",
16-
path: "/admin-ui-sdk/app-development.md"
15+
title: "App registration",
16+
path: "/admin-ui-sdk/app-registration.md"
1717
},
1818
{
1919
title: "MenuApp component",
@@ -23,6 +23,10 @@ module.exports = [
2323
title: "PageApp component",
2424
path: "/admin-ui-sdk/reference/page-app.md"
2525
},
26+
{
27+
title: "Troubleshooting",
28+
path: "/admin-ui-sdk/troubleshooting.md"
29+
},
2630
{
2731
title: "Release notes",
2832
path: "/admin-ui-sdk/release-notes.md"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = [
2+
{
3+
title: "Overview",
4+
path: "/app-development/index.md",
5+
}
6+
];

src/data/navigation/sections/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
const appdev = require("./app-development");
12
const adminuisdk = require("./admin-ui-sdk");
23
const amazon = require("./amazon-sales-channel");
34

4-
module.exports = [...adminuisdk, ...amazon];
5+
module.exports = [...appdev, ...adminuisdk, ...amazon];

src/pages/admin-ui-sdk/app-development.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
title: App registration
3+
description: Learn about registering your app in the App Registry
4+
---
5+
6+
# App registration
7+
8+
When the application on App Builder is ready to be published, a registration to the Adobe Registry is required to add a menu in the Admin Panel.
9+
10+
## Add or update the `install.yml` file
11+
12+
Create an `install.yml` file in the root of your project.
13+
14+
Make sure you target the correct `extensionPointId`: `commerce/backend-ui/1`
15+
16+
```yaml
17+
$schema: http://json-schema.org/draft-07/schema
18+
$id: https://adobe.io/schemas/app-builder-templates/1
19+
20+
categories:
21+
- action
22+
- ui
23+
24+
extensions:
25+
- extensionPointId: commerce/backend-ui/1
26+
```
27+
28+
## Create or update the `extension-manifest.json` file
29+
30+
Create or update your project `extension-manifest.json` file so that it is similar to the following:
31+
32+
```json
33+
{
34+
"name": "commerce-first-app",
35+
"displayName": "Commerce First App on App Builder",
36+
"description": "Commerce First App on App Builder",
37+
"platform": "web",
38+
"id": "commerce-first-app",
39+
"version": "1.0.0"
40+
}
41+
```
42+
43+
## Add an `ExtensionRegistration` component
44+
45+
Create an `ExtensionRegistration` component that registers the menu configuration in the App Registry. Use the `adobe/uix-sdk` with the `adobe-uix-guest` dependency. The [UI Extensibility](https://developer.adobe.com/uix/docs/overview/design/) Guide describes this process further.
46+
47+
1. Add the `uix-guest` dependency in the `package.json`.
48+
49+
```json
50+
"@adobe/uix-guest": "^<latest-version>"
51+
```
52+
53+
2. Run `npm install`.
54+
55+
```bash
56+
npm install
57+
```
58+
59+
3. Create an `ExtensionRegistration.js` file as follows:
60+
61+
```javascript
62+
import { register } from '@adobe/uix-guest';
63+
64+
export default function ExtensionRegistration() {
65+
init().catch(console.error);
66+
return <></>;
67+
}
68+
69+
const extensionId = 'commerce-first-app'
70+
71+
const init = async () => {
72+
await register({
73+
id: extensionId,
74+
debug: false,
75+
methods: {
76+
extension: {
77+
getId() {
78+
return 'commerce-first-app';
79+
}
80+
},
81+
menu: {
82+
getItems() {
83+
return [
84+
{
85+
id: 'ext_page',
86+
title: 'First App on App Builder',
87+
action: `uixpage/index/index/uix-ext/${extensionId}`,
88+
parent: 'Magento_Backend::marketing',
89+
},
90+
];
91+
},
92+
},
93+
page: {
94+
getTitle() {
95+
return 'Commerce First App on App Builder';
96+
},
97+
},
98+
},
99+
}
100+
);
101+
};
102+
```
103+
104+
Upon registration, the `extension:getId`, `menu:getItems`, and `page:getTitle` methods should be defined for the app.
105+
106+
In this example, the merchant accesses the custom menu from the **Marketing** menu in the Commerce Admin. The title displayed in the menu is defined in `getItems`, whereas the title displayed on page load is defined in `getTitle`.
107+
108+
## Update the `App.js` routing
109+
110+
Add the following route to your `App.js` file to define the correct routing to your app:
111+
112+
```javascript
113+
<Route path={'index.html'} element={<ExtensionRegistration />} />
114+
```
115+
116+
Make sure that your main page is correctly routed to the index. Here is an example of the first app routing in the `App.js` component:
117+
118+
```javascript
119+
<ErrorBoundary onError={onError} FallbackComponent={fallbackComponent}>
120+
<BrowserRouter>
121+
<Provider theme={lightTheme} colorScheme={'light'}>
122+
<Routes>
123+
<Route path={'index.html'} element={<ExtensionRegistration />} />
124+
<Route index element={<MainPage runtime={props.runtime} ims={props.ims} />} />
125+
</Routes>
126+
</Provider>
127+
</BrowserRouter>
128+
</ErrorBoundary>
129+
```
130+
131+
## Update the `app.config.yaml` file
132+
133+
Update the `app.config.yaml` [configuration file](https://developer.adobe.com/app-builder/docs/guides/configuration/) as follows:
134+
135+
```yaml
136+
extensions:
137+
commerce/backend-ui/1:
138+
$include: ext.config.yaml
139+
```
140+
141+
This file now declares extensions and redirects to an `ext.config.yaml` file.
142+
143+
## Add or update the `ext.config.yaml`
144+
145+
Your extension configuration file should look like this:
146+
147+
```yaml
148+
operations:
149+
view:
150+
- type: web
151+
impl: index.html
152+
actions: actions
153+
web: web-src
154+
runtimeManifest:
155+
packages:
156+
SampleExtension:
157+
license: Apache-2.0
158+
actions:
159+
```
160+
161+
Complete this file with the actions from your app.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Troubleshooting
3+
description:
4+
---
5+
6+
# Troubleshooting

src/pages/app-development/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Adobe Commerce App Developer Guide Overview
3+
description:
4+
---
5+
6+
# Adobe Commerce App Developer Guide Overview

0 commit comments

Comments
 (0)