Remove feedback widget.

@electron-elements/send-feedback won’t work with Electron 14, and all
it ever did was open your mail client.  Have the “Report an Issue”
menu item direct users to our website instead.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-08-30 18:52:00 -07:00
parent a3f4e19aa2
commit 014e97b563
10 changed files with 3 additions and 124 deletions

View File

@@ -4,6 +4,6 @@
"color-named": "never",
"color-no-hex": true,
"font-family-no-missing-generic-family-keyword": [true, {"ignoreFontFamilies": ["Material Icons"]}],
"selector-type-no-unknown": [true, {"ignoreTypes": ["send-feedback", "webview"]}],
"selector-type-no-unknown": [true, {"ignoreTypes": ["webview"]}],
}
}

View File

@@ -48,7 +48,6 @@ export interface RendererMessage {
logout: () => void;
"new-server": () => void;
"open-about": () => void;
"open-feedback-modal": () => void;
"open-help": () => void;
"open-network-settings": () => void;
"open-org-tab": () => void;

View File

@@ -280,12 +280,8 @@ function getHelpSubmenu(): Electron.MenuItemConstructorOptions[] {
},
{
label: t.__("Report an Issue"),
click() {
// The goal is to notify the main.html BrowserWindow
// which may not be the focused window.
for (const window of BrowserWindow.getAllWindows()) {
send(window.webContents, "open-feedback-modal");
}
async click() {
await shell.openExternal("https://zulip.com/help/contact-support");
},
},
];

View File

@@ -467,26 +467,3 @@ webview.focus {
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

@@ -1,54 +0,0 @@
import {remote} from "electron";
import fs from "fs";
import path from "path";
import SendFeedback from "@electron-elements/send-feedback";
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@zulip.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)),
);

View File

@@ -14,7 +14,6 @@ import type {NavItem, ServerConf, TabData} from "../../common/types";
import FunctionalTab from "./components/functional-tab";
import ServerTab from "./components/server-tab";
import WebView from "./components/webview";
import {feedbackHolder} from "./feedback";
import {ipcRenderer} from "./typed-ipc-renderer";
import * as DomainUtil from "./utils/domain-util";
import * as LinkUtil from "./utils/link-util";
@@ -1171,10 +1170,6 @@ class ServerManagerView {
},
);
ipcRenderer.on("open-feedback-modal", () => {
feedbackHolder.classList.add("show");
});
ipcRenderer.on("copy-zulip-url", () => {
clipboard.writeText(this.getCurrentActiveServer());
});

View File

@@ -51,10 +51,6 @@
<div id="webviews-container"></div>
</div>
</div>
<div id="feedback-modal">
<send-feedback show-cancel-button="show"></send-feedback>
</div>
</body>
<script>

13
package-lock.json generated
View File

@@ -374,19 +374,6 @@
"ajv-keywords": "^3.4.1"
}
},
"@electron-elements/send-feedback": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@electron-elements/send-feedback/-/send-feedback-2.0.3.tgz",
"integrity": "sha512-cZyXjnRayZA+AidE2LnZ8neN0bmDcvELKpTDhE6FDLFGetf43l/NQqcjZcs26lCn3oUExQfWU1NJa7sDg5hbFw==",
"requires": {
"@electron-elements/utils": "1.0.4"
}
},
"@electron-elements/utils": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@electron-elements/utils/-/utils-1.0.4.tgz",
"integrity": "sha512-P3IJuXwaWbaxBtWln6IIoTYnC80zEGmDVj3vTybBUUxdQA7pq6HaBPaE7QiAkR7Xi87FApvq/eoZB3rAnTnvcQ=="
},
"@electron/get": {
"version": "1.12.4",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.4.tgz",

View File

@@ -146,7 +146,6 @@
"InstantMessaging"
],
"dependencies": {
"@electron-elements/send-feedback": "^2.0.3",
"@sentry/electron": "^2.5.1",
"@yaireo/tagify": "^4.5.0",
"adm-zip": "^0.5.5",

16
typings.d.ts vendored
View File

@@ -3,22 +3,6 @@ declare namespace Electron {
interface IncomingMessage extends NodeJS.ReadableStream {}
}
declare module "@electron-elements/send-feedback" {
class SendFeedback extends HTMLElement {
customStyles: string;
customStylesheet: string;
titleLabel: string;
titlePlaceholder: string;
textareaLabel: string;
textareaPlaceholder: string;
buttonLabel: string;
loaderSuccessText: string;
logs: string[];
useReporter: (reporter: string, data: Record<string, unknown>) => void;
}
export = SendFeedback;
}
interface ClipboardDecrypter {
version: number;
key: Uint8Array;