Skip to content

Commit

Permalink
Fixing pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Dec 12, 2024
1 parent 0280ad5 commit 8f7c5af
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
30 changes: 30 additions & 0 deletions src-admin/src/Tabs/Bridges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import {
DomainDisabled,
Edit,
FormatListBulleted,
Info,
KeyboardArrowDown,
KeyboardArrowUp,
QuestionMark,
Save,
UnfoldLess,
UnfoldMore,
Warning,
} from '@mui/icons-material';
import {
Button,
Expand Down Expand Up @@ -1073,6 +1075,10 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
devIndex: number,
): React.JSX.Element {
const isLast = devIndex === bridge.list.length - 1;
const hasError = Array.isArray(this.props.nodeStates?.[bridge.uuid]?.error)
? !!(this.props.nodeStates[bridge.uuid].error as string[])?.includes(device.uuid)
: false;

return (
<TableRow
key={devIndex}
Expand All @@ -1094,6 +1100,30 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
</div>
<div style={styles.deviceType}>{`${I18n.t('Device type')}: ${I18n.t(device.type)}`}</div>
</div>
<div style={{ flex: 1 }} />
{this.props.nodeStates?.[bridge.uuid] ? (
<Tooltip
key="debug"
title={hasError ? I18n.t('Show error') : I18n.t('Show additional information')}
slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}
>
<IconButton
style={{
height: 40,
color: hasError
? '#FF0000'
: this.isDevice
? this.props.themeType === 'dark'
? 'white'
: '#00000080'
: 'white',
}}
onClick={e => this.requestAdditionalInformation(e, device.uuid)}
>
{hasError ? <Warning /> : <Info />}
</IconButton>
</Tooltip>
) : null}
</div>
</TableCell>
<TableCell />
Expand Down
11 changes: 5 additions & 6 deletions src-admin/src/Tabs/BridgesAndDevices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,11 @@ class BridgesAndDevices<TProps extends BridgesAndDevicesProps, TState extends Br
return <QuestionMark style={{ color }} />;
}

requestAdditionalInformation(uuid: string): void {
requestAdditionalInformation(e: React.MouseEvent, uuid: string): void {
e.stopPropagation();

this.props.socket
.sendTo(`matter.${this.props.instance}`, 'extendedInfo', {
uuid,
error: this.props.nodeStates[uuid]?.error,
})
.sendTo(`matter.${this.props.instance}`, 'extendedInfo', { uuid })
.then((result: { schema: JsonFormSchema; options?: BackEndCommandJsonFormOptions }): void => {
this.setState({
jsonConfig: {
Expand Down Expand Up @@ -324,7 +323,7 @@ class BridgesAndDevices<TProps extends BridgesAndDevicesProps, TState extends Br
: '#00000080'
: 'white',
}}
onClick={() => this.requestAdditionalInformation(deviceOrBridge.uuid)}
onClick={e => this.requestAdditionalInformation(e, deviceOrBridge.uuid)}
>
{this.props.nodeStates[deviceOrBridge.uuid].error ? <Warning /> : <Info />}
</IconButton>
Expand Down
11 changes: 10 additions & 1 deletion src-admin/src/Tabs/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ import React from 'react';
import { v4 as uuidv4 } from 'uuid';

import { IconButton } from '@foxriver76/iob-component-lib';
import { Add, AutoMode, Close, Delete, DeviceHub, FormatListBulleted, QuestionMark, Save } from '@mui/icons-material';
import {

Check failure on line 6 in src-admin/src/Tabs/Devices.tsx

View workflow job for this annotation

GitHub Actions / check-and-lint

Replace `⏎····Add,⏎····AutoMode,⏎····Close,⏎····Delete,⏎····DeviceHub,⏎····FormatListBulleted,⏎····QuestionMark,⏎····Save,⏎` with `·Add,·AutoMode,·Close,·Delete,·DeviceHub,·FormatListBulleted,·QuestionMark,·Save·`

Check failure on line 6 in src-admin/src/Tabs/Devices.tsx

View workflow job for this annotation

GitHub Actions / check-and-lint

Replace `⏎····Add,⏎····AutoMode,⏎····Close,⏎····Delete,⏎····DeviceHub,⏎····FormatListBulleted,⏎····QuestionMark,⏎····Save,⏎` with `·Add,·AutoMode,·Close,·Delete,·DeviceHub,·FormatListBulleted,·QuestionMark,·Save·`
Add,
AutoMode,
Close,
Delete,
DeviceHub,
FormatListBulleted,
QuestionMark,
Save,
} from '@mui/icons-material';
import {
Button,
Checkbox,
Expand Down
2 changes: 1 addition & 1 deletion src-admin/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface ConnectionInfo {

export interface NodeStateResponse {
status: NodeStates;
error?: boolean;
error?: boolean | string[];
qrPairingCode?: string;
manualPairingCode?: string;
connectionInfo?: ConnectionInfo[];
Expand Down
3 changes: 2 additions & 1 deletion src/matter/BaseServerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export abstract class BaseServerNode implements GeneralNode {
};

// TODO: @Apollon77. Set this flag to true if error flag should be shown
// result.error = true;
// result.error = true; if the error is related to bridge
// or ['UUID1', 'UUID2'] if the error is related to a specific device

// Device is not commissioned, so show QR code
if (!this.serverNode.lifecycle.isCommissioned) {
Expand Down

0 comments on commit 8f7c5af

Please sign in to comment.