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

chore: release merge rc into main #3079

Merged
merged 24 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5839ebf
chore: vitest mitgration
tracy-french Nov 20, 2024
5d4ecac
fix(react-components): allow vertical legend reszing when title prese…
ssjagad Nov 20, 2024
5041aa2
fix: build conflicts
Nov 21, 2024
a03fbb0
fix: dashboard editor grid dot
Nov 21, 2024
9f271ca
fix: assistant failing to fetch
Nov 21, 2024
ac5a618
feat: improve prompt engering for assistant dashboard
Nov 22, 2024
25c456c
chore: adjust documentation links and have the same README to all pac…
Nov 22, 2024
e65ae4b
chore: vitest mitgration
tracy-french Nov 20, 2024
833f3e7
chore: force update packages
tracy-french Nov 21, 2024
c282317
fix: missing package-lock.json updates
tracy-french Nov 25, 2024
d8ea960
chore: move doc-site to apps dir
tracy-french Nov 25, 2024
2dc39f5
docs: installation dev guide
tracy-french Nov 25, 2024
7a3ecdc
chore: shard dashboard playwright tests in CI
tracy-french Nov 25, 2024
289c135
fix: fix time series data hook reactivity
jmbuss Nov 25, 2024
135bc48
chore: add assistant documentation, overview, kpi, gauge, chart, tabl…
Nov 22, 2024
18385e6
fix: disable chatbot button when assistant is loading, improve error …
Nov 25, 2024
67bfe3b
chore: get started page updates
Nov 26, 2024
7d33668
chore: move dashboard dev env + msw to separate packages for reuse
tracy-french Nov 26, 2024
7999974
fix: type-fest dep
tracy-french Nov 26, 2024
3204abc
chore: update lodash imports to use esm
tracy-french Nov 26, 2024
71bae9c
chore: specified permissions need for dashboard to operate in docs
chejimmy Nov 27, 2024
09a7874
fix: exports
tracy-french Nov 27, 2024
2160f88
fix: doc site assistant pages
tracy-french Nov 27, 2024
2b1a541
fix: doc site import
tracy-french Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 33 additions & 14 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ on:
pull_request:
push:
branches:
- sophon
- rc
- main
env:
PW_TEST_HTML_REPORT_OPEN: 'never'
jobs:
repo:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -49,14 +50,19 @@ jobs:
unit:
needs: repo
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
package:
[
core,
core-util,
dashboard,
data-mocked,
dev-env,
doc-site,
helpers,
react-components,
scene-composer,
source-iotsitewise,
Expand Down Expand Up @@ -107,14 +113,24 @@ jobs:
${{ runner.os }}-test-lint-${{ matrix.package}}-

- name: Validate
run: npx turbo run build:cjs build:es lint test --filter=@iot-app-kit/${{ matrix.package }}
run: npx turbo build:cjs build:es lint test --filter=@iot-app-kit/${{ matrix.package }}

playwright:
needs: repo
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
package: [dashboard, react-components, scene-composer]
package:
[
{ name: 'dev-env', shardIndex: 1, totalShards: 4 },
{ name: 'dev-env', shardIndex: 2, totalShards: 4 },
{ name: 'dev-env', shardIndex: 3, totalShards: 4 },
{ name: 'dev-env', shardIndex: 4, totalShards: 4 },
{ name: 'react-components', totalShards: 1, shardIndex: 1 },
{ name: 'scene-composer', totalShards: 1, shardIndex: 1 },
]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -145,9 +161,9 @@ jobs:
uses: actions/cache@v4
with:
path: '.turbo'
key: ${{ runner.os }}-turbo-playwright-${{ matrix.package}}-${{ github.sha }}
key: ${{ runner.os }}-turbo-playwright-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-playwright-${{ matrix.package}}-
${{ runner.os }}-turbo-playwright-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-

- name: Get installed Playwright version
id: playwright-version
Expand All @@ -172,20 +188,23 @@ jobs:
run: npx playwright install-deps

- name: Playwright
run: npx turbo run test:ui:ci --filter=@iot-app-kit/${{matrix.package}}
run: |
npx turbo test:ui:ci --filter=@iot-app-kit/${{ matrix.package.name }} -- --shard=${{ matrix.package.shardIndex }}/${{ matrix.package.totalShards }}

- name: Failure report
- name: Test report
id: upload-test-report
uses: actions/upload-artifact@v4
if: failure()
if: always()
with:
name: ${{ matrix.package }}-test-results
path: packages/**/test-results
name: ${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-playwright-report
path: packages/**/playwright-report
retention-days: 30

- name: Test report
- name: Failure report
id: upload-failure-report
uses: actions/upload-artifact@v4
if: always()
if: failure()
with:
name: ${{ matrix.package }}-playwright-report
path: packages/**/playwright-report
name: ${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-test-results
path: packages/**/test-results
retention-days: 30
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/post-checkout

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/post-commit

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/post-merge

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/pre-push

This file was deleted.

3 changes: 0 additions & 3 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"packages/source-iotsitewise": "12.1.0",
"packages/source-iottwinmaker": "12.1.0",
".": "12.1.0",
"configuration/jest-config": "12.1.0",
"packages/testing-util": "12.1.0",
"configuration/ts-config": "12.1.0",
"configuration/eslint-config": "12.1.0",
"packages/tools-iottwinmaker": "12.1.0"
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[![Downloads](https://img.shields.io/npm/dw/@iot-app-kit/core)](https://npmjs.org/package/@iot-app-kit/core)


## [Official IoT App Kit documentation site](https://awslabs.github.io/iot-app-kit/)
## Official IoT App Kit documentation site

#### Please visit [https://awslabs.github.io/iot-app-kit/](https://awslabs.github.io/iot-app-kit/) for docs, guides and more!

## Overview

Expand Down
16 changes: 16 additions & 0 deletions apps/dev-env/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VITE_AWS_ACCESS_KEY_ID=xxxxx
VITE_AWS_SECRET_ACCESS_KEY=xxxxx
VITE_AWS_SESSION_TOKEN=xxxxx
VITE_AWS_REGION=xxxxx
VITE_EDGE_GATEWAY_ENDPOINT=xxxxx

STRING_ASSET_ID=xxxxx

DEMO_TURBINE_ASSET_1=xxxxx
DEMO_TURBINE_ASSET_1_PROPERTY_1=xxxxx
DEMO_TURBINE_ASSET_1_PROPERTY_2=xxxxx
DEMO_TURBINE_ASSET_1_PROPERTY_3=xxxxx
DEMO_TURBINE_ASSET_1_PROPERTY_4=xxxxx

AGGREGATED_DATA_PROPERTY=xxxxx
AGGREGATED_DATA_PROPERTY_2=xxxxx
2 changes: 2 additions & 0 deletions apps/dev-env/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
storybook-static
File renamed without changes.
24 changes: 24 additions & 0 deletions apps/dev-env/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { StorybookConfig } from '@storybook/react-vite';

const config = {
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],

staticDirs: ['../public'],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],

framework: '@storybook/react-vite',

typescript: {
check: false,
reactDocgen: false,
},

docs: {},
} satisfies StorybookConfig;

export default config;
19 changes: 19 additions & 0 deletions apps/dev-env/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { handlers } from '@iot-app-kit/data-mocked/handers';
import { initialize, mswLoader } from 'msw-storybook-addon';

initialize();

export const parameters = {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
msw: {
handlers,
},
};

export const loaders = [mswLoader];
export const tags = ['autodocs'];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { expect, test } from '@playwright/test';

const TEST_PAGE = '/iframe.html?id=dashboard-mocked-data--view-only';
const TEST_PAGE = '/iframe.html?args=&id=dashboard-mocked-data--view-only';

test('dashboard has assistant enabled', async ({ page }) => {
await page.goto(TEST_PAGE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type Locator, type Page } from '@playwright/test';

const Y_LABEL_PLACEHOLDER_TEXT = 'Input Y-axis label';
const CHECKBOX_LOCATOR = 'input[type=checkbox]';

export class ConfigPanel {
readonly page: Page;
readonly container: Locator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const TEST_PAGE = '/iframe.html?id=dashboard-mocked-data--empty';
export const TEST_PAGE = '/iframe.html?args=&id=dashboard-mocked-data--empty';
export const TEST_IFRAME = '#root';
export const COMPONENT_SELECTOR = '.dashboard';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const DEFAULT_WIDGET_POS_Y = 300;
export class DashboardPage {
readonly page: Page;
readonly browser: Browser;
public readonly heading: Locator;
public readonly widgetPalette: Locator;
public readonly lineChartWidgetButton: Locator;
public readonly textWidgetButton: Locator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { test, expect } from '@playwright/test';
import { gridUtil } from '../utils/grid';
import { expect, test } from '@playwright/test';
import {
ASSET_MODEL_TAB,
MODELED_TAB,
TEST_PAGE,
UNMODELED_TAB,
WIDGET_EMPTY_STATE_TEXT,
} from '../constants';
import { gridUtil } from '../utils/grid';
import { resourceExplorerUtil } from '../utils/resourceExplorer';
import { componentAssetModelName } from '../../../src/msw/iot-sitewise/resources/assetModels';

test('can load resource explorer', async ({ page }) => {
await page.goto(TEST_PAGE);
Expand Down Expand Up @@ -317,8 +316,8 @@ test('filters COMPONENT_MODEL from asset model results', async ({ page }) => {
await page.getByLabel('Asset model', { exact: true }).click();
const searchBox = await page.getByPlaceholder('Filter asset models');
await searchBox.click();
await searchBox.fill(componentAssetModelName);
await searchBox.fill('Component Asset Model');

// check that composite model does not show up
await expect(page.getByText(componentAssetModelName)).not.toBeVisible();
await expect(page.getByText('Component Asset Model')).not.toBeVisible();
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type Locator, type Page } from '@playwright/test';
import zip from 'lodash/zip';
import { isDefined } from '../../../src/util/isDefined';
import { center } from './mousePosition';
import zip from 'lodash-es/zip.js';
import { type BoundingBox, getBoundingBox } from './locator';
import { center } from './mousePosition';

export type Point = [number, number];

Expand Down Expand Up @@ -70,7 +69,9 @@ const subdivide = (points: Point[]) => {
const midPointsOfPairs = pairPoints(points).map(midPointFromPair);
// Interleave the original list with the mid points of the pair
// Remove any undefined entries as the result of interleaving
return zip(points, midPointsOfPairs).flat().filter(isDefined);
return zip(points, midPointsOfPairs)
.flat()
.filter((p) => p != null);
};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type Locator, type Page } from '@playwright/test';

import { type DragPosition, dragAndDrop } from './dragAndDrop';
import { center } from './mousePosition';
import { type BoundingBox, getBoundingBox } from './locator';
import { center } from './mousePosition';

export const GRID_SIZE = 10;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { expect, test, type Locator } from '@playwright/test';
import { ConfigPanel } from '../configPanel/ConfigPanel';
import { NEW_PROPERTY_NAME } from '../constants';
import { test, expect } from '@playwright/test';
import { getTrendCursorText } from './LineWidget';
import { type Locator } from '@playwright/test';
import { createNewDashboardWithWidget } from '../createDashboardWidget';
import { ResourceExplorer } from '../resourceExplorer/ResourceExplorer';
import { ConfigPanel } from '../configPanel/ConfigPanel';
import { getTrendCursorText } from './LineWidget';

const NEW_Y_LABEL = 'This is new Y-axis Label';
const Y_MIN = '1';
Expand Down
52 changes: 52 additions & 0 deletions apps/dev-env/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@iot-app-kit/dev-env",
"private": true,
"type": "module",
"scripts": {
"start": "npm run dev",
"clean": "rimraf storybook-static .turbo .cache test-results playwright-report",
"clean:nuke": "npm run clean && rimraf node_modules",
"dev": "storybook dev -p 6006",
"lint": "eslint . --max-warnings=0 --cache --cache-location .cache/eslint/ & tsc --noEmit",
"fix": "eslint --fix . --cache --cache-location ./cache/eslint/",
"test:ui": "npx playwright test",
"test:ui:ci": "npx playwright test",
"test:ui:watch": "npx playwright test --ui"
},
"dependencies": {
"@aws-sdk/client-iot-events": "^3.354.0",
"@aws-sdk/client-iotsitewise": "^3.696.0",
"@aws-sdk/client-iottwinmaker": "^3.354.0",
"@cloudscape-design/components": "3.0.693",
"@iot-app-kit/core": "*",
"@iot-app-kit/core-util": "*",
"@iot-app-kit/dashboard": "*",
"@iot-app-kit/data-mocked": "*",
"@iot-app-kit/helpers": "*",
"@iot-app-kit/ts-config": "*",
"@playwright/test": "^1.48.2",
"@storybook/addon-essentials": "^8.4.5",
"@storybook/addon-interactions": "^8.4.5",
"@storybook/addon-links": "^8.4.5",
"@storybook/react": "^8.4.5",
"@storybook/react-vite": "^8.4.5",
"@storybook/test": "^8.4.5",
"@types/lodash-es": "^4.17.12",
"@types/node": "^18.16.18",
"@vitejs/plugin-react": "^4.3.3",
"eslint-config-iot-app-kit": "*",
"lodash-es": "^4.17.21",
"msw-storybook-addon": "^2.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.46.1",
"rimraf": "^5.0.1",
"storybook": "^8.4.5",
"typescript": "^5.5.4",
"uuid": "^9.0.0",
"vite": "^5.4.11"
},
"msw": {
"workerDirectory": "public"
}
}
Loading
Loading