feat(GODT-3121): QML request suggestions.

This commit is contained in:
Xavier Michelon
2023-11-28 17:05:49 +01:00
parent 3070912416
commit 2e2648fcd5
16 changed files with 62 additions and 7 deletions

View File

@ -247,6 +247,22 @@ SPStreamEvent newCertificateInstallFailedEvent() {
}
//****************************************************************************************************************************************************
/// \param[in] suggestions the suggestions
/// \return The event.
//****************************************************************************************************************************************************
SPStreamEvent newKnowledgeBaseSuggestionsEvent(QList<KnowledgeBaseSuggestion> const& suggestions) {
auto event = new grpc::KnowledgeBaseSuggestionsEvent;
for (KnowledgeBaseSuggestion const &suggestion: suggestions) {
grpc::KnowledgeBaseSuggestion *s = event->add_suggestions();
s->set_url(suggestion.url.toStdString());
s->set_title(suggestion.title.toStdString());
}
auto appEvent = new grpc::AppEvent;
appEvent->set_allocated_knowledgebasesuggestions(event);
return wrapAppEvent(appEvent);
}
//****************************************************************************************************************************************************
/// \return The event.
//****************************************************************************************************************************************************

View File

@ -22,6 +22,7 @@
#include "bridge.grpc.pb.h"
#include "GRPCUtils.h"
#include <bridgepp/GRPC/GRPCClient.h>
namespace bridgepp {
@ -39,6 +40,7 @@ SPStreamEvent newCertificateInstallSuccessEvent(); ///< Create a new Certificate
SPStreamEvent newCertificateInstallCanceledEvent(); ///< Create a new CertificateInstallCanceledEvent event.
SPStreamEvent newCertificateInstallFailedEvent(); ///< Create anew CertificateInstallFailedEvent event.
SPStreamEvent newShowMainWindowEvent(); ///< Create a new ShowMainWindowEvent event.
SPStreamEvent newKnowledgeBaseSuggestionsEvent(QList<KnowledgeBaseSuggestion> const& suggestions); ///< Create a new KnowledgeBaseSuggestions event.
// Login events
SPStreamEvent newLoginError(grpc::LoginErrorType error, QString const &message); ///< Create a new LoginError event.

View File

@ -571,7 +571,7 @@ grpc::Status GRPCClient::hostname(QString &outHostname) {
//****************************************************************************************************************************************************
/// \param[in] input The user input to analyze.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::RequestKnowledgeBaseSuggestions(QString const &input) {
grpc::Status GRPCClient::requestKnowledgeBaseSuggestions(QString const &input) {
return this->logGRPCCallStatus(this->setString(&Bridge::Stub::RequestKnowledgeBaseSuggestions, input), __FUNCTION__);
}

View File

@ -102,7 +102,7 @@ public: // member functions.
grpc::Status releaseNotesPageLink(QUrl &outUrl); ///< Performs the 'releaseNotesPageLink' call.
grpc::Status landingPageLink(QUrl &outUrl); ///< Performs the 'landingPageLink' call.
grpc::Status hostname(QString &outHostname); ///< Performs the 'Hostname' call.
grpc::Status RequestKnowledgeBaseSuggestions(QString const &input); ///< Performs the 'RequestKnowledgeBaseSuggestions' call.
grpc::Status requestKnowledgeBaseSuggestions(QString const &input); ///< Performs the 'RequestKnowledgeBaseSuggestions' call.
signals: // app related signals
void internetStatus(bool isOn);