@commercetools-frontend-extensions/export-resources-modal 4.8.1 → 4.8.3
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/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +8 -19
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +8 -19
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +8 -19
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -778,27 +778,19 @@ function buildSelectedExportFilters(selectedResourceIds) {
|
|
|
778
778
|
return `id in (${formattedIds})`;
|
|
779
779
|
}
|
|
780
780
|
function isQueryFilter(filters) {
|
|
781
|
-
|
|
781
|
+
if (!filters) return false;
|
|
782
|
+
return 'query' in filters;
|
|
782
783
|
}
|
|
783
784
|
function isSearchFilter(filters) {
|
|
784
|
-
|
|
785
|
+
if (!filters) return false;
|
|
786
|
+
return 'filters' in filters || 'fullText' in filters;
|
|
785
787
|
}
|
|
786
788
|
function validateFilters(filtersObject) {
|
|
787
789
|
var _context2;
|
|
788
790
|
if (filtersObject.where && filtersObject.filters) {
|
|
789
791
|
return false;
|
|
790
792
|
}
|
|
791
|
-
|
|
792
|
-
return Boolean(filtersObject.filters?.query);
|
|
793
|
-
}
|
|
794
|
-
if (isSearchFilter(filtersObject.filters)) {
|
|
795
|
-
const searchFilters = filtersObject.filters;
|
|
796
|
-
return Boolean(searchFilters.filters?.length || searchFilters.fullText?.text?.trim());
|
|
797
|
-
}
|
|
798
|
-
if (filtersObject.where && _trimInstanceProperty__default["default"](_context2 = filtersObject.where).call(_context2) !== '') {
|
|
799
|
-
return true;
|
|
800
|
-
}
|
|
801
|
-
return false;
|
|
793
|
+
return Boolean(isQueryFilter(filtersObject.filters) || isSearchFilter(filtersObject.filters) || filtersObject.where && _trimInstanceProperty__default["default"](_context2 = filtersObject.where).call(_context2) !== '');
|
|
802
794
|
}
|
|
803
795
|
function areFiltersApplied(filtersObject) {
|
|
804
796
|
var _context3;
|
|
@@ -808,10 +800,10 @@ function areFiltersApplied(filtersObject) {
|
|
|
808
800
|
if (filtersObject.where && _trimInstanceProperty__default["default"](_context3 = filtersObject.where).call(_context3) !== '') {
|
|
809
801
|
return true;
|
|
810
802
|
}
|
|
811
|
-
if (filtersObject.filters
|
|
803
|
+
if (isQueryFilter(filtersObject.filters)) {
|
|
812
804
|
return Boolean(filtersObject.filters.query);
|
|
813
805
|
}
|
|
814
|
-
if (
|
|
806
|
+
if (isSearchFilter(filtersObject.filters)) {
|
|
815
807
|
const _filters = filtersObject.filters;
|
|
816
808
|
return Boolean(_filters.filters?.length || _filters.fullText?.text?.trim());
|
|
817
809
|
}
|
|
@@ -1066,10 +1058,7 @@ const useStartExportOperation = props => {
|
|
|
1066
1058
|
} else if (exportType === EXPORT_TYPES.FILTERED && props.filters) {
|
|
1067
1059
|
where = props.filters.where;
|
|
1068
1060
|
if (isQueryFilter(props.filters.filters)) {
|
|
1069
|
-
|
|
1070
|
-
filters = {
|
|
1071
|
-
query: _filters.query
|
|
1072
|
-
};
|
|
1061
|
+
filters = props.filters.filters;
|
|
1073
1062
|
} else if (isSearchFilter(props.filters.filters)) {
|
|
1074
1063
|
filters = props.filters.filters;
|
|
1075
1064
|
}
|
|
@@ -778,27 +778,19 @@ function buildSelectedExportFilters(selectedResourceIds) {
|
|
|
778
778
|
return `id in (${formattedIds})`;
|
|
779
779
|
}
|
|
780
780
|
function isQueryFilter(filters) {
|
|
781
|
-
|
|
781
|
+
if (!filters) return false;
|
|
782
|
+
return 'query' in filters;
|
|
782
783
|
}
|
|
783
784
|
function isSearchFilter(filters) {
|
|
784
|
-
|
|
785
|
+
if (!filters) return false;
|
|
786
|
+
return 'filters' in filters || 'fullText' in filters;
|
|
785
787
|
}
|
|
786
788
|
function validateFilters(filtersObject) {
|
|
787
789
|
var _context2;
|
|
788
790
|
if (filtersObject.where && filtersObject.filters) {
|
|
789
791
|
return false;
|
|
790
792
|
}
|
|
791
|
-
|
|
792
|
-
return Boolean(filtersObject.filters?.query);
|
|
793
|
-
}
|
|
794
|
-
if (isSearchFilter(filtersObject.filters)) {
|
|
795
|
-
const searchFilters = filtersObject.filters;
|
|
796
|
-
return Boolean(searchFilters.filters?.length || searchFilters.fullText?.text?.trim());
|
|
797
|
-
}
|
|
798
|
-
if (filtersObject.where && _trimInstanceProperty__default["default"](_context2 = filtersObject.where).call(_context2) !== '') {
|
|
799
|
-
return true;
|
|
800
|
-
}
|
|
801
|
-
return false;
|
|
793
|
+
return Boolean(isQueryFilter(filtersObject.filters) || isSearchFilter(filtersObject.filters) || filtersObject.where && _trimInstanceProperty__default["default"](_context2 = filtersObject.where).call(_context2) !== '');
|
|
802
794
|
}
|
|
803
795
|
function areFiltersApplied(filtersObject) {
|
|
804
796
|
var _context3;
|
|
@@ -808,10 +800,10 @@ function areFiltersApplied(filtersObject) {
|
|
|
808
800
|
if (filtersObject.where && _trimInstanceProperty__default["default"](_context3 = filtersObject.where).call(_context3) !== '') {
|
|
809
801
|
return true;
|
|
810
802
|
}
|
|
811
|
-
if (filtersObject.filters
|
|
803
|
+
if (isQueryFilter(filtersObject.filters)) {
|
|
812
804
|
return Boolean(filtersObject.filters.query);
|
|
813
805
|
}
|
|
814
|
-
if (
|
|
806
|
+
if (isSearchFilter(filtersObject.filters)) {
|
|
815
807
|
const _filters = filtersObject.filters;
|
|
816
808
|
return Boolean(_filters.filters?.length || _filters.fullText?.text?.trim());
|
|
817
809
|
}
|
|
@@ -1066,10 +1058,7 @@ const useStartExportOperation = props => {
|
|
|
1066
1058
|
} else if (exportType === EXPORT_TYPES.FILTERED && props.filters) {
|
|
1067
1059
|
where = props.filters.where;
|
|
1068
1060
|
if (isQueryFilter(props.filters.filters)) {
|
|
1069
|
-
|
|
1070
|
-
filters = {
|
|
1071
|
-
query: _filters.query
|
|
1072
|
-
};
|
|
1061
|
+
filters = props.filters.filters;
|
|
1073
1062
|
} else if (isSearchFilter(props.filters.filters)) {
|
|
1074
1063
|
filters = props.filters.filters;
|
|
1075
1064
|
}
|
|
@@ -739,27 +739,19 @@ function buildSelectedExportFilters(selectedResourceIds) {
|
|
|
739
739
|
return `id in (${formattedIds})`;
|
|
740
740
|
}
|
|
741
741
|
function isQueryFilter(filters) {
|
|
742
|
-
|
|
742
|
+
if (!filters) return false;
|
|
743
|
+
return 'query' in filters;
|
|
743
744
|
}
|
|
744
745
|
function isSearchFilter(filters) {
|
|
745
|
-
|
|
746
|
+
if (!filters) return false;
|
|
747
|
+
return 'filters' in filters || 'fullText' in filters;
|
|
746
748
|
}
|
|
747
749
|
function validateFilters(filtersObject) {
|
|
748
750
|
var _context2;
|
|
749
751
|
if (filtersObject.where && filtersObject.filters) {
|
|
750
752
|
return false;
|
|
751
753
|
}
|
|
752
|
-
|
|
753
|
-
return Boolean(filtersObject.filters?.query);
|
|
754
|
-
}
|
|
755
|
-
if (isSearchFilter(filtersObject.filters)) {
|
|
756
|
-
const searchFilters = filtersObject.filters;
|
|
757
|
-
return Boolean(searchFilters.filters?.length || searchFilters.fullText?.text?.trim());
|
|
758
|
-
}
|
|
759
|
-
if (filtersObject.where && _trimInstanceProperty(_context2 = filtersObject.where).call(_context2) !== '') {
|
|
760
|
-
return true;
|
|
761
|
-
}
|
|
762
|
-
return false;
|
|
754
|
+
return Boolean(isQueryFilter(filtersObject.filters) || isSearchFilter(filtersObject.filters) || filtersObject.where && _trimInstanceProperty(_context2 = filtersObject.where).call(_context2) !== '');
|
|
763
755
|
}
|
|
764
756
|
function areFiltersApplied(filtersObject) {
|
|
765
757
|
var _context3;
|
|
@@ -769,10 +761,10 @@ function areFiltersApplied(filtersObject) {
|
|
|
769
761
|
if (filtersObject.where && _trimInstanceProperty(_context3 = filtersObject.where).call(_context3) !== '') {
|
|
770
762
|
return true;
|
|
771
763
|
}
|
|
772
|
-
if (filtersObject.filters
|
|
764
|
+
if (isQueryFilter(filtersObject.filters)) {
|
|
773
765
|
return Boolean(filtersObject.filters.query);
|
|
774
766
|
}
|
|
775
|
-
if (
|
|
767
|
+
if (isSearchFilter(filtersObject.filters)) {
|
|
776
768
|
const _filters = filtersObject.filters;
|
|
777
769
|
return Boolean(_filters.filters?.length || _filters.fullText?.text?.trim());
|
|
778
770
|
}
|
|
@@ -1027,10 +1019,7 @@ const useStartExportOperation = props => {
|
|
|
1027
1019
|
} else if (exportType === EXPORT_TYPES.FILTERED && props.filters) {
|
|
1028
1020
|
where = props.filters.where;
|
|
1029
1021
|
if (isQueryFilter(props.filters.filters)) {
|
|
1030
|
-
|
|
1031
|
-
filters = {
|
|
1032
|
-
query: _filters.query
|
|
1033
|
-
};
|
|
1022
|
+
filters = props.filters.filters;
|
|
1034
1023
|
} else if (isSearchFilter(props.filters.filters)) {
|
|
1035
1024
|
filters = props.filters.filters;
|
|
1036
1025
|
}
|
|
@@ -33,7 +33,7 @@ export interface ExportResourcesModalProps {
|
|
|
33
33
|
}
|
|
34
34
|
export type ExportType = keyof typeof EXPORT_TYPES;
|
|
35
35
|
export type QueryFilter = {
|
|
36
|
-
query
|
|
36
|
+
query?: Record<string, unknown>;
|
|
37
37
|
};
|
|
38
38
|
export type SearchFilter = {
|
|
39
39
|
filters?: string[];
|
package/package.json
CHANGED