Compare commits

..

10 Commits

Author SHA1 Message Date
Akash Nimare
32a21889fb snap: Update snap summary. 2018-04-20 18:55:45 +05:30
Akash Nimare
c4a961f9da snap: Update snap config. 2018-04-19 23:48:58 +05:30
Akash Nimare
ceaa898570 snap: Add source branch for snap. 2018-04-19 23:19:01 +05:30
Akash Nimare
73fe17041d snap: Update Snap configuration. 2018-04-19 22:11:33 +05:30
Akash Nimare
9f756cad3e snap: Update snap icon path. 2018-04-19 20:58:48 +05:30
Akash Nimare
6db6b7c482 reconnect-util: Do not throw error message on server page while reconnecting. 2018-04-18 22:00:30 +05:30
Akash Nimare
09c45e75e8 Update package-lock files. 2018-04-18 17:51:22 +05:30
Akash Nimare
120b80cf65 release: 🎉 v2.0.0. 2018-04-17 15:51:32 +05:30
Abhigyan Khaund
22f705960d sidebar: Add scrollbar for list of organizations on overflow. 2018-04-16 19:38:26 +05:30
Priyank Patel
ca8ce1deaa report-issue: Add report issue UX using send-feedback electron element.
This uses @electron-elements/send-feedback package to easily implement
UX for reporting issues.
2018-04-16 11:34:11 +05:30
12 changed files with 12185 additions and 36 deletions

View File

@@ -1,5 +1,4 @@
'use strict'; 'use strict';
const os = require('os');
const path = require('path'); const path = require('path');
const { app, shell, BrowserWindow, Menu, dialog } = require('electron'); const { app, shell, BrowserWindow, Menu, dialog } = require('electron');
@@ -139,13 +138,11 @@ class AppMenu {
}, { }, {
label: 'Report an Issue...', label: 'Report an Issue...',
click() { click() {
const body = ` // the goal is to notify the main.html BrowserWindow
<!-- Please succinctly describe your issue and steps to reproduce it. --> // which may not be the focused window.
- BrowserWindow.getAllWindows().forEach(window => {
${app.getName()} ${app.getVersion()} window.webContents.send('open-feedback-modal');
Electron ${process.versions.electron} });
${process.platform} ${process.arch} ${os.release()}`;
shell.openExternal(`https://github.com/zulip/zulip-electron/issues/new?body=${encodeURIComponent(body)}`);
} }
}]; }];
} }

1414
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "1.9.0", "version": "2.0.0",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",
"copyright": "Kandra Labs, Inc.", "copyright": "Kandra Labs, Inc.",
@@ -26,6 +26,7 @@
"InstantMessaging" "InstantMessaging"
], ],
"dependencies": { "dependencies": {
"@electron-elements/send-feedback": "1.0.7",
"auto-launch": "5.0.1", "auto-launch": "5.0.1",
"electron-is-dev": "0.3.0", "electron-is-dev": "0.3.0",
"electron-log": "2.2.7", "electron-log": "2.2.7",
@@ -36,7 +37,6 @@
"node-json-db": "0.7.3", "node-json-db": "0.7.3",
"request": "2.81.0", "request": "2.81.0",
"semver": "5.4.1", "semver": "5.4.1",
"@sentry/electron": "0.5.0",
"wurl": "2.5.0" "wurl": "2.5.0"
}, },
"optionalDependencies": { "optionalDependencies": {

View File

@@ -45,6 +45,28 @@ body {
transition: all 0.6s ease-out; transition: all 0.6s ease-out;
} }
#view-controls-container {
height: calc(100% - 156px);
overflow-y: hidden;
}
#view-controls-container:hover {
overflow-y: overlay;
}
#view-controls-container::-webkit-scrollbar {
width: 4px;
}
#view-controls-container::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
#view-controls-container::-webkit-scrollbar-thumb {
background-color: darkgrey;
outline: 1px solid slategrey;
}
@font-face { @font-face {
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
@@ -408,3 +430,26 @@ webview.focus {
opacity: 1; opacity: 1;
} }
} }
send-feedback {
width: 60%;
height: 85%;
}
#feedback-modal {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(68, 67, 67, 0.81);
align-items: center;
justify-content: center;
z-index: 2;
transition: all 1s ease-out;
}
#feedback-modal.show {
display: flex;
}

View File

@@ -0,0 +1,62 @@
const { app } = require('electron').remote;
const path = require('path');
const fs = require('fs');
const SendFeedback = require('@electron-elements/send-feedback');
// make the button color match zulip app's theme
SendFeedback.customStyles = `
button:hover, button:focus {
border-color: #4EBFAC;
color: #4EBFAC;
}
button:active {
background-color: #f1f1f1;
color: #4EBFAC;
}
button {
background-color: #4EBFAC;
border-color: #4EBFAC;
}
`;
customElements.define('send-feedback', SendFeedback);
const sendFeedback = document.querySelector('send-feedback');
const feedbackHolder = sendFeedback.parentElement;
// customize the fields of custom elements
sendFeedback.title = 'Report Issue';
sendFeedback.titleLabel = 'Issue title:';
sendFeedback.titlePlaceholder = 'Enter issue title';
sendFeedback.textareaLabel = 'Describe the issue:';
sendFeedback.textareaPlaceholder = 'Succinctly describe your issue and steps to reproduce it...';
sendFeedback.buttonLabel = 'Report Issue';
sendFeedback.loaderSuccessText = '';
sendFeedback.useReporter('emailReporter', {
email: 'akash@zulipchat.com'
});
feedbackHolder.addEventListener('click', e => {
// only remove the class if the grey out faded
// part is clicked and not the feedback element itself
if (e.target === e.currentTarget) {
feedbackHolder.classList.remove('show');
}
});
sendFeedback.addEventListener('feedback-submitted', () => {
setTimeout(() => {
feedbackHolder.classList.remove('show');
}, 1000);
});
const dataDir = app.getPath('userData');
const logsDir = path.join(dataDir, '/Logs');
sendFeedback.logs.push(...fs.readdirSync(logsDir).map(file => path.join(logsDir, file)));
module.exports = {
feedbackHolder,
sendFeedback
};

View File

@@ -12,6 +12,7 @@ const ServerTab = require(__dirname + '/js/components/server-tab.js');
const FunctionalTab = require(__dirname + '/js/components/functional-tab.js'); const FunctionalTab = require(__dirname + '/js/components/functional-tab.js');
const ConfigUtil = require(__dirname + '/js/utils/config-util.js'); const ConfigUtil = require(__dirname + '/js/utils/config-util.js');
const ReconnectUtil = require(__dirname + '/js/utils/reconnect-util.js'); const ReconnectUtil = require(__dirname + '/js/utils/reconnect-util.js');
const { feedbackHolder } = require(__dirname + '/js/feedback.js');
class ServerManagerView { class ServerManagerView {
constructor() { constructor() {
@@ -175,7 +176,7 @@ class ServerManagerView {
}); });
}); });
this.sidebarHoverEvent(this.$addServerButton, this.$addServerTooltip); this.sidebarHoverEvent(this.$addServerButton, this.$addServerTooltip, true);
this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip); this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip);
this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip); this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip);
this.sidebarHoverEvent(this.$backButton, this.$backTooltip); this.sidebarHoverEvent(this.$backButton, this.$backTooltip);
@@ -187,9 +188,17 @@ class ServerManagerView {
return currentIndex; return currentIndex;
} }
sidebarHoverEvent(SidebarButton, SidebarTooltip) { sidebarHoverEvent(SidebarButton, SidebarTooltip, addServer = false) {
SidebarButton.addEventListener('mouseover', () => { SidebarButton.addEventListener('mouseover', () => {
SidebarTooltip.removeAttribute('style'); SidebarTooltip.removeAttribute('style');
// To handle position of add server tooltip due to scrolling of list of organizations
// This could not be handled using CSS, hence the top of the tooltip is made same
// as that of its parent element.
// This needs to handled only for the add server tooltip and not others.
if (addServer) {
const { top } = SidebarButton.getBoundingClientRect();
SidebarTooltip.style.top = top + 'px';
}
}); });
SidebarButton.addEventListener('mouseout', () => { SidebarButton.addEventListener('mouseout', () => {
SidebarTooltip.style.display = 'none'; SidebarTooltip.style.display = 'none';
@@ -199,6 +208,11 @@ class ServerManagerView {
onHover(index, serverName) { onHover(index, serverName) {
this.$serverIconTooltip[index].innerHTML = serverName; this.$serverIconTooltip[index].innerHTML = serverName;
this.$serverIconTooltip[index].removeAttribute('style'); this.$serverIconTooltip[index].removeAttribute('style');
// To handle position of servers' tooltip due to scrolling of list of organizations
// This could not be handled using CSS, hence the top of the tooltip is made same
// as that of its parent element.
const { top } = this.$serverIconTooltip[index].parentElement.getBoundingClientRect();
this.$serverIconTooltip[index].style.top = top + 'px';
} }
onHoverOut(index) { onHoverOut(index) {
@@ -496,6 +510,10 @@ class ServerManagerView {
} }
ipcRenderer.send('update-taskbar-icon', createOverlayIcon(messageCount).toDataURL(), String(messageCount)); ipcRenderer.send('update-taskbar-icon', createOverlayIcon(messageCount).toDataURL(), String(messageCount));
}); });
ipcRenderer.on('open-feedback-modal', () => {
feedbackHolder.classList.add('show');
});
} }
} }

View File

@@ -13,12 +13,12 @@ class ReconnectUtil {
pollInternetAndReload() { pollInternetAndReload() {
const pollInterval = setInterval(() => { const pollInterval = setInterval(() => {
this._checkAndReload() this._checkAndReload()
.then(status => { .then(status => {
if (status) { if (status) {
this.alreadyReloaded = true; this.alreadyReloaded = true;
clearInterval(pollInterval); clearInterval(pollInterval);
} }
}); });
}, 1500); }, 1500);
} }
@@ -26,22 +26,24 @@ class ReconnectUtil {
return new Promise(resolve => { return new Promise(resolve => {
if (!this.alreadyReloaded) { // eslint-disable-line no-negated-condition if (!this.alreadyReloaded) { // eslint-disable-line no-negated-condition
isOnline() isOnline()
.then(online => { .then(online => {
if (online) { if (online) {
if (!this.alreadyReloaded) { if (!this.alreadyReloaded) {
this.serverManagerView.reloadView(); this.serverManagerView.reloadView();
}
console.log('You\'re back online.');
return resolve(true);
} }
console.log('You\'re back online.');
return resolve(true);
}
console.log('There is no internet connection, try checking network cables, modem and router.'); console.log('There is no internet connection, try checking network cables, modem and router.');
const errMsgHolder = document.querySelector('#description'); const errMsgHolder = document.querySelector('#description');
errMsgHolder.innerHTML = ` if (errMsgHolder) {
errMsgHolder.innerHTML = `
<div>You internet connection does't seem to work properly!</div> <div>You internet connection does't seem to work properly!</div>
</div>Verify that it works and then click try again.</div>`; </div>Verify that it works and then click try again.</div>`;
return resolve(false); }
}); return resolve(false);
});
} else { } else {
return resolve(true); return resolve(true);
} }

View File

@@ -42,6 +42,10 @@
<div id="webviews-container"></div> <div id="webviews-container"></div>
</div> </div>
</div> </div>
<div id="feedback-modal">
<send-feedback></send-feedback>
</div>
</body> </body>
<script src="js/main.js"></script> <script src="js/main.js"></script>
<script>require('./js/shared/preventdrag.js')</script> <script>require('./js/shared/preventdrag.js')</script>

10607
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "zulip", "name": "zulip",
"productName": "Zulip", "productName": "Zulip",
"version": "1.9.0", "version": "2.0.0",
"main": "./app/main", "main": "./app/main",
"description": "Zulip Desktop App", "description": "Zulip Desktop App",
"license": "Apache-2.0", "license": "Apache-2.0",

BIN
snap/gui/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1,10 +1,10 @@
name: zulip name: zulip
version: 1.8.2 version: 2.0.0
summary: Zulip summary: Zulip Desktop Client for Linux
description: Zulip Desktop Client for Linux description: Zulip combines the immediacy of Slack with an email threading model. With Zulip, you can catch up on important conversations while ignoring irrelevant ones.
confinement: strict confinement: strict
grade: stable grade: stable
icon: ../build/icon.png icon: snap/gui/icon.png
apps: apps:
zulip: zulip:
command: env TMPDIR=$XDG_RUNTIME_DIR desktop-launch $SNAP/zulip command: env TMPDIR=$XDG_RUNTIME_DIR desktop-launch $SNAP/zulip
@@ -32,6 +32,6 @@ parts:
- libpulse0 - libpulse0
- libxss1 - libxss1
- libxtst6 - libxtst6
source: ../dist/linux-unpacked source: dist/linux-unpacked
after: after:
- desktop-gtk2 - desktop-gtk2