Skip to content

Commit

Permalink
Fixing dm components (#2860)
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox authored Dec 11, 2024
1 parent 7a7a77b commit 5fdaf06
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 70 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 8 additions & 59 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,21 @@ 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

# Runs adapter tests on all supported node versions and OSes
adapter-tests:
Expand Down Expand Up @@ -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/
Expand Down
12 changes: 9 additions & 3 deletions packages/admin/src-admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2411,9 +2411,13 @@ class App extends Router<AppProps, AppState> {
if (this.state.user && this.props.width !== 'xs' && this.props.width !== 'sm') {
return (
<div>
{this.state.systemConfig.common.siteName ? (
<div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>
) : null}
{
// @ts-expect-error fixed in js-controller 7
this.state.systemConfig.common.siteName ? (
// @ts-expect-error fixed in js-controller 7
<div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>
) : null
}

<Box
component="div"
Expand Down Expand Up @@ -2456,7 +2460,9 @@ class App extends Router<AppProps, AppState> {
</div>
);
}
// @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 <div style={styles.siteName}>{this.state.systemConfig.common.siteName}</div>;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class ObjectChart extends Component<ObjectChartProps, ObjectChartState> {
from: false,
ack: false,
q: false,
// @ts-expect-error fixed in js-controller 7
addId: false,
aggregate: 'none',
})
Expand Down Expand Up @@ -565,6 +566,7 @@ class ObjectChart extends Component<ObjectChartProps, ObjectChartState> {
from: false,
ack: false,
q: false,
// @ts-expect-error fixed in js-controller 7
addId: false,
aggregate: 'none',
returnNewestEntries: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ class ObjectHistoryData extends Component<ObjectHistoryDataProps, ObjectHistoryD
from: true,
ack: true,
q: true,
// @ts-expect-error fixed in js-controller 7
addId: false,
aggregate: 'none',
returnNewestEntries: true,
Expand Down Expand Up @@ -633,6 +634,7 @@ class ObjectHistoryData extends Component<ObjectHistoryDataProps, ObjectHistoryD
from: false,
ack: false,
q: false,
// @ts-expect-error fixed in js-controller 7
addId: false,
aggregate: 'none',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,15 @@ class MainSettingsDialog extends BaseSystemSettingsDialog<Props, State> {
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(
"This name will be shown in admin's header. Just to identify the whole installation",
)}
slotProps={{
input: {
// @ts-expect-error Fixed in js-controller 7
endAdornment: this.props.data.common.siteName ? (
<InputAdornment position="end">
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ class RepositoriesDialog extends BaseSystemSettingsDialog<RepositoriesDialogProp
<span>
<Checkbox
disabled
// @ts-expect-error Fixed in js-controller 7
checked={this.props.repoInfo[item.title]?.stable}
indeterminate={!this.props.repoInfo[item.title]}
/>
Expand Down
1 change: 1 addition & 0 deletions packages/dm-gui-components/src/Communication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ class Communication<P extends CommunicationProps, S extends CommunicationState>
open={!0}
onClose={() => this.state.form?.handleClose && this.state.form.handleClose()}
hideBackdrop
fullWidth
maxWidth={this.state.form.maxWidth || 'md'}
>
{this.state.form?.title ? (
Expand Down

0 comments on commit 5fdaf06

Please sign in to comment.