From 5fdaf06f287e3d67707ab94766d529fd22a50030 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Wed, 11 Dec 2024 17:27:53 +0000 Subject: [PATCH] Fixing dm components (#2860) --- .github/workflows/create-release.yml | 12 ++-- .github/workflows/test-and-release.yml | 67 +++---------------- packages/admin/src-admin/src/App.tsx | 12 +++- .../src/components/Object/ObjectChart.tsx | 2 + .../components/Object/ObjectHistoryData.tsx | 2 + .../SystemSettingsTabs/MainSettingsDialog.tsx | 2 + .../SystemSettingsTabs/RepositoriesDialog.tsx | 1 + .../dm-gui-components/src/Communication.tsx | 1 + 8 files changed, 29 insertions(+), 70 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index e7150e233..f4ff00fe6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -17,23 +17,19 @@ jobs: publish-config: runs-on: ubuntu-20.04 - strategy: - matrix: - node: [20.x] # This should be LTS - steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch the history, or this action won't work - - name: Use Node.js ${{ matrix.node }} + - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version: 20.x - - name: Install dependencies - run: npm ci -f + - name: Install Dependencies + run: npm run install-monorepo - name: 'Build backend' run: npm run build:backend -w packages/admin diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 4c7b84b71..30f3eb93d 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -30,32 +30,12 @@ jobs: with: node-version: 20.x - - name: 'Install' - run: npm i -f - - - name: 'Install Adapter' - run: npm i -w packages/admin -f - - - name: 'Install FE' - run: | - cd packages/admin/src-admin - npm i -f - - - name: 'Lint Backend' - run: npm run lint-backend -w packages/admin + - name: Install Dependencies + run: npm run install-monorepo - name: 'Build backend' run: npm run build:backend -w packages/admin - - name: 'Build adapter-react-v5' - run: npm run build -w packages/adapter-react-v5 - - - name: 'Build JsonConfig' - run: npm run build -w packages/jsonConfig - - - name: 'Build dm-gui-components' - run: npm run build -w packages/dm-gui-components - - name: Check TypeScript files run: | cd packages/admin/src-admin @@ -63,10 +43,8 @@ jobs: # Wait till js-controller 7 types are available continue-on-error: true - - name: 'Build' - run: | - npm run clean - NODE_OPTIONS=--max_old_space_size=4096 npm run build + - name: Build + run: NODE_OPTIONS=--max_old_space_size=8192 npm run build # Runs adapter tests on all supported node versions and OSes adapter-tests: @@ -110,43 +88,14 @@ jobs: with: node-version: 20.x - - name: 'Install' - run: npm i -f - - - name: 'Install Adapter' - run: npm i -w packages/admin -f - - - name: 'Install FE' - run: | - cd packages/admin/src-admin - npm i -f - - - name: 'Lint Backend' - run: npm run lint-backend -w packages/admin + - name: Install Dependencies + run: npm run install-monorepo - name: 'Build backend' run: npm run build:backend -w packages/admin - - name: 'Build adapter-react-v5' - run: npm run build -w packages/adapter-react-v5 - - - name: 'Build JsonConfig' - run: npm run build -w packages/jsonConfig - - - name: 'Build dm-gui-components' - run: npm run build -w packages/dm-gui-components - - - name: Check TypeScript files - run: | - cd packages/admin/src-admin - npm run check-ts - # Wait till js-controller 7 types are available - continue-on-error: true - - - name: 'Build' - run: | - npm run clean - NODE_OPTIONS=--max_old_space_size=4096 npm run build + - name: Build + run: NODE_OPTIONS=--max_old_space_size=8192 npm run build - name: Run GUI tests run: npm run test:gui -w packages/admin/ diff --git a/packages/admin/src-admin/src/App.tsx b/packages/admin/src-admin/src/App.tsx index e041be171..e3fc2c3d8 100644 --- a/packages/admin/src-admin/src/App.tsx +++ b/packages/admin/src-admin/src/App.tsx @@ -2411,9 +2411,13 @@ class App extends Router { if (this.state.user && this.props.width !== 'xs' && this.props.width !== 'sm') { return (
- {this.state.systemConfig.common.siteName ? ( -
{this.state.systemConfig.common.siteName}
- ) : null} + { + // @ts-expect-error fixed in js-controller 7 + this.state.systemConfig.common.siteName ? ( + // @ts-expect-error fixed in js-controller 7 +
{this.state.systemConfig.common.siteName}
+ ) : null + } {
); } + // @ts-expect-error fixed in js-controller 7 if (this.props.width !== 'xs' && this.props.width !== 'sm' && this.state.systemConfig.common.siteName) { + // @ts-expect-error fixed in js-controller 7 return
{this.state.systemConfig.common.siteName}
; } return null; diff --git a/packages/admin/src-admin/src/components/Object/ObjectChart.tsx b/packages/admin/src-admin/src/components/Object/ObjectChart.tsx index 191d037a8..87b2682d4 100644 --- a/packages/admin/src-admin/src/components/Object/ObjectChart.tsx +++ b/packages/admin/src-admin/src/components/Object/ObjectChart.tsx @@ -520,6 +520,7 @@ class ObjectChart extends Component { from: false, ack: false, q: false, + // @ts-expect-error fixed in js-controller 7 addId: false, aggregate: 'none', }) @@ -565,6 +566,7 @@ class ObjectChart extends Component { from: false, ack: false, q: false, + // @ts-expect-error fixed in js-controller 7 addId: false, aggregate: 'none', returnNewestEntries: true, diff --git a/packages/admin/src-admin/src/components/Object/ObjectHistoryData.tsx b/packages/admin/src-admin/src/components/Object/ObjectHistoryData.tsx index 4a388a6fb..ffd987957 100644 --- a/packages/admin/src-admin/src/components/Object/ObjectHistoryData.tsx +++ b/packages/admin/src-admin/src/components/Object/ObjectHistoryData.tsx @@ -522,6 +522,7 @@ class ObjectHistoryData extends Component { variant="standard" id="siteName" label={this.props.t('Site name')} + // @ts-expect-error Fixed in js-controller 7 value={this.props.data.common.siteName || ''} onChange={e => this.doChange('siteName', e.target.value)} helperText={this.props.t( @@ -662,6 +663,7 @@ class MainSettingsDialog extends BaseSystemSettingsDialog { )} slotProps={{ input: { + // @ts-expect-error Fixed in js-controller 7 endAdornment: this.props.data.common.siteName ? ( diff --git a/packages/dm-gui-components/src/Communication.tsx b/packages/dm-gui-components/src/Communication.tsx index b7b61eea0..50e6e3a21 100644 --- a/packages/dm-gui-components/src/Communication.tsx +++ b/packages/dm-gui-components/src/Communication.tsx @@ -579,6 +579,7 @@ class Communication

open={!0} onClose={() => this.state.form?.handleClose && this.state.form.handleClose()} hideBackdrop + fullWidth maxWidth={this.state.form.maxWidth || 'md'} > {this.state.form?.title ? (