Skip to content

Commit 791c03f

Browse files
authored
chore: minor package doc fixes (#183)
* chore: minor package doc fixes * chore: fix example in ecommerce usage docs * chore: add sentence to explain what the libraries actually implement
1 parent 2c91623 commit 791c03f

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

Diff for: packages/dam-app-base/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
`@contentful/dam-app-base` is a library that helps you to quickly build an app to integrate your DAM (Digital Asset Management) system of choice with Contentful. Many DAM integrations are very similar, therefore this library provides the boilerplate for your app and you only need to add the code for your specific service.
66

7+
This library creates an app that can be used in the entry field location to select assets from your DAM service. The library also provides a configuration screen for easy customization.
8+
79
## Usage
810

911
```javascript

Diff for: packages/dam-app-base/docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ You probably want to call [`sdk.openCurrentApp`](https://www.contentful.com/deve
8686

8787
**`example`**
8888
```javascript
89-
function openDialog(sdk, currentValue, config) {
89+
async function openDialog(sdk, currentValue, config) {
9090
return await sdk.dialogs.openCurrentApp({
9191
parameters: { config, currentValue },
9292
});

Diff for: packages/dam-app-base/src/interfaces.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export type RenderDialogFn = (sdk: DialogExtensionSDK) => void;
100100
*
101101
* @example
102102
* ```javascript
103-
* function openDialog(sdk, currentValue, config) {
103+
* async function openDialog(sdk, currentValue, config) {
104104
* return await sdk.dialogs.openCurrentApp({
105105
* parameters: { config, currentValue },
106106
* });

Diff for: packages/ecommerce-app-base/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
`@contentful/ecommerce-app-base` is a library that helps you to quickly build an app to integrate your e-commerce system of choice with Contentful. Many e-commerce integrations are very similar, therefore this library provides the boilerplate for your app and you only need to add the code for your specific service.
66

7+
This library creates an app which can be used in the entry field location to select stock keeping units (sku) from your e-commerce service. The library also provides a configuration screen for an easy customization.
8+
79
## Usage
810

911
```javascript
@@ -30,7 +32,7 @@ setup({
3032
skus.map(sku => fetch(`https://example.com/products/${sku}`))
3133
);
3234
return responses.map(response => response.json());
33-
}
35+
},
3436
renderDialog: (sdk) => {
3537
const config = sdk.parameters.invocation;
3638

Diff for: packages/ecommerce-app-base/docs/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ___
5050

5151
Function that should return true when the button should be disabled.
5252

53-
**`param`** Currently selected assets
53+
**`param`** Currently selected skus
5454

5555
**`param`** App configuration
5656

@@ -74,13 +74,13 @@ ___
7474

7575
Ƭ **OpenDialogFn**: (`sdk`: FieldExtensionSDK, `currentValue`: *string*[] \| *string*, `config`: [*Config*](README.md#config)) => *Promise*<*string*[]\>
7676

77-
Function that gets called when app wants to open a dialog. Should return an updated list of assets as a Promise.
77+
Function that gets called when app wants to open a dialog. Should return an updated list of skus as a Promise.
7878

7979
You probably want to call [`sdk.openCurrentApp`](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#open-the-current-app-in-a-dialog).
8080

8181
**`example`**
8282
```javascript
83-
function openDialog(sdk, currentValue, config) {
83+
async function openDialog(sdk, currentValue, config) {
8484
return await sdk.dialogs.openCurrentApp({
8585
parameters: { config, currentValue },
8686
});
@@ -90,11 +90,11 @@ function openDialog(sdk, currentValue, config) {
9090

9191
**`param`** (https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/)
9292

93-
**`param`** List of currently selected assets
93+
**`param`** List of currently selected akus
9494

9595
**`param`** App configuration
9696

97-
**`returns`** Promise containing a list of selected assets
97+
**`returns`** Promise containing a list of selected skus
9898

9999
___
100100

Diff for: packages/ecommerce-app-base/docs/interfaces/integration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ ___
100100

101101
**openDialog**: [*OpenDialogFn*](../README.md#opendialogfn)
102102

103-
Function that gets called when app wants to open a dialog. Should return an updated list of assets as a Promise.
103+
Function that gets called when app wants to open a dialog. Should return an updated list of skus as a Promise.
104104

105105
You probably want to call [`sdk.openCurrentApp`](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#open-the-current-app-in-a-dialog).
106106

107107
**`example`**
108108
```javascript
109-
function openDialog(sdk, currentValue, config) {
109+
async function openDialog(sdk, currentValue, config) {
110110
return await sdk.dialogs.openCurrentApp({
111111
parameters: { config, currentValue },
112112
});

Diff for: packages/ecommerce-app-base/src/interfaces.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ export type DeleteFn = (index: number) => void;
114114
export type RenderDialogFn = (sdk: DialogExtensionSDK) => void;
115115

116116
/**
117-
* Function that gets called when app wants to open a dialog. Should return an updated list of assets as a Promise.
117+
* Function that gets called when app wants to open a dialog. Should return an updated list of skus as a Promise.
118118
*
119119
* You probably want to call [`sdk.openCurrentApp`](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#open-the-current-app-in-a-dialog).
120120
*
121121
* @example
122122
* ```javascript
123-
* function openDialog(sdk, currentValue, config) {
123+
* async function openDialog(sdk, currentValue, config) {
124124
* return await sdk.dialogs.openCurrentApp({
125125
* parameters: { config, currentValue },
126126
* });
@@ -129,9 +129,9 @@ export type RenderDialogFn = (sdk: DialogExtensionSDK) => void;
129129
* ```
130130
*
131131
* @param sdk [FieldExtensionSDK](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/)
132-
* @param currentValue List of currently selected assets
132+
* @param currentValue List of currently selected akus
133133
* @param config App configuration
134-
* @returns Promise containing a list of selected assets
134+
* @returns Promise containing a list of selected skus
135135
*/
136136
export type OpenDialogFn = (
137137
sdk: FieldExtensionSDK,
@@ -142,7 +142,7 @@ export type OpenDialogFn = (
142142
/**
143143
* Function that should return true when the button should be disabled.
144144
*
145-
* @param currentValue Currently selected assets
145+
* @param currentValue Currently selected skus
146146
* @param config App configuration
147147
* @returns true, if the button in the field location should be disabled. false, if the button should be enabled
148148
*/
@@ -218,13 +218,13 @@ export interface Integration {
218218
renderDialog: RenderDialogFn;
219219

220220
/**
221-
* Function that gets called when app wants to open a dialog. Should return an updated list of assets as a Promise.
221+
* Function that gets called when app wants to open a dialog. Should return an updated list of skus as a Promise.
222222
*
223223
* You probably want to call [`sdk.openCurrentApp`](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#open-the-current-app-in-a-dialog).
224224
*
225225
* @example
226226
* ```javascript
227-
* function openDialog(sdk, currentValue, config) {
227+
* async function openDialog(sdk, currentValue, config) {
228228
* return await sdk.dialogs.openCurrentApp({
229229
* parameters: { config, currentValue },
230230
* });

0 commit comments

Comments
 (0)