Skip to content

Commit

Permalink
Fixed sentry admin integration, Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
crycode-de committed Apr 19, 2022
1 parent 01842e1 commit f34e960
Show file tree
Hide file tree
Showing 10 changed files with 1,185 additions and 970 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ By writing JSON data to the `raw.send` state you are able to send CAN messages c

## Changelog

### 1.3.1 (pending)
### 1.3.1 (2022-04-19)
* (crycode-de) Fixed `autoSetValue` defaults for parsers
* (crycode-de) Fixed sentry admin integration
* (crycode-de) Updated dependencies

### 1.3.0 (2022-02-07)
* (crycode-de) Added `sharedData` object in custom parsers
Expand Down
581 changes: 314 additions & 267 deletions admin/build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/build/index.js.map

Large diffs are not rendered by default.

68 changes: 40 additions & 28 deletions admin/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,38 @@ import { GenericAppProps, GenericAppSettings } from '@iobroker/adapter-react/typ

import I18n from '@iobroker/adapter-react/i18n';

import * as Sentry from '@sentry/react';

import { AppContext } from './common';

import Settings from './components/settings';

import { compareObjects } from './lib/helpers';

import * as ioPkg from '../../io-package.json';

const styles = (_theme: Theme): StyleRules => ({
root: {},
});

class App extends GenericApp {
constructor(props: GenericAppProps) {
const extendedProps: GenericAppSettings = { ...props };
extendedProps.encryptedFields = [];
extendedProps.translations = {
en: require('./i18n/en.json'),
de: require('./i18n/de.json'),
ru: require('./i18n/ru.json'),
pt: require('./i18n/pt.json'),
nl: require('./i18n/nl.json'),
fr: require('./i18n/fr.json'),
it: require('./i18n/it.json'),
es: require('./i18n/es.json'),
pl: require('./i18n/pl.json'),
'zh-cn': require('./i18n/zh-cn.json'),
const extendedProps: GenericAppSettings & { sentryDSN: string } = {
...props,
encryptedFields: [],
translations: {
'en': require('./i18n/en.json'),
'de': require('./i18n/de.json'),
'ru': require('./i18n/ru.json'),
'pt': require('./i18n/pt.json'),
'nl': require('./i18n/nl.json'),
'fr': require('./i18n/fr.json'),
'it': require('./i18n/it.json'),
'es': require('./i18n/es.json'),
'pl': require('./i18n/pl.json'),
'zh-cn': require('./i18n/zh-cn.json'),
},
sentryDSN: ioPkg.common.plugins.sentry.dsn,
};

super(props, extendedProps);
Expand Down Expand Up @@ -78,21 +85,26 @@ class App extends GenericApp {
};

return (
<div className='App' style={{ background: theme.palette.background.default, color: theme.palette.text.primary }}>
<Settings
common={this.common}
context={context}
native={this.state.native}
onChange={(attr, value) => this.updateNativeValue(attr, value)}
onError={(err) => this.showError(err)}
onValidate={(isValid) => this.setState({ isConfigurationError: isValid ? '' : I18n.t('Your configuration is invalid. Please check the settings marked in red.') })}
setNative={this.setNative}
showToast={(text) => this.showToast(text)}
/>
{this.renderError()}
{this.renderToast()}
{this.renderSaveCloseButtons()}
</div>
<Sentry.ErrorBoundary
fallback={<p>An error has occurred</p>}
showDialog
>
<div className='App' style={{ background: theme.palette.background.default, color: theme.palette.text.primary }}>
<Settings
common={this.common}
context={context}
native={this.state.native as ioBroker.AdapterConfig}
onChange={(attr, value) => this.updateNativeValue(attr, value)}
onError={(err) => this.showError(err)}
onValidate={(isValid) => this.setState({ isConfigurationError: isValid ? '' : I18n.t('Your configuration is invalid. Please check the settings marked in red.') })}
setNative={this.setNative}
showToast={(text) => this.showToast(text)}
/>
{this.renderError()}
{this.renderToast()}
{this.renderSaveCloseButtons()}
</div>
</Sentry.ErrorBoundary>
);
}

Expand Down
31 changes: 7 additions & 24 deletions admin/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import * as Sentry from '@sentry/react';
import * as SentryIntegrations from '@sentry/integrations';
import { MuiThemeProvider } from '@material-ui/core/styles';
import theme from '@iobroker/adapter-react/Theme';
import Utils from '@iobroker/adapter-react/Components/Utils';
Expand All @@ -14,31 +12,16 @@ let themeName = Utils.getThemeName();
function build(): void {
ReactDOM.render(
<MuiThemeProvider theme={theme(themeName)}>
<Sentry.ErrorBoundary
fallback={<p>An error has occurred</p>}
showDialog
>
<App
adapterName={ioPkg.common.name}
onThemeChange={(_theme) => {
themeName = _theme;
build();
}}
/>
</Sentry.ErrorBoundary>
<App
adapterName={ioPkg.common.name}
onThemeChange={(_theme) => {
themeName = _theme;
build();
}}
/>
</MuiThemeProvider>,
document.getElementById('root'),
);
}

if (window.location.host !== 'localhost:3000') {
Sentry.init({
dsn: ioPkg.common.plugins.sentry.dsn,
release: `iobroker.${ioPkg.common.name}@${ioPkg.common.version}`,
integrations: [
new SentryIntegrations.Dedupe()
]
});
}

build();
8 changes: 6 additions & 2 deletions build/can-interface.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions build/main.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "canbus",
"version": "1.3.0",
"version": "1.3.1",
"news": {
"1.3.1": {
"en": "Fixed `autoSetValue` defaults for parsers, Fixed sentry admin integration, Updated dependencies",
"de": "`autoSetValue`-Standardwerte für Parser korrigiert, Sentry-Admin-Integration korrigiert, Abhängigkeiten aktualisiert",
"ru": "Исправлены значения по умолчанию `autoSetValue` для парсеров, Исправлена интеграция с сторожевым администратором, Обновлены зависимости",
"pt": "Corrigidos padrões `autoSetValue` para analisadores, integração de administração sentry fixa, dependências atualizadas",
"nl": "Vaste `autoSetValue`-standaardinstellingen voor parsers, Vaste Sentry-beheerdersintegratie, Bijgewerkte afhankelijkheden",
"fr": "Correction des valeurs par défaut de `autoSetValue` pour les analyseurs, intégration de l'administrateur de la sentinelle fixe, dépendances mises à jour",
"it": "Risolti i valori predefiniti di `autoSetValue` per i parser, risolta l'integrazione dell'amministratore della sentinella, Aggiornate le dipendenze",
"es": "Se corrigieron los valores predeterminados de `autoSetValue` para los analizadores, se corrigió la integración del administrador centinela, se actualizaron las dependencias",
"pl": "Poprawiono domyślne ustawienia `autoSetValue` dla parserów, Poprawiono integrację admina Sentry, Zaktualizowano zależności",
"zh-cn": "修复了解析器的“autoSetValue”默认值,修复了哨兵管理员集成,更新了依赖项"
},
"1.3.0": {
"en": "Added sharedData object in custom parsers.",
"de": "sharedData-Objekt in benutzerdefinierten Parsern hinzugefügt.",
Expand Down
Loading

0 comments on commit f34e960

Please sign in to comment.