mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-01 04:23:30 +00:00
Compare commits
14 Commits
v5.10.3
...
redesign-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
208826e0bb | ||
|
|
25875a9a35 | ||
|
|
2da195f6f6 | ||
|
|
5ba6ae777e | ||
|
|
2c212f7035 | ||
|
|
0fe62b2023 | ||
|
|
f186c200e2 | ||
|
|
20d1c06dc5 | ||
|
|
2c21aea643 | ||
|
|
1a3511c28c | ||
|
|
4c4de820e2 | ||
|
|
ea77c5f003 | ||
|
|
d22d26cfdb | ||
|
|
fc12e7a00e |
@@ -52,8 +52,8 @@ const iconPath = () => {
|
|||||||
function createMainWindow() {
|
function createMainWindow() {
|
||||||
// Load the previous state with fallback to defaults
|
// Load the previous state with fallback to defaults
|
||||||
const mainWindowState = windowStateKeeper({
|
const mainWindowState = windowStateKeeper({
|
||||||
defaultWidth: 1000,
|
defaultWidth: 1100,
|
||||||
defaultHeight: 600
|
defaultHeight: 720
|
||||||
});
|
});
|
||||||
|
|
||||||
// Let's keep the window position global so that we can access it in other process
|
// Let's keep the window position global so that we can access it in other process
|
||||||
|
|||||||
@@ -121,11 +121,14 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.action-button.active {
|
.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 {
|
.action-button.active i {
|
||||||
color: #eee;
|
color: #1c262b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab:first-child {
|
.tab:first-child {
|
||||||
@@ -284,7 +287,7 @@ webview.focus {
|
|||||||
#setting-tooltip {
|
#setting-tooltip {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
background: #222c31;
|
background: #222c31;
|
||||||
margin-left: 45px;
|
margin-left: 48px;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
@@ -356,6 +359,8 @@ webview.focus {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-basis: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
|
|||||||
@@ -129,6 +129,12 @@ td:nth-child(odd) {
|
|||||||
content: '';
|
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 {
|
#settings-header {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
color: #222c31;
|
color: #222c31;
|
||||||
@@ -144,12 +150,12 @@ td:nth-child(odd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#new-server-container {
|
#new-server-container {
|
||||||
opacity: 1;
|
padding-left: 42px;
|
||||||
transition: opacity 0.3s;
|
padding-top: 25px;
|
||||||
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
padding: 4px 0 6px 0;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #222c31;
|
color: #222c31;
|
||||||
}
|
}
|
||||||
@@ -205,18 +211,16 @@ img.server-info-icon {
|
|||||||
.setting-input-value {
|
.setting-input-value {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 22px;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 7px;
|
padding: 13px;
|
||||||
border: #ededed 2px solid;
|
border: #ededed 2px solid;
|
||||||
outline-width: 0;
|
outline-width: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
max-width: 500px;
|
max-width: 450px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-input-value:focus {
|
.setting-input-value:focus {
|
||||||
border: #7cb980 2px solid;
|
border: #4EBFAC 2px solid;
|
||||||
border-radius: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-block {
|
.setting-block {
|
||||||
@@ -370,17 +374,10 @@ i.open-tab-button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#open-create-org-link {
|
#open-create-org-link {
|
||||||
color: #666;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#open-create-org-link:hover {
|
|
||||||
color: #005580;
|
|
||||||
;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle {
|
.toggle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: -9999px;
|
margin-left: -9999px;
|
||||||
@@ -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 */
|
/* responsive grid */
|
||||||
|
|
||||||
@media (max-width: 650px) {
|
@media (max-width: 650px) {
|
||||||
@@ -447,4 +525,18 @@ input.toggle-round:checked+label:after {
|
|||||||
#css-delete-action span {
|
#css-delete-action span {
|
||||||
display: none;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ class ServerManagerView {
|
|||||||
// Remove focus from the settings icon at sidebar bottom
|
// Remove focus from the settings icon at sidebar bottom
|
||||||
this.$settingsButton.classList.remove('active');
|
this.$settingsButton.classList.remove('active');
|
||||||
} else {
|
} else {
|
||||||
this.openSettings('Servers');
|
this.openSettings('AddServer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class ServerManagerView {
|
|||||||
this.tabs[this.activeTabIndex].webview.reload();
|
this.tabs[this.activeTabIndex].webview.reload();
|
||||||
});
|
});
|
||||||
this.$addServerButton.addEventListener('click', () => {
|
this.$addServerButton.addEventListener('click', () => {
|
||||||
this.openSettings('Servers');
|
this.openSettings('AddServer');
|
||||||
});
|
});
|
||||||
this.$settingsButton.addEventListener('click', () => {
|
this.$settingsButton.addEventListener('click', () => {
|
||||||
this.openSettings('General');
|
this.openSettings('General');
|
||||||
|
|||||||
51
app/renderer/js/pages/preference/connected-org-section.js
Normal file
51
app/renderer/js/pages/preference/connected-org-section.js
Normal file
@@ -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;
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const BaseComponent = require(__dirname + '/../../components/base.js');
|
|
||||||
const shell = require('electron').shell;
|
|
||||||
|
|
||||||
class CreateOrganziation extends BaseComponent {
|
|
||||||
constructor(props) {
|
|
||||||
super();
|
|
||||||
this.props = props;
|
|
||||||
}
|
|
||||||
|
|
||||||
template() {
|
|
||||||
return `
|
|
||||||
<div class="setting-row">
|
|
||||||
<div class="setting-description">
|
|
||||||
<span id="open-create-org-link">Or create a new organization on zulipchat.com<i class="material-icons open-tab-button">open_in_new</i></span>
|
|
||||||
</div>
|
|
||||||
<div class="setting-control"></div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.props.$root.innerHTML = this.template();
|
|
||||||
this.openCreateNewOrgExternalLink();
|
|
||||||
}
|
|
||||||
|
|
||||||
openCreateNewOrgExternalLink() {
|
|
||||||
const link = 'https://zulipchat.com/beta/';
|
|
||||||
const externalCreateNewOrgEl = document.getElementById('open-create-org-link');
|
|
||||||
externalCreateNewOrgEl.addEventListener('click', () => {
|
|
||||||
shell.openExternal(link);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = CreateOrganziation;
|
|
||||||
@@ -8,7 +8,7 @@ class PreferenceNav extends BaseComponent {
|
|||||||
|
|
||||||
this.props = props;
|
this.props = props;
|
||||||
|
|
||||||
this.navItems = ['General', 'Network', 'Servers', 'Shortcuts'];
|
this.navItems = ['General', 'Network', 'AddServer', 'Organizations', 'Shortcuts'];
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const BaseComponent = require(__dirname + '/../../components/base.js');
|
const BaseComponent = require(__dirname + '/../../components/base.js');
|
||||||
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
|
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
|
||||||
|
const shell = require('electron').shell;
|
||||||
|
|
||||||
class NewServerForm extends BaseComponent {
|
class NewServerForm extends BaseComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -11,19 +12,26 @@ class NewServerForm extends BaseComponent {
|
|||||||
|
|
||||||
template() {
|
template() {
|
||||||
return `
|
return `
|
||||||
<div class="settings-card">
|
<div class="server-input-container">
|
||||||
<div class="server-info-right">
|
<div class="title">Organization URL</div>
|
||||||
<div class="title">URL of Zulip organization</div>
|
<div class="server-info-row">
|
||||||
<div class="server-info-row">
|
<input class="setting-input-value" autofocus placeholder="your-organization.zulipchat.com or chat.your-organization.com"/>
|
||||||
<input class="setting-input-value" autofocus placeholder="your-organization.zulipchat.com or chat.your-organization.com"/>
|
</div>
|
||||||
</div>
|
<div class="server-center">
|
||||||
<div class="server-info-row">
|
<div class="action blue server-save-action">
|
||||||
<div class="action blue server-save-action">
|
<span id="connect">Connect</span>
|
||||||
<i class="material-icons">add_box</i>
|
|
||||||
<span>Add</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="server-center">
|
||||||
|
<div class="divider">
|
||||||
|
<hr class="left"/>OR<hr class="right" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="server-center">
|
||||||
|
<div class="action blue server-save-action">
|
||||||
|
<span id="open-create-org-link">Create a new organization</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -36,6 +44,7 @@ class NewServerForm extends BaseComponent {
|
|||||||
initForm() {
|
initForm() {
|
||||||
this.$newServerForm = this.generateNodeFromTemplate(this.template());
|
this.$newServerForm = this.generateNodeFromTemplate(this.template());
|
||||||
this.$saveServerButton = this.$newServerForm.getElementsByClassName('server-save-action')[0];
|
this.$saveServerButton = this.$newServerForm.getElementsByClassName('server-save-action')[0];
|
||||||
|
|
||||||
this.props.$root.innerHTML = '';
|
this.props.$root.innerHTML = '';
|
||||||
this.props.$root.appendChild(this.$newServerForm);
|
this.props.$root.appendChild(this.$newServerForm);
|
||||||
|
|
||||||
@@ -43,17 +52,25 @@ class NewServerForm extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submitFormHandler() {
|
submitFormHandler() {
|
||||||
this.$saveServerButton.children[1].innerHTML = 'Adding...';
|
this.$saveServerButton.children[0].innerHTML = 'Connecting...';
|
||||||
DomainUtil.checkDomain(this.$newServerUrl.value).then(serverConf => {
|
DomainUtil.checkDomain(this.$newServerUrl.value).then(serverConf => {
|
||||||
DomainUtil.addDomain(serverConf).then(() => {
|
DomainUtil.addDomain(serverConf).then(() => {
|
||||||
this.props.onChange(this.props.index);
|
this.props.onChange(this.props.index);
|
||||||
});
|
});
|
||||||
}, errorMessage => {
|
}, errorMessage => {
|
||||||
this.$saveServerButton.children[1].innerHTML = 'Add';
|
this.$saveServerButton.children[0].innerHTML = 'Connect';
|
||||||
alert(errorMessage);
|
alert(errorMessage);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openCreateNewOrgExternalLink() {
|
||||||
|
const link = 'https://zulipchat.com/beta/';
|
||||||
|
const externalCreateNewOrgEl = document.getElementById('open-create-org-link');
|
||||||
|
externalCreateNewOrgEl.addEventListener('click', () => {
|
||||||
|
shell.openExternal(link);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
initActions() {
|
initActions() {
|
||||||
this.$saveServerButton.addEventListener('click', () => {
|
this.$saveServerButton.addEventListener('click', () => {
|
||||||
this.submitFormHandler();
|
this.submitFormHandler();
|
||||||
@@ -65,6 +82,8 @@ class NewServerForm extends BaseComponent {
|
|||||||
this.submitFormHandler();
|
this.submitFormHandler();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// open create new org link in default browser
|
||||||
|
this.openCreateNewOrgExternalLink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const Nav = require(__dirname + '/js/pages/preference/nav.js');
|
|||||||
const ServersSection = require(__dirname + '/js/pages/preference/servers-section.js');
|
const ServersSection = require(__dirname + '/js/pages/preference/servers-section.js');
|
||||||
const GeneralSection = require(__dirname + '/js/pages/preference/general-section.js');
|
const GeneralSection = require(__dirname + '/js/pages/preference/general-section.js');
|
||||||
const NetworkSection = require(__dirname + '/js/pages/preference/network-section.js');
|
const NetworkSection = require(__dirname + '/js/pages/preference/network-section.js');
|
||||||
|
const ConnectedOrgSection = require(__dirname + '/js/pages/preference/connected-org-section.js');
|
||||||
const ShortcutsSection = require(__dirname + '/js/pages/preference/shortcuts-section.js');
|
const ShortcutsSection = require(__dirname + '/js/pages/preference/shortcuts-section.js');
|
||||||
|
|
||||||
class PreferenceView extends BaseComponent {
|
class PreferenceView extends BaseComponent {
|
||||||
@@ -39,7 +40,7 @@ class PreferenceView extends BaseComponent {
|
|||||||
handleNavigation(navItem) {
|
handleNavigation(navItem) {
|
||||||
this.nav.select(navItem);
|
this.nav.select(navItem);
|
||||||
switch (navItem) {
|
switch (navItem) {
|
||||||
case 'Servers': {
|
case 'AddServer': {
|
||||||
this.section = new ServersSection({
|
this.section = new ServersSection({
|
||||||
$root: this.$settingsContainer
|
$root: this.$settingsContainer
|
||||||
});
|
});
|
||||||
@@ -51,6 +52,12 @@ class PreferenceView extends BaseComponent {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'Organizations': {
|
||||||
|
this.section = new ConnectedOrgSection({
|
||||||
|
$root: this.$settingsContainer
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'Network': {
|
case 'Network': {
|
||||||
this.section = new NetworkSection({
|
this.section = new NetworkSection({
|
||||||
$root: this.$settingsContainer
|
$root: this.$settingsContainer
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const BaseSection = require(__dirname + '/base-section.js');
|
const BaseSection = require(__dirname + '/base-section.js');
|
||||||
const DomainUtil = require(__dirname + '/../../utils/domain-util.js');
|
|
||||||
const ServerInfoForm = require(__dirname + '/server-info-form.js');
|
|
||||||
const NewServerForm = require(__dirname + '/new-server-form.js');
|
const NewServerForm = require(__dirname + '/new-server-form.js');
|
||||||
const CreateOrganziation = require(__dirname + '/create-new-org.js');
|
|
||||||
|
|
||||||
class ServersSection extends BaseSection {
|
class ServersSection extends BaseSection {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -14,13 +11,14 @@ class ServersSection extends BaseSection {
|
|||||||
|
|
||||||
template() {
|
template() {
|
||||||
return `
|
return `
|
||||||
<div class="settings-pane" id="server-settings-pane">
|
<div class="add-server-modal">
|
||||||
<div class="page-title">Register or login to a Zulip organization to get started</div>
|
<div class="modal-container">
|
||||||
<div id="new-server-container"></div>
|
<div class="settings-pane" id="server-settings-pane">
|
||||||
<div class="title" id="existing-servers"></div>
|
<div class="page-title">Add a Zulip organization</div>
|
||||||
<div id="server-info-container"></div>
|
<div id="new-server-container"></div>
|
||||||
<div id="create-organization-container"></div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,35 +29,10 @@ class ServersSection extends BaseSection {
|
|||||||
initServers() {
|
initServers() {
|
||||||
this.props.$root.innerHTML = '';
|
this.props.$root.innerHTML = '';
|
||||||
|
|
||||||
const servers = DomainUtil.getDomains();
|
|
||||||
this.props.$root.innerHTML = this.template();
|
this.props.$root.innerHTML = this.template();
|
||||||
this.$serverInfoContainer = document.getElementById('server-info-container');
|
|
||||||
this.$existingServers = document.getElementById('existing-servers');
|
|
||||||
this.$newServerContainer = document.getElementById('new-server-container');
|
this.$newServerContainer = document.getElementById('new-server-container');
|
||||||
this.$newServerButton = document.getElementById('new-server-action');
|
|
||||||
|
|
||||||
this.$serverInfoContainer.innerHTML = servers.length ? '' : '';
|
|
||||||
// Show Existing servers if servers are there otherwise hide it
|
|
||||||
this.$existingServers.innerHTML = servers.length === 0 ? '' : 'Connected organizations';
|
|
||||||
this.initNewServerForm();
|
this.initNewServerForm();
|
||||||
|
|
||||||
this.$createOrganizationContainer = document.getElementById('create-organization-container');
|
|
||||||
this.initCreateNewOrganization();
|
|
||||||
|
|
||||||
for (let i = 0; i < servers.length; i++) {
|
|
||||||
new ServerInfoForm({
|
|
||||||
$root: this.$serverInfoContainer,
|
|
||||||
server: servers[i],
|
|
||||||
index: i,
|
|
||||||
onChange: this.reloadApp
|
|
||||||
}).init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
initCreateNewOrganization() {
|
|
||||||
new CreateOrganziation({
|
|
||||||
$root: this.$createOrganizationContainer
|
|
||||||
}).init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initNewServerForm() {
|
initNewServerForm() {
|
||||||
|
|||||||
Reference in New Issue
Block a user