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

Remove subscription pages for iOS and call-to-actions #2835

Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 30 additions & 2 deletions app/inputhelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,40 @@ QString InputHelp::merginWebLink() const

QString InputHelp::merginDashboardLink() const
{
QString activeWorkspacePathPart;

if ( mMerginApi && mMerginApi->apiSupportsWorkspaces() )
{
int activeWS = mMerginApi->userInfo()->activeWorkspaceId();
if ( activeWS >= 0 )
{
activeWorkspacePathPart = QStringLiteral( "?workspace=%1&" ).arg( activeWS );
}
}

if ( mMerginApi && mMerginApi->apiRoot() != MerginApi::defaultApiRoot() )
{
return mMerginApi->apiRoot() + "dashboard"; // UTM tags are included only for production server
return mMerginApi->apiRoot() + "dashboard" + activeWorkspacePathPart;
}

// Let's include UTM tags for production server
QString queryParams;

if ( !activeWorkspacePathPart.isEmpty() )
{
queryParams = activeWorkspacePathPart;

// URL can not have two question marks, let's remove the one in the utm tag
QString utms( utmTagAttention );
utms.replace( "?", "" );
tomasMizera marked this conversation as resolved.
Show resolved Hide resolved
queryParams += utms;
}
else
{
queryParams = utmTagAttention;
}

return MerginApi::defaultApiRoot() + "dashboard" + utmTagAttention;
return MerginApi::defaultApiRoot() + "dashboard" + queryParams;
}

QString InputHelp::privacyPolicyLink() const
Expand Down
13 changes: 0 additions & 13 deletions app/purchasing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,6 @@ void Purchasing::onHasInAppPurchasesChanged()
setSubscriptionBillingUrl( subscriptionBillingUrl );
}

QString Purchasing::subscriptionUrlWithWorkspace()
{
int ws = mMerginApi->userInfo()->activeWorkspaceId();
if ( ws >= 0 )
{
return mSubscriptionManageUrl + QStringLiteral( "?workspace=%1" ).arg( ws );
}
else
{
return mSubscriptionManageUrl;
}
}

bool Purchasing::hasInAppPurchases() const
{
return mHasInAppPurchases;
Expand Down
1 change: 0 additions & 1 deletion app/purchasing.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ class Purchasing : public QObject

Q_INVOKABLE void purchase( const QString &planId );
Q_INVOKABLE void restore();
Q_INVOKABLE QString subscriptionUrlWithWorkspace();

bool hasManageSubscriptionCapability() const;
bool transactionPending() const;
Expand Down
4 changes: 0 additions & 4 deletions app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,9 @@ set(MM_QML
SettingsPanel.qml
StakeoutPanel.qml
StorageLimitDialog.qml
SubscribePage.qml
SubscribePlanItem.qml
SwitchWorkspacePage.qml
WorkspaceAccountPage.qml
WhatsNewDialog.qml
WorkspaceSubscribePage.qml
WorkspaceSubscribePlanItem.qml
main.qml
PARENT_SCOPE
)
2 changes: 1 addition & 1 deletion app/qml/ProjectLimitDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Dialog {
font.pixelSize: InputStyle.fontPixelSizeNormal
font.underline: true
color: InputStyle.fontColor
text: qsTr("Manage subscriptions")
text: qsTr("Manage account")
visible: __merginApi.apiSupportsSubscriptions

MouseArea {
Expand Down
38 changes: 1 addition & 37 deletions app/qml/ProjectPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,7 @@ Item {
}

function manageSubscriptionPlans() {
if (__purchasing.hasInAppPurchases && (__purchasing.hasManageSubscriptionCapability || !__merginApi.subscriptionInfo.ownsActiveSubscription )) {
if ( __merginApi.serverType === MerginServerType.OLD ) {
stackView.push( subscribePanelComp )
}
else if ( __merginApi.serverType === MerginServerType.SAAS ) {
stackView.push( workspaceSubscribePageComp )
}
}
else {
Qt.openUrlExternally(__purchasing.subscriptionUrlWithWorkspace());
}
Qt.openUrlExternally(__inputHelp.merginDashboardLink);
}

function getServiceInfo() {
Expand Down Expand Up @@ -962,32 +952,6 @@ Item {
}
}

Component {
id: subscribePanelComp

SubscribePage {
id: subscribePanel
height: root.height
width: root.width
onBackClicked: {
stackView.popOnePageOrClose()
}
onSubscribeClicked: {
stackView.popOnePageOrClose()
}
}
}

Component {
id: workspaceSubscribePageComp

WorkspaceSubscribePage {
id: subscribePanel

onBack: stackView.popOnePageOrClose()
}
}

Component {
id: projectWizardComp

Expand Down
2 changes: 1 addition & 1 deletion app/qml/StorageLimitDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Dialog {
font.pixelSize: InputStyle.fontPixelSizeNormal
font.underline: true
color: InputStyle.fontColor
text: qsTr("Manage subscriptions")
text: qsTr("Manage account")
visible: __merginApi.apiSupportsSubscriptions

MouseArea {
Expand Down
168 changes: 0 additions & 168 deletions app/qml/SubscribePage.qml

This file was deleted.

Loading