Skip to content

Commit befd54a

Browse files
authored
Merge branch 'develop' into dependabot/npm_and_yarn/common-front/vite-4.5.14
2 parents cbfdd05 + dd8f9ba commit befd54a

4 files changed

Lines changed: 36 additions & 36 deletions

File tree

common-front/lib/components/MessagesContainer/Messages/MessageView/ProtectionMessageView/ProtectionMessageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ProtectionMessageView = ({ message, className }: Props) => {
2121
name={message.name}
2222
/>
2323
</div>
24-
<ProtectionView protection={message.payload} />
24+
<ProtectionView protection={message} />
2525
</div>
2626
);
2727
};
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Protection } from "../../../../../..";
1+
import { ProtectionMessage } from "../../../../../..";
22
import styles from "./ProtectionView.module.scss";
33

44
type Props = {
5-
protection: Protection;
5+
protection: ProtectionMessage;
66
};
77

88
const DECIMALS = 2;
@@ -13,63 +13,63 @@ export const ProtectionView = ({ protection }: Props) => {
1313
return <div className={styles.protectionView}>{ProtectionText}</div>;
1414
};
1515

16-
function getProtectionText(protection: Protection) {
17-
switch (protection.kind) {
16+
function getProtectionText(protection: ProtectionMessage) {
17+
switch (protection.payload.kind) {
1818
case "OUT_OF_BOUNDS":
1919
return (
2020
<>
2121
<span>
2222
{" "}
23-
Want: [{protection.data.bounds[0].toFixed(
23+
Want: [{protection.payload.data.bounds[0].toFixed(
2424
DECIMALS
25-
)}, {protection.data.bounds[1].toFixed(DECIMALS)}]
25+
)}, {protection.payload.data.bounds[1].toFixed(DECIMALS)}]
2626
</span>{" "}
27-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
27+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
2828
</>
2929
);
3030
case "UPPER_BOUND":
3131
return (
3232
<>
3333
<span>
34-
Want: x {"<"} {protection.data.bound.toFixed(DECIMALS)}
34+
Want: [{protection.name}] {"<"} {protection.payload.data.bound.toFixed(DECIMALS)}
3535
</span>{" "}
36-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
36+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
3737
</>
3838
);
3939
case "LOWER_BOUND":
4040
return (
4141
<>
4242
<span>
43-
Want: x {">"} {protection.data.bound.toFixed(DECIMALS)}
43+
Want: [{protection.name}] {">"} {protection.payload.data.bound.toFixed(DECIMALS)}
4444
</span>{" "}
45-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
45+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
4646
</>
4747
);
4848
case "EQUALS":
4949
return (
5050
<>
5151
<span>
52-
Mustn't be {protection.data.value.toFixed(DECIMALS)}
52+
Mustn't be {protection.payload.data.value.toFixed(DECIMALS)}
5353
</span>
5454
</>
5555
);
5656
case "NOT_EQUALS":
5757
return (
5858
<>
5959
<span>
60-
Must be {protection.data.want.toFixed(DECIMALS)} but is{" "}
61-
{protection.data.value.toFixed(DECIMALS)}
60+
Must be {protection.payload.data.want.toFixed(DECIMALS)} but is{" "}
61+
{protection.payload.data.value.toFixed(DECIMALS)}
6262
</span>
6363
</>
6464
);
6565
case "TIME_ACCUMULATION":
6666
return (
6767
<span>
68-
Value was {protection.data.value.toFixed(DECIMALS)} for{" "}
69-
{protection.data.timelimit.toFixed(DECIMALS)} seconds
68+
Value was {protection.payload.data.value.toFixed(DECIMALS)} for{" "}
69+
{protection.payload.data.timelimit.toFixed(DECIMALS)} seconds
7070
</span>
7171
);
7272
case "ERROR_HANDLER":
73-
return <span>{protection.data}</span>;
73+
return <span>{protection.payload.data}</span>;
7474
}
7575
}

ethernet-view/src/components/MessagesContainer/Messages/MessageView/ProtectionMessageView/ProtectionMessageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ProtectionMessageView = ({ message, className }: Props) => {
2121
name={message.name}
2222
/>
2323
</div>
24-
<ProtectionView protection={message.payload} />
24+
<ProtectionView protection={message} />
2525
</div>
2626
);
2727
};
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import styles from './ProtectionView.module.scss';
2-
import { Protection } from 'common';
2+
import { ProtectionMessage } from 'common';
33

44
type Props = {
5-
protection: Protection;
5+
protection: ProtectionMessage;
66
};
77

88
const DECIMALS = 2;
@@ -13,64 +13,64 @@ export const ProtectionView = ({ protection }: Props) => {
1313
return <div className={styles.protectionView}>{ProtectionText}</div>;
1414
};
1515

16-
function getProtectionText(protection: Protection) {
17-
switch (protection.kind) {
16+
function getProtectionText(protection: ProtectionMessage) {
17+
switch (protection.payload.kind) {
1818
case 'OUT_OF_BOUNDS':
1919
return (
2020
<>
2121
<span>
2222
{' '}
23-
Want: [{protection.data.bounds[0].toFixed(
23+
Want: [{protection.payload.data.bounds[0].toFixed(
2424
DECIMALS
25-
)}, {protection.data.bounds[1].toFixed(DECIMALS)}]
25+
)}, {protection.payload.data.bounds[1].toFixed(DECIMALS)}]
2626
</span>{' '}
27-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
27+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
2828
</>
2929
);
3030
case 'UPPER_BOUND':
3131
return (
3232
<>
3333
<span>
34-
Want: x {'<'} {protection.data.bound.toFixed(DECIMALS)}
34+
Want: [{protection.name}] {'<'} {protection.payload.data.bound.toFixed(DECIMALS)}
3535
</span>{' '}
36-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
36+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
3737
</>
3838
);
3939
case 'LOWER_BOUND':
4040
return (
4141
<>
4242
<span>
43-
Want: x {'>'} {protection.data.bound.toFixed(DECIMALS)}
43+
Want: [{protection.name}] {'>'} {protection.payload.data.bound.toFixed(DECIMALS)}
4444
</span>{' '}
45-
<span>Got: {protection.data.value.toFixed(DECIMALS)}</span>
45+
<span>Got: {protection.payload.data.value.toFixed(DECIMALS)}</span>
4646
</>
4747
);
4848
case 'EQUALS':
4949
return (
5050
<>
5151
<span>
52-
Mustn't be {protection.data.value.toFixed(DECIMALS)}
52+
Mustn't be {protection.payload.data.value.toFixed(DECIMALS)}
5353
</span>
5454
</>
5555
);
5656
case 'NOT_EQUALS':
5757
return (
5858
<>
5959
<span>
60-
Must be {protection.data.want.toFixed(DECIMALS)} but is{' '}
61-
{protection.data.value.toFixed(DECIMALS)}
60+
Must be {protection.payload.data.want.toFixed(DECIMALS)} but is{' '}
61+
{protection.payload.data.value.toFixed(DECIMALS)}
6262
</span>
6363
</>
6464
);
6565
case 'TIME_ACCUMULATION':
6666
return (
6767
<span>
68-
Value was {protection.data.value.toFixed(DECIMALS)} for{' '}
69-
{protection.data.timelimit.toFixed(DECIMALS)} seconds
68+
Value was {protection.payload.data.value.toFixed(DECIMALS)} for{' '}
69+
{protection.payload.data.timelimit.toFixed(DECIMALS)} seconds
7070
</span>
7171
);
7272
case 'ERROR_HANDLER':
7373
case 'WARNING':
74-
return <span>{protection.data}</span>;
74+
return <span>{protection.payload.data}</span>;
7575
}
7676
}

0 commit comments

Comments
 (0)