From 86ac4ae0e54970311383d4a2580a12314e827d08 Mon Sep 17 00:00:00 2001 From: "Xiao(Bill) Li" Date: Wed, 24 Aug 2022 13:48:37 -0400 Subject: [PATCH] docs(table): update docs / major version bump for breaking changes.(#213) --- CHANGELOG.md | 8 ++ docs/Table.md | 101 +++++++++++++++-------- packages/components/CHANGELOG.md | 7 ++ packages/core/package.json | 2 +- packages/react-components/package.json | 4 +- packages/related-table/package.json | 2 +- packages/source-iotsitewise/package.json | 4 +- packages/table/package.json | 4 +- 8 files changed, 88 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c9dcf2e..bb916677d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# 2.0.0 (2022-08-24) + +### Features +* (**breaking changes**) add supports of sorting and filtering to iot-table. ([commit hash TBA]()) + * iot-table now uses AWS-UI's table components (wrapped as a separated [package](https://github.com/awslabs/iot-app-kit/blob/main/packages/table)) instead of Synchro-chart's table component. +Check this [documentation](https://github.com/awslabs/iot-app-kit/blob/main/docs/Table.md) for more information about new APIs and migration from old API. + + # 1.4.0 (2022-06-09) diff --git a/docs/Table.md b/docs/Table.md index 187136304..48c2d3de9 100644 --- a/docs/Table.md +++ b/docs/Table.md @@ -87,7 +87,7 @@ const { query } = initialize({ iotsitewiseClient }); #### Web component example ``` -import { initialize } from '@iot-app-kit/source-iotsitewise'; +import { initialize, toId } from '@iot-app-kit/source-iotsitewise'; const { IoTSiteWiseClient } = require('@aws-sdk/client-iotsitewise'); const { defineCustomElements } = require('@iot-app-kit/components/loader'); defineCustomElements(); @@ -175,8 +175,6 @@ Specifies the data displayed in rows. Each item contains the data for one row. T Type: Array of [Item](#item) objects -Required: Yes - #### `item` An item maps its own properties to dataStreams. A special property name [$cellRef](#cellref) can be used to refer to a datastream. Other properties of an item will remain unchanged. @@ -207,7 +205,7 @@ const items: Item[] = [{ ``` -#### `$cellRef` +#### (optional) `$cellRef` $cellRef is a special keyword in Item. We use it to find the according dataStream. For the above example, the item has two properties. Both of them are using `$cellRef` to map properties to data stream. @@ -215,7 +213,10 @@ Type: Object - `id` A string representing the id of a time series data stream, which you can get by utilizing the time series data source of choices toId helper, for example, with AWS IoT SiteWise, you can refer to an id with the following code: - Type: String - - Required: Yes +- `resolution` +The resolution, in milliseconds, at which the data should be aggregated. + - Type: Number + ```typescript jsx import { toId } from '@iot-app-kit/source-sitewise'; const item = [ @@ -229,12 +230,6 @@ const item = [ } ] ``` -- `resolution` -The resolution, in milliseconds, at which the data should be aggregated. - - Type: Number - - Required: Yes - -Required: No ### `columnDefinitions` @@ -248,9 +243,8 @@ with the following changes: Type: Array of Object -Required: Yes -### `sorting` +### (optional)`sorting` Specifies sorting configuration. If you want to use sorting with default settings, provide an empty object. This feature is only applicable for the table component. @@ -260,8 +254,8 @@ Specifies sorting configuration. If you want to use sorting with default setting Type: Object -Required: No -### `propertyFiltering` + +### (optional)`propertyFiltering` Specifies property filtering configuration. @@ -278,7 +272,6 @@ Specifies property filtering configuration. Type: Object -Required: No ### `viewport` @@ -306,45 +299,81 @@ A viewport contains the following fields: Type: String -Required: Yes -### `annotations` +### (optional)`annotations` Defines thresholds for the table. To view and interact with an annotation example, see [Annotation](https://synchrocharts.com/#/Features/Annotation) in the Synchro Charts documentation. For more information about the `annotations` API, see [Properties](https://synchrocharts.com/#/API/Properties) in the Synchro Charts documentation. Type: Object - -Required: No - ### `queries` Selects what data to visualize. Learn more about queries, see [Core](https://github.com/awslabs/iot-app-kit/tree/main/docs/Core.md). + Type: Array -Required: Yes -### `styleSettings` +### (optional)`widgetId` -A map of `refId` to style settings for the table. Learn more about reference IDs, see [Core](https://github.com/awslabs/iot-app-kit/tree/main/docs/Core.md). +The ID of the widget. A widget is a visualization that you use the table component to create. -The table chart provides the following style settings that you can customize: +Type: String -* `name` string - (Optional) Specify a name to replace the name of the data set given by its source. -* `unit` string - (Optional) The unit given to the data (for example, `"m/s"` and `"count"`). -* `detailedName` string - (Optional) A detailed name that is presented in the tooltip. +### (optional)`messageOverrides` -Required: No +An object overrides messages for localization. -### `widgetId` +- `tableCellMessages` -The ID of the widget. A widget is a visualization that you use the table component to create. + (Optional) override table cell labels. + + - Default: + ``` typescript + { + loading: "Loading" + } + ``` + +- `propertyFilteringMessages` + + (Optional) override property filtering labels. + + - Default: + ```typescript + { + filteringAriaLabel: 'your choice', + dismissAriaLabel: 'Dismiss', + filteringPlaceholder: 'Search', + groupValuesText: 'Values', + groupPropertiesText: 'Properties', + operatorsText: 'Operators', + operationAndText: 'and', + operationOrText: 'or', + operatorLessText: 'Less than', + operatorLessOrEqualText: 'Less than or equal', + operatorGreaterText: 'Greater than', + operatorGreaterOrEqualText: 'Greater than or equal', + operatorContainsText: 'Contains', + operatorDoesNotContainText: 'Does not contain', + operatorEqualsText: 'Equals', + operatorDoesNotEqualText: 'Does not equal', + editTokenHeader: 'Edit filter', + propertyText: 'Property', + operatorText: 'Operator', + valueText: 'Value', + cancelActionText: 'Cancel', + applyActionText: 'Apply', + allPropertiesLabel: 'All properties', + tokenLimitShowMore: 'Show more', + tokenLimitShowFewer: 'Show fewer', + clearFiltersText: 'Clear filters', + removeTokenButtonAriaLabel: () => 'Remove token', + enteredTextLabel: (text) => `Use: "${text}"`, + }; + ``` + +Type: Object -Type: String -Required: No ----- ## Migrate from previous API diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index b0ef86638..e8d76af02 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# 2.0.0 (2022-08-24) + +### Features +* (**breaking changes**) add supports of sorting and filtering to iot-table. ([commit hash TBA]()) + * iot-table now uses AWS-UI's table components (wrapped as a separated [package](https://github.com/awslabs/iot-app-kit/blob/main/packages/table)) instead of Synchro-chart's table component. + Check this [documentation](https://github.com/awslabs/iot-app-kit/blob/main/docs/Table.md) for more information about new APIs and migration from old API. + # 1.5.0 (2022-07-09) diff --git a/packages/core/package.json b/packages/core/package.json index e897655b1..2b02e1161 100755 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.0", + "version": "2.0.0", "description": "IoT Application Kit core", "main": "./dist/index.cj.js", "module": "./dist/index.js", diff --git a/packages/react-components/package.json b/packages/react-components/package.json index 1835df24e..410218bb9 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -5,7 +5,7 @@ "access": "public" }, "sideEffects": false, - "version": "1.5.0", + "version": "2.0.0", "description": "React specific wrapper for IoT Application Kit", "author": { "name": "Amazon Web Services", @@ -46,7 +46,7 @@ "typescript": "^3.3.4000" }, "dependencies": { - "@iot-app-kit/components": "^1.5.0" + "@iot-app-kit/components": "^2.0.0" }, "peerDependencies": { "react": "^17.0.2", diff --git a/packages/related-table/package.json b/packages/related-table/package.json index 90d685cb0..8be3bee09 100644 --- a/packages/related-table/package.json +++ b/packages/related-table/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.0", + "version": "2.0.0", "description": "IoT Application Kit - Related Table component", "license": "Apache-2.0", "main": "dist/index.js", diff --git a/packages/source-iotsitewise/package.json b/packages/source-iotsitewise/package.json index 5b46dc69c..9b86f0e6d 100644 --- a/packages/source-iotsitewise/package.json +++ b/packages/source-iotsitewise/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.0", + "version": "2.0.0", "description": "AWS IoT SiteWise source for IoT Application Kit", "homepage": "https://github.com/awslabs/iot-app-kit#readme", "license": "Apache-2.0", @@ -39,7 +39,7 @@ }, "dependencies": { "@aws-sdk/client-iotsitewise": "^3.87.0", - "@iot-app-kit/core": "^1.5.0", + "@iot-app-kit/core": "^2.0.0", "@rollup/plugin-typescript": "^8.3.0", "@synchro-charts/core": "^6.0.0", "dataloader": "^2.1.0", diff --git a/packages/table/package.json b/packages/table/package.json index aa904e13b..6bd2f7f13 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.0", + "version": "2.0.0", "description": "IoT Application Kit - Table component", "license": "Apache-2.0", "main": "./dist/index.cj.js", @@ -53,7 +53,7 @@ "dependencies": { "@awsui/collection-hooks": "^1.0.0", "@awsui/components-react": "^3.0.0", - "@iot-app-kit/core": "^1.5.0", + "@iot-app-kit/core": "^2.0.0", "@synchro-charts/core": "^5.0.0", "d3-array": "^3.1.6", "react": "^17.0.2",