Skip to content

Commit

Permalink
Merge release/4.6.0 into master (#2785)
Browse files Browse the repository at this point in the history
* Added jest and couple of unit tests for DDW-706

* Applied code review suggestions

* Fixed wrong dependencies

* Added a new test and a default config file

* unicode-property pump

* [DDW-706] Move new jest specs into tests folder

* [DDW-706] Add Github action workflow for jest tests

* Fix build issues

* [DDW-706] Use supported node version in Github actions

* [DDW-706] fix github action node version

* Fix yarn.lock

* Fix CI issues

* Fix CI issues

* downgrade to jest 26

* fix lockfile

* Testing adding the conflict dependency as primary

* Downgrade of istanbul-lib-report

* [DDW-815] Fix broken Ledger support on Linux (#2741)

* fix yarn dev on linux

* fix ledger on linux

* [DDW-815] Adds CHANGELOG entery

* fix windows builds

* remove LD_PRELOAD to make the code more stable

Co-authored-by: Nikola Glumac <niglumac@gmail.com>

* Fix wallet restore dialog and continue disable check (#2745)

* Fix walleFix wallet restore dialog and continue disable check

* Updated CHANGELOG

Co-authored-by: Nikola Glumac <niglumac@gmail.com>

* Updated CHANGELOG.md

* Change istanbul-lib-report  resolution to 3.0.0

* Revert "Change istanbul-lib-report  resolution to 3.0.0"

This reverts commit 9f63133.

* Reverted bump

* Reverted bump

* Merges release/4.5.1 into release/4.5.0

* Fixes CHANGELOG link

* [DDW-771] Add apache license to npm package

* [DDW-771] Remove apache license from package.json again

* [DDW-771] refactor to multi-line template literals

* [DDW-811] Normalize checkbox tick offset

* [DDW-824] Introduce a fix for app update on specific platform

* [DDW-824] Improve faked data loading

* [DDW-824] CHANGELOG update

* [DDW-824] Remove unnecessary comment

* [DDW-847] Bump CWB to v2021-11-11

* [DDW-847] CHANGELOG update

* [DDW-683] Adjusted slider onAfterChange

* [DDW-683] Updated CHANGELOG

* [DDW-683] Converted component from class to functional

* Removed unstable rts flags

* [DDW-824] Restrict FAKED news QA loader to DEV mode only

* [DDW-785] Discreet mode - Create the Discreet Mode variables

* [DDW-738] Setup feature-driven design

Co-authored-by: Lucas <lukas_barros@hotmail.com>
Co-authored-by: Dominik Guzei <dominik.guzei@gmail.com>

* [DDW-813] Move discreet mode behavior to its own feature

* [DDW-738] Fix circular dependency

* [DDW-786] Discreet mode - Create the TopBar icon (#2725)

* [DDW-786] Added discreet mode toggle component

* [DDW-789] Remove specific styles from component

* [DDW-789] Fix translations

* [DDW-789] CHANGELOG

* [DDW-789] Fix eslint issue

* [DDW-789] Remove popover theme variables

* [DDW-789] Increase height for hide icon

* [DDW-789] Remove style

* [DDW-789] Rearrange icons to group by action or info

* [DDW-786] Add japanese translations

* [DDW-786] Rearrange icons order

* [DDW-786] Add opacity

* [DDW-786] Add isDiscreetMode control to story

* [DDW-786] Fix gap width

* [DDW-786] Fix default message

* [DDW-786] Update to use mobx feature pattern

* [DDW-786] Fix style

* [DDW-738] Move toggle component to discreet mode feature folder

* [DDW-738] Update translations file

* [DDW-738] Remove popOver from DiscreetToggle

* [DDW-814] Discreet mode - hide sensitive information (#2742)

* [DDW-814] Fix React Dev Tools installation

* [DDW-814] Hide sensitive values

* [DDW-814] Setup storybook

* [DDW-814] Localstorage factory

* [DDW-814] Hide token amount for decimal config

* [DDW-814] Refactor discreet mode ui components

* [DDW-814] Directly use discreet mode feature in toggle

* [DDW-814] Introduce configurable replacer pattern

* [DDW-814] Create LocalStorageFeatureProvider

* [DDW-814] Fix flow

* [DDW-814] Fix topbar

* [DDW-814] React to state changes on WalletUTXO description

* [DDW-814] Preseve Stake pools ranking slider value

* [DDW-814] Hide filter input

* [DDW-814] Prevent stake pools from refreshing

* [DDW-814] Update README

* [DDW-814] Hide wallets dropdown in discreet mode

* [DDW-814] Disable All transactions button on Filter dialog

* [DDW-814] Rename DiscreetToggle component

* [DDW-814] Add unit tests for discreet replacers

* [DDW-814] Cleanup minor issues

* [DDW-814] Fix prettier

* [DDW-814] Revert istanbul

* [DDW-814] Fix flow errors

* [DDW-814] Add discreet toggle mode knob

Co-authored-by: Dominik Guzei <dominik.guzei@gmail.com>

* [DDW-787] Discreet mode - Implement the Settings option (#2740)

* [DDW-785] Discreet mode - Create the Discreet Mode variables

* [DDW-786] Discreet mode - Create the TopBar icon (#2725)

* [DDW-786] Added discreet mode toggle component

* [DDW-789] Remove specific styles from component

* [DDW-789] Fix translations

* [DDW-789] CHANGELOG

* [DDW-789] Fix eslint issue

* [DDW-789] Remove popover theme variables

* [DDW-789] Increase height for hide icon

* [DDW-789] Remove style

* [DDW-789] Rearrange icons to group by action or info

* [DDW-786] Add japanese translations

* [DDW-786] Rearrange icons order

* [DDW-786] Add opacity

* [DDW-786] Add isDiscreetMode control to story

* [DDW-786] Fix gap width

* [DDW-786] Fix default message

* [DDW-786] Update to use mobx feature pattern

* [DDW-786] Fix style

* [DDW-787] Implement discreet mode settings

* [DDW-787] Fix text

* [DDW-787] Add story

* [DDW-787] Update translations

* [DDW-787] Update translations

* [DDW-787] Discreet mode tooltip local storage setting

* [DDW-787] NotificationPopOver component

* [DDW-787] Migrate Sidebar to functional component

* [DDW-787] Wrap categories with NotificationPopOver

* [DDW-787] Fix lint

* [DDW-787] Add new placements

* [DDW-787] Add default translations

* [DDW-787] Adjust styles

* [DDW-787] One time fixed popOver

* [DDW-787] Add red dot to discreet mode settings

* [DDW-787] Update initial translations

* [DDW-787] Add styles specific for language

* [DDW-787] Update action text

* [DDW-787] Review changes

* [DDW-787] Update translations

* [DDW-787] Changelog

* [DDW-787] Fix tooltip showing after accessing security tab

* [DDW-787] Fix notification dot click

* [DDW-787] Fix jumping icons

* [DDW-787] Add jp translation

* [DDW-787] Fix styling issues

* [DDW-787] Remove red dot when user leaves security tab

* [DDW-787] Fix tooltip overlap

* [DDW-787] Fix click through tooltip

* [DDW-787] Fix tooltip overlap dialogs

* [DDW-787] Fix prettier issue

* [DDW-787] Dismiss tooltip on route leave

* [DDW-787] Fix tooltip overlaping issues

* [DDW-787] Fix closing discreet mode popover on staking page

* [DDW-787] Fix merge conflicts

* [DDW-787] Move condition to const

* [DDW-787] Move trigger component to stand alone hook

* [DDW-787] Fix type import

* [DDW-787] Remove unused

* [DDW-787] Review changes

Co-authored-by: Renan Ferreira <renan.ferreira@iohk.io>

* [DDW-738] Notification knob

* [DDW-839] Discreet mode - automated tests (#2756)

* [DDW-839] Discreet mode integration tests

* [DDW-839] Remove aria-query from yarnlock

* [DDW-839] Remove istanbul from yarnlock

* [DDW-839] Tests for public api

* [DDW-839] Run lockfile:fix

* [DDW-839] Update changelog

* [DDW-738] Fix font weights

* [DDW-738] Fix button style

* [DDW-738] Fix button style

* [DDW-738] Pin package version

* [DDW-738] Fix name/icon overlapping

* [DDW-738] Update yarn.lock

* [DDW-738] Review changes

* [DDW-738] Fix yarn.lock

* [DDW-738] Review changes

* [DDW-738] Review changes - use lang selector

* [DDW-738] Fix flow issue

* [DDW-738] Fix discreet mode logic on filter component

* [DDW-854] Init

* [DDW-854] New line

* [DDW-854] Adjustments

* [DDW-854] Update copy

* [DDW-854] Small fix

* [DDW-854] Small adjustment

* [DDW-854] Update icon size

* [DDW-854] Fix sass lint

* [DDW-854] Update description color

* [DDW-854] Update changelog

* [DDW-854] Update changelog

* [DDW-854] Update message for verifyng stage

* [DDW-854] Update colors

* [DDW-796] Refactor and voting phases

* [DDW-796] Remove closed voting logic

* [DDW-796] Exclude js/ts files from nix-build glob

* [DDW-796] Fund phase logic

* [DDW-796] Fund phase components

* [DDW-796] Fix lint issues

* [DDW-796] Fix flow issues

* [DDW-796] Style fix

* [DDW-796] Add observer

* [DDW-796] Remove unused

* [DDW-796] Lazy validation

* [DDW-796] Update text

* [DDW-858] Fix eslint warnings

* [DDW-796] Add jp translations

* [DDW-796] Enable voting in all env for testing only

* [DDW-796] Add function for external link

* [DDW-796] Review changes

* [DDW-796] VotingStore unit test

* [DDW-796] Update story

* [DDW-796] Test only

* Revert "[DDW-796] Test only"

This reverts commit 3140b65.

* Revert "[DDW-796] Enable voting in all env for testing only"

This reverts commit 454c7e1.

* [DDW-854] Remove opacity property

* [DDW-854] Added flow return type

* Fixed duplicated text, wrong order

* Bump version to 4.6.0

* Bump version to 4.6.0 (#2780)

* Removed RTS Flags from CHANGELOG

* Bump version to 4.6.0

Co-authored-by: Dominik Guzei <dominik.guzei@gmail.com>
Co-authored-by: Nikola Glumac <niglumac@gmail.com>
Co-authored-by: Michael Bishop <michael.bishop@iohk.io>
Co-authored-by: Michael Chappell <michael.chappell@iohk.io>
Co-authored-by: Daniel Main <daniel.main.cernhoff@icould.com>
Co-authored-by: Renan Ferreira <renan.ferreira@iohk.io>
Co-authored-by: Tomislav Horaček <tomislav@tt-media.hr>
Co-authored-by: Lucas <lukas_barros@hotmail.com>
Co-authored-by: Lucas Araujo <lucas.araujo@iohk.io>
Co-authored-by: Danilo Prates <daniloprates@gmail.com>
  • Loading branch information
11 people committed Mar 7, 2022
1 parent f522869 commit 646a6cf
Show file tree
Hide file tree
Showing 76 changed files with 3,598 additions and 20 deletions.
1,222 changes: 1,222 additions & 0 deletions flow-typed/npm/jest_v27.x.x.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions source/renderer/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class App extends Component<{
document.documentElement.lang = locale;
}

if (document.documentElement) {
document.documentElement.lang = locale;
}

return (
<Fragment>
{/* @ts-ignore ts-migrate(2769) FIXME: No overload matches this call. */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export default class SyncingConnectingStatus extends Component<Props> {
showEllipsis ? styles.withoutAnimation : null,
]);

const {
connectingMessage,
connectingDescription,
} = this._getConnectingMessage();

return (
<div className={componentStyles}>
<h1 className={headlineStyles}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// @flow
import React from 'react';
import { injectIntl } from 'react-intl';
import NormalSwitch from '../../widgets/forms/NormalSwitch';
import styles from './SecuritySettings.scss';
import messages from './SecuritySettings.messages';
import type { Intl } from '../../../types/i18nTypes';

type Props = {
intl: Intl,
discreetMode: boolean,
openDiscreetMode: boolean,
onDiscreetModeToggle: () => void,
onOpenDiscreetModeToggle: () => void,
};

const SecuritySettings = ({
intl,
discreetMode,
openDiscreetMode,
onDiscreetModeToggle,
onOpenDiscreetModeToggle,
}: Props) => {
return (
<div className={styles.root}>
<div className={styles.setting}>
<div className={styles.title}>
{intl.formatMessage(messages.discreetModeTitle)}
</div>
<div className={styles.settingContent}>
<p className={styles.description}>
{intl.formatMessage(messages.discreetModeDescription)}
</p>
<NormalSwitch
checked={discreetMode}
onChange={onDiscreetModeToggle}
/>
</div>
</div>
<div className={styles.setting}>
<div className={styles.title}>
{intl.formatMessage(messages.openInDiscreetModeTitle)}
</div>
<div className={styles.settingContent}>
<p className={styles.description}>
{intl.formatMessage(messages.openInDiscreetModeDescription)}
</p>
<NormalSwitch
checked={openDiscreetMode}
onChange={onOpenDiscreetModeToggle}
/>
</div>
</div>
</div>
);
};

export default injectIntl(SecuritySettings);
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// @flow
import { defineMessages } from 'react-intl';

export default defineMessages({
discreetModeTitle: {
id: 'settings.security.discreetMode.title',
defaultMessage: '!!!Discreet mode',
description:
'Title for the "Discreet mode" setting in the security category.',
},
discreetModeDescription: {
id: 'settings.security.discreetMode.description',
defaultMessage: '!!!This mode uses asterisks to hide sensitive data',
description:
'Description for the "Discreet mode" setting in the security category.',
},
openInDiscreetModeTitle: {
id: 'settings.security.openInDiscreetMode.title',
defaultMessage: '!!!Start the application in Discreet mode',
description:
'Title for the "Open in discreet mode" setting in the security category.',
},
openInDiscreetModeDescription: {
id: 'settings.security.openInDiscreetMode.description',
defaultMessage:
'!!!Daedalus will start with Discreet mode enabled by default',
description:
'Description for the "Open in discreet mode" setting in the security category.',
},
});
54 changes: 54 additions & 0 deletions source/renderer/app/components/settings/menu/SecurityMenuItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// @flow
import React from 'react';
import classnames from 'classnames';
import { observer } from 'mobx-react';
import { injectIntl } from 'react-intl';
import styles from './SettingsMenu.scss';
import messages from './SettingsMenu.messages';
import SettingsMenuItem from './SettingsMenuItem';
import NotificationDot from '../../widgets/notification-dot/NotificationDot';
import { ROUTES } from '../../../routes-config';
import { useTriggerOnRouteLeave } from './hooks';
import { useDiscreetModeFeature } from '../../../features/discreet-mode';
import type { Intl } from '../../../types/i18nTypes';

type Props = {
intl: Intl,
isActiveItem: Function,
onClick: Function,
};

const SecurityMenuItem = ({ intl, isActiveItem, onClick }: Props) => {
const {
isNotificationEnabled,
setDiscreetModeNotification,
setDiscreetModeSettingsTooltip,
} = useDiscreetModeFeature();
const disableNotification = () => {
setDiscreetModeNotification(false);
setDiscreetModeSettingsTooltip(false);
};
const isActive = isActiveItem(ROUTES.SETTINGS.SECURITY);

useTriggerOnRouteLeave({
enabled: isNotificationEnabled,
isOnRoute: isActive,
onLeave: disableNotification,
});

return (
<NotificationDot
enabled={isNotificationEnabled}
dotClassName={classnames(styles.dot, isActive && styles.active)}
>
<SettingsMenuItem
active={isActive}
label={intl.formatMessage(messages.security)}
onClick={() => onClick(ROUTES.SETTINGS.SECURITY)}
className="security"
/>
</NotificationDot>
);
};

export default injectIntl(observer(SecurityMenuItem));
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @flow
import { defineMessages } from 'react-intl';

export default defineMessages({
general: {
id: 'settings.menu.general.link.label',
defaultMessage: '!!!General',
description: 'Label for the "General" link in the settings menu.',
},
security: {
id: 'settings.menu.security.link.label',
defaultMessage: '!!!Security',
description: 'Label for the "Security" link in the settings menu.',
},
wallets: {
id: 'settings.menu.wallets.link.label',
defaultMessage: '!!!Wallets',
description: 'Label for the "Wallets" link in the settings menu.',
},
stakePools: {
id: 'settings.menu.stakePools.link.label',
defaultMessage: '!!!Stake Pools',
description: 'Label for the "Support" link in the settings menu.',
},
support: {
id: 'settings.menu.support.link.label',
defaultMessage: '!!!Support',
description: 'Label for the "Support" link in the settings menu.',
},
termsOfUse: {
id: 'settings.menu.termsOfUse.link.label',
defaultMessage: '!!!Terms of service',
description: 'Label for the "Terms of service" link in the settings menu.',
},
display: {
id: 'settings.menu.display.link.label',
defaultMessage: '!!!Themes',
description: 'Label for the "Themes" link in the settings menu.',
},
});
13 changes: 13 additions & 0 deletions source/renderer/app/components/settings/menu/SettingsMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,17 @@
margin: 20px 0;
padding: 16px 0;
width: 240px;

.dot {
right: 140px;
top: 22px;

&.active {
right: 134px;
}

&:lang(ja-JP) {
right: 108px;
}
}
}
36 changes: 36 additions & 0 deletions source/renderer/app/components/settings/menu/hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// @flow
import { useState, useEffect } from 'react';

type Props = {
enabled: boolean,
isOnRoute: boolean,
onLeave: () => void,
};

export const useTriggerOnRouteLeave = ({
enabled,
isOnRoute,
onLeave,
}: Props) => {
const [wasOnRoute, setWasOnRoute] = useState(false);

useEffect(() => {
if (!enabled) {
return () => {};
}

if (isOnRoute) {
setWasOnRoute(true);
}

if (wasOnRoute && !isOnRoute) {
onLeave();
}

return () => {
if (wasOnRoute) {
onLeave();
}
};
}, [isOnRoute, wasOnRoute]);
};
47 changes: 47 additions & 0 deletions source/renderer/app/components/sidebar/SidebarCategoryWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// @flow
import React from 'react';
import type { Node } from 'react';
import { FormattedHTMLMessage } from 'react-intl';
import { PopOver } from 'react-polymorph/lib/components/PopOver';
import { CATEGORIES_BY_NAME } from '../../config/sidebarConfig';
import NotificationDot from '../widgets/notification-dot/NotificationDot';
import DiscreetModeFeatureInject from '../../features/discreet-mode/ui/DiscreetModeFeatureInject';
import { messages } from './SidebarCategoryWrapper.messages';
import styles from './SidebarCategoryWrapper.scss';

type Props = {
children: Node,
categoryName: string,
};

const SidebarCategoryWrapper = ({ children, categoryName }: Props) => {
if (categoryName === CATEGORIES_BY_NAME.SETTINGS.name) {
const popOverContent = (
<div className={styles.content}>
<FormattedHTMLMessage {...messages.label} />
</div>
);
return (
<DiscreetModeFeatureInject>
{({ isNotificationEnabled }) => (
<PopOver
placement="right"
className={styles.popOver}
content={isNotificationEnabled ? popOverContent : null}
>
<NotificationDot
enabled={isNotificationEnabled}
dotClassName={styles.dot}
>
{children}
</NotificationDot>
</PopOver>
)}
</DiscreetModeFeatureInject>
);
}

return children;
};

export default SidebarCategoryWrapper;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @flow
import { defineMessages } from 'react-intl';

export const messages = defineMessages({
label: {
id: 'sidebar.category.settings.notification.label',
defaultMessage:
'!!!New discreet mode settings are available in <b>Security</b> tab.',
description: 'Label of settings sidebar category popover notification',
},
});
28 changes: 28 additions & 0 deletions source/renderer/app/components/sidebar/SidebarCategoryWrapper.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.popOver {
transform: translate(-20px, -15px);
width: 218px;

.content {
align-items: flex-end;
display: flex;
flex-direction: column;
font-family: var(--font-regular);
font-size: 14px;
line-height: 1.36;

b {
font-family: var(--font-semibold);
}
}

:global {
.tippy-arrow {
transform: translateY(-5px);
}
}
}

.dot {
right: 20px;
top: 20px;
}
9 changes: 9 additions & 0 deletions source/renderer/app/components/sidebar/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @flow
import type { ShouldShowWalletSubMenu } from './types';

export const shouldShowWalletSubMenu = ({
activeSidebarCategory,
walletRoute,
menus,
}: ShouldShowWalletSubMenu) =>
menus?.wallets?.items && activeSidebarCategory === walletRoute;
18 changes: 18 additions & 0 deletions source/renderer/app/components/sidebar/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @flow
import type { SidebarWalletType } from '../../types/sidebarTypes';

export type SidebarMenus = {
wallets: ?{
items: Array<SidebarWalletType>,
activeWalletId: ?string,
actions: {
onWalletItemClick: Function,
},
},
};

export type ShouldShowWalletSubMenu = {
activeSidebarCategory: string,
walletRoute: string,
menus: SidebarMenus,
};
Loading

0 comments on commit 646a6cf

Please sign in to comment.