Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-4985] Created an advanced date range filter for search #8714

Merged
merged 76 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
344a69c
[ACS-4985] Added SearchFilterTabbedComponent and SearchDateRangeAdvan…
swapnil-verma-gl Jun 9, 2023
9baba67
[ACS-4985] Using widget-composite component now correctly updates the…
swapnil-verma-gl Jun 12, 2023
47131dc
[ACS-4985] Added compatibility of all search filters/facets with Sear…
swapnil-verma-gl Jun 13, 2023
a4e87b2
[ACS-4985] Added documentation for SearchFilterTabbedComponent and Se…
swapnil-verma-gl Jun 13, 2023
8325990
[ACS-4985] Updated UI for search filters. Minor fixes
swapnil-verma-gl Jun 13, 2023
1a2648c
[ACS-4985] Removed vertical mode from SearchFilterTabbedComponent
swapnil-verma-gl Jun 13, 2023
c51b9dd
[ACS-4985] Added test cases for SearchFilterTabbedComponent
swapnil-verma-gl Jun 13, 2023
180910d
[ACS-4985] Added data-automation-id to search-date-range-advanced.com…
swapnil-verma-gl Jun 13, 2023
be81683
[ACS-4985] Added test cases for SearchFilterTabbedComponent. Added te…
swapnil-verma-gl Jun 13, 2023
19ded72
[ACS-4985] Updated SearchModule declarations. Fixed minor typo in Sea…
swapnil-verma-gl Jun 13, 2023
e73e9b2
[ACS-4985] Updated Labels for 'In last' date range option
swapnil-verma-gl Jun 14, 2023
8e62479
[ACS-4985] Added test cases for SearchDateRangeAdvancedComponent. Min…
swapnil-verma-gl Jun 14, 2023
555b717
[ACS-4985] Resolved minor issue where the reset method would still tr…
swapnil-verma-gl Jun 14, 2023
db5b9ca
[ACS-4985] Added exports for SearchDateRangeAdvanced and SearchFilter…
swapnil-verma-gl Jun 14, 2023
b3340c8
[ACS-4985] Updated imports in test cases
swapnil-verma-gl Jun 14, 2023
950210f
Added import for BaseQueryBuilderService in public-api.ts. Fixes #8647
swapnil-verma-gl Jun 14, 2023
73a2227
[ACS-4985] Migrated SearchDateRangeAdvancedComponent from moment.js t…
swapnil-verma-gl Jun 14, 2023
26111f8
[ACS-4985] Updated test cases for SearchDateRangeAdvancedComponent fr…
swapnil-verma-gl Jun 14, 2023
46914d9
[ACS-4985] Added license headers and re-ordered imports
swapnil-verma-gl Jun 14, 2023
cca5806
[ACS-4985] Fixed erroneous imports
swapnil-verma-gl Jun 14, 2023
e41a6ed
[ACS-4985] Fixed test cases for SearchDateRangeAdvancedComponent.
swapnil-verma-gl Jun 14, 2023
3951896
[ACS-4985] Removed fdescribe test cases for SearchDateRangeAdvancedCo…
swapnil-verma-gl Jun 14, 2023
a91da0c
[ACS-4985] Updated date formats for SearchDateRangeAdvancedComponent
swapnil-verma-gl Jun 14, 2023
8cfb88b
[ACS-4985] Updated test cases for changed date format
swapnil-verma-gl Jun 14, 2023
781e2b1
ACS-4985 Fixed issue with nx build, some clean ups, using changes in …
AleksanderSklorz Jun 21, 2023
2152c63
[ACS-4985] Updated app.cconfig for demo-shell to use new date-range-a…
swapnil-verma-gl Jun 26, 2023
cf2532a
[ACS-4985] Updated SearchDateRangeAdvancedTabbed component to use var…
swapnil-verma-gl Jun 26, 2023
4a8c215
[ACS-4985] Updated test cases for SearchDateRangeAdvancedComponent. M…
swapnil-verma-gl Jun 26, 2023
8853810
[ACS-4985] Updated SearchDateRangeAdvancedTabbed component to no long…
swapnil-verma-gl Jun 26, 2023
bc66e69
[ACS-4985] Added field validation to test case
swapnil-verma-gl Jun 26, 2023
b81b825
[ACS-4985] Updated test cases for SearchFilterTabbedComponent. Added …
swapnil-verma-gl Jun 26, 2023
9baadb0
[ACS-4985] Added clear and apply button to SearchDateRangeAdvancedTab…
swapnil-verma-gl Jun 26, 2023
826ea9c
[ACS-4985] Added test cases for SearchDateRangeAdvancedTabbedComponen…
swapnil-verma-gl Jun 27, 2023
d5d7af1
[ACS-4985] Updated the documentation for the components
swapnil-verma-gl Jun 27, 2023
92e84d5
[ACS-4985] Removed disableUpdateOnSubmit flag from search widgets
swapnil-verma-gl Jun 28, 2023
101ecea
[ACS-4985] Updated documentation for components
swapnil-verma-gl Jun 28, 2023
402b06e
[ACS-4985] Added validation to SearchDateRangeAdvancedComponent
swapnil-verma-gl Jun 28, 2023
b925494
[ACS-4985] Added image for updated documentation
swapnil-verma-gl Jun 28, 2023
df9e21f
[ACS-4985] Added @angular/material-date-fns-adapter package
swapnil-verma-gl Jun 28, 2023
c2e492e
[ACS-4985] Resolved issue where clear button would not clear the valu…
swapnil-verma-gl Jun 28, 2023
9ccd6f4
[ACS-4985] Updated component to use MatDateFnsAdapter. BetweenStartDa…
swapnil-verma-gl Jun 28, 2023
0e2a28f
[ACS-4985] Resolved minor issues with display label creation
swapnil-verma-gl Jun 28, 2023
ea10f5b
[ACS-4985] Resolved minor issues where switching between tabs could s…
swapnil-verma-gl Jun 28, 2023
55b7160
[ACS-4985] Resolved linting and unit test issues
swapnil-verma-gl Jun 28, 2023
763a6a9
[ACS-4985] Resolved PR review comments
swapnil-verma-gl Jun 28, 2023
29c5ce2
[ACS-4985] Removed unused code from base-query-builder.service.ts
swapnil-verma-gl Jul 4, 2023
691d64a
[ACS-4985] Resolved PR review comments
swapnil-verma-gl Jul 4, 2023
5683608
[ACS-4985] Transferred business logic from SearchDateRangeAdvancedCom…
swapnil-verma-gl Jul 6, 2023
431812b
[ACS-4985] Updated test cases for SearchDateRangeAdvancedTabbedComponent
swapnil-verma-gl Jul 6, 2023
7b3e713
[ACS-4985] Added borders to inputs
swapnil-verma-gl Jul 6, 2023
1e49902
[ACS-4985] Added borders to inputs
swapnil-verma-gl Jul 6, 2023
326e0c9
[ACS-4985] Added validation when user manually enters the start and e…
swapnil-verma-gl Jul 7, 2023
e02b1c5
[ACS-4985] Added test cases for end date validation. Fixed minor issu…
swapnil-verma-gl Jul 7, 2023
dcef054
[ACS-4985] Added link for AngularMaterial bug for CSS workaround
swapnil-verma-gl Jul 10, 2023
a125d20
[ACS-4985] Updated documentation
swapnil-verma-gl Jul 10, 2023
04730d0
[ACS-4985] Updated dates in documentation
swapnil-verma-gl Jul 10, 2023
27c82c3
[ACS-4985] Fixed code smell in regex
swapnil-verma-gl Jul 10, 2023
bf62ff8
[ACS-4985] Resolved lint issues
swapnil-verma-gl Jul 10, 2023
e51257b
[ACS-4985] Split declarations into multiple lines
swapnil-verma-gl Jul 10, 2023
fdeb7cf
[ACS-4985] Removed ANY case from switch (will be handled by default c…
swapnil-verma-gl Jul 10, 2023
ef4f58d
[ACS-4985] Updated query generation logic. Now both 'In the last' and…
swapnil-verma-gl Jul 10, 2023
43739d9
[ACS-4985] Added *ngFor back to the search-date-range-advanced-tabbed…
swapnil-verma-gl Jul 10, 2023
fcfdd42
[ACS-4985] Added missing null check when generating query
swapnil-verma-gl Jul 10, 2023
80f8cfc
[ACS-4985] Updated test cases after query generation changes
swapnil-verma-gl Jul 10, 2023
085a1bf
[ACS-4985] Resolved issue where typing a special character after addi…
swapnil-verma-gl Jul 11, 2023
f79778a
[ACS-4985] Moved inLast input field back to input type number.
swapnil-verma-gl Jul 11, 2023
7173049
[ACS-4985] Added documentation to versionIndex.md and README.md
swapnil-verma-gl Jul 14, 2023
012bc05
[ACS-4985] Moved new components to v6.2.0 in versionIndex.md
swapnil-verma-gl Jul 14, 2023
bf38df5
[ACS-4985] Resolved lint issues
swapnil-verma-gl Jul 14, 2023
a7e7cd4
[ACS-4985] Resolved unit test failures
swapnil-verma-gl Jul 14, 2023
da5eb5a
[ACS-4985] Increased value for drag emulation to account for increase…
swapnil-verma-gl Jul 18, 2023
99b35c9
[ACS-4985] Resolved e2e test failures
swapnil-verma-gl Jul 19, 2023
ade8e28
Testing global install of webdriver-manager for e2e webdriver fix
swapnil-verma-gl Jul 19, 2023
7d48b77
[ACS-4985] Revert test fix for e2e execution. Updated search.config.t…
swapnil-verma-gl Jul 20, 2023
1e6b351
[ACS-4985] Resolved e2e test cases
swapnil-verma-gl Jul 21, 2023
e8a162a
[ci:force]
swapnil-verma-gl Jul 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions demo-shell/src/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,23 @@
}
}
},
{
"id": "createdModifiedDateRange",
"name": "Date",
"enabled": true,
"component": {
"selector": "date-range-advanced",
"settings": {
"dateFormat": "dd-MMM-yy",
"maxDate": "today",
"field": "cm:created, cm:modified",
"displayedLabelsByField": {
"cm:created": "Created Date",
swapnil-verma-gl marked this conversation as resolved.
Show resolved Hide resolved
"cm:modified": "Modified Date"
}
}
}
},
{
"id": "queryType",
"name": "Type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
margin-left: 5px;

.app-search-settings {
width: 260px;
border: 1px solid #eee;
}

Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,15 @@ for more information about installing and using the source code.
| [Search Chip Input Component](content-services/components/search-chip-input.component.md) | Displays input for providing phrases display as "chips". | [Source](../lib/content-services/src/lib/search/components/search-chip-input/search-chip-input.component.ts) |
| [Search Chip Autocomplete Input component](content-services/components/search-chip-autocomplete-input.component.md) | Displays an input with autocomplete options. | [Source](../lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.ts) |
| [Search Chip List Component](content-services/components/search-chip-list.component.md) | Displays search criteria as a set of "chips". | [Source](../lib/content-services/src/lib/search/components/search-chip-list/search-chip-list.component.ts) |
| [Search Date Range Advanced Component](content-services/components/search-date-range-advanced.component.md) | Displays a UI to configure different kinds of search criteria around date. Options are 'Anyytime', 'In the last' and 'Between' | [Source](../lib/content-services/src/lib/search/components/search-date-range-advanced-tabbed/search-date-range-advanced/search-date-range-advanced.component.ts) |
| [Search control component](content-services/components/search-control.component.md) | Displays a input text that shows find-as-you-type suggestions. | [Source](../lib/content-services/src/lib/search/components/search-control.component.ts) |
| [Search date range component](content-services/components/search-date-range.component.md) | Implements a search widget for the Search Filter component. | [Source](../lib/content-services/src/lib/search/components/search-date-range/search-date-range.component.ts) |
| [Search date range advanced tabbed component](content-services/components/search-date-range-advanced-tabbed.component.md) | Implements a tabbed advanced search widget for the Search Filter component. | [Source](../lib/content-services/src/lib/search/components/search-date-range-advanced-tabbed/search-date-range-advanced-tabbed.component.ts) |
| [Search datetime range component](content-services/components/search-datetime-range.component.md) | Implements a search widget for the Search Filter component. | [Source](../lib/content-services/src/lib/search/components/search-datetime-range/search-datetime-range.component.ts) |
| [Search Filter Autocomplete Chips component](content-services/components/search-filter-autocomplete-chips.component.md) | Implements a search widget for the Search Filter component. | [Source](../lib/content-services/src/lib/search/components/search-filter-autocomplete-chips/search-filter-autocomplete-chips.component.ts) |
| [Search Filter Chips component](content-services/components/search-filter-chips.component.md) | Represents a chip based container component for custom search and faceted search settings. | [Source](../lib/content-services/src/lib/search/components/search-filter-chips/search-filter-chips.component.ts) |
| [Search Filter component](content-services/components/search-filter.component.md) | Represents a main container component for custom search and faceted search settings. | [Source](../lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts) |
| [Search Filter Tabbed component](content-services/components/search-filter-tabbed.component.md) | Represents a container component for creating tabbed layout. | [Source](../lib/content-services/src/lib/search/components/search-filter/search-filter.component.ts) |
| [Search Form component](content-services/components/search-form.component.md) | Search Form screenshot | [Source](../lib/content-services/src/lib/search/components/search-form/search-form.component.ts) |
| [Search Logical Filter component](content-services/components/search-logical-filter.component.md) | Displays 3 chip inputs each representing different logical condition for search query. | [Source](../lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.ts) |
| [Search Properties component](content-services/components/search-properties.component.md) | Allows to search by file size and type.| [Source](../lib/content-services/src/lib/search/components/search-properties/search-properties.component.ts) |
Expand Down
AleksanderSklorz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
Title: Search date range advanced tabbed component
Added: v6.2.0
Status: Active
Last reviewed: 2023-07-10
---

# [Search date range advanced tabbed component](../../../lib/content-services/src/lib/search/components/search-date-range-advanced-tabbed/search-date-range-advanced-tabbed.component.ts "Defined in search-date-range-advanced-tabbed.component.ts")

Represents a tabbed advanced date range [search widget](../../../lib/content-services/src/lib/search/models/search-widget.interface.ts) for
the [Search Filter component](search-filter.component.md).

![Date Range Advanced Widget](../../docassets/images/search-date-range-advanced-tabbed.png)

## Basic usage

```json
{
"search": {
"categories": [
{
"id": "createdModifiedDateRange",
"name": "Date",
"enabled": true,
"component": {
"selector": "date-range-advanced",
"settings": {
"dateFormat": "dd-MMM-yy",
"maxDate": "today",
"field": "cm:created, cm:modified",
"displayedLabelsByField": {
"cm:created": "Created Date",
"cm:modified": "Modified Date"
}
}
}
}
]
}
}
```

### Settings

| Name | Type | Description |
|------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| field | string | Fields to apply the query to. Multiple, comma separated fields can be passed, to create multiple tabs per field. Required value |
| dateFormat | string | Date format. Dates used by the datepicker are Javascript Date objects, using [date-fns](https://date-fns.org/v2.30.0/docs/format) for formatting, so you can use any date format supported by the library. Default is 'dd-MMM-yy (sample date - 07-Jun-23) |
| maxDate | string | A fixed date (in format mentioned above, default format: dd-MMM-yy) or the string `"today"` that will set the maximum searchable date. Default is today. |
| displayedLabelsByField | { [key: string]: string } | A javascript object containing the different display labels to be used for each tab name, identified by the field for a particular tab. |

## Details

This component creates a tabbed layout where each tab consists of the [SearchDateRangeAdvanced](./search-date-range-advanced-tabbed.component.md) component, which allows user to create a query containing multiple date related queries in one go.

See the [Search filter component](search-filter.component.md) for full details of how to use widgets in a search query.

### Custom date format

You can set the date range picker to work with any date format your app requires. You can use
any date format supported by the [date-fns](https://date-fns.org/v2.30.0/docs/format) library
in the `dateFormat` and in the `maxDate` setting:

```json
{
"search": {
"categories": [
{
"id": "createdModifiedDateRange",
"name": "Date",
"enabled": true,
"component": {
"selector": "date-range-advanced",
"settings": {
"dateFormat": "dd-MMM-yy",
"maxDate": "02-May-23",
"field": "cm:created, cm:modified",
"displayedLabelsByField": {
"cm:created": "Created Date",
"cm:modified": "Modified Date"
}
}
}
}
]
}
}
```

The [SearchDateRangeAdvanced](./search-date-range-advanced-tabbed.component.md) component allows 3 different kinds of date related operations to be performed.
Based on what information is provided to that component, this component will create different kinds of queries -

- Anytime - No date filters are applied on the `field`. This option is selected by default
- In the last - Allows to user to apply a filter to only show results from the last 'n' unit of time.
- Between - Allows the user to select a range of dates to filter the search results.

The queries generated by this filter when using the 'In the last' or 'Between' options is of the form -

`<field>:[<from_date> TO <to_date>]`


## See also

- [Search Configuration Guide](../../user-guide/search-configuration-guide.md)
- [Search Query Builder service](../services/search-query-builder.service.md)
- [Search Widget Interface](../interfaces/search-widget.interface.md)
- [Search check list component](search-check-list.component.md)
- [Search date range component](search-date-range.component.md)
- [Search number range component](search-number-range.component.md)
- [Search radio component](search-radio.component.md)
- [Search slider component](search-slider.component.md)
- [Search text component](search-text.component.md)
- [Search filter tabbed component](search-filter-tabbed.component.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
Title: Search date range advanced component
Added: v6.2.0
Status: Active
Last reviewed: 2023-07-10
---

# [Search date range advanced component](../../../lib/content-services/src/lib/search/components/search-date-range-advanced-tabbed/search-date-range-advanced/search-date-range-advanced.component.ts "Defined in search-date-range-advanced.component.ts")

Represents an advanced date range component for
the [SearchAdvancedDateRangeTabbedComponent](search-date-range-advanced-tabbed.component.md).

![Date Range Advanced Widget](../../docassets/images/search-date-range-advanced.png)

## Basic usage

```html

<adf-search-date-range-advanced></adf-search-date-range-advanced>
```

## Class Members

### Properties

| Name | Type | Description |
|--------------|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| field | string | Field to apply the query to. Required value |
| maxDate | string | A fixed date (default format: dd-MMM-yy) or the string `"today"` that will set the maximum searchable date. Default is today. |
| dateFormat | string | Date format. Dates used by the datepicker are Javascript Date objects, using [date-fns](https://date-fns.org/v2.30.0/docs/format) for formatting, so you can use any date format supported by the library. Default is 'dd-MMM-yy (sample date - 07-Jun-23) |
| initialValue | SearchDateRangeAdvanced | Initial value for the component |

### Events

| Name | Type | Description |
|---------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| changed | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Partial<SearchDateRangeAdvanced>>` | Emitted whenever a change is made in the component values. Emits the changes being made in the component. |
| valid | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted whenever a change is made in the component values. Emits a flag indicating whether the current state of the component is valid or not. |

## Details

This component lets the user choose a variety of options to perform date related operations.

- Anytime - No date related data will be returned. This option is selected by default
- In the last - Allows user to perform date related operations over a period of time. The user can select the length of the period from current time,
as well as its unit. Currently, 3 units are supported - Days, Weeks, and Months.
- Between - Allows the user to select a range of dates to perform operations on.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
Title: Search filter tabbed component
Added: v6.2.0
Status: Active
Last reviewed: 2023-07-10
---

# [Search filter tabbed component](../../../lib/content-services/src/lib/search/components/search-filter-tabbed/search-filter-tabbed.component.ts "Defined in search-filter-tabbed.component.ts")

Represents a container for [Search Filters](search-filter.component.md) to provide a tabbed user interface for the filters.

![Search Filter Tabbed Widget](../../docassets/images/search-filter-tabbed.png)

## Basic Usage

```html

<adf-search-filter-tabbed>
<ng-container *ngFor="let field of fields">
<my-search-filter *adf-search-filter-tab="MyTabLabel"></my-search-filter>
</ng-container>
</adf-search-filter-tabbed>
```

In order to generate a tabbed widget for multiple search filters, you can pass in the search filter widget component as a content child of the adf-search-filter-tabbed component as shown above.

Additionally, you also have to make sure that the search filter being passed as a content child of the adf-search-filter-tabbed component, also has the adf-search-filter-tabbed directive applied on it,
with the name input property being assigned the value of whatever name should be displayed for that particular tab

## See also

- [Search Configuration Guide](../../user-guide/search-configuration-guide.md)
- [Search Query Builder service](../services/search-query-builder.service.md)
- [Search Widget Interface](../interfaces/search-widget.interface.md)
- [Search check list component](search-check-list.component.md)
- [Search date range component](search-date-range.component.md)
- [Search date range advanced component](search-date-range-advanced.component.md)
- [Search number range component](search-number-range.component.md)
- [Search radio component](search-radio.component.md)
- [Search slider component](search-slider.component.md)
- [Search text component](search-text.component.md)
2 changes: 2 additions & 0 deletions docs/content-services/components/search-filter.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ to build and execute the query.
- [Search Widget Interface](../interfaces/search-widget.interface.md)
- [Search check list component](search-check-list.component.md)
- [Search date range component](search-date-range.component.md)
- [Search date range advanced component](search-date-range-advanced.component.md)
- [Search number range component](search-number-range.component.md)
- [Search radio component](search-radio.component.md)
- [Search slider component](search-slider.component.md)
- [Search text component](search-text.component.md)
- [Search filter tabbed component](search-filter-tabbed.component.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docassets/images/search-filter-tabbed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/versionIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ backend services have been tested with each released version of ADF.
<!--v620 start-->

- [Search Properties component](content-services/components/search-properties.component.md)
- [Search Date Range Advanced Component](content-services/components/search-date-range-advanced.component.md)
- [Search Date Range Advanced Tabbed Component](content-services/components/search-date-range-advanced-tabbed.component.md)
- [Search Filter Tabbed Component](content-services/components/search-filter-tabbed.component.md)

<!--v620 end-->

Expand Down
Loading
Loading