Skip to content

Commit

Permalink
feat(core): Implement regex string filter for PaginatedList queries
Browse files Browse the repository at this point in the history
Relates to #543
  • Loading branch information
michaelbromley committed Nov 6, 2020
1 parent 7c7dcf2 commit 0a33441
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 138 deletions.
27 changes: 4 additions & 23 deletions packages/admin-ui/src/lib/core/src/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};


Expand Down Expand Up @@ -1075,7 +1075,7 @@ export type CreateCollectionInput = {
parentId?: Maybe<Scalars['ID']>;
filters: Array<ConfigurableOperationInput>;
translations: Array<CreateCollectionTranslationInput>;
customFields?: Maybe<CreateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type UpdateCollectionInput = {
Expand All @@ -1086,7 +1086,7 @@ export type UpdateCollectionInput = {
assetIds?: Maybe<Array<Scalars['ID']>>;
filters?: Maybe<Array<ConfigurableOperationInput>>;
translations?: Maybe<Array<UpdateCollectionTranslationInput>>;
customFields?: Maybe<UpdateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CountryTranslationInput = {
Expand Down Expand Up @@ -2116,6 +2116,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -3921,8 +3922,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -3933,8 +3932,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type CountryFilterParameter = {
Expand Down Expand Up @@ -4203,22 +4200,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type CollectionCustomFields = {
__typename?: 'CollectionCustomFields';
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CreateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type UpdateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
__typename?: 'CustomFields';
Address: Array<CustomFieldConfig>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionProductVariantsArgs = {
Expand Down Expand Up @@ -909,7 +909,7 @@ export type CreateCollectionInput = {
parentId?: Maybe<Scalars['ID']>;
filters: Array<ConfigurableOperationInput>;
translations: Array<CreateCollectionTranslationInput>;
customFields?: Maybe<CreateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type UpdateCollectionInput = {
Expand All @@ -920,7 +920,7 @@ export type UpdateCollectionInput = {
assetIds?: Maybe<Array<Scalars['ID']>>;
filters?: Maybe<Array<ConfigurableOperationInput>>;
translations?: Maybe<Array<UpdateCollectionTranslationInput>>;
customFields?: Maybe<UpdateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CountryTranslationInput = {
Expand Down Expand Up @@ -1928,6 +1928,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -3661,8 +3662,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -3673,8 +3672,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type CountryFilterParameter = {
Expand Down Expand Up @@ -3943,21 +3940,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type CollectionCustomFields = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CreateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type UpdateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
Address: Array<CustomFieldConfig>;
Collection: Array<CustomFieldConfig>;
Expand Down
13 changes: 2 additions & 11 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -1773,7 +1774,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionProductVariantsArgs = {
Expand Down Expand Up @@ -2635,8 +2636,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -2647,8 +2646,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type ProductFilterParameter = {
Expand Down Expand Up @@ -2761,12 +2758,6 @@ export type UpdateOrderInput = {
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionCustomFields = {
__typename?: 'CollectionCustomFields';
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
__typename?: 'CustomFields';
Address: Array<CustomFieldConfig>;
Expand Down
27 changes: 4 additions & 23 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};


Expand Down Expand Up @@ -1044,7 +1044,7 @@ export type CreateCollectionInput = {
parentId?: Maybe<Scalars['ID']>;
filters: Array<ConfigurableOperationInput>;
translations: Array<CreateCollectionTranslationInput>;
customFields?: Maybe<CreateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type UpdateCollectionInput = {
Expand All @@ -1055,7 +1055,7 @@ export type UpdateCollectionInput = {
assetIds?: Maybe<Array<Scalars['ID']>>;
filters?: Maybe<Array<ConfigurableOperationInput>>;
translations?: Maybe<Array<UpdateCollectionTranslationInput>>;
customFields?: Maybe<UpdateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CountryTranslationInput = {
Expand Down Expand Up @@ -2084,6 +2084,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -3889,8 +3890,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -3901,8 +3900,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type CountryFilterParameter = {
Expand Down Expand Up @@ -4171,22 +4168,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type CollectionCustomFields = {
__typename?: 'CollectionCustomFields';
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CreateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type UpdateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
__typename?: 'CustomFields';
Address: Array<CustomFieldConfig>;
Expand Down
26 changes: 4 additions & 22 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionProductVariantsArgs = {
Expand Down Expand Up @@ -909,7 +909,7 @@ export type CreateCollectionInput = {
parentId?: Maybe<Scalars['ID']>;
filters: Array<ConfigurableOperationInput>;
translations: Array<CreateCollectionTranslationInput>;
customFields?: Maybe<CreateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type UpdateCollectionInput = {
Expand All @@ -920,7 +920,7 @@ export type UpdateCollectionInput = {
assetIds?: Maybe<Array<Scalars['ID']>>;
filters?: Maybe<Array<ConfigurableOperationInput>>;
translations?: Maybe<Array<UpdateCollectionTranslationInput>>;
customFields?: Maybe<UpdateCollectionCustomFieldsInput>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CountryTranslationInput = {
Expand Down Expand Up @@ -1928,6 +1928,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -3661,8 +3662,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -3673,8 +3672,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type CountryFilterParameter = {
Expand Down Expand Up @@ -3943,21 +3940,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type CollectionCustomFields = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CreateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type UpdateCollectionCustomFieldsInput = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
Address: Array<CustomFieldConfig>;
Collection: Array<CustomFieldConfig>;
Expand Down
12 changes: 2 additions & 10 deletions packages/core/e2e/graphql/generated-e2e-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
in?: Maybe<Array<Scalars['String']>>;
regex?: Maybe<Scalars['String']>;
};

export type BooleanOperators = {
Expand Down Expand Up @@ -1721,7 +1722,7 @@ export type Collection = Node & {
filters: Array<ConfigurableOperation>;
translations: Array<CollectionTranslation>;
productVariants: ProductVariantList;
customFields?: Maybe<CollectionCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionProductVariantsArgs = {
Expand Down Expand Up @@ -2515,8 +2516,6 @@ export type CollectionFilterParameter = {
slug?: Maybe<StringOperators>;
position?: Maybe<NumberOperators>;
description?: Maybe<StringOperators>;
foo?: Maybe<DateOperators>;
bar?: Maybe<StringOperators>;
};

export type CollectionSortParameter = {
Expand All @@ -2527,8 +2526,6 @@ export type CollectionSortParameter = {
slug?: Maybe<SortOrder>;
position?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
foo?: Maybe<SortOrder>;
bar?: Maybe<SortOrder>;
};

export type ProductFilterParameter = {
Expand Down Expand Up @@ -2641,11 +2638,6 @@ export type UpdateOrderInput = {
customFields?: Maybe<Scalars['JSON']>;
};

export type CollectionCustomFields = {
foo?: Maybe<Scalars['DateTime']>;
bar?: Maybe<Scalars['String']>;
};

export type CustomFields = {
Address: Array<CustomFieldConfig>;
Collection: Array<CustomFieldConfig>;
Expand Down
Loading

0 comments on commit 0a33441

Please sign in to comment.