@commercetools-frontend-extensions/export-resources-modal 1.0.5 → 1.0.7
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
|
@@ -35,7 +35,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
|
|
|
35
35
|
{ key: 'externalId' },
|
|
36
36
|
{ key: 'createdAt' },
|
|
37
37
|
{ key: 'lastModifiedAt' },
|
|
38
|
-
{ key: 'name',
|
|
38
|
+
{ key: 'name', isLocalized: true },
|
|
39
39
|
]}
|
|
40
40
|
renderProperties={()=>(
|
|
41
41
|
<>
|
|
@@ -58,13 +58,13 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
|
|
|
58
58
|
{ key: 'externalId' },
|
|
59
59
|
{ key: 'createdAt' },
|
|
60
60
|
{ key: 'lastModifiedAt' },
|
|
61
|
-
{ key: 'name',
|
|
61
|
+
{ key: 'name', isLocalized: true },
|
|
62
62
|
]}
|
|
63
63
|
appliedFilters={
|
|
64
64
|
[
|
|
65
65
|
{
|
|
66
66
|
key: 'name',
|
|
67
|
-
value: '
|
|
67
|
+
value: 'John'
|
|
68
68
|
},
|
|
69
69
|
]
|
|
70
70
|
}
|
|
@@ -90,7 +90,7 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
|
|
|
90
90
|
{ key: 'externalId' },
|
|
91
91
|
{ key: 'createdAt' },
|
|
92
92
|
{ key: 'lastModifiedAt' },
|
|
93
|
-
{ key: 'name',
|
|
93
|
+
{ key: 'name', isLocalized: true },
|
|
94
94
|
]}
|
|
95
95
|
renderProperties={()=>(
|
|
96
96
|
<>
|
|
@@ -117,10 +117,10 @@ import { ExportResourcesModal } from '@commercetools-frontend-extensions/export-
|
|
|
117
117
|
| `selectedResourceIds` | `array` | ✅ Required only if `exportSelectionType` is `onlySelected` | | Array of Ids of the selected resources |
|
|
118
118
|
| `columns` | `array` | ✅ Required | | Array of the columns to export |
|
|
119
119
|
| `columns[].key` | `string` | ✅ Required | | The unique key of the column that is used to identify data type |
|
|
120
|
-
| `columns[].
|
|
120
|
+
| `columns[].isLocalized` | `boolean` | ✅ Required | | The column is a localised field |
|
|
121
121
|
| `appliedSearchTerms` | `array` | | [] | Array of the search terms that are used when `exportSelectionType` is `onlyMatching` |
|
|
122
122
|
| `appliedFilters` | `array` | | [] | Array of the filters that are used when `exportSelectionType` is `onlyMatching` |
|
|
123
|
-
| `renderProperties` | `function` |
|
|
123
|
+
| `renderProperties` | `function` | | | A prop to render properties that are resource-specific |
|
|
124
124
|
|
|
125
125
|
## Releasing
|
|
126
126
|
|
|
@@ -215,7 +215,7 @@ function buildColumns(columns, languages) {
|
|
|
215
215
|
var _context2;
|
|
216
216
|
|
|
217
217
|
return _flatInstanceProperty__default["default"](_context2 = _mapInstanceProperty__default["default"](columns).call(columns, function (column) {
|
|
218
|
-
if (column.
|
|
218
|
+
if (column.isLocalized) return _mapInstanceProperty__default["default"](languages).call(languages, function (language) {
|
|
219
219
|
var _context3, _context4, _context5;
|
|
220
220
|
|
|
221
221
|
var alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(column.key, "_")).call(_context3, language));
|
|
@@ -382,15 +382,15 @@ var ExportResourcesModalShape = PropTypes__default["default"].shape({
|
|
|
382
382
|
allResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
383
383
|
matchingResourcesCount: PropTypes__default["default"].number,
|
|
384
384
|
selectedResourceIds: PropTypes__default["default"].array,
|
|
385
|
-
columns: PropTypes__default["default"].arrayOf({
|
|
385
|
+
columns: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
386
386
|
key: PropTypes__default["default"].string.isRequired,
|
|
387
|
-
|
|
388
|
-
}).isRequired,
|
|
387
|
+
isLocalized: PropTypes__default["default"].bool
|
|
388
|
+
})).isRequired,
|
|
389
389
|
exportSelectionType: PropTypes__default["default"].string,
|
|
390
390
|
appliedSearchTerms: PropTypes__default["default"].array,
|
|
391
391
|
appliedFilters: PropTypes__default["default"].array,
|
|
392
392
|
renderProperties: PropTypes__default["default"].func
|
|
393
|
-
});
|
|
393
|
+
}).isRequired;
|
|
394
394
|
|
|
395
395
|
function validate(values) {
|
|
396
396
|
var errors = {
|
|
@@ -421,9 +421,6 @@ var ExportResourcesContextProvider = function ExportResourcesContextProvider(pro
|
|
|
421
421
|
var todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
422
422
|
|
|
423
423
|
var _useApplicationContex = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
424
|
-
console.log({
|
|
425
|
-
applicationContext: applicationContext
|
|
426
|
-
});
|
|
427
424
|
return {
|
|
428
425
|
language: applicationContext.dataLocale
|
|
429
426
|
};
|
|
@@ -785,10 +782,10 @@ function Columns(_ref) {
|
|
|
785
782
|
});
|
|
786
783
|
}
|
|
787
784
|
Columns.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
788
|
-
columns: PropTypes__default["default"].arrayOf({
|
|
785
|
+
columns: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
789
786
|
key: PropTypes__default["default"].string.isRequired,
|
|
790
|
-
|
|
791
|
-
}).isRequired
|
|
787
|
+
isLocalized: PropTypes__default["default"].bool
|
|
788
|
+
})).isRequired
|
|
792
789
|
} : {};
|
|
793
790
|
|
|
794
791
|
var ExportSelection = function ExportSelection() {
|
|
@@ -215,7 +215,7 @@ function buildColumns(columns, languages) {
|
|
|
215
215
|
var _context2;
|
|
216
216
|
|
|
217
217
|
return _flatInstanceProperty__default["default"](_context2 = _mapInstanceProperty__default["default"](columns).call(columns, function (column) {
|
|
218
|
-
if (column.
|
|
218
|
+
if (column.isLocalized) return _mapInstanceProperty__default["default"](languages).call(languages, function (language) {
|
|
219
219
|
var _context3, _context4, _context5;
|
|
220
220
|
|
|
221
221
|
var alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(column.key, "_")).call(_context3, language));
|
|
@@ -382,15 +382,15 @@ PropTypes__default["default"].shape({
|
|
|
382
382
|
allResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
383
383
|
matchingResourcesCount: PropTypes__default["default"].number,
|
|
384
384
|
selectedResourceIds: PropTypes__default["default"].array,
|
|
385
|
-
columns: PropTypes__default["default"].arrayOf({
|
|
385
|
+
columns: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
386
386
|
key: PropTypes__default["default"].string.isRequired,
|
|
387
|
-
|
|
388
|
-
}).isRequired,
|
|
387
|
+
isLocalized: PropTypes__default["default"].bool
|
|
388
|
+
})).isRequired,
|
|
389
389
|
exportSelectionType: PropTypes__default["default"].string,
|
|
390
390
|
appliedSearchTerms: PropTypes__default["default"].array,
|
|
391
391
|
appliedFilters: PropTypes__default["default"].array,
|
|
392
392
|
renderProperties: PropTypes__default["default"].func
|
|
393
|
-
});
|
|
393
|
+
}).isRequired;
|
|
394
394
|
|
|
395
395
|
function validate(values) {
|
|
396
396
|
var errors = {
|
|
@@ -417,9 +417,6 @@ var ExportResourcesContextProvider = function ExportResourcesContextProvider(pro
|
|
|
417
417
|
var todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
418
418
|
|
|
419
419
|
var _useApplicationContex = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
420
|
-
console.log({
|
|
421
|
-
applicationContext: applicationContext
|
|
422
|
-
});
|
|
423
420
|
return {
|
|
424
421
|
language: applicationContext.dataLocale
|
|
425
422
|
};
|
package/package.json
CHANGED