Skip to content

Commit 6dbd261

Browse files
authored
Feat: Rename Message to Block (#93)
* feat: renaming message to block * fix: update eslint * fix: IPublicNodeStatus properties to camel case * fix: imports and reformating * fix: missing output metadata field * Fix: Update stardust iota.js version to 15 * Fix: Rename message to block in analytics and spammer * Fix: bump iota.js version / required/optional fields * fix: unix timestamp and milestone in unlock conditions
1 parent b354517 commit 6dbd261

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+662
-669
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"license": "MIT",
1111
"dependencies": {
12-
"@iota/iota.js": "^1.9.0-stardust.13",
12+
"@iota/iota.js": "^1.9.0-stardust.16",
1313
"classnames": "^2.3.1",
1414
"humanize-duration": "^3.25.2",
1515
"moment": "^2.29.1",
@@ -48,8 +48,8 @@
4848
"@types/react-dom": "^17.0.5",
4949
"@types/react-helmet": "^6.1.1",
5050
"@types/react-router-dom": "^5.1.7",
51-
"@typescript-eslint/eslint-plugin": "^4.23.0",
52-
"@typescript-eslint/parser": "^4.23.0",
51+
"@typescript-eslint/eslint-plugin": "^5.25.0",
52+
"@typescript-eslint/parser": "^5.25.0",
5353
"cross-env": "^7.0.3",
5454
"eslint": "^7.26.0",
5555
"eslint-plugin-import": "^2.23.2",

src/app/App.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import { AnalyticsRouteProps } from "./routes/AnalyticsRouteProps";
3333
import Explorer from "./routes/Explorer";
3434
import Address from "./routes/explorer/Address";
3535
import { AddressRouteProps } from "./routes/explorer/AddressRouteProps";
36-
import Message from "./routes/explorer/Message";
37-
import { MessageRouteProps } from "./routes/explorer/MessageRouteProps";
36+
import Block from "./routes/explorer/Block";
37+
import { BlockRouteProps } from "./routes/explorer/BlockRouteProps";
3838
import Milestone from "./routes/explorer/Milestone";
3939
import { MilestoneRouteProps } from "./routes/explorer/MilestoneRouteProps";
4040
import Home from "./routes/Home";
@@ -148,8 +148,8 @@ class App extends AsyncComponent<RouteComponentProps, AppState> {
148148
this._statusSubscription = this._metricsService.subscribe<INodeStatus>(
149149
WebSocketTopic.NodeStatus,
150150
data => {
151-
if (data && data.node_alias !== this._alias) {
152-
this._alias = data.node_alias;
151+
if (data && data.nodeAlias !== this._alias) {
152+
this._alias = data.nodeAlias;
153153
this.updateTitle();
154154
}
155155
});
@@ -180,11 +180,11 @@ class App extends AsyncComponent<RouteComponentProps, AppState> {
180180
online: true
181181
});
182182
}
183-
if (data.is_healthy !== this.state.nodeHealth) {
184-
this.setState({ nodeHealth: data.is_healthy });
183+
if (data.isHealthy !== this.state.nodeHealth) {
184+
this.setState({ nodeHealth: data.isHealthy });
185185
}
186-
if (data.is_synced !== this.state.syncHealth) {
187-
this.setState({ syncHealth: data.is_synced });
186+
if (data.isSynced !== this.state.syncHealth) {
187+
this.setState({ syncHealth: data.isSynced });
188188
}
189189
}
190190
});
@@ -388,9 +388,9 @@ class App extends AsyncComponent<RouteComponentProps, AppState> {
388388
component={(props: RouteComponentProps<never>) => (<Unavailable {...props} />)}
389389
/>
390390
<Route
391-
path="/explorer/message/:messageId"
392-
component={(props: RouteComponentProps<MessageRouteProps>) =>
393-
(<Message {...props} />)}
391+
path="/explorer/block/:blockId"
392+
component={(props: RouteComponentProps<BlockRouteProps>) =>
393+
(<Block {...props} />)}
394394
/>
395395
<Route
396396
path="/explorer/milestone/:milestoneIndex"

src/app/components/layout/MessageButton.scss renamed to src/app/components/layout/BlockButton.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@import '../../../scss/fonts';
22
@import '../../../scss/variables';
33

4-
.message-button {
4+
.block-button {
55
position: relative;
66

7-
.message-button-btn {
7+
.block-button-btn {
88
border: 0;
99
outline: none;
1010
background: none;
@@ -27,7 +27,7 @@
2727
}
2828
}
2929

30-
.message-button--message {
30+
.block-button--message {
3131
@include font-size(10px);
3232

3333
position: absolute;
@@ -40,12 +40,12 @@
4040
font-weight: bold;
4141
text-transform: uppercase;
4242

43-
&.message-button--message--right {
43+
&.block-button--message--right {
4444
top: 3px;
4545
margin-left: 10px;
4646
}
4747

48-
&.message-button--message--top {
48+
&.block-button--message--top {
4949
top: -15px;
5050
left: -10px;
5151
}

src/app/components/layout/MessageButton.tsx renamed to src/app/components/layout/BlockButton.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import classNames from "classnames";
22
import React, { Component, ReactNode } from "react";
33
import { ReactComponent as CopyIcon } from "../../../assets/copy.svg";
4-
import "./MessageButton.scss";
5-
import { MessageButtonProps } from "./MessageButtonProps";
6-
import { MessageButtonState } from "./MessageButtonState";
4+
import "./BlockButton.scss";
5+
import { BlockButtonProps } from "./BlockButtonProps";
6+
import { BlockButtonState } from "./BlockButtonState";
77

88
/**
9-
* Component which will display a message button.
9+
* Component which will display a block button.
1010
*/
11-
class MessageButton extends Component<MessageButtonProps, MessageButtonState> {
11+
class BlockButton extends Component<BlockButtonProps, BlockButtonState> {
1212
/**
13-
* Create a new instance of MessageButton.
13+
* Create a new instance of BlockButton.
1414
* @param props The props.
1515
*/
16-
constructor(props: MessageButtonProps) {
16+
constructor(props: BlockButtonProps) {
1717
super(props);
1818

1919
this.state = {
@@ -28,12 +28,12 @@ class MessageButton extends Component<MessageButtonProps, MessageButtonState> {
2828
*/
2929
public render(): ReactNode {
3030
return (
31-
<div className="message-button">
31+
<div className="block-button">
3232
<button
3333
type="button"
3434
className={classNames(
35-
"message-button-btn",
36-
{ "message-button-btn--active": this.state.active }
35+
"block-button-btn",
36+
{ "block-button-btn--active": this.state.active }
3737
)}
3838
onClick={() => this.activate()}
3939
>
@@ -44,9 +44,9 @@ class MessageButton extends Component<MessageButtonProps, MessageButtonState> {
4444
{this.state.active && this.state.message && (
4545
<span
4646
className={classNames(
47-
"message-button--message",
48-
{ "message-button--message--right": this.props.labelPosition === "right" },
49-
{ "message-button--message--top": this.props.labelPosition === "top" }
47+
"block-button--message",
48+
{ "block-button--message--right": this.props.labelPosition === "right" },
49+
{ "block-button--message--top": this.props.labelPosition === "top" }
5050
)}
5151
>
5252
{this.state.message}
@@ -71,4 +71,4 @@ class MessageButton extends Component<MessageButtonProps, MessageButtonState> {
7171
}
7272
}
7373

74-
export default MessageButton;
74+
export default BlockButton;

src/app/components/layout/MessageButtonProps.ts renamed to src/app/components/layout/BlockButtonProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface MessageButtonProps {
1+
export interface BlockButtonProps {
22
/**
33
* The type of button to show.
44
*/

src/app/components/layout/MessageButtonState.ts renamed to src/app/components/layout/BlockButtonState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface MessageButtonState {
1+
export interface BlockButtonState {
22
/**
33
* Is the message active.
44
*/

src/app/components/layout/Header.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { ReactNode } from "react";
22
import { RouteComponentProps, withRouter } from "react-router-dom";
33
import { ServiceFactory } from "../../../factories/serviceFactory";
4+
import { IBpsMetrics } from "../../../models/websocket/IBpsMetrics";
45
import { IDBSizeMetric } from "../../../models/websocket/IDBSizeMetric";
5-
import { IMpsMetrics } from "../../../models/websocket/IMpsMetrics";
66
import { INodeStatus } from "../../../models/websocket/INodeStatus";
77
import { IPublicNodeStatus } from "../../../models/websocket/IPublicNodeStatus";
88
import { WebSocketTopic } from "../../../models/websocket/webSocketTopic";
@@ -50,9 +50,9 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
5050
private _databaseSizeSubscription?: string;
5151

5252
/**
53-
* The mps metrics subscription id.
53+
* The bps metrics subscription id.
5454
*/
55-
private _mpsMetricsSubscription?: string;
55+
private _bpsMetricsSubscription?: string;
5656

5757
/**
5858
* Create a new instance of Header.
@@ -67,8 +67,8 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
6767
this.state = {
6868
syncHealth: false,
6969
nodeHealth: false,
70-
mps: "-",
71-
mpsValues: [],
70+
bps: "-",
71+
bpsValues: [],
7272
memorySizeFormatted: "-",
7373
memorySize: [],
7474
databaseSizeFormatted: "-",
@@ -107,11 +107,11 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
107107
online: true
108108
});
109109
}
110-
if (data.is_healthy !== this.state.nodeHealth) {
111-
this.setState({ nodeHealth: data.is_healthy });
110+
if (data.isHealthy !== this.state.nodeHealth) {
111+
this.setState({ nodeHealth: data.isHealthy });
112112
}
113-
if (data.is_synced !== this.state.syncHealth) {
114-
this.setState({ syncHealth: data.is_synced });
113+
if (data.isSynced !== this.state.syncHealth) {
114+
this.setState({ syncHealth: data.isSynced });
115115
}
116116
}
117117
});
@@ -155,19 +155,19 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
155155
this.setState({ databaseSize: databaseSizeValues });
156156
});
157157

158-
this._mpsMetricsSubscription = this._metricsService.subscribe<IMpsMetrics>(
159-
WebSocketTopic.MPSMetrics,
158+
this._bpsMetricsSubscription = this._metricsService.subscribe<IBpsMetrics>(
159+
WebSocketTopic.BPSMetrics,
160160
data => {
161161
if (data) {
162-
const mpsValues = this.state.mpsValues.slice(-40);
163-
mpsValues.push(data.new);
162+
const bpsValues = this.state.bpsValues.slice(-40);
163+
bpsValues.push(data.new);
164164

165-
const mpsFormatted = mpsValues[mpsValues.length - 1].toString();
165+
const bpsFormatted = bpsValues[bpsValues.length - 1].toString();
166166

167-
if (mpsFormatted !== this.state.mps) {
168-
this.setState({ mps: mpsFormatted });
167+
if (bpsFormatted !== this.state.bps) {
168+
this.setState({ bps: bpsFormatted });
169169
}
170-
this.setState({ mpsValues });
170+
this.setState({ bpsValues });
171171
}
172172
});
173173
}
@@ -196,9 +196,9 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
196196
this._databaseSizeSubscription = undefined;
197197
}
198198

199-
if (this._mpsMetricsSubscription) {
200-
this._metricsService.unsubscribe(this._mpsMetricsSubscription);
201-
this._mpsMetricsSubscription = undefined;
199+
if (this._bpsMetricsSubscription) {
200+
this._metricsService.unsubscribe(this._bpsMetricsSubscription);
201+
this._bpsMetricsSubscription = undefined;
202202
}
203203
}
204204

@@ -232,9 +232,9 @@ class Header extends AsyncComponent<RouteComponentProps & HeaderProps, HeaderSta
232232
</Breakpoint>
233233
<Breakpoint size="desktop" aboveBelow="above">
234234
<MicroGraph
235-
label="MPS"
236-
value={this.state.mps}
237-
values={this.state.mpsValues}
235+
label="BPS"
236+
value={this.state.bps}
237+
values={this.state.bpsValues}
238238
className="child"
239239
/>
240240
{this.state.isLoggedIn && (

src/app/components/layout/HeaderState.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export interface HeaderState {
1010
nodeHealth: boolean;
1111

1212
/**
13-
* Mps for micro graph.
13+
* Bps for micro graph.
1414
*/
15-
mps: string;
15+
bps: string;
1616

1717
/**
18-
* Mps values for micro graph.
18+
* Bps values for micro graph.
1919
*/
20-
mpsValues: number[];
20+
bpsValues: number[];
2121

2222
/**
2323
* Database size for micro graph.

src/app/components/layout/NavMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NavMenu extends Component<RouteComponentProps & NavMenuProps, NavMenuState
4040
logoSrc: await BrandHelper.getLogoNavigation(this._themeService.get())
4141
});
4242

43-
EventAggregator.subscribe("theme", "navmenu", async theme => {
43+
EventAggregator.subscribe("theme", "navmenu", async (theme: string) => {
4444
this.setState({
4545
logoSrc: await BrandHelper.getLogoNavigation(theme)
4646
});

src/app/components/layout/NavPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NavPanel extends Component<RouteComponentProps & NavPanelProps, NavPanelSt
4040
logoSrc: await BrandHelper.getLogoNavigation(this._themeService.get())
4141
});
4242

43-
EventAggregator.subscribe("theme", "navpanel", async theme => {
43+
EventAggregator.subscribe("theme", "navpanel", async (theme: string) => {
4444
this.setState({
4545
logoSrc: await BrandHelper.getLogoNavigation(theme)
4646
});

0 commit comments

Comments
 (0)