-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from KimFFVII/fix/docs-fixes
feat: added result diagram cookbook, fixes
- Loading branch information
Showing
13 changed files
with
314 additions
and
54 deletions.
There are no files selected for viewing
98 changes: 93 additions & 5 deletions
98
docs/modules/angular/pages/cookbook/components/group-by-count-diagram/index.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,98 @@ | ||
= OneCX GroupByCountDiagram | ||
|
||
:group_by_count_diagram_storybook: https://main--65f7f64d4506c9f2dfe59383.chromatic.com/?path=/docs/components-groupbycountdiagramcomponent--docs | ||
|
||
:idprefix: | ||
:idseparator: - | ||
|
||
[#overview] | ||
== Overview | ||
This document aims to showcase how to manage GroupByCountDiagram Component. | ||
This document aims to showcase how to manage GroupByCountDiagram component. | ||
|
||
This component displays the search result data as a diagram. Please, visit the storybook page for the {group_by_count_diagram_storybook}[GroupByCountDiagram component] and interact with the examples to find out if the component is suitable for the desired use-case. | ||
|
||
[#customization] | ||
== Customization | ||
|
||
The GroupByCountDiagram component allows for content customization: | ||
|
||
* render different types of diagrams | ||
* enable switching between diagram types | ||
* set custom colors | ||
To find out how to work with the GroupByCountDiagram component, please visit the {group_by_count_diagram_storybook}[storybook page] and interact with the examples to find out the required features. For more in-depth information on the GroupByCountDiagram component interface, please read the further documentation. | ||
|
||
[#inputs] | ||
== Inputs | ||
|
||
[cols="1,1,1,2", options="header"] | ||
.GroupByCountDiagram inputs | ||
|=== | ||
| Property name | Type | Default | Description | ||
|
||
| `sumKey` | `string` | `FEATURE_SEARCH.DIAGRAM.SUM` | Translation key for label below the chart. | ||
| `diagramType` | `<<diagram-type, DiagramType>>` | `DiagramType.PIE` | Type of the chart to be displayed as. | ||
| `supportedDiagramTypes` | `<<diagram-type, DiagramType[]>>` | `[]` | Add multiple Diagram types to be able to switch between them. | ||
| `data` | `unknown[]` | - | Data to be displayed as a diagram. | ||
| `columnType` | `<<column-type, ColumnType>>` | `ColumnType.STRING` | Defines the type of the column. | ||
| `columnField` | `string` | `''` | Defines which column data field to be displayed. | ||
| `column` | `<<diagram-column, DiagramColumn>>` | - | Defines which columns and its type to be displayed. | ||
| `fillMissingColors` | `boolean` | `true` | Determines if diagram should generate the colors for the data that does not have any set. Set to false will result in using the provided colors only if every data item has one. When at least one item does not have a color set, diagram will generate all colors. | ||
| `colors` | `Record<string, string>` | `{}` | Defines custom color for data items. | ||
|=== | ||
|
||
[#outputs] | ||
== Outputs | ||
|
||
.GroupByCountDiagram outputs | ||
|=== | ||
| Property name | Type | Description | ||
|
||
| `dataSelected` | `EventEmitter<any>` | Emits data object upon clicking a diagram element. | ||
| `diagramTypeChanged` | `EventEmitter<<<diagram-type, DiagramType>>>` | Emits the `<<diagram-type, DiagramType>>` when one of the supported diagram types is selected to switch the type. | ||
| `componentStateChanged` | `EventEmitter<<<group-by-count-diagram-component-state, GroupByCountDiagramComponentState>>>` | Emits the selected `<<diagram-type, DiagramType>>` to ensure consistent component state. | ||
|=== | ||
|
||
[#types] | ||
== Types | ||
|
||
[#diagram-type] | ||
=== DiagramType | ||
|
||
.DiagramType enum | ||
|
||
[source, javascript] | ||
---- | ||
export const enum DiagramType { | ||
PIE = 'PIE', | ||
VERTICAL_BAR = 'VERTICAL_BAR', | ||
HORIZONTAL_BAR = 'HORIZONTAL_BAR', | ||
} | ||
---- | ||
|
||
[#column-type] | ||
=== ColumnType | ||
|
||
include::partial$column-type.adoc[] | ||
|
||
[#diagram-column] | ||
=== DiagramColumn | ||
|
||
.DiagramColumn type | ||
|
||
[source, javascript] | ||
---- | ||
export type DiagramColumn = { columnType: ColumnType; id: string } | ||
---- | ||
|
||
[#group-by-count-diagram-component-state] | ||
=== GroupByCountDiagramComponentState | ||
|
||
// TODO: How to import | ||
// TODO: How to use - storybook | ||
.GroupByCountDiagramComponentState interface | ||
|
||
// TODO: Overview of properties | ||
// TODO: Overview of interfaces related | ||
[source, javascript] | ||
---- | ||
export interface GroupByCountDiagramComponentState { | ||
activeDiagramType?: DiagramType | ||
} | ||
---- |
41 changes: 41 additions & 0 deletions
41
.../angular/pages/cookbook/components/interactive-data-view/data-table-column.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
= DataTableColumn | ||
|
||
:idprefix: | ||
:idseparator: - | ||
|
||
[#data-table-column-properties-overview] | ||
== DataTableColumn properties overview | ||
|
||
.DataTableColumn interface | ||
[cols="3,2,9"] | ||
|=== | ||
| Property name | Type | Description | ||
|
||
| `columnType` | `ColumnType` | Defines the type of the column. | ||
| `id` | `string` | The id of the column. | ||
| `nameKey` | `string` | Translation key for the column header name. | ||
| `sortable?` | `boolean` | Indicates if the column is sortable. | ||
| `filterable?` | `boolean` | Indicates if the column is filterable. | ||
| `filterType?` | `FilterType` | Defines which type of filter is used. | ||
| `predefinedGroupKeys?` | `string[]` | Defines the group set in which the following column is available. Additionally, the `predefinedGroups` can be selected from a dropdown menu at the top of the search results table. If you want your search column to belong only to the default column group, then only add `+FEATURE_SEARCH.PREDEFINED_GROUP.DEFAULT+`. | ||
| `dateFormat?` | `string` | Configuration object allowing for customization of the dialog behavior and visual aspects. | ||
|=== | ||
|
||
include::partial$column-type.adoc[] | ||
|
||
.FilterType enum | ||
[source, javascript] | ||
---- | ||
export declare enum FilterType { | ||
EQUAL = "EQUAL", | ||
TRUTHY = "TRUTHY" | ||
} | ||
---- | ||
|
||
[cols="2,2,3"] | ||
|=== | ||
| Type | Description | ||
|
||
| `EQUAL` | Will create a set of unique values for filtering. | ||
| `TRUTHY` | Will always have two filter options which result in empty and not empty. | ||
|=== |
4 changes: 4 additions & 0 deletions
4
docs/modules/angular/pages/cookbook/components/interactive-data-view/index.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
docs/modules/angular/pages/cookbook/components/search-header/index.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
= OneCX SearchHeader | ||
|
||
:search_header_storybook: https://main--65f7f64d4506c9f2dfe59383.chromatic.com/?path=/docs/components-searchheadercomponent--docs | ||
:page_header_url: xref:angular/cookbook/components/page-header/index.adoc | ||
|
||
:idprefix: | ||
:idseparator: - | ||
|
||
[#overview] | ||
== Overview | ||
This document aims to showcase how to manage SearchHeader component. | ||
|
||
This component displays the search result data as a diagram. Please, visit the storybook page for the {search_header_storybook}[SearchHeader component] and interact with the examples to find out if the component is suitable for the desired use-case. | ||
|
||
[#customization] | ||
== Customization | ||
|
||
The SearchHeader component allows for content customization: | ||
|
||
* define header title | ||
* add input fields | ||
* add header actions buttons | ||
* `*ocxAdvanced` directive | ||
** The `*ocxAdvanced` directive specifies whether a field is part of the `basic` or `advanced` mode. This mode can be toggled using the Basic\|Advanced button in the search header which is only displayed when this directive is used for defining advanced input fields. The directive will be added to the div element: | ||
+ | ||
[source, html] | ||
---- | ||
<form [formGroup]="criteriaGroup"> | ||
<div class="grid mt-0 p-fluid"> | ||
<div *ocxAdvanced class="col-12 md:col-3"> | ||
<span class="p-float-label"> | ||
// PLACE YOUR INPUT FIELD HERE | ||
</span> | ||
</div> | ||
... | ||
---- | ||
To find out how to work with the SearchHeader component, please visit the {search_header_storybook}[storybook page] and interact with the examples to find out the required features. For more in-depth information on the SearchHeader component interface, please read the further documentation. | ||
[#inputs] | ||
== Inputs | ||
[cols="1,1,1,2", options="header"] | ||
.SearchHeader inputs | ||
|=== | ||
|Property name | Type | Default | Description | ||
| `header` | `string` | `''` | Translation key for header title. | ||
| `subheader` | `string \| undefined` | - | Translation key for sub-header title. | ||
| `viewMode` | `'basic' \| 'advanced'` | `'basic'` | Determines if `'basic'` or `'advanced'` search criterias are displayed. | ||
| `manualBreadcrumbs` |`boolean` | `false` | Determines to use custom or default rendered breadcrumbs. | ||
| `actions` | `<<column-type, ColumnType>>` | `[]` | Array of actions available in the header in form of a button or a menu item. Please refer to {page_header_url}[PageHeader component] for detailed information. | ||
| `searchButtonDisabled` | `boolean` | `false` | Determines if the search button should be rendered. | ||
| `resetButtonDisabled` | `boolean` | `false` | Determines if the reset button should be rendered. | ||
// TODO: Add reference to search config docs? | ||
| `searchConfigPermission` | `string \| string[] \| undefined` | - | Defines the permission key(s) for displaying the searchConfig. | ||
| `pageName` | `string \| undefined` | - | Defines page name for searchConfig. | ||
|=== | ||
[#outputs] | ||
== Outputs | ||
.SearchHeader outputs | ||
|=== | ||
| Property name | Type | Description | ||
| `searched` | `EventEmitter<any>` | Emits event when search button is clicked. | ||
| `resetted` | `EventEmitter<any>` | Emits event when reset button is clicked. | ||
// TODO: Add reference to search config docs? | ||
| `selectedSearchConfigChanged` | `EventEmitter<<<search-config-data, SearchConfigData>> \| undefined>` | Emits the `<<search-config-data, SearchConfigData>>` upon change of selected searchConfig. | ||
| `viewModeChanged` | `EventEmitter<'basic' \| 'advanced'>` | Emits the viewMode `'basic'` or `'advanced'` when the Basic\|Advanced button is clicked. | ||
| `componentStateChanged` | `EventEmitter <<<search-header-component-state, SearchHeaderComponentState>>>` | Emits the `<<search-header-component-state, SearchHeaderComponentState>>` with updated `viewMode` or `searchConfig` if changed, to ensure consistent component state. | ||
|=== | ||
[#types] | ||
== Types | ||
[#search-header-component-state] | ||
=== SearchHeaderComponentState | ||
SearchHeaderComponentState is used to maintain consistent ComponentState. | ||
.SearchHeaderComponentState interface | ||
|=== | ||
| Property name | Type | Description | ||
| `activeViewMode` | `EventEmitter<any>` | Current active viewMode. | ||
// TODO: Add reference to search config docs? | ||
| `selectedSearchConfig` | `EventEmitter<any>` | Current selected searchConfig. | ||
|=== | ||
[#search-config-data] | ||
=== SearchConfigData | ||
// TODO: Move this to search config docs and add reference to it | ||
SearchConfigData is used for the SearchConfig component. | ||
.SearchConfigData interface | ||
|=== | ||
| Property name | Type | Description | ||
| `name` | `string \| undefined` | Name of the searchConfig. | ||
| `fieldValues` | `{ [key: string]: string }` | Data values to display. | ||
| `displayedColumnsIds` | `string[]` | List of columns to display. | ||
| `viewMode` | `'basic' \| 'advanced'` | The viewMode for displaying input fields as `'basic'` or `'advanced'`. | ||
|=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.