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

Fix/example app node version #1470

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@ jobs:
working-directory: example/

- name: Pull docker images
run: docker-compose pull
run: docker compose pull
working-directory: example/

- name: Run docker images
env:
ENVIRONMENT: CI
run: docker-compose up -d
run: docker compose up -d
working-directory: example/

- name: Capture output DMSS version
id: capture_dmss_version
run: |
docker-compose exec -t dmss cat src/version.txt > dmss_version.txt
docker compose exec -t dmss cat src/version.txt > dmss_version.txt
dmss_version=$(tail -n 1 dmss_version.txt)
echo "dmss_version=$dmss_version" >> "$GITHUB_OUTPUT"
working-directory: example/

- name: Capture job-api version
id: capture_job_version
run: |
docker-compose exec -t job-api cat version.txt > job_version.txt
docker compose exec -t job-api cat version.txt > job_version.txt
job_version=$(tail -n 1 job_version.txt)
echo "job_version=$job_version" >> "$GITHUB_OUTPUT"
working-directory: example/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: "v0.1.0"
hooks:
- id: biome-check
additional_dependencies: [ "@biomejs/biome@1.4.1" ]
additional_dependencies: [ "@biomejs/biome@1.9.4" ]

- repo: local
hooks:
Expand Down
7 changes: 2 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignore": [
"packages/dm-core/src/services/api/configs/**",
Expand All @@ -18,7 +18,7 @@
"indentWidth": 2,
"jsxQuoteStyle": "single",
"quoteStyle": "single",
"trailingComma": "es5"
"trailingCommas": "es5"
}
},
"json": {
Expand All @@ -37,9 +37,6 @@
],
"enabled": true,
"rules": {
"nursery": {
"noUnusedImports": "error"
},
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
Expand Down
6 changes: 2 additions & 4 deletions e2e/tests/plugin-default_recipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ test('TableList default DMSS UI Recipe', async ({ page }) => {
await expect(page.getByRole('code')).toBeVisible()
await page.getByRole('tab', { name: 'Edit' }).click()
await page.getByLabel('Open in tab').click()
await page
.getByRole('row', { name: 'Volvo' })
.getByRole('button', { name: 'Expand item', exact: true })
.click()
await expect(page.getByTestId('expandListItem-0').last()).toBeVisible()
await page.getByTestId('expandListItem-0').last().click()
await expect(page.getByRole('button', { name: 'Copy as YAML' })).toBeVisible()
await page.getByRole('tab', { name: 'Edit' }).last().click()
await expect(page.getByTestId('form-text-widget-Manufacturer')).toHaveValue(
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/plugin-form-Nested.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page, expect, test } from '@playwright/test'
import { type Page, expect, test } from '@playwright/test'

test.describe.configure({ mode: 'serial' })

Expand Down
24 changes: 2 additions & 22 deletions e2e/tests/plugin-grid-car_grid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,16 @@ test.beforeEach(async ({ page }) => {
)
})

test('Table non-referenced', async ({ page }) => {
test('Check rendered children items', async ({ page }) => {
const cars = page.getByTestId('carsOnGrid')
await expect(cars.getByText('Lando')).toBeVisible()
await cars.getByRole('tab', { name: 'Q2' }).click()
await expect(cars.getByText('Albon')).toBeVisible()
})

test('List reference resolved', async ({ page }) => {
const tyreList = page.getByTestId('tyreList')
await expect(tyreList.getByText('Hard')).toBeVisible()
await tyreList
.getByRole('row')
.filter({ hasText: 'Soft' })
.getByRole('button', { name: 'Expand item' })
.click()
await expect(
tyreList
.getByLabel('Tyre description')
.getByText('Faster, but wears quicker.')
).toBeVisible()
})

test('List reference unresolved', async ({ page }) => {
const tyreList = page.getByTestId('tyreList')
await expect(
tyreList.getByTestId('form-text-widget-Reference Type')
).toHaveValue('link')
})

test('Nested form', async ({ page }) => {
test('Test Nested form render', async ({ page }) => {
const nestedForm = page.getByTestId('nestedForm')
await expect(nestedForm.getByLabel('Bar')).toHaveText('hello')
})
26 changes: 12 additions & 14 deletions e2e/tests/plugin-header-roles_header_example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,22 @@ test('Change to operator role and back', async ({ page }) => {

await test.step('Edit option not visible through Explorer', async () => {
await page.getByRole('menuitem', { name: 'Explorer' }).click()
await page
const demoDataSourceListItem = page
.locator('li')
.filter({ hasText: /^data sourceDemoDataSource$/ })
.getByRole('button')
.click()
await page
.filter({ hasText: 'DemoDataSource' })
.last()
await demoDataSourceListItem.getByRole('button').click()
const pluginsListItem = demoDataSourceListItem
.locator('li')
.filter({ hasText: /^root packageplugins$/ })
.getByRole('button')
.click()
await page
.filter({ hasText: 'plugins' })
await pluginsListItem.getByRole('button').click()
const headerListItem = pluginsListItem
.locator('li')
.filter({ hasText: /^packageheader$/ })
.getByRole('button')
.click()
await page
.filter({ hasText: 'header' })
await headerListItem.getByRole('button').click()
await headerListItem
.locator('li')
.filter({ hasText: /^packageroles_header_example$/ })
.filter({ hasText: 'roles_header_example' })
.getByRole('button')
.click()
await page.getByRole('button', { name: 'file elonMusk' }).nth(1).click()
Expand Down
12 changes: 8 additions & 4 deletions e2e/tests/plugin-view_selector-car_garage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ test('View selector - car garage', async ({ page }) => {
)
})

await test.step('Collapse and expand sidebar', async () => {
// TODO: EDS ISSUE - Sidebar open state can't be controlled. Contact eds-team and wait for a solution or create own sidebar

/* await test.step('Collapse and expand sidebar', async () => {
await page.getByRole('tab', { name: 'Self' }).click()
await page.getByRole('button', { name: 'Collapse sidebar' }).click()
await expect(page.getByRole('tab', { name: 'Self' })).not.toBeVisible()
Expand All @@ -27,7 +29,7 @@ test('View selector - car garage', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Self' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Audi' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Volvo' })).toBeVisible()
})
}) */

await test.step('Open a car and verify that tabs opens within the car', async () => {
await page.getByRole('tab', { name: 'Audi' }).click()
Expand Down Expand Up @@ -69,9 +71,11 @@ test('View selector - car garage', async ({ page }) => {
page.getByRole('tab', { name: 'car Dimensions' })
).toBeVisible()

await page.getByTestId('form-text-widget-Next control date').last()
await page
.getByTestId('form-text-widget-Next control date')
.last()

.fill('2025-06-31')
.fill('2025-06-31')
await page.getByRole('button', { name: 'Submit' }).click()
await expect(page.getByRole('alert')).toHaveText(['Document updated'])
await page
Expand Down
8 changes: 2 additions & 6 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../tsconfig.json",
"include": [
"tests"
],
"exclude": [
"node_modules"
]
"include": ["tests"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:21-bullseye-slim as base
FROM node:22-bullseye-slim as base
WORKDIR /code
COPY package.json ./
RUN yarn install --immutable --immutable-cache
Expand Down
54 changes: 25 additions & 29 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@development-framework/dm-core": "^1.3.3",
"@development-framework/dm-core-plugins": "^1.3.3",
"plotly.js": "^2.18.2",
"@development-framework/dm-core": "^1.46.0",
"@development-framework/dm-core-plugins": "^1.57.0",
"plotly.js": "^2.35.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-oauth2-code-pkce": "^1.10.1",
"react-oauth2-code-pkce": "^1.22.2",
"react-plotly.js": "^2.6.0",
"react-router-dom": "^6.21.2",
"react-toastify": "9.1.3",
"styled-components": "^5.3.11",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.0"
"react-router-dom": "^7.0.2",
"react-toastify": "10.0.6",
"styled-components": "^6.1.13",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.2.0"
},
"devDependencies": {
"@biomejs/biome": "1.4.1",
"@types/node": "^20.10.0",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.7",
"@types/react-plotly.js": "^2.6.0",
"@biomejs/biome": "1.9.4",
"@types/node": "^20.10.2",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/react-plotly.js": "^2.6.3",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.26",
"@vitejs/plugin-react-swc": "^3.3.2",
"serve": "14.2.1",
"typescript": "^5.2.2",
"vite": "^5.0.0",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^0.34.6"
"@types/styled-components": "^5.1.34",
"@vitejs/plugin-react-swc": "^3.7.2",
"serve": "14.2.4",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-svgr": "^4.3.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
},
"scripts": {
"start": "vite",
"build": "vite build -d",
"lint": "biome lint . --apply",
"lint": "biome lint . --write",
"preview": "vite preview",
"serve": "serve -s dist -p 3000 --no-clipboard",
"test": "vitest",
Expand All @@ -45,11 +45,7 @@
"remove-symlinks": "for package in ../packages/*/; do echo $package && rm -rf dist && cd ../example; done"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
6 changes: 3 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {
DMApplicationProvider,
DmssAPI,
EntityView,
ErrorResponse,
TApplication,
type ErrorResponse,
type TApplication,
} from '@development-framework/dm-core'
import { Button, Card, Icon, Typography } from '@equinor/eds-core-react'
import { refresh } from '@equinor/eds-icons'

import { AxiosError } from 'axios'
import type { AxiosError } from 'axios'
import { useContext, useEffect, useState } from 'react'
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
import ViewPage from './ViewPage'
Expand Down
2 changes: 1 addition & 1 deletion example/src/ViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
EntityView,
ErrorGroup,
Loading,
TValidEntity,
type TValidEntity,
useDocument,
} from '@development-framework/dm-core'
import { Typography } from '@equinor/eds-core-react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
IUIPlugin,
type IUIPlugin,
Loading,
TGenericObject,
type TGenericObject,
useDocument,
} from '@development-framework/dm-core'
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { chevron_left, chevron_right } from '@equinor/eds-icons'
import { useState } from 'react'

import {
IUIPlugin,
type IUIPlugin,
Loading,
TGenericObject,
type TGenericObject,
useDocument,
} from '@development-framework/dm-core'
import { PaginationWrapper, SectionWrapper } from './styles'
Expand Down Expand Up @@ -86,6 +86,7 @@ const SignalTable = (props: { document: TGenericObject }) => {
{rows
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
.map((row: any) => (
// biome-ignore lint/a11y/useSemanticElements: <explanation>
<Table.Row role='checkbox' tabIndex={-1} key={row.index}>
{columns.map((column) => {
const value = row[column.id]
Expand Down
6 changes: 3 additions & 3 deletions example/src/plugins/marmo-ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { TUiPluginMap } from '@development-framework/dm-core'
import type { TUiPluginMap } from '@development-framework/dm-core'

//views
import { SignalPlot } from './containers/views/SignalPlot'
import { SignalTable } from './containers/views/SignalTable/SignalTable'

export default ({
export default {
'marmo-ess-plot-view': {
component: SignalPlot,
},
'marmo-ess-table-view': {
component: SignalTable,
},
} as TUiPluginMap)
} as TUiPluginMap
Loading
Loading