@commercetools-frontend-extensions/export-resources-modal 3.5.1 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,6 +69,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
69
69
  type:{
70
70
  key: 'general-category-attributes',
71
71
  label: 'General category attributes',
72
+ resourceTypeIds: ['category'],
72
73
  },
73
74
  fields: [
74
75
  {
@@ -85,6 +86,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
85
86
  type:{
86
87
  key: 'book-category-attributes',
87
88
  label: 'Book category attributes',
89
+ resourceTypeIds: ['category', 'asset'],
88
90
  },
89
91
  fields: [
90
92
  {
@@ -153,6 +155,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
153
155
  type:{
154
156
  key: 'general-category-attributes',
155
157
  label: 'General category attributes',
158
+ resourceTypeIds: ['category'],
156
159
  },
157
160
  fields: [
158
161
  {
@@ -169,6 +172,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
169
172
  type:{
170
173
  key: 'book-category-attributes',
171
174
  label: 'Book category attributes',
175
+ resourceTypeIds: ['category', 'asset'],
172
176
  },
173
177
  fields: [
174
178
  {
@@ -195,29 +199,30 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
195
199
 
196
200
  ## Properties
197
201
 
198
- | Props | Type | Required | Default | Description |
199
- | ------------------------------- | ------------------------------------------------------- | :--------------------------------------------------: | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
200
- | `isOpen` | `boolean` | | `false` | Controls whether the export modal is open or closed |
201
- | `outputFormat` | `string`<br/>Possible values: `csv`, `json` | | `csv` | The file format to export |
202
- | `onExportSuccess` | `function` | | | Callback function that is called when the export operation is successful |
203
- | `onClose` | `function` | | | Callback function invoked when the modal is requested to close (on overlay click, close button click or `ESC` press). This function is also called after an export operation regardless of its success or failure |
204
- | `resourceType` | `string` | ✅ | | The type of the resource, example: `category`, `product`... |
205
- | `totalResourcesCount` | `Number` | (✅) Required only if the `exportType` is `all` | | The count of all resources of identified `resourceType` |
206
- | `exportType` | `string` <br/>Possible values:<br/>`all` and `selected` | | `all` | The type of export, so either export `all` resources or export only `selected` resources |
207
- | `selectedResourceIds` | `array` | (✅) Required only if the `exportType` is `selected` | | Array of Ids of the selected resources |
208
- | `fields` | `array` | ✅ | | Array of the fields to export. The fields must align with the [commercetools API schema](https://docs.commercetools.com/api/) |
209
- | `fields[].name` | `string` | ✅ | | A string that represents the unique identifier for each field |
210
- | `fields[].label` | `string` | ✅ | | The label of the field to be shown in the export modal |
211
- | `fields[].isRequired` | `boolean` | | `false` | `isRequired` field indicates whether a field is required for the export process. If `true` the field will be selected by default and cannot be deselected by the user. This is useful for fields that are essential for the export process. Fields marked as required will have a `*` appended to their label in the UI |
212
- | `fields[].isSelectedByDefault` | `boolean` | | `true` | This field is a part of the `fields` array is used to control the default state of the corresponding checkbox in the UI. If `isSelectedByDefault` is set to true, the checkbox for that particular field will be checked by default when the component loads. The default value of this attribute is `true` which means unless explicitly set to `false`, the checkbox for the field will be checked on initial load. |
213
- | `customFields` | `array` | | | Array of objects, each representing a group of custom fields defined under a specific type. |
214
- | `customFields[].type` | `string` | | | The type object. |
215
- | `customFields[].type.key` | `string` | | | The unique identifier for the type. |
216
- | `customFields[].type.label` | `string` | | | The label of the type to be shown in the export modal. |
217
- | `customFields[].fields` | `array` | | | An array of objects with custom fields defined under the type represented by `type.key`. |
218
- | `customFields[].fields[].name` | `string` | | | The name of the custom field. |
219
- | `customFields[].fields[].label` | `string` | | | The label of the custom field to be shown in the export modal. This should match the label of the custom field in the selected locale. |
220
- | `renderProperties` | `function` | | | A prop to render properties that are resource-specific |
202
+ | Props | Type | Required | Default | Description |
203
+ | ------------------------------------- | ------------------------------------------------------- | :--------------------------------------------------: | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
204
+ | `isOpen` | `boolean` | | `false` | Controls whether the export modal is open or closed |
205
+ | `outputFormat` | `string`<br/>Possible values: `csv`, `json` | | `csv` | The file format to export |
206
+ | `onExportSuccess` | `function` | | | Callback function that is called when the export operation is successful |
207
+ | `onClose` | `function` | | | Callback function invoked when the modal is requested to close (on overlay click, close button click or `ESC` press). This function is also called after an export operation regardless of its success or failure |
208
+ | `resourceType` | `string` | ✅ | | The type of the resource, example: `category`, `product`... |
209
+ | `totalResourcesCount` | `number` | (✅) Required only if the `exportType` is `all` | | The count of all resources of identified `resourceType` |
210
+ | `exportType` | `string` <br/>Possible values:<br/>`all` and `selected` | | `all` | The type of export, so either export `all` resources or export only `selected` resources |
211
+ | `selectedResourceIds` | `array` | (✅) Required only if the `exportType` is `selected` | | Array of Ids of the selected resources |
212
+ | `fields` | `array` | ✅ | | Array of the fields to export. The fields must align with the [commercetools API schema](https://docs.commercetools.com/api/) |
213
+ | `fields[].name` | `string` | ✅ | | A string that represents the unique identifier for each field |
214
+ | `fields[].label` | `string` | ✅ | | The label of the field to be shown in the export modal |
215
+ | `fields[].isRequired` | `boolean` | | `false` | `isRequired` field indicates whether a field is required for the export process. If `true` the field will be selected by default and cannot be deselected by the user. This is useful for fields that are essential for the export process. Fields marked as required will have a `*` appended to their label in the UI |
216
+ | `fields[].isSelectedByDefault` | `boolean` | | `true` | This field is a part of the `fields` array is used to control the default state of the corresponding checkbox in the UI. If `isSelectedByDefault` is set to true, the checkbox for that particular field will be checked by default when the component loads. The default value of this attribute is `true` which means unless explicitly set to `false`, the checkbox for the field will be checked on initial load. |
217
+ | `customFields` | `array` | | | Array of objects, each representing a group of custom fields defined under a specific type. |
218
+ | `customFields[].type` | `string` | | | The type object. |
219
+ | `customFields[].type.key` | `string` | | | The unique identifier for the type. |
220
+ | `customFields[].type.label` | `string` | | | The label of the type to be shown in the export modal. |
221
+ | `customFields[].type.resourceTypeIds` | `string[]` | | | An array of [resource type IDs](https://docs.commercetools.com/api/projects/types#ctp:api:type:ResourceTypeId) for which the type is defined. |
222
+ | `customFields[].fields` | `array` | | | An array of objects with custom fields defined under the type represented by `type.key`. |
223
+ | `customFields[].fields[].name` | `string` | | | The name of the custom field. |
224
+ | `customFields[].fields[].label` | `string` | | | The label of the custom field to be shown in the export modal. This should match the label of the custom field in the selected locale. |
225
+ | `renderProperties` | `function` | | | A prop to render properties that are resource-specific |
221
226
 
222
227
  ## Releasing
223
228