fix lint formatting so GH action build doesn't break

This commit is contained in:
Proddy
2022-10-30 16:56:00 +01:00
parent f3adc13c6d
commit 805c1298fb
34 changed files with 108 additions and 105 deletions

View File

@@ -559,11 +559,11 @@ const DashboardData: FC = () => {
offset: sensor.o
});
if (response.status === 204) {
enqueueSnackbar(LL.UPLOAD_OF( LL.TEMP_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' });
enqueueSnackbar(LL.UPLOAD_OF(LL.TEMP_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' });
} else if (response.status === 403) {
enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' });
} else {
enqueueSnackbar(LL.UPDATED_OF( LL.TEMP_SENSOR() ), { variant: 'success' });
enqueueSnackbar(LL.UPDATED_OF(LL.TEMP_SENSOR()), { variant: 'success' });
}
setSensor(undefined);
} catch (error) {
@@ -986,11 +986,11 @@ const DashboardData: FC = () => {
});
if (response.status === 204) {
enqueueSnackbar(LL.DELETION_OF( LL.ANALOG_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' });
enqueueSnackbar(LL.DELETION_OF(LL.ANALOG_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' });
} else if (response.status === 403) {
enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' });
} else {
enqueueSnackbar( LL.REMOVED_OF( LL.ANALOG_SENSOR() ), { variant: 'success' });
enqueueSnackbar(LL.REMOVED_OF(LL.ANALOG_SENSOR()), { variant: 'success' });
}
} catch (error) {
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
@@ -1014,11 +1014,11 @@ const DashboardData: FC = () => {
});
if (response.status === 204) {
enqueueSnackbar(LL.UPDATE_OF( LL.ANALOG_SENSOR() ) + ' ' + LL.FAILED(), { variant: 'error' });
enqueueSnackbar(LL.UPDATE_OF(LL.ANALOG_SENSOR()) + ' ' + LL.FAILED(), { variant: 'error' });
} else if (response.status === 403) {
enqueueSnackbar(LL.ACCESS_DENIED(), { variant: 'error' });
} else {
enqueueSnackbar(LL.UPDATED_OF( LL.ANALOG_SENSOR() ), { variant: 'success' });
enqueueSnackbar(LL.UPDATED_OF(LL.ANALOG_SENSOR()), { variant: 'success' });
}
} catch (error) {
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
@@ -1077,7 +1077,13 @@ const DashboardData: FC = () => {
{analog.t >= AnalogType.COUNTER && analog.t <= AnalogType.RATE && (
<>
<Grid item>
<ValidatedTextField name="u" label={LL.UNIT()} value={analog.u} select onChange={updateValue(setAnalog)}>
<ValidatedTextField
name="u"
label={LL.UNIT()}
value={analog.u}
select
onChange={updateValue(setAnalog)}
>
{DeviceValueUOM_s.map((val, i) => (
<MenuItem key={i} value={i}>
{val}

View File

@@ -201,7 +201,10 @@ const DashboardStatus: FC = () => {
<DirectionsBusIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary={LL.EMS_BUS_STATUS()} secondary={busStatus(data) + ' (' + formatDurationSec(data.uptime) + ')'} />
<ListItemText
primary={LL.EMS_BUS_STATUS()}
secondary={busStatus(data) + ' (' + formatDurationSec(data.uptime) + ')'}
/>
</ListItem>
<ListItem>
<ListItemAvatar>

View File

@@ -13,12 +13,12 @@ const Help: FC = () => {
const { LL } = useI18nContext();
const { routerTab } = useRouterTab();
useLayoutTitle(LL.HELP_OF(""));
useLayoutTitle(LL.HELP_OF(''));
return (
<>
<RouterTabs value={routerTab}>
<Tab value="information" label={LL.HELP_OF("EMS-ESP")} />
<Tab value="information" label={LL.HELP_OF('EMS-ESP')} />
</RouterTabs>
<Routes>
<Route path="information" element={<HelpInformation />} />

View File

@@ -22,11 +22,11 @@ const ProjectMenu: FC = () => {
<LayoutMenuItem icon={DashboardIcon} label={LL.DASHBOARD()} to={`/${PROJECT_PATH}/dashboard`} />
<LayoutMenuItem
icon={TuneIcon}
label={LL.SETTINGS_OF("")}
label={LL.SETTINGS_OF('')}
to={`/${PROJECT_PATH}/settings`}
disabled={!authenticatedContext.me.admin}
/>
<LayoutMenuItem icon={InfoIcon} label={LL.HELP_OF("")} to={`/${PROJECT_PATH}/help`} />
<LayoutMenuItem icon={InfoIcon} label={LL.HELP_OF('')} to={`/${PROJECT_PATH}/help`} />
</List>
);
};

View File

@@ -14,7 +14,7 @@ const Settings: FC = () => {
const { LL } = useI18nContext();
const { routerTab } = useRouterTab();
useLayoutTitle(LL.SETTINGS_OF(""));
useLayoutTitle(LL.SETTINGS_OF(''));
return (
<>

View File

@@ -278,7 +278,7 @@ const SettingsApplication: FC = () => {
</>
)}
<Typography variant="h6" color="primary">
{LL.SETTINGS_OF("EMS BUS")}
{LL.SETTINGS_OF('EMS BUS')}
</Typography>
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
<Grid item xs={6}>

View File

@@ -167,10 +167,7 @@ const SettingsCustomization: FC = () => {
function formatName(de: DeviceEntity) {
return (
<>
{de.n && (
(de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '
)}
(
{de.n && (de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '}(
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].t + '/' + de.id}>
{de.id}
</Link>

View File

@@ -24,10 +24,7 @@ export const GPIO_VALIDATOR = {
export const GPIO_VALIDATORC3 = {
validator(rule: InternalRuleItem, value: number, callback: (error?: string) => void) {
if (
value &&
((value >= 11 && value <= 19) || value > 21 || value < 0)
) {
if (value && ((value >= 11 && value <= 19) || value > 21 || value < 0)) {
callback('Must be an valid GPIO port');
} else {
callback();
@@ -37,10 +34,7 @@ export const GPIO_VALIDATORC3 = {
export const GPIO_VALIDATORS2 = {
validator(rule: InternalRuleItem, value: number, callback: (error?: string) => void) {
if (
value &&
((value >= 19 && value <= 20) || (value >= 22 && value <= 32) || value > 40 || value < 0)
) {
if (value && ((value >= 19 && value <= 20) || (value >= 22 && value <= 32) || value > 40 || value < 0)) {
callback('Must be an valid GPIO port');
} else {
callback();
@@ -50,27 +44,30 @@ export const GPIO_VALIDATORS2 = {
export const createSettingsValidator = (settings: Settings) =>
new Schema({
...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATOR],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATOR],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATOR],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATOR],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR]
}),
...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32-C3' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORC3],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORC3],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORC3],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORC3],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORC3]
}),
...(settings.board_profile === 'CUSTOM' && settings.platform === 'ESP32-S2' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORS2],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORS2],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORS2],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORS2],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORS2]
}),
...(settings.board_profile === 'CUSTOM' &&
settings.platform === 'ESP32' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATOR],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATOR],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATOR],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATOR],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR]
}),
...(settings.board_profile === 'CUSTOM' &&
settings.platform === 'ESP32-C3' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORC3],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORC3],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORC3],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORC3],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORC3]
}),
...(settings.board_profile === 'CUSTOM' &&
settings.platform === 'ESP32-S2' && {
led_gpio: [{ required: true, message: 'LED GPIO is required' }, GPIO_VALIDATORS2],
dallas_gpio: [{ required: true, message: 'GPIO is required' }, GPIO_VALIDATORS2],
pbutton_gpio: [{ required: true, message: 'Button GPIO is required' }, GPIO_VALIDATORS2],
tx_gpio: [{ required: true, message: 'Tx GPIO is required' }, GPIO_VALIDATORS2],
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATORS2]
}),
...(settings.syslog_enabled && {
syslog_host: [{ required: true, message: 'Host is required' }, IP_OR_HOSTNAME_VALIDATOR],
syslog_port: [