mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 16:13:37 +00:00
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.
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
'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;
|