mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-16 20:01:51 +00:00
It looks like the removed instructions were directly copied from GitHub issue template and did not fit here. Specifically, the first point about including the platform is automatically included in the email we prepare for the user and we also include browser and electron version. Then the second bullet point re-iterates the instructions present. Lastly, the third point asks for screenshot however user cannot add screenshot in the UI but they can in the email. We also remove an comment disabling a eslint rule. The rule was disable for no reason because we should have used template literal instead of the undocumented multi-str format which is not cleaner.
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import {remote} from 'electron';
|
|
import SendFeedback from '@electron-elements/send-feedback';
|
|
|
|
import path from 'path';
|
|
import fs from 'fs';
|
|
|
|
const {app} = remote;
|
|
|
|
customElements.define('send-feedback', SendFeedback);
|
|
export const sendFeedback: SendFeedback = document.querySelector('send-feedback');
|
|
export const feedbackHolder = sendFeedback.parentElement;
|
|
|
|
// Make the button color match zulip app's theme
|
|
sendFeedback.customStylesheet = 'css/feedback.css';
|
|
|
|
// 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: 'support@zulipchat.com'
|
|
});
|
|
|
|
feedbackHolder.addEventListener('click', (event: Event) => {
|
|
// Only remove the class if the grey out faded
|
|
// part is clicked and not the feedback element itself
|
|
if (event.target === event.currentTarget) {
|
|
feedbackHolder.classList.remove('show');
|
|
}
|
|
});
|
|
|
|
sendFeedback.addEventListener('feedback-submitted', () => {
|
|
setTimeout(() => {
|
|
feedbackHolder.classList.remove('show');
|
|
}, 1000);
|
|
});
|
|
|
|
sendFeedback.addEventListener('feedback-cancelled', () => {
|
|
feedbackHolder.classList.remove('show');
|
|
});
|
|
|
|
const dataDir = app.getPath('userData');
|
|
const logsDir = path.join(dataDir, '/Logs');
|
|
sendFeedback.logs.push(...fs.readdirSync(logsDir).map(file => path.join(logsDir, file)));
|