Add new header to rails static pages

pull/14609/head
csubira 6 years ago
parent c3b01c66cd
commit 794c2dde60

@ -0,0 +1,8 @@
<div id="header">
<nav class="navbar-placeholder">
<div class="navbar-placeholder-logo">
<%= image_tag ("imagotype.svg") %>
</div>
</nav>
</div>
<%= stylesheet_link_tag 'header.css', :media => 'all' %>

@ -17,7 +17,11 @@
<%= insert_google_tag_manager_no_script('primary') %>
<% if ( ( controller_name != "visualizations" && controller_name != "tables" ) || action_name != "show" ) %>
<% breadcrumb = local_assigns.fetch(:breadcrumb, true) %>
<%= render 'admin/shared/new_private_header' %>
<% if current_user.has_feature_flag?('new-dashboard-feature') %>
<%= render 'admin/shared/new_private_header' %>
<% else %>
<%= render 'admin/shared/private_header' %>
<% end %>
<% if current_user.notification.present? %>
<div class="CDB-Text FlashMessage">
@ -42,5 +46,8 @@
<%= insert_google_analytics('primary') -%>
<%= insert_hubspot() -%>
<%= render 'admin/shared/intercom' %>
<% if current_user.has_feature_flag?('new-dashboard-feature') %>
<%= javascript_include_tag 'header' %>
<% end %>
</body>
</html>

@ -1,5 +1,7 @@
const CoreView = require('backbone/core-view');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const PrivateHeaderView = require('dashboard/components/private-header-view');
const HeaderViewModel = require('dashboard/views/account/header-view-model');
const TrialNotificationView = require('dashboard/components/trial-notification/trial-notification-view');
const AccountContentView = require('./account-content-view');
const UpgradeMessage = require('dashboard/components/upgrade-message-view.js');
@ -26,6 +28,18 @@ module.exports = CoreView.extend({
_initViews: function () {
const $app = this.$('#app');
const featureFlags = this._userModel.get('feature_flags');
if (!featureFlags.includes('new-dashboard-feature')) {
const headerView = new PrivateHeaderView({
model: this._userModel,
configModel: this._configModel,
viewModel: new HeaderViewModel(),
organizationNotifications: this._organizationNotifications
});
$app.prepend(headerView.render().el);
this.addView(headerView);
}
if (this._userModel.get('account_type') === PERSONAL_30_ACCOUNT) {
const trialNotificationView = new TrialNotificationView({

@ -1,5 +1,7 @@
const CoreView = require('backbone/core-view');
const ProfileContentView = require('dashboard/views/profile/profile-content/profile-content-view');
const PrivateHeaderView = require('dashboard/components/private-header-view');
const HeaderViewModel = require('dashboard/views/account/header-view-model');
const SupportView = require('dashboard/components/support-view');
const UpgradeMessage = require('dashboard/components/upgrade-message-view.js');
const FooterView = require('dashboard/components/footer/footer-view');
@ -28,6 +30,18 @@ module.exports = CoreView.extend({
_initViews: function () {
const $app = this.$('#app');
const featureFlags = this._userModel.get('feature_flags');
if (!featureFlags.includes('new-dashboard-feature')) {
const headerView = new PrivateHeaderView({
model: this._userModel,
configModel: this._configModel,
viewModel: new HeaderViewModel(),
organizationNotifications: this._organizationNotifications
});
$app.prepend(headerView.render().el);
this.addView(headerView);
}
if (this._userModel.get('account_type') === PERSONAL_30_ACCOUNT) {
const trialNotificationView = new TrialNotificationView({

@ -16,7 +16,8 @@ describe('dashboard/views/account/account-main-view', function () {
username: 'pepe',
base_url: 'http://pepe.carto.com',
email: 'pepe@carto.com',
account_type: 'FREE'
account_type: 'FREE',
feature_flags: ['new-dashboard-feature']
});
ConfigModelFixture.set('account_update_url', 'accountUpdateUrl');
@ -56,7 +57,8 @@ describe('dashboard/views/account/account-main-view', function () {
email: 'pepe@carto.com',
account_type: 'PERSONAL30',
id: 1,
api_key: 'hello-apikey'
api_key: 'hello-apikey',
feature_flags: ['new-dashboard-feature']
});
view = createViewFn({ userModel });

@ -20,7 +20,8 @@ describe('dashboard/views/profile/profile-main-view', function () {
email: 'pepe@carto.com',
account_type: 'FREE',
id: 1,
api_key: 'hello-apikey'
api_key: 'hello-apikey',
feature_flags: ['new-dashboard-feature']
}, options)
);

@ -151,6 +151,7 @@ var files = {
scripts: [
'/javascripts/common.js',
'/javascripts/common_vendor.js',
'/javascripts/account.js'
],
feature_flags: {
'new-dashboard-feature': {

Loading…
Cancel
Save