Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-769] Remove locale-specific rules from the CSS files #1871

Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d542787
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Feb 27, 2020
649d2e3
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Feb 27, 2020
18e50b4
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Feb 27, 2020
e508e9b
Merge branch 'v2-integration' into fix/ddw-769-remove-locale-specific…
DeeJayElly Feb 27, 2020
81f518c
[DDW-769] Fix storybook
nikolaglumac Feb 28, 2020
a5f2613
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Feb 28, 2020
6d7011d
[DDW-769] Fix CHANGELOG
nikolaglumac Mar 5, 2020
46c6360
Merge branch 'v2-integration' into fix/ddw-769-remove-locale-specific…
nikolaglumac Mar 5, 2020
e0247f2
Merge branch 'v2-integration' into fix/ddw-769-remove-locale-specific…
DeeJayElly Mar 6, 2020
acf5ba4
Merge remote-tracking branch 'origin/fix/ddw-769-remove-locale-specif…
DeeJayElly Mar 6, 2020
08358cc
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 6, 2020
40b180c
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 9, 2020
4abad84
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 9, 2020
e31eda7
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 9, 2020
2bf03ea
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 9, 2020
1af51d6
Merge branch 'v2-integration' into fix/ddw-769-remove-locale-specific…
nikolaglumac Mar 10, 2020
aaa296f
Merge branch 'v2-integration' into fix/ddw-769-remove-locale-specific…
nikolaglumac Mar 10, 2020
20bce11
[DDW-769] Remove react-syntax-highlighter ^11.0.2 from yarn.lock
Mar 10, 2020
b389f7b
[DDW-769] Run prettier
Mar 10, 2020
3a4d210
[DDW-769] Remove minimist and parse-json from yarn.lock
Mar 10, 2020
6c80466
[DDW-769] Remove types/events from yanr.lock
Mar 10, 2020
e7c9d04
[DDW-769] - Remove locale specific rules from the css files
DeeJayElly Mar 10, 2020
150aab4
Merge remote-tracking branch 'origin/fix/ddw-769-remove-locale-specif…
DeeJayElly Mar 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Changelog

## vNext

### Fixes

- Removed locale specific rules from the CSS files ([PR 1871](https://github.com/input-output-hk/daedalus/pull/1871))

### Chores

- Updated small 3rd party dependencies ([PR 1877](https://github.com/input-output-hk/daedalus/pull/1877))
Expand Down
168 changes: 88 additions & 80 deletions source/renderer/app/components/status/DaedalusDiagnostics.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @flow
import React, { Component, Fragment } from 'react';
import type { Node } from 'react';
import classNames from 'classnames';
import { observer } from 'mobx-react';
import { get, includes, upperFirst } from 'lodash';
import { defineMessages, intlShape } from 'react-intl';
import classNames from 'classnames';
import CopyToClipboard from 'react-copy-to-clipboard';
import { Tooltip } from 'react-polymorph/lib/components/Tooltip';
import { TooltipSkin } from 'react-polymorph/lib/skins/simple/TooltipSkin';
Expand Down Expand Up @@ -369,7 +369,6 @@ type Props = {
networkTip: ?TipInfo,
// localBlockHeight: number,
// networkBlockHeight: number,
currentLocale: string,
// onForceCheckLocalTimeDifference: Function,
onOpenStateDirectory: Function,
onOpenExternalLink: Function,
Expand Down Expand Up @@ -421,13 +420,13 @@ export default class DaedalusDiagnostics extends Component<Props, State> {

getSectionRow = (messageId: string, content?: Node) => {
return (
<tr>
<th className={styles.sectionTitle} colSpan={2}>
<div className={styles.layoutRow}>
<div className={styles.sectionTitle}>
<span>{this.context.intl.formatMessage(messages[messageId])}</span>
{content}
<hr />
</th>
</tr>
</div>
</div>
);
};

Expand All @@ -436,21 +435,27 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
const key = intl.formatMessage(messages[messageId]);
const colon = intl.formatMessage(globalMessages.punctuationColon);
let content = value;
let className = styles[messageId];
let className = classNames([styles[messageId], styles.layoutData]);
const classNameHeader = classNames([
styles[messageId],
styles.layoutHeader,
]);
if (typeof value === 'boolean') {
content = value
? intl.formatMessage(messages.statusOn)
: intl.formatMessage(messages.statusOff);
className = value ? styles.green : styles.red;
className = value
? classNames([className, styles.green])
: classNames([className, styles.red]);
}
return (
<tr>
<th>
<div className={styles.layoutRow}>
<div className={classNameHeader}>
{key}
{colon}
</th>
<td className={className}>{content}</td>
</tr>
</div>
<div className={className}>{content}</div>
</div>
);
};

Expand Down Expand Up @@ -488,7 +493,6 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
// isTestnet,
// isStaging,
// isMainnet,
currentLocale,
} = this.props;

const {
Expand Down Expand Up @@ -530,6 +534,7 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
// remainingUnsyncedBlocks > UNSYNCED_BLOCKS_ALLOWED
// ? styles.red
// : styles.green,
// styles.layoutData
// ]);

// const latestLocalBlockAge = moment(Date.now()).diff(
Expand All @@ -541,6 +546,7 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
// latestLocalBlockTimestamp > 0 && !isLocalBlockHeightStalling
// ? styles.green
// : styles.red,
// styles.layoutData
// ]);

// const latestNetworkBlockAge = moment(Date.now()).diff(
Expand All @@ -552,6 +558,7 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
// latestNetworkBlockTimestamp > 0 && !isNetworkBlockHeightStalling
// ? styles.green
// : styles.red,
// styles.layoutData
// ]);

// Cardano Node EKG server is not enabled for the Mainnet and Testnet builds!
Expand All @@ -564,11 +571,6 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
// isTestnet,
// });

const stateDirectoryPathStyles = classNames([
styles.stateDirectoryPath,
styles[`locale-${currentLocale}`],
]);

const unknownDiskSpaceSupportUrl = intl.formatMessage(
messages.unknownDiskSpaceSupportUrl
);
Expand All @@ -584,6 +586,10 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
cardanoNetworkValue += ` (${cardanoRawNetworkValue})`;
}

// const localTimeDifferenceClasses = classNames([styles.layoutData, styles.localTimeDifferenceItem]);
// const isSystemTimeCorrectClasses = classNames([styles.layoutData, this.getClassName(isSystemTimeCorrect)]);
// const isSystemTimeIgnoredClasses = classNames([styles.layoutData, this.getClassName(!isSystemTimeIgnored)]);

const { getSectionRow, getRow } = this;

return (
Expand All @@ -595,8 +601,8 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
/>

<div className={styles.tables}>
<table className={styles.table}>
<tbody>
<div className={styles.table}>
<div>
{getSectionRow('cardanoNodeStatus')}
{getRow('platform', platform)}
{getRow('platformVersion', platformVersion)}
Expand All @@ -619,8 +625,8 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
/>
)
)}
</tbody>
<tbody>
</div>
<div>
{getSectionRow('coreInfo')}
{getRow('daedalusVersion', daedalusVersion)}
{getRow('daedalusMainProcessID', daedalusMainProcessID)}
Expand All @@ -646,7 +652,7 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
text={daedalusStateDirectoryPath}
onCopy={onCopyStateDirectoryPath}
>
<div className={stateDirectoryPathStyles}>
<div className={styles.stateDirectoryPath}>
<Tooltip
skin={TooltipSkin}
tip={
Expand All @@ -655,7 +661,9 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
</div>
}
>
<p>{daedalusStateDirectoryPath}</p>
<div className={styles.daedalusStateDirectoryPath}>
{daedalusStateDirectoryPath}
</div>
<SVGInline svg={iconCopy} />
</Tooltip>
</div>
Expand All @@ -666,25 +674,25 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
{getRow('cardanoProcessID', cardanoProcessID)}
{getRow('cardanoApiPort', cardanoAPIPort || '-')}
{getRow('cardanoNetwork', cardanoNetworkValue)}
</tbody>
</div>
{isConnected && nodeConnectionError ? (
<tbody>
<div>
{getSectionRow('connectionError')}
<tr>
<th>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>
<div className={styles.error}>
{intl.formatMessage(messages.message)}: {message || '-'}
<br />
{intl.formatMessage(messages.code)}: {code || '-'}
</div>
</th>
</tr>
</tbody>
</div>
</div>
</div>
) : null}
</table>
</div>

<table className={styles.table}>
<tbody>
<div className={styles.table}>
<div>
{getSectionRow('daedalusStatus')}
{getRow('connected', isConnected)}
{getRow('synced', isSynced)}
Expand Down Expand Up @@ -713,31 +721,31 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
</Fragment>
)}
{/*
<tr>
<th>{intl.formatMessage(messages.remainingUnsyncedBlocks)}:</th>
<td className={remainingUnsyncedBlocksClasses}>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.remainingUnsyncedBlocks)}:</div>
<div className={remainingUnsyncedBlocksClasses}>
{remainingUnsyncedBlocks >= 0 ? remainingUnsyncedBlocks : '-'}
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.latestLocalBlockAge)}:</th>
<td className={latestLocalBlockAgeClasses}>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.latestLocalBlockAge)}:</div>
<div className={latestLocalBlockAgeClasses}>
{latestLocalBlockTimestamp > 0
? `${latestLocalBlockAge} ms`
: '-'}
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.latestNetworkBlockAge)}:</th>
<td className={latestNetworkBlockAgeClasses}>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.latestNetworkBlockAge)}:</div>
<div className={latestNetworkBlockAgeClasses}>
{latestNetworkBlockTimestamp > 0
? `${latestNetworkBlockAge} ms`
: '-'}
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.localTimeDifference)}:</th>
<td className={styles.localTimeDifferenceItem}>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.localTimeDifference)}:</div>
<div className={localTimeDifferenceClasses}>
<button
onClick={() => this.checkTime()}
disabled={isForceCheckingNodeTime || !isConnected}
Expand All @@ -753,35 +761,35 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
? `${localTimeDifference || 0} μs`
: intl.formatMessage(messages.serviceUnreachable)}
</span>
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.systemTimeCorrect)}:</th>
<td className={this.getClassName(isSystemTimeCorrect)}>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.systemTimeCorrect)}:</div>
<div className={isSystemTimeCorrectClasses}>
{isSystemTimeCorrect
? intl.formatMessage(messages.statusOn)
: intl.formatMessage(messages.statusOff)}
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.systemTimeIgnored)}:</th>
<td className={this.getClassName(!isSystemTimeIgnored)}>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.systemTimeIgnored)}:</div>
<div className={isSystemTimeIgnoredClasses}>
{isSystemTimeIgnored
? intl.formatMessage(messages.statusOn)
: intl.formatMessage(messages.statusOff)}
</td>
</tr>
<tr>
<th>{intl.formatMessage(messages.checkingNodeTime)}:</th>
<td>
</div>
</div>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>{intl.formatMessage(messages.checkingNodeTime)}:</div>
<div className={styles.layoutData}>
{isForceCheckingNodeTime
? intl.formatMessage(messages.statusOn)
: intl.formatMessage(messages.statusOff)}
</td>
</tr>
</div>
</div>
*/}
</tbody>
<tbody>
</div>
<div>
{getSectionRow(
'cardanoNodeStatus',
<button
Expand All @@ -796,11 +804,11 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
)}
{/*
{showCardanoNodeEkgLink ? (
<tr>
<th>
<div className={styles.layoutRow}>
<div className={styles.layoutHeader}>
{intl.formatMessage(messages.cardanoNodeDiagnostics)}:
</th>
<td>
</div>
<div className={styles.layoutData}>
<button
className={styles.realTimeStatusBtn}
onClick={() => onOpenExternalLink(showCardanoNodeEkgLink)}
Expand All @@ -811,8 +819,8 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
className={styles.externalLinkIcon}
/>
</button>
</td>
</tr>
</div>
</div>
) : null}
*/}
{getRow(
Expand All @@ -832,8 +840,8 @@ export default class DaedalusDiagnostics extends Component<Props, State> {
*/}
{getRow('cardanoNodeSyncing', isNodeSyncing)}
{getRow('cardanoNodeInSync', isNodeInSync)}
</tbody>
</table>
</div>
</div>
</div>
</div>
);
Expand Down
Loading