diff --git a/README.md b/README.md index 4de340b..2cfea33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # ARMata [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/ARMataTeam/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) [![Build Status](https://travis-ci.org/ARMataTeam/ARMata.svg?branch=develop)](https://travis-ci.org/ARMataTeam/ARMata) [![Build status](https://ci.appveyor.com/api/projects/status/ao4tcsxoh1te8elk/branch/develop?svg=true)](https://ci.appveyor.com/project/kamil-mrzyglod/armata/branch/develop) [![Dependency Status](https://gemnasium.com/badges/github.com/ARMataTeam/ARMata.svg)](https://gemnasium.com/github.com/ARMataTeam/ARMata) [![Coverage Status](https://coveralls.io/repos/github/ARMataTeam/ARMata/badge.svg?branch=develop)](https://coveralls.io/github/ARMataTeam/ARMata?branch=develop) ARM templates visualizer +

+ ## Installation [![release](http://github-release-version.herokuapp.com/github/armatateam/armata/release.svg?style=flat)](https://github.com/armatateam/armata/releases/latest) You can obtain current version of ARMata from our [Releases](https://github.com/ARMataTeam/ARMata/releases) page. @@ -36,6 +38,7 @@ ARMata is currently at the very beginning of development phase and yet there're * toolbox * live editing of a template * template validation -* refreshed UI -* active resources with linked paramteres and variables +* ability to generate an image from a parsed template +* ~~refreshed UI~~ +* ~~active resources with linked parameters and variables~~ * and many more! diff --git a/app/components/AboutWindow.js b/app/components/AboutWindow.js index 77fed8d..40877ba 100644 --- a/app/components/AboutWindow.js +++ b/app/components/AboutWindow.js @@ -1,6 +1,7 @@ // @flow +/* eslint-disable react/jsx-indent */ import React, { Component } from 'react'; -import { Header, Icon } from 'semantic-ui-react'; +import { Header, Icon, Divider } from 'semantic-ui-react'; const appVersion = require('electron').remote.app.getVersion(); @@ -9,9 +10,17 @@ export default class AboutWindow extends Component { return (
ARMata - - ARM templates vizualizer and editor
- Version: {appVersion}
+ + ARM templates visualizer and editor
+ Version: {appVersion}
+ + Built with:
+ + +
+ Resources icons taken from `Cloud and Enterprise Icon Set` by Microsoft
+ Cannon icon by Bakunetsu Kaito from `The Noun Project` +
); } } diff --git a/app/components/App.js b/app/components/App.js index 8dcd32b..439d280 100644 --- a/app/components/App.js +++ b/app/components/App.js @@ -24,7 +24,8 @@ export default class App extends Component { loadedIn: number, resources: Array, layout: Object, - isSettingsWindowOpen: boolean + isSettingsWindowOpen: boolean, + currentView: string }; render() { @@ -37,7 +38,7 @@ export default class App extends Component { title={this.props.layout.title} /> ); + } +} diff --git a/app/components/SideMenu.css b/app/components/SideMenu.css index f77445b..2d0693d 100644 --- a/app/components/SideMenu.css +++ b/app/components/SideMenu.css @@ -1,3 +1,8 @@ .sideMenu { width: 5rem !important; } + +.settings { + position: absolute !important; + bottom: 17px; +} diff --git a/app/components/SideMenu.js b/app/components/SideMenu.js index 5dbf073..0afc87b 100644 --- a/app/components/SideMenu.js +++ b/app/components/SideMenu.js @@ -1,6 +1,7 @@ // @flow import React, { Component } from 'react'; import { Icon, Menu } from 'semantic-ui-react'; +import { Link } from 'react-router-dom'; import styles from './SideMenu.css'; // eslint-disable-line flowtype-errors/show-errors export default class SideMenu extends Component { @@ -12,10 +13,13 @@ export default class SideMenu extends Component { render() { return ( - ''} active={this.props.currentView === 'Structure'}> - + + - this.props.openSettings()} active={this.props.currentView === 'Settings'}> + + + + this.props.openSettings()} active={this.props.currentView === 'Settings'} className={styles.settings}> ); diff --git a/app/components/Visualization.js b/app/components/Visualization.js index 452d3c2..1e11089 100644 --- a/app/components/Visualization.js +++ b/app/components/Visualization.js @@ -128,7 +128,7 @@ export default class Visualization extends Component { centralGravity: 0.03, gravitationalConstant: -300 }, - solver: "forceAtlas2Based" + solver: 'forceAtlas2Based' }, autoResize: true }; diff --git a/app/containers/App.js b/app/containers/App.js index f234fa4..6230dc8 100644 --- a/app/containers/App.js +++ b/app/containers/App.js @@ -12,7 +12,8 @@ function mapStateToProps(state) { characters: state.fileDialog.fileData.characters, loadedIn: state.fileDialog.fileData.loadedIn, resources: state.fileDialog.fileData.resources, - isSettingsWindowOpen: state.layout.isSettingsWindowOpen + isSettingsWindowOpen: state.layout.isSettingsWindowOpen, + currentView: state.router.location.pathname }; } diff --git a/app/containers/EditorPage.js b/app/containers/EditorPage.js new file mode 100644 index 0000000..e0a2975 --- /dev/null +++ b/app/containers/EditorPage.js @@ -0,0 +1,11 @@ +// @flow +import { connect } from 'react-redux'; +import Editor from '../components/Editor'; + +function mapStateToProps(state) { + return { + json: state.fileDialog.rawJson + }; +} + +export default connect(mapStateToProps)(Editor); diff --git a/app/loading.html b/app/loading.html new file mode 100644 index 0000000..f82f13c --- /dev/null +++ b/app/loading.html @@ -0,0 +1,26 @@ + + + + + + + + +
+

ARMata

+
Loading, wait a second...
+ + + diff --git a/app/main.dev.js b/app/main.dev.js index d1e662c..ea20998 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -15,6 +15,7 @@ import Updater from './updater'; import MenuBuilder from './menu'; let mainWindow = null; +let loadingScreen = null; if (process.env.NODE_ENV === 'production') { const sourceMapSupport = require('source-map-support'); @@ -62,12 +63,12 @@ app.on('ready', async () => { await installExtensions(); } + createLoadingScreen(); mainWindow = new BrowserWindow({ - show: false, width: 1366, - height: 768 + height: 768, + show: false }); - mainWindow.loadURL(`file://${__dirname}/app.html`); // @TODO: Use 'ready-to-show' event @@ -76,8 +77,14 @@ app.on('ready', async () => { if (!mainWindow) { throw new Error('"mainWindow" is not defined'); } + + if (loadingScreen) { + loadingScreen.close(); + } + mainWindow.show(); mainWindow.focus(); + mainWindow.setMaximizable(true); const updater = new Updater(mainWindow); updater.initialize(); @@ -90,3 +97,19 @@ app.on('ready', async () => { const menuBuilder = new MenuBuilder(mainWindow); menuBuilder.buildMenu(); }); + +function createLoadingScreen() { + loadingScreen = new BrowserWindow({ + width: 1000, + height: 700, + show: false, + transparent: true, + frame: false, + parent: mainWindow + }); + loadingScreen.loadURL(`file://${__dirname}/loading.html`); + loadingScreen.on('closed', () => { loadingScreen = null; }); + loadingScreen.webContents.on('did-finish-load', () => { + loadingScreen.show(); + }); +} diff --git a/app/package.json b/app/package.json index 98ff1ed..b12a463 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "ARMata", "productName": "ARMata", - "version": "v1.0.0-beta1", + "version": "v1.0.0-beta2", "description": "ARM templates visualizer & editor", "main": "./main.prod.js", "author": { diff --git a/app/reducers/fileDialog.js b/app/reducers/fileDialog.js index 65157f1..25214fd 100644 --- a/app/reducers/fileDialog.js +++ b/app/reducers/fileDialog.js @@ -23,7 +23,8 @@ const initialState = { parameters: [], lines: 0, characters: 0, - loadedIn: 0 + loadedIn: 0, + rawJson: '' } }; @@ -38,7 +39,8 @@ export default function fileDialog(state: fileDialogStateType = initialState, ac return Object.assign({}, state, { selectedFilename: action.selectedFilename, fileData: parsedTemplate, - hierarchicalLayout: false + hierarchicalLayout: false, + rawJson: action.data }); } default: { diff --git a/app/routes.js b/app/routes.js index fd2dcc0..f326ac6 100644 --- a/app/routes.js +++ b/app/routes.js @@ -3,10 +3,12 @@ import React from 'react'; import { Switch, Route } from 'react-router'; import App from './containers/App'; import HomePage from './containers/HomePage'; +import EditorPage from './containers/EditorPage'; export default () => ( + diff --git a/package.json b/package.json index 3a89bf6..7fc6445 100644 --- a/package.json +++ b/package.json @@ -185,6 +185,7 @@ "font-awesome": "^4.7.0", "history": "^4.6.1", "react": "^15.5.4", + "react-ace": "^5.2.0", "react-dom": "^15.5.4", "react-graph-vis": "^0.1.2", "react-hot-loader": "3.0.0-beta.6", diff --git a/repository/armata.gif b/repository/armata.gif new file mode 100644 index 0000000..2a8b6e1 Binary files /dev/null and b/repository/armata.gif differ diff --git a/test/reducers/__snapshots__/fileDialog.spec.js.snap b/test/reducers/__snapshots__/fileDialog.spec.js.snap index 9c8fec8..17c087f 100644 --- a/test/reducers/__snapshots__/fileDialog.spec.js.snap +++ b/test/reducers/__snapshots__/fileDialog.spec.js.snap @@ -14,6 +14,7 @@ Object { "variables": Array [], }, "hierarchicalLayout": false, + "rawJson": "{\\"foo\\":\\"bar\\", \\"parameters\\": []}", "selectedFilename": undefined, } `; @@ -34,6 +35,7 @@ Object { "loadedIn": 0, "outputs": Array [], "parameters": Array [], + "rawJson": "", "resources": Array [], "schema": "", "variables": Array [], diff --git a/webpack.config.renderer.prod.js b/webpack.config.renderer.prod.js index 601d5af..ab5f211 100644 --- a/webpack.config.renderer.prod.js +++ b/webpack.config.renderer.prod.js @@ -11,8 +11,6 @@ import BabiliPlugin from 'babili-webpack-plugin'; import baseConfig from './webpack.config.base'; export default merge.smart(baseConfig, { - devtool: 'source-map', - target: 'electron-renderer', entry: ['babel-polyfill', './app/index'],