Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send post-registration data when onboarding is completed #3049

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/qml/onboarding/MMHowYouFoundUs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Page {
id: header

title: listView.contentY > -30 * __dp ? root.headerTitle : ""
backVisible: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I completely remove the root page's backClicked signal too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets keep it for now


onBackClicked: root.backClicked()

Expand Down
17 changes: 13 additions & 4 deletions app/qml/onboarding/MMOnboardingController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ Item {
id: howYouFoundUsPanel

objectName: "howYouFoundUsPanel"
onBackClicked: {
stackView.popOnePageOrClose()
}

onHowYouFoundUsSelected: function (selectedText) {
postRegisterData.howYouFoundUs = selectedText
Expand All @@ -249,7 +246,19 @@ Item {

onIndustrySelected: function (selectedText) {
postRegisterData.whichIndustry = selectedText
controller.end()
__merginApi.postRegisterUser( postRegisterData.howYouFoundUs, postRegisterData.whichIndustry, postRegisterData.wantNewsletter )
}

Connections {
target: __merginApi

function onPostRegistrationSucceeded() {
controller.end()
}

function onPostRegistrationFailed() {
controller.end()
}
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,6 @@ void MerginApi::postRegistrationFinished()
if ( r->error() == QNetworkReply::NoError )
{
CoreUtils::log( "post-register", QStringLiteral( "Success" ) );
QString msg = tr( "Workspace created" );
emit notify( msg );
emit postRegistrationSucceeded();
}
else
Expand All @@ -1349,10 +1347,9 @@ void MerginApi::postRegistrationFinished()
QVariant statusCode = r->attribute( QNetworkRequest::HttpStatusCodeAttribute );
int status = statusCode.toInt();
emit postRegistrationFailed( QStringLiteral( "Post-registation failed %1" ).arg( serverMsg ) );

QString msg = tr( "Unable to send post registration information" );
emit notify( msg );
}
QString msg = tr( "Workspace created" );
emit notify( msg );
r->deleteLater();
}

Expand Down
Loading