Skip to content

Commit

Permalink
remove subscription pages for ios and call-to-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed Oct 5, 2023
1 parent 897285b commit aa4dd1f
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 582 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, let's remove the one in the utm tag
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
40 changes: 1 addition & 39 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 @@ -943,8 +933,6 @@ Item {

onBack: stackView.popOnePageOrClose()

onManagePlansClicked: manageSubscriptionPlans()

onSignOutClicked: {
__merginApi.signOut()
stackView.pop( null )
Expand All @@ -962,32 +950,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

0 comments on commit aa4dd1f

Please sign in to comment.