Skip to content

Commit

Permalink
Remove subscription pages for iOS and call-to-actions (#2835)
Browse files Browse the repository at this point in the history
* remove subscription pages for ios and call-to-actions

* bring back button to account page to get to the dashboard

* merge url params
  • Loading branch information
tomasMizera authored Oct 5, 2023
1 parent 34f2c60 commit c835469
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 576 deletions.
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, merge the tags with &
QString utms( utmTagAttention );
utms.replace( "?", "&" );
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

1 comment on commit c835469

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

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

iOS - version 23.10.464711 just submitted!

Please sign in to comment.