feat(GODT-2842): Implement Bug Report Fallback notification.

This commit is contained in:
Romain LE JEUNE
2023-08-10 09:46:12 +02:00
parent 4ee6da4baa
commit 78c0651661
8 changed files with 1112 additions and 1001 deletions

View File

@ -1265,6 +1265,7 @@ void QMLBackend::connectGrpcEvents() {
connect(client, &GRPCClient::resetFinished, this, &QMLBackend::onResetFinished);
connect(client, &GRPCClient::reportBugFinished, this, &QMLBackend::reportBugFinished);
connect(client, &GRPCClient::reportBugSuccess, this, &QMLBackend::bugReportSendSuccess);
connect(client, &GRPCClient::reportBugFallback, this, &QMLBackend::bugReportSendFallback);
connect(client, &GRPCClient::reportBugError, this, &QMLBackend::bugReportSendError);
connect(client, &GRPCClient::showMainWindow, [&]() { this->showMainWindow("gRPC showMainWindow event"); });

View File

@ -266,6 +266,7 @@ signals: // Signals received from the Go backend, to be forwarded to QML
void resetFinished(); ///< Signal for the 'resetFinished' gRPC stream event.
void reportBugFinished(); ///< Signal for the 'reportBugFinished' gRPC stream event.
void bugReportSendSuccess(); ///< Signal for the 'bugReportSendSuccess' gRPC stream event.
void bugReportSendFallback(); ///< Signal for the 'bugReportSendFallback' gRPC stream event.
void bugReportSendError(); ///< Signal for the 'bugReportSendError' gRPC stream event.
void showMainWindow(); ///< Signal for the 'showMainWindow' gRPC stream event.
void hideMainWindow(); ///< Signal for the 'hideMainWindow' gRPC stream event.

View File

@ -76,7 +76,7 @@ QtObject {
target: Backend
}
}
property var all: [root.noInternet, root.imapPortStartupError, root.smtpPortStartupError, root.imapPortChangeError, root.smtpPortChangeError, root.imapConnectionModeChangeError, root.smtpConnectionModeChangeError, root.updateManualReady, root.updateManualRestartNeeded, root.updateManualError, root.updateForce, root.updateForceError, root.updateSilentRestartNeeded, root.updateSilentError, root.updateIsLatestVersion, root.loginConnectionError, root.onlyPaidUsers, root.alreadyLoggedIn, root.enableBeta, root.bugReportSendSuccess, root.bugReportSendError, root.cacheUnavailable, root.cacheCantMove, root.accountChanged, root.diskFull, root.cacheLocationChangeSuccess, root.enableSplitMode, root.resetBridge, root.changeAllMailVisibility, root.deleteAccount, root.noKeychain, root.rebuildKeychain, root.addressChanged, root.apiCertIssue, root.noActiveKeyForRecipient, root.userBadEvent, root.imapLoginWhileSignedOut, root.genericError, root.genericQuestion]
property var all: [root.noInternet, root.imapPortStartupError, root.smtpPortStartupError, root.imapPortChangeError, root.smtpPortChangeError, root.imapConnectionModeChangeError, root.smtpConnectionModeChangeError, root.updateManualReady, root.updateManualRestartNeeded, root.updateManualError, root.updateForce, root.updateForceError, root.updateSilentRestartNeeded, root.updateSilentError, root.updateIsLatestVersion, root.loginConnectionError, root.onlyPaidUsers, root.alreadyLoggedIn, root.enableBeta, root.bugReportSendSuccess, root.bugReportSendError, root.bugReportSendFallback, root.cacheUnavailable, root.cacheCantMove, root.accountChanged, root.diskFull, root.cacheLocationChangeSuccess, root.enableSplitMode, root.resetBridge, root.changeAllMailVisibility, root.deleteAccount, root.noKeychain, root.rebuildKeychain, root.addressChanged, root.apiCertIssue, root.noActiveKeyForRecipient, root.userBadEvent, root.imapLoginWhileSignedOut, root.genericError, root.genericQuestion]
property Notification alreadyLoggedIn: Notification {
brief: qsTr("Already signed in")
description: qsTr("This account is already signed in.")
@ -153,6 +153,30 @@ QtObject {
}
}
property Notification bugReportSendFallback: Notification {
brief: qsTr("Error sharing debug data")
description: qsTr("Report was sent but debug data could not be shared. Please consider sharing it using "+ "<a href=\"https://proton.me/support/send-large-files-proton-drive\">Proton Drive</a>.")
group: Notifications.Group.Configuration
icon: "./icons/ic-exclamation-circle-filled.svg"
type: Notification.NotificationType.Info
action: Action {
text: qsTr("OK")
onTriggered: {
root.bugReportSendFallback.active = false;
}
}
Connections {
function onBugReportSendFallback() {
root.bugReportSendFallback.active = true;
}
target: Backend
}
}
// Bug reports
property Notification bugReportSendSuccess: Notification {
brief: qsTr("Report sent")

View File

@ -1130,6 +1130,10 @@ void GRPCClient::processAppEvent(AppEvent const &event) {
this->logTrace("App event received: ShowMainWindow.");
emit showMainWindow();
break;
case AppEvent::kReportBugFallback:
this->logTrace("App event received: ReportBugFallback.");
emit reportBugFallback();
break;
default:
this->logError("Unknown App event received.");
}

View File

@ -102,6 +102,7 @@ signals: // app related signals
void reportBugFinished();
void reportBugSuccess();
void reportBugError();
void reportBugFallback();
void showMainWindow();
// cache related calls

File diff suppressed because it is too large Load Diff

View File

@ -261,6 +261,7 @@ message AppEvent {
ReportBugSuccessEvent reportBugSuccess = 5;
ReportBugErrorEvent reportBugError = 6;
ShowMainWindowEvent showMainWindow = 7;
ReportBugFallbackEvent reportBugFallback = 8;
}
}
@ -274,6 +275,7 @@ message ReportBugFinishedEvent {}
message ReportBugSuccessEvent {}
message ReportBugErrorEvent {}
message ShowMainWindowEvent {}
message ReportBugFallbackEvent {}
//**********************************************************
// Login related events

View File

@ -41,6 +41,10 @@ func NewReportBugErrorEvent() *StreamEvent {
return appEvent(&AppEvent{Event: &AppEvent_ReportBugError{ReportBugError: &ReportBugErrorEvent{}}})
}
func NewReportBugFallbackEvent() *StreamEvent {
return appEvent(&AppEvent{Event: &AppEvent_ReportBugFallback{ReportBugFallback: &ReportBugFallbackEvent{}}})
}
func NewShowMainWindowEvent() *StreamEvent {
return appEvent(&AppEvent{Event: &AppEvent_ShowMainWindow{ShowMainWindow: &ShowMainWindowEvent{}}})
}