Skip to content

Commit

Permalink
Merge with genesis-front v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurer committed Dec 3, 2018
2 parents af92ec8 + 9dc055c commit 8fa7180
Show file tree
Hide file tree
Showing 41 changed files with 1,049 additions and 466 deletions.
10 changes: 5 additions & 5 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "apla-front",
"version": "0.10.3",
"version": "0.11.0",
"author": {
"name": "apla-front"
},
Expand Down Expand Up @@ -36,6 +36,8 @@
"qrcode.react": "^0.7.2",
"query-string": "^5.1.0",
"random-js": "^1.0.8",
"react-arcgis": "^3.3.3",
"react-autosuggest": "^9.4.2",
"react-bootstrap": "^0.31.2",
"react-chartjs-2": "^2.7.2",
"react-contenteditable": "^2.0.7",
Expand All @@ -45,13 +47,11 @@
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-document-title": "^2.0.3",
"react-google-maps": "^9.4.5",
"react-hot-loader": "^3.1.3",
"react-intl": "^2.4.0",
"react-measure": "^2.0.2",
"react-monaco-editor": "^0.13.0",
"react-onclickoutside": "^6.6.0",
"react-places-autocomplete": "^7.2.0",
"react-redux": "^5.0.6",
"react-redux-loading-bar": "^2.9.3",
"react-router-dom": "^4.1.2",
Expand Down Expand Up @@ -95,7 +95,6 @@
"@types/classnames": "^2.2.3",
"@types/crypto-js": "^3.1.43",
"@types/electron-store": "^1.3.0",
"@types/googlemaps": "^3.30.5",
"@types/jest": "^21.1.8",
"@types/js-beautify": "^0.0.31",
"@types/lodash": "^4.14.107",
Expand All @@ -107,6 +106,7 @@
"@types/qrcode.react": "^0.6.2",
"@types/query-string": "^5.1.0",
"@types/random-js": "^1.0.30",
"@types/react-autosuggest": "^9.3.6",
"@types/react-bootstrap": "^0.0.52",
"@types/react-chartjs-2": "^2.5.7",
"@types/react-copy-to-clipboard": "^4.2.3",
Expand Down Expand Up @@ -147,4 +147,4 @@
"typescript": "^2.8.3",
"typescript-react-intl": "^0.1.7"
}
}
}
1 change: 1 addition & 0 deletions public/index.html
Expand Up @@ -88,6 +88,7 @@
<link rel="stylesheet" href="%PUBLIC_URL%/styles/fonts.css">
<link rel="stylesheet" href="%PUBLIC_URL%/styles/pe-helper.min.css">
<link rel="stylesheet" href="%PUBLIC_URL%/styles/iconfont.css">
<link rel="stylesheet" href="https://js.arcgis.com/4.8/esri/css/main.css">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
7 changes: 6 additions & 1 deletion public/locales/ru-RU.json
Expand Up @@ -2,6 +2,7 @@
"LANG_NAME": "Русский (RU)",
"wallet.create": "Создать кошелёк",
"wallet.createimport": "Создать или импортировать кошелёк",
"wallet.createimport.desc": "Восстановить кошелёк из резервной копии или создать новый",
"wallet.import": "Восстановление кошелька",
"wallet.login": "Вход в систему",
"alert.cancel": "Отмена",
Expand Down Expand Up @@ -45,6 +46,8 @@
"auth.import.disclaimer": "Пожалуйста, введите данные резервной копии вашего кошелька для того, чтобы восстановить доступ к системе",
"auth.import.existing": "Импортировать существующий",
"auth.login": "Вход в систему",
"auth.login.guest": "Войти используя гостевой ключ",
"auth.login.guest.desc": "Выберите данную опцию чтобы использовать Genesis в тестовом режиме",
"auth.nokey": "У меня нет ключа",
"auth.nokey.desc": "Если вы используете систему в первый раз или просто хотите создать новый кошелёк, используйте данную опцию, чтобы сгенерировать новый закрытый ключ и защитить его паролем",
"auth.password": "Пароль",
Expand All @@ -66,7 +69,7 @@
"auth.seed.save": "Сохранить",
"auth.session.prompt": "Пожалуйста, введите пароль для выполнения входа",
"auth.welcome": "Добро пожаловать",
"auth.welcome.continue": "Нажмите кнопку 'Начать работу' для того, чтобы начать процесс создания или восстановления кошелька",
"auth.welcome.continue": "Нажмите кнопку 'Создать или импортировать кошелёк' для того, чтобы начать процесс создания или восстановления кошелька",
"auth.welcome.guide": "Перед началом работы необходимо создать кошелёк. Это не займёт много времени. После создания кошелька вы сможете использовать все возможности Apla",
"cancel": "Отмена",
"clear": "Очистить",
Expand Down Expand Up @@ -190,12 +193,14 @@
"tx.error.warning.desc": "{error}",
"tx.error.E_CONTRACT": "Ошибка вызова",
"tx.error.E_DELETEDKEY": "Ошибка вызова",
"tx.error.E_GUEST_VIOLATION": "Ошибка вызова",
"tx.error.E_INVALID_PASSWORD": "Ошибка вызова",
"tx.error.E_LIMITFORSIGN": "Ошибка вызова",
"tx.error.E_OFFLINE": "Ошибка подключения",
"tx.error.E_SERVER": "Ошибка выполнения",
"tx.error.E_CONTRACT.desc": "Контракт '{contract}' не существует",
"tx.error.E_DELETEDKEY.desc": "Ваш кошелёк был удалён",
"tx.error.E_GUEST_VIOLATION.desc": "Вызвов транзакций в гостевом режиме запрещён",
"tx.error.E_INVALID_PASSWORD.desc": "Неверный пароль",
"tx.error.E_LIMITFORSIGN.desc": "Параметры вызова содержат данные слишком большого объёма",
"tx.error.E_OFFLINE.desc": "Не удалось установить подключение к серверу",
Expand Down
19 changes: 13 additions & 6 deletions src/app/components/Auth/Login/ContextButton.tsx
Expand Up @@ -20,12 +20,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import * as React from 'react';
import React from 'react';
import styled from 'styled-components';

export interface IContextButtonProps {
className?: string;
icon: string;
description: React.ReactNode;
onClick: () => void;
}

Expand All @@ -34,21 +35,24 @@ const ContextButton: React.SFC<IContextButtonProps> = props => (
<div className="button-icon">
<em className={props.icon} />
</div>
<div className="button-label">
{props.children}
<div>
<div className="button-label">
{props.children}
</div>
<div className="button-desc">{props.description}</div>
</div>
</button>
);

export default styled(ContextButton) `
export default styled(ContextButton)`
display: block;
width: 100%;
height: 40px;
color: #4085dc;
border: 0;
background: 0;
padding: 0;
margin: 10px 0;
margin: 10px 0 15px 0;
text-align: left;
&:hover {
Expand All @@ -68,6 +72,9 @@ export default styled(ContextButton) `
.button-label {
font-size: 16px;
line-height: 36px;
}
.button-desc {
color: #909FA7;
}
`;
36 changes: 23 additions & 13 deletions src/app/components/Auth/Login/WalletList/index.tsx
Expand Up @@ -25,12 +25,13 @@ import classNames from 'classnames';
import { FormattedMessage } from 'react-intl';
import { IWallet, IAccountContext } from 'apla/auth';
import { IAccount } from 'apla/api';
import { INotificationsMessage } from 'apla/socket';

import LocalizedDocumentTitle from 'components/DocumentTitle/LocalizedDocumentTitle';
import Heading from 'components/Auth/Heading';
import ContextButton from '../ContextButton';
import WalletButton from './WalletButton';
import { INotificationsMessage } from 'apla/socket';
import Welcome from 'components/Auth/Welcome';

export interface IWalletListProps {
className?: string;
Expand All @@ -44,6 +45,7 @@ export interface IWalletListProps {
onCopy: (wallet: IWallet) => any;
onRegister: (wallet: IWallet) => any;
onSelect: (params: IAccountContext) => any;
onGuestLogin: () => any;
}

const WalletList: React.SFC<IWalletListProps> = props => (
Expand All @@ -54,22 +56,30 @@ const WalletList: React.SFC<IWalletListProps> = props => (
</Heading>
<div className="form-horizontal desktop-flex-col desktop-flex-stretch" style={{ padding: 10 }}>
<div className="text-center desktop-flex-stretch">
{props.wallets.map((wallet, index) =>
<WalletButton
key={wallet.id}
wallet={wallet}
notifications={props.notifications.filter(l => l.id === wallet.id)}
onRemove={() => props.onRemove(wallet)}
onCopy={() => props.onCopy(wallet)}
onRegister={props.activationEnabled ? () => props.onRegister(wallet) : null}
onSelect={params => props.onSelect({ ...params, wallet })}
/>
)}
{0 === props.wallets.length ?
(
<Welcome />
)
: props.wallets.map((wallet, index) =>
<WalletButton
key={wallet.id}
wallet={wallet}
notifications={props.notifications.filter(l => l.id === wallet.id)}
onRemove={() => props.onRemove(wallet)}
onCopy={() => props.onCopy(wallet)}
onRegister={props.activationEnabled ? () => props.onRegister(wallet) : null}
onSelect={params => props.onSelect({ ...params, wallet })}
/>
)
}
</div>
<div className="text-left">
<ContextButton icon="icon-plus" onClick={props.onCreate}>
<ContextButton icon="icon-plus" onClick={props.onCreate} description={<FormattedMessage id="wallet.createimport.desc" defaultMessage="Restore your existing wallet or enroll a new one" />}>
<FormattedMessage id="wallet.createimport" defaultMessage="Create or import wallet" />
</ContextButton>
<ContextButton icon="icon-login" onClick={props.onGuestLogin} description={<FormattedMessage id="auth.login.guest.desc" defaultMessage="Proceed with this option if you want to try Apla in test mode" />}>
<FormattedMessage id="auth.login.guest" defaultMessage="Login using guest key" />
</ContextButton>
</div>
</div>
</div>
Expand Down
36 changes: 13 additions & 23 deletions src/app/components/Auth/Welcome.tsx
Expand Up @@ -21,35 +21,25 @@
// SOFTWARE.

import React from 'react';
import { Button } from 'react-bootstrap';
import { FormattedMessage } from 'react-intl';

import LocalizedDocumentTitle from 'components/DocumentTitle/LocalizedDocumentTitle';
import Heading from './Heading';

export interface IWelcomeProps {
onConfirm: () => void;

}

const Welcome: React.SFC<IWelcomeProps> = (props) => (
<LocalizedDocumentTitle title="auth.welcome" defaultTitle="Welcome">
<div>
<Heading>Apla</Heading>
<h4>
<FormattedMessage id="auth.welcome" defaultMessage="Welcome" />
</h4>
<p className="pv">
<FormattedMessage id="auth.welcome.guide" defaultMessage="Before proceeding, you will be guided through the wallet creation process. This will not take too much time. After completing this process you will be able to use all features of Apla" />
</p>
<p>
<FormattedMessage id="auth.welcome.continue" defaultMessage="Press 'Get started' button to begin the process of creating or restoring your wallet" />
</p>
<hr />
<Button bsStyle="primary" className="btn-block" onClick={props.onConfirm}>
<FormattedMessage id="auth.getstarted" defaultMessage="Get started" />
</Button>
</div>
</LocalizedDocumentTitle>
<div>
<h4 className="p0 m0">
<FormattedMessage id="auth.welcome" defaultMessage="Welcome" />
</h4>
<p className="pv">
<FormattedMessage id="auth.welcome.guide" defaultMessage="Before proceeding, you will be guided through the wallet creation process. This will not take too much time. After completing this process you will be able to use all features of Apla" />
</p>
<p>
<FormattedMessage id="auth.welcome.continue" defaultMessage="Press 'Get started' button to begin the process of creating or restoring your wallet" />
</p>
<hr />
</div>
);

export default Welcome;
5 changes: 1 addition & 4 deletions src/app/components/Auth/index.tsx
Expand Up @@ -29,15 +29,13 @@ import platform from 'lib/platform';

import themed from 'components/Theme/themed';
import Titlebar from 'components/Main/Titlebar';
import Welcome from 'containers/Auth/Welcome';
import Wallet from 'components/Auth/Wallet';
import Login from 'containers/Auth/Login';
import Offline from 'containers/Auth/Offline';

export interface IAuthProps {
className?: string;
locale: string;
firstRun: boolean;
isOffline: boolean;
changeLocale: () => void;
}
Expand All @@ -53,8 +51,7 @@ const Auth: React.SFC<IAuthProps> = props => (
<Switch>
{props.isOffline && (<Route path="/" component={Offline} />)}
<Route path="/wallet" component={Wallet} />
{props.firstRun && (<Route path="/" component={Welcome} />)}
{!props.firstRun && (<Route path="/" component={Login} />)}
<Route path="/" component={Login} />
<Redirect to="/" />
</Switch>
</Panel>
Expand Down
12 changes: 7 additions & 5 deletions src/app/components/Main/Toolbar/EditorToolbar.tsx
Expand Up @@ -82,11 +82,13 @@ const EditorToolbar: React.SFC<IEditorToolbarProps> = props => {
<FormattedMessage id="editor.save.all" defaultMessage="Save all" />
</ToolButton>*/}
{props.currentTab && 'contract' !== props.currentTab.type && (
<SectionToolButton
activeIndex={resolveToolIndex(props.currentTab.tool)}
onChange={onToolChange}
items={editorTools.map(l => l.content)}
/>
<li style={{ margin: '8px', float: 'right' }}>
<SectionToolButton
activeIndex={resolveToolIndex(props.currentTab.tool)}
onChange={onToolChange}
items={editorTools.map(l => l.content)}
/>
</li>
)}
{props.currentTab && 'contract' === props.currentTab.type && (
<ToolButton icon="icon-paper-plane" disabled={props.currentTab.new || props.canSave} onClick={props.onExec}>
Expand Down

0 comments on commit 8fa7180

Please sign in to comment.