Skip to content

Commit

Permalink
design: Redesign Add new server page. (#446)
Browse files Browse the repository at this point in the history
Changes - 
* New setting nav item for connected organizations.
* All new page for adding a new server.
* Minor UI changes in setting page.
* Update default height, width of the main window.
* Fix webview showing outline.
* Hide Server nav item in setting page.

Fixes #340.
  • Loading branch information
akashnimare authored Mar 14, 2018
1 parent b31fc6b commit 6c12026
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 108 deletions.
4 changes: 2 additions & 2 deletions app/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const iconPath = () => {
function createMainWindow() {
// Load the previous state with fallback to defaults
const mainWindowState = windowStateKeeper({
defaultWidth: 1000,
defaultHeight: 600
defaultWidth: 1100,
defaultHeight: 720
});

// Let's keep the window position global so that we can access it in other process
Expand Down
11 changes: 8 additions & 3 deletions app/renderer/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ body {
}

.action-button.active {
background-color: rgba(255, 255, 255, 0.25);
/* background-color: rgba(255, 255, 255, 0.25); */
background-color: #efefef;
opacity: 0.9;
padding-right: 14px;
}

.action-button.active i {
color: #eee;
color: #1c262b;
}

.tab:first-child {
Expand Down Expand Up @@ -284,7 +287,7 @@ webview.focus {
#setting-tooltip {
font-family: sans-serif;
background: #222c31;
margin-left: 45px;
margin-left: 48px;
padding: 6px 8px;
position: absolute;
margin-top: 0px;
Expand Down Expand Up @@ -356,6 +359,8 @@ webview.focus {
height: 100%;
width: 100%;
position: relative;
flex-grow: 1;
flex-basis: 0px;
}

.hidden {
Expand Down
122 changes: 107 additions & 15 deletions app/renderer/css/preference.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ td:nth-child(odd) {
content: '';
}

/* We don't want to show this in nav item since we have the + button for adding an Organization */

#nav-AddServer {
display: none;
}

#settings-header {
font-size: 22px;
color: #222c31;
Expand All @@ -144,12 +150,12 @@ td:nth-child(odd) {
}

#new-server-container {
opacity: 1;
transition: opacity 0.3s;
padding-left: 42px;
padding-top: 25px;
margin-right: 16px;
}

.title {
padding: 4px 0 6px 0;
font-weight: 500;
color: #222c31;
}
Expand Down Expand Up @@ -205,18 +211,16 @@ img.server-info-icon {
.setting-input-value {
flex-grow: 1;
font-size: 14px;
height: 22px;
border-radius: 3px;
padding: 7px;
padding: 13px;
border: #ededed 2px solid;
outline-width: 0;
background: transparent;
max-width: 500px;
max-width: 450px;
}

.setting-input-value:focus {
border: #7cb980 2px solid;
border-radius: 3px;
border: #4EBFAC 2px solid;
}

.setting-block {
Expand Down Expand Up @@ -370,17 +374,10 @@ i.open-tab-button {
}

#open-create-org-link {
color: #666;
cursor: pointer;
text-decoration: none;
}

#open-create-org-link:hover {
color: #005580;
;
text-decoration: underline;
}

.toggle {
position: absolute;
margin-left: -9999px;
Expand Down Expand Up @@ -435,6 +432,87 @@ input.toggle-round:checked+label:after {
}


/* Add new server modal */

.add-server-modal {
display: block;
position: fixed;
z-index: 1;
padding-top: 15vh;
left: 0;
top: 0;
margin: auto;
width: 100%;
height: 100%;
/* background: rgba(61, 64, 67, 15); */
background: linear-gradient(35deg, #003b52, #45b59b);
}


/* Modal Content */

.modal-container {
background-color: #f4f7f8;
margin: auto;
padding: 57px;
border: #dae1e3 1px solid;
width: 550px;
height: 370px;
border-radius: 4px;
}

.add-server-modal .page-title {
text-align: center;
font-size: 1.6rem;
}

.divider {
margin-bottom: 30px;
margin-right: 10px;
margin-top: 30px;
color: #7d878a;
}

.divider hr {
margin-left: auto;
margin-right: auto;
width: 45%;
}

.left {
float: left;
}

.right {
float: right;
}

.server-center {
width: 100%;
text-align: center;
align-items: center;
padding-top: 13px;
}

.server-center span {
font-weight: bold;
font-size: 1.1rem;
padding: 10px;
margin: auto;
align-items: center;
text-align: center;
}

.server-center .blue {
border-radius: 3px;
}

.server-center .blue:hover {
border-right: 2px solid #309085;
border-bottom: 2px solid #309085;
}


/* responsive grid */

@media (max-width: 650px) {
Expand All @@ -447,4 +525,18 @@ input.toggle-round:checked+label:after {
#css-delete-action span {
display: none;
}
}

@media (max-width: 720px) {
.modal-container {
width: 60vw;
padding: 40px;
min-width: 300px;
}
.server-center .blue {
margin-right: 1px;
}
#new-server-container {
padding-left: 0px;
}
}
4 changes: 2 additions & 2 deletions app/renderer/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ServerManagerView {
// Remove focus from the settings icon at sidebar bottom
this.$settingsButton.classList.remove('active');
} else {
this.openSettings('Servers');
this.openSettings('AddServer');
}
}

Expand Down Expand Up @@ -159,7 +159,7 @@ class ServerManagerView {
this.tabs[this.activeTabIndex].webview.reload();
});
this.$addServerButton.addEventListener('click', () => {
this.openSettings('Servers');
this.openSettings('AddServer');
});
this.$settingsButton.addEventListener('click', () => {
this.openSettings('General');
Expand Down
51 changes: 51 additions & 0 deletions app/renderer/js/pages/preference/connected-org-section.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';

const BaseSection = require(__dirname + '/base-section.js');
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
const ServerInfoForm = require(__dirname + '/server-info-form.js');

class ConnectedOrgSection extends BaseSection {
constructor(props) {
super();
this.props = props;
}

template() {
return `
<div class="settings-pane" id="server-settings-pane">
<div class="page-title">Connected organizations</div>
<div class="title" id="existing-servers">All the connected orgnizations will appear here.</div>
<div id="server-info-container"></div>
</div>
`;
}

init() {
this.initServers();
}

initServers() {
this.props.$root.innerHTML = '';

const servers = DomainUtil.getDomains();
this.props.$root.innerHTML = this.template();
this.$serverInfoContainer = document.getElementById('server-info-container');
this.$existingServers = document.getElementById('existing-servers');

const noServerText = 'All the connected orgnizations will appear here';
// Show noServerText if no servers are there otherwise hide it
this.$existingServers.innerHTML = servers.length === 0 ? noServerText : '';

for (let i = 0; i < servers.length; i++) {
new ServerInfoForm({
$root: this.$serverInfoContainer,
server: servers[i],
index: i,
onChange: this.reloadApp
}).init();
}
}

}

module.exports = ConnectedOrgSection;
37 changes: 0 additions & 37 deletions app/renderer/js/pages/preference/create-new-org.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/renderer/js/pages/preference/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PreferenceNav extends BaseComponent {

this.props = props;

this.navItems = ['General', 'Network', 'Servers', 'Shortcuts'];
this.navItems = ['General', 'Network', 'AddServer', 'Organizations', 'Shortcuts'];

this.init();
}
Expand Down
Loading

0 comments on commit 6c12026

Please sign in to comment.