Skip to content

Commit 1b94d63

Browse files
authored
Merge pull request #5740 from Countly/SER-2116
[SER-2116] Show a flex banner on sidebar for CE
2 parents 56190fb + 7213593 commit 1b94d63

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

frontend/express/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
974974
timezones: timezones,
975975
countlyTypeName: COUNTLY_NAMED_TYPE,
976976
countlyTypeTrack: COUNTLY_TRACK_TYPE,
977+
countlyTypeCE: COUNTLY_TYPE_CE,
977978
countly_tracking,
978979
countly_domain,
979980
frontend_app: versionInfo.frontend_app || 'e70ec21cbe19e799472dfaee0adb9223516d238f',

frontend/express/public/javascripts/countly/vue/components/sidebar.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,9 @@
742742
},
743743
helpCenterTarget: function() {
744744
return this.enableGuides ? '_self' : "_blank";
745+
},
746+
isCommunityEdition: function() {
747+
return countlyGlobal.countlyTypeCE;
745748
}
746749
},
747750
methods: {
@@ -894,6 +897,12 @@
894897

895898
return menu;
896899
});
900+
},
901+
handleButtonClick: function() {
902+
CountlyHelpers.goTo({
903+
url: "https://flex.countly.com",
904+
isExternalLink: true
905+
});
897906
}
898907
},
899908
mounted: function() {

frontend/express/public/javascripts/countly/vue/templates/sidebar/sidebar.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,18 @@
4242
<analytics-menu ref="analytics" v-show="visibleSidebarMenu === 'analytics'"></analytics-menu>
4343
<management-menu ref="management" v-show="visibleSidebarMenu === 'management'" @management-menu-ready="onManagementMenuReady"></management-menu>
4444
<component :ref="item.name" v-for="item in components" :is="item.component" v-show="visibleSidebarMenu === item.name" :key="item.name"></component>
45-
<a :href="countlySidebarVersionPath"><div class="cly-vue-sidebar__version" data-test-id="sidebar-menu-version"> {{versionInfo}} </div></a>
45+
<div v-if="isCommunityEdition" class="cly-vue-sidebar__version" data-test-id="sidebar-menu-version">
46+
<div class="cly-vue-sidebar__version__banner">
47+
<div class="text">{{i18n('sidebar.banner.text')}}</div>
48+
<div class="text bu-has-text-weight-medium">{{i18n('sidebar.banner.upgrade')}}</div>
49+
<el-button class="button" type="success" @click="handleButtonClick">{{i18n('sidebar.banner.upgrade-button')}}</el-button>
50+
</div>
51+
</div>
52+
<a v-else :href="countlySidebarVersionPath">
53+
<div class="cly-vue-sidebar__version" data-test-id="sidebar-menu-version">
54+
{{versionInfo}}
55+
</div>
56+
</a>
4657
</div>
4758
</transition>
4859
</div>

frontend/express/public/localization/dashboard/dashboard.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ sidebar.dashboard-tooltip = Dashboards
440440
sidebar.main-menu = Main Menu
441441
sidebar.my-profile = My Profile
442442
sidebar.copy-api-key-success-message = Api Key has been copied to clipboard!
443+
sidebar.banner.text = You are using a free plan.
444+
sidebar.banner.upgrade = Upgrade and get more.
445+
sidebar.banner.upgrade-button = Manage your plan
443446

444447
#dashboard
445448
dashboard.apply = Apply

frontend/express/public/stylesheets/styles/blocks/_sidebar.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,26 @@ $bg-color: #24292e;
378378
width: 224px;
379379
font-size: 10px;
380380
background-color: #24292e;
381+
382+
&__banner {
383+
background-color: #191C20;
384+
display: flex;
385+
flex-direction: column;
386+
align-items: center;
387+
justify-content: center;
388+
border-radius: 4px;
389+
padding: 16px;
390+
margin-bottom: 30%;
391+
cursor: default;
392+
.text {
393+
font-size: 14px;
394+
color: #fff;
395+
}
396+
.button {
397+
width: 100%;
398+
margin-top: 12px;
399+
}
400+
}
381401
}
382402

383403
.cly-icon {

0 commit comments

Comments
 (0)