Skip to content

Commit bd2fa3e

Browse files
committed
Merge branch 'develop'
2 parents bc891ce + 18b0d9b commit bd2fa3e

273 files changed

Lines changed: 4672 additions & 5221 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ API binding can be customized to the value of your choice. Simply create a setti
4949
}
5050
```
5151
- **defaultNetwork** - Key of the default network that will be connected automatically
52-
- **networks.key** - Specifies a unique key for a network
53-
- **networks.name** - A human readable network name that will be shown in the interface
54-
- **networks.networkID** - Unique identificator that is imprinted in all transactions. Refer to the configuration of your go-apla instance
55-
- **networks.fullNodes** - Prebuilt list of URLs that will be used for synchronization
56-
- **networks.socketUrl** - Optional parameter that overrides Centrifugo connection endpoint. Default: provided by go-apla configuration
57-
- **networks.activationEmail** - Optional parameter that will be shown to a user when there are no active endpoints to log in. Used for KYC
58-
- **networks.enableDemoMode** - When set to true, will enable authorization using the guest key
59-
- **networks.disableSync** - Optional parameter that disables synchronization of the full nodes. Unsafe, use with caution
52+
- **networks** - Specifies an array of predefined network endpoints that are used to connect your application to the blockchain
53+
- **networks[x].key** - Specifies a unique key for a network
54+
- **networks[x].name** - A human readable network name that will be shown in the interface
55+
- **networks[x].networkID** - Unique identificator that is imprinted in all transactions. Refer to the configuration of your go-apla instance
56+
- **networks[x].fullNodes** - Prebuilt list of URLs that will be used for synchronization
57+
- **networks[x].socketUrl** - Optional parameter that overrides Centrifugo connection endpoint. Default: provided by go-apla configuration
58+
- **networks[x].activationEmail** - Optional parameter that will be shown to a user when there are no active endpoints to log in. Used for KYC
59+
- **networks[x].enableDemoMode** - When set to true, will enable authorization using the guest key
60+
- **networks[x].disableSync** - Optional parameter that disables synchronization of the full nodes. Unsafe, use with caution
6061

6162
Development server emits warnings and will report errors in readable format. You can hack around it, but it is suited only for development/testing. To use it in production environment you will need to build the project.
6263

now.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": 2,
3+
"routes": [
4+
{
5+
"src": "/(fonts|img|locales|styles|static)/(.*)",
6+
"dest": "/$1/$2"
7+
},
8+
{
9+
"src": "/(settings\\.json|asset-manifest\\.json|favicon\\.ico|manifest\\.json|service-worker\\.json)",
10+
"dest": "/$1"
11+
},
12+
{
13+
"src": "/(.*)",
14+
"dest": "/index.html"
15+
}
16+
]
17+
}

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apla-front",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"author": {
55
"name": "apla-front"
66
},
@@ -53,7 +53,6 @@
5353
"react-monaco-editor": "^0.25.1",
5454
"react-onclickoutside": "^6.6.0",
5555
"react-redux": "^5.0.6",
56-
"react-redux-loading-bar": "^2.9.3",
5756
"react-router-dom": "^4.1.2",
5857
"react-router-transition": "^1.1.0",
5958
"react-sortable-tree": "^2.1.0",
@@ -64,6 +63,7 @@
6463
"redux-localstorage-debounce": "^0.1.0",
6564
"redux-localstorage-filter": "^0.1.1",
6665
"redux-observable": "^0.16.0",
66+
"route-parser": "^0.0.5",
6767
"rxjs": "^5.4.3",
6868
"simple-line-icons": "^2.4.1",
6969
"sockjs-client": "^1.1.4",
@@ -88,7 +88,8 @@
8888
"start-js-desktop": "react-scripts-ts-electron start",
8989
"build-desktop": "npm run build-css && cross-env PUBLIC_URL=./ REACT_APP_VERSION=$npm_package_version react-scripts-ts-electron build",
9090
"package": "electron-builder --config electron-builder.json --dir",
91-
"release": "electron-builder --config electron-builder.json"
91+
"release": "electron-builder --config electron-builder.json",
92+
"serve": "now ./build -A ../now.json -n apla"
9293
},
9394
"devDependencies": {
9495
"@types/bluebird": "^3.5.18",
@@ -128,6 +129,7 @@
128129
"@types/redux-localstorage": "^1.0.8",
129130
"@types/redux-localstorage-debounce": "^0.1.4",
130131
"@types/redux-localstorage-filter": "^0.1.4",
132+
"@types/route-parser": "^0.1.3",
131133
"@types/rx": "^4.1.1",
132134
"@types/sockjs-client": "^1.0.32",
133135
"@types/url-join": "^0.8.2",
@@ -151,4 +153,4 @@
151153
"resolutions": {
152154
"**/event-stream": "^4.0.1"
153155
}
154-
}
156+
}

public/locales/en-US.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,15 @@
7979
"confirm": "Confirm",
8080
"contract": "Smart contract",
8181
"contract.exec": "Execute contract",
82+
"editor": "Editor",
83+
"editor.app": "Application",
8284
"editor.block.create": "Create block",
8385
"editor.close.confirm": "Do you really want to close '{name}' without saving changes?",
8486
"editor.close.all": "Close all tabs",
87+
"editor.close.all.confirm": "Do you really want to close all tabs without saving?",
8588
"editor.close.saved": "Close saved tabs",
8689
"editor.conditions.change": "Change conditions",
90+
"editor.contract.create": "Create smart contract",
8791
"editor.create": "Create",
8892
"editor.execute": "Execute",
8993
"editor.menu": "Menu",
@@ -92,7 +96,7 @@
9296
"editor.page.name": "Name",
9397
"editor.param.add": "Add parameter",
9498
"editor.revert": "Revert",
95-
"editor.revert.confirm": "Do you really want to discard all changes?",
99+
"editor.revert.confirm": "Do you really want to discard all changes in '{name}'?",
96100
"editor.save": "Save",
97101
"editor.tool.developer": "Developer",
98102
"editor.tool.designer": "Designer",
@@ -114,14 +118,15 @@
114118
"general.download.asfile": "Download as file",
115119
"general.ecosystems": "Ecosystems",
116120
"general.error": "Error",
117-
"general.error.notfound": "The page you are looking for does not exists",
121+
"general.error.notfound": "The page you are looking for does not exist",
118122
"general.error.page": "The page you are looking for could not be processed",
119123
"general.error.timeout": "The page you are looking for is too heavy to be processed. Consider reducing number of database queries",
120124
"general.error.socket": "Notifications are unavailable",
121125
"general.error.socket.desc": "Failed to establish connection to the WebSocket server. Check your configuration",
122126
"general.home": "Home",
123127
"general.key.private": "Private key",
124128
"general.key.public": "Public key",
129+
"general.main_menu": "Main menu",
125130
"general.network.id.short": "ID",
126131
"general.network.id.auto": "Automatic discovery",
127132
"general.network.add": "Add network",
@@ -143,7 +148,7 @@
143148
"general.network.error.E_SERVER_MISCONFIGURATION": "Server configuration error",
144149
"general.networks": "Networks",
145150
"general.notfound.page": "We couldn't find this page",
146-
"general.notfound.page.notexists": "The page you are looking for does not exists",
151+
"general.notfound.page.notexists": "The page you are looking for does not exist",
147152
"general.password": "Password",
148153
"general.password.repeat": "Repeat password",
149154
"general.password.old": "Old password",
@@ -180,18 +185,17 @@
180185
"map.editor": "Map editor",
181186
"map.meter.short": "m",
182187
"modal.authorization.title": "Authorization",
183-
"modal.authorization.password": "Enter your password to execute transaction {contract}",
188+
"modal.authorization.password": "Please enter your password to perform this action",
184189
"modal.confirm.title": "Confirmation",
185190
"modal.imageeditor.cancel": "Cancel",
186191
"modal.imageeditor.confirm": "Confirm",
187192
"modal.imageeditor.desc": "Prepare your image for uploading by selecting which part of the image you want to use",
188193
"modal.imageeditor.title": "Image editor",
189-
"modal.locale.title": "Switch language",
190194
"modal.network.remove.confirmation": "Do you really want to delete network \"{name}\"?",
191-
"navigation.back": "Back",
192-
"navigation.forward": "Forward",
193-
"navigation.home": "Home",
195+
"navigation.default_page": "Main page",
196+
"navigation.loaded_page": "Loaded page",
194197
"navigation.refresh": "Refresh",
198+
"navigation.return": "Return",
195199
"notifications": "Notifications",
196200
"notification.ecosystem_invited": "Joined ecosystem {ecosystem}",
197201
"notification.tx_batch": "Batch processing completed",
@@ -224,7 +228,7 @@
224228
"tx.error.E_LIMITFORSIGN": "Execution failed",
225229
"tx.error.E_OFFLINE": "Service offline",
226230
"tx.error.E_SERVER": "Runtime error",
227-
"tx.error.E_CONTRACT.desc": "Contract '{0}' does not exists",
231+
"tx.error.E_CONTRACT.desc": "Contract '{0}' does not exist",
228232
"tx.error.E_DELETEDKEY.desc": "Your account has been removed",
229233
"tx.error.E_GUEST_VIOLATION.desc": "Transaction can't be executed using demo mode",
230234
"tx.error.E_INVALID_PASSWORD.desc": "Invalid password",

public/locales/ru-RU.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,15 @@
7979
"confirm": "Подтвердить",
8080
"contract": "Смарт-контракт",
8181
"contract.exec": "Вызвать контракт",
82+
"editor": "Редактор",
83+
"editor.app": "Приложение",
8284
"editor.block.create": "Создать блок",
8385
"editor.close.confirm": "Вы действительно хотите закрыть '{name}' без сохранения изменений?",
8486
"editor.close.all": "Закрыть все вкладки",
87+
"editor.close.all.confirm": "Вы действительно хотите закрыть все вкладки без сохранения изменений?",
8588
"editor.close.saved": "Закрыть сохранённые",
8689
"editor.conditions.change": "Права на изменение",
90+
"editor.contract.create": "Создать смарт-контракт",
8791
"editor.create": "Создать",
8892
"editor.execute": "Вызвать",
8993
"editor.menu": "Меню",
@@ -92,7 +96,7 @@
9296
"editor.page.name": "Название",
9397
"editor.param.add": "Добавить параметр",
9498
"editor.revert": "Сброс",
95-
"editor.revert.confirm": "Вы действительно хотите сбросить все изменения?",
99+
"editor.revert.confirm": "Вы действительно хотите сбросить все изменения в '{name}'?",
96100
"editor.save": "Сохранить",
97101
"editor.tool.developer": "Разработка",
98102
"editor.tool.designer": "Дизайн",
@@ -122,6 +126,7 @@
122126
"general.home": "Домашняя страница",
123127
"general.key.private": "Закрытый ключ",
124128
"general.key.public": "Открытый ключ",
129+
"general.main_menu": "Главное меню",
125130
"general.network.id.short": "ID",
126131
"general.network.id.auto": "Автоматическое обнаружение",
127132
"general.network.add": "Добавить сеть",
@@ -180,18 +185,17 @@
180185
"map.editor": "Редактирование карты",
181186
"map.meter.short": "м",
182187
"modal.authorization.title": "Авторизация",
183-
"modal.authorization.password": "Введите пароль для вызова транзакции {contract}",
188+
"modal.authorization.password": "Пожалуйста, введите пароль для выполнения данного действия",
184189
"modal.confirm.title": "Подтверждение",
185190
"modal.imageeditor.cancel": "Отмена",
186191
"modal.imageeditor.confirm": "Подтверждение",
187192
"modal.imageeditor.desc": "Произведите обработку вашего изображения для загрузки, выбрав необходимую область",
188193
"modal.imageeditor.title": "Редактирование изображения",
189-
"modal.locale.title": "Выбор языка",
190194
"modal.network.remove.confirmation": "Вы действительно хотите удалить сеть \"{name}\"?",
191-
"navigation.back": "Назад",
192-
"navigation.forward": "Вперёд",
193-
"navigation.home": "Домашняя страница",
195+
"navigation.default_page": "Главная страница",
196+
"navigation.loaded_page": "Загруженная страница",
194197
"navigation.refresh": "Обновить",
198+
"navigation.return": "Назад",
195199
"notifications": "Уведомления",
196200
"notification.ecosystem_invited": "Добавлена экосистема {ecosystem}",
197201
"notification.tx_batch": "Пакетная обработка завершена",

src/app/components/Animation/Dropdown.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
* See LICENSE in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as React from 'react';
6+
import React from 'react';
77
import Transition from 'react-transition-group/Transition';
88

9-
const animationDuration = 300;
9+
const animationDuration = 200;
1010
const containerAnimationDef = {
1111
defaultStyle: {
12+
opacity: 1,
1213
position: 'absolute',
1314
overflow: 'hidden',
1415
zIndex: 600
@@ -42,22 +43,26 @@ const containerAnimationDef = {
4243

4344
const animationDef = {
4445
defaultStyle: {
45-
transition: `transform ${animationDuration}ms cubic-bezier(0,0.5,0,1)`,
46-
transform: 'translateY(-100%)',
47-
marginTop: '0'
46+
transition: `transform ${animationDuration}ms cubic-bezier(0,0.5,0.5,1), opacity ${animationDuration}ms`,
47+
transform: 'translateY(-25%)',
48+
marginTop: '0',
49+
opacity: 0
4850
},
4951
entering: {
50-
transform: 'translateY(0)'
52+
transform: 'translateY(0)',
53+
opacity: 1
5154
},
5255
entered: {
53-
transform: 'translateY(0)'
56+
transform: 'translateY(0)',
57+
opacity: 1
5458
},
5559

5660
// We use negative margin to make children unclickable and not to break
5761
// animation that will be used later
5862
exited: {
59-
transform: 'translateY(-100%)',
60-
marginTop: '-100000px'
63+
transform: 'translateY(-25%)',
64+
marginTop: '-100000px',
65+
opacity: 0
6166
}
6267
};
6368

src/app/components/App.tsx

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) EGAAS S.A. All rights reserved.
3+
* See LICENSE in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import React from 'react';
7+
import { INetworkEndpoint } from 'apla/auth';
8+
import { Route } from 'react-router-dom';
9+
import { FormattedMessage, IntlProvider } from 'react-intl';
10+
import { mainRoute } from 'lib/routing';
11+
import platform from 'lib/platform';
12+
import classnames from 'classnames';
13+
import baseTheme from 'components/Theme/baseTheme';
14+
15+
import { AnimatedSwitch } from 'components/Animation';
16+
import themed from 'components/Theme/themed';
17+
import Auth from 'containers/Auth';
18+
import Error from 'containers/Auth/Error';
19+
import Splash from 'components/Splash';
20+
import ModalProvider from 'containers/Modal/ModalProvider';
21+
import NotificationsProvider from 'containers/Notifications/NotificationsProvider';
22+
import SecurityWarning from 'containers/SecurityWarning';
23+
import ThemeProvider from 'components/Theme/ThemeProvider';
24+
import Titlebar from 'components/Titlebar';
25+
import Main from './Main';
26+
27+
interface AppProps {
28+
network: INetworkEndpoint;
29+
locale: string;
30+
isSessionAcquired: boolean;
31+
isAuthenticated: boolean;
32+
isLoaded: boolean;
33+
isFatal: boolean;
34+
securityWarningClosed: boolean;
35+
localeMessages: { [key: string]: string };
36+
initialize?: () => void;
37+
}
38+
39+
const ThemedApp = themed.div`
40+
&.platform-windows {
41+
border: solid 1px ${props => props.theme.windowBorder};
42+
}
43+
`;
44+
45+
const StyledTitlebar = themed.div`
46+
background: ${props => props.theme.headerBackground};
47+
height: ${props => props.theme.headerHeight}px;
48+
line-height: ${props => props.theme.headerHeight}px;
49+
font-size: 15px;
50+
color: #fff;
51+
text-align: center;
52+
`;
53+
54+
class App extends React.Component<AppProps> {
55+
componentDidMount() {
56+
this.props.initialize();
57+
}
58+
59+
render() {
60+
const appTitle = `Apla ${this.props.network ? '(' + this.props.network.apiHost + ')' : ''}`;
61+
const classes = classnames({
62+
'wrapper': true,
63+
'layout-fixed': true,
64+
'platform-desktop': platform.select({ desktop: true }),
65+
'platform-web': platform.select({ web: true }),
66+
'platform-windows': platform.select({ win32: true })
67+
});
68+
69+
return (
70+
<IntlProvider key={this.props.locale} locale={this.props.locale} defaultLocale="en-US" messages={this.props.localeMessages}>
71+
<ThemeProvider theme={baseTheme}>
72+
<ThemedApp className={classes}>
73+
<StyledTitlebar className="drag">
74+
<Titlebar>{appTitle}</Titlebar>
75+
</StyledTitlebar>
76+
77+
<ModalProvider />
78+
<NotificationsProvider />
79+
80+
{platform.select({
81+
web: !this.props.securityWarningClosed && (
82+
<SecurityWarning>
83+
<FormattedMessage id="general.security.warning" defaultMessage="Please use desktop version or mobile application for better security" />
84+
</SecurityWarning>
85+
)
86+
})}
87+
88+
<AnimatedSwitch animation={AnimatedSwitch.animations.fade()}>
89+
{this.props.isFatal && (
90+
<Route path="/" component={Error} />
91+
)}
92+
{!this.props.isLoaded && (
93+
<Route path="/" component={Splash} />
94+
)}
95+
{!this.props.isAuthenticated && (
96+
<Route path="/" component={Auth} />
97+
)}
98+
{!this.props.isSessionAcquired && (
99+
<Route path="/" component={Splash} />
100+
)}
101+
<Route path={mainRoute} render={route => <Main {...route.match.params} />} />
102+
</AnimatedSwitch>
103+
</ThemedApp>
104+
</ThemeProvider>
105+
</IntlProvider>
106+
);
107+
}
108+
}
109+
110+
export default App;

0 commit comments

Comments
 (0)