@commercetools-frontend-extensions/export-resources-modal 4.6.1 → 4.6.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.
@@ -0,0 +1,24 @@
1
+ export interface ExportApiRequest {
2
+ projectKey: string;
3
+ resourceType: string;
4
+ fileName: string;
5
+ fileFormat: string;
6
+ fields: string[];
7
+ locales: string[];
8
+ filters?: Record<string, unknown>;
9
+ where?: string;
10
+ }
11
+ export interface ExportApiResponse {
12
+ id: string;
13
+ state: string;
14
+ resourceType: string;
15
+ fileName: string;
16
+ fileFormat: string;
17
+ fields: string[];
18
+ locales: string[];
19
+ filters?: Record<string, unknown>;
20
+ where?: string;
21
+ completedPercentage: number;
22
+ resourceCount: number;
23
+ createdAt: string;
24
+ }
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { FormikProps } from 'formik';
3
+ import type { ExportType, Filters } from "./export-resources-modal-types.js";
4
+ import type { FormValues } from "./form.js";
5
+ export interface ExportResourcesModalContext {
6
+ formik: FormikProps<FormValues>;
7
+ currentStep: number;
8
+ setCurrentStep: React.Dispatch<React.SetStateAction<number>>;
9
+ onClose: () => void;
10
+ resourceType: string;
11
+ exportType: ExportType;
12
+ totalResourcesCount: number;
13
+ selectedResourceIds: string[];
14
+ filters: Filters;
15
+ hasFilters: boolean;
16
+ setExportType: React.Dispatch<React.SetStateAction<ExportType>>;
17
+ hideExportSelectedResourcesOption?: boolean;
18
+ }
@@ -19,7 +19,7 @@ export interface FieldGroup {
19
19
  additionalFieldExtensions?: string[];
20
20
  fields: Field[];
21
21
  }
22
- export interface ExportResourcesModalShape {
22
+ export interface ExportResourcesModalProps {
23
23
  isOpen?: boolean;
24
24
  resourceType: ResourceType;
25
25
  outputFormat?: string;
@@ -28,6 +28,7 @@ export interface ExportResourcesModalShape {
28
28
  selectedResourceIds?: string[];
29
29
  fieldGroups: FieldGroup[];
30
30
  fieldOrder?: string[];
31
+ hideExportSelectedResourcesOption?: boolean;
31
32
  onClose: () => void;
32
33
  onExportSuccess?: () => void;
33
34
  }
@@ -0,0 +1,41 @@
1
+ import type { Field, FieldGroup } from "./export-resources-modal-types.js";
2
+ import type { OutputFormat } from "./output-format.js";
3
+ export interface FormField extends Field {
4
+ isChecked?: boolean;
5
+ fields?: FormField[];
6
+ additionalFieldExtensions?: string[];
7
+ }
8
+ export interface FormGroup extends FieldGroup {
9
+ isChecked?: boolean;
10
+ isExpanded?: boolean;
11
+ fields: FormField[];
12
+ additionalFieldExtensions?: string[];
13
+ dependentGroupNames?: string[];
14
+ }
15
+ export interface FilteredField extends FormField {
16
+ isHidden?: boolean;
17
+ }
18
+ export interface FilteredGroup extends FieldGroup {
19
+ isHidden?: boolean;
20
+ dependentGroupNames?: string[];
21
+ fields: FilteredField[];
22
+ }
23
+ export interface FormValues {
24
+ outputFormat: OutputFormat;
25
+ fileName: string;
26
+ groups: FormGroup[];
27
+ locales: string[];
28
+ }
29
+ export type FormFieldError = Record<string, boolean>;
30
+ export interface FormValidationErrors {
31
+ fileName: {
32
+ invalidInput?: boolean;
33
+ missing?: boolean;
34
+ };
35
+ locales: {
36
+ missing?: boolean;
37
+ };
38
+ fields: {
39
+ missing?: boolean;
40
+ };
41
+ }
@@ -1,3 +1,6 @@
1
1
  export * from "./export-resources-modal-types.js";
2
- export * from "./formik.js";
2
+ export * from "./export-resources-modal-context.js";
3
+ export * from "./form.js";
3
4
  export * from "./resource-type.js";
5
+ export * from "./output-format.js";
6
+ export * from "./export-api.js";
@@ -0,0 +1 @@
1
+ export type OutputFormat = 'csv' | 'json';
@@ -1,12 +1,13 @@
1
- import { ExportResourcesModalShape } from "./@types/index.js";
1
+ import type { ExportResourcesModalProps } from "./@types/index.js";
2
2
  declare const ExportResourcesModal: {
3
- (props: ExportResourcesModalShape): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element | null;
3
+ (props: ExportResourcesModalProps): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element | null;
4
4
  displayName: string;
5
5
  defaultProps: {
6
6
  isOpen: boolean;
7
7
  selectedResourceIds: never[];
8
8
  outputFormat: string;
9
9
  fieldGroups: never[];
10
+ fieldOrder: never[];
10
11
  };
11
12
  };
12
13
  export default ExportResourcesModal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/export-resources-modal",
3
3
  "description": "Shared export modal for exporting resources",
4
- "version": "4.6.1",
4
+ "version": "4.6.3",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@babel/runtime": "7.25.0",
19
19
  "@babel/runtime-corejs3": "7.25.0",
20
- "@commercetools-frontend/experimental-components": "6.1.5",
20
+ "@commercetools-frontend/experimental-components": "6.2.0",
21
21
  "@commercetools-frontend/fullstory": "2.4.5",
22
22
  "@emotion/react": "11.13.0",
23
23
  "@emotion/styled": "11.13.0",
@@ -1,21 +0,0 @@
1
- import type { Field, FieldGroup } from "./export-resources-modal-types.js";
2
- export interface FormikField extends Field {
3
- isChecked?: boolean;
4
- fields?: FormikField[];
5
- additionalFieldExtensions: string[];
6
- }
7
- export interface FormikGroup extends FieldGroup {
8
- isChecked?: boolean;
9
- isExpanded?: boolean;
10
- fields: FormikField[];
11
- additionalFieldExtensions?: string[];
12
- dependentGroupNames?: string[];
13
- }
14
- export interface FilteredField extends FormikField {
15
- isHidden?: boolean;
16
- }
17
- export interface FilteredGroup extends FieldGroup {
18
- isHidden?: boolean;
19
- dependentGroupNames?: string[];
20
- fields: FilteredField[];
21
- }