Skip to content

Commit

Permalink
Merge pull request #14784 from CartoDB/13691-delete-builder-enabled-n…
Browse files Browse the repository at this point in the history
…otification

Remove Builder enabled notification
  • Loading branch information
jesusbotella committed Mar 28, 2019
2 parents 5c357cf + e21cd2b commit 2212dc7
Show file tree
Hide file tree
Showing 16 changed files with 3 additions and 285 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Development
- Fix z-index in Quick Actions dropdown ([#14780](https://github.com/CartoDB/cartodb/pull/14780))
- Fix extra API call in global search ([#14774](https://github.com/CartoDB/cartodb/issues/14774))
- Fix Radio buttons not being displayed correctly in connect dataset modal ([#14776](https://github.com/CartoDB/cartodb/issues/14776))
- Remove Builder enabled notification from Builder and migrated Dashboard ([#14784](https://github.com/CartoDB/cartodb/pull/14784))

4.26.0 (2019-03-11)
-------------------
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/carto/api/user_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module Api
class UserPresenter
include AccountTypeHelper

BUILDER_ACTIVATION_DATE = Date.new(2016, 11, 11).freeze

def initialize(user,
fetch_groups: false,
current_viewer: nil,
Expand Down Expand Up @@ -202,7 +200,6 @@ def data(options = {})
upgraded_at: @user.upgraded_at,
show_trial_reminder: @user.trial_ends_at.present?,
show_upgraded_message: (@user.account_type.downcase != 'free' && @user.upgraded_at && @user.upgraded_at + 15.days > Date.today ? true : false),
show_builder_activated_message: @user.created_at < BUILDER_ACTIVATION_DATE,
actions: {
private_tables: @user.private_tables_enabled,
private_maps: @user.private_maps_enabled?,
Expand Down
2 changes: 0 additions & 2 deletions app/models/user/user_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module CartoDB
module UserDecorator
include AccountTypeHelper
BUILDER_ACTIVATION_DATE = Date.new(2016, 11, 11).freeze

# Options:
# - show_api_calls: load api calls. Default: true.
Expand Down Expand Up @@ -95,7 +94,6 @@ def data(options = {})
upgraded_at: upgraded_at,
show_trial_reminder: trial_ends_at.present?,
show_upgraded_message: (account_type.downcase != 'free' && upgraded_at && upgraded_at + 15.days > Date.today ? true : false),
show_builder_activated_message: created_at < BUILDER_ACTIVATION_DATE,
actions: {
private_tables: private_tables_enabled,
private_maps: private_maps_enabled?,
Expand Down

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions lib/assets/javascripts/builder/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ var UserModel = require('builder/data/user-model');
var Notifier = require('builder/components/notifier/notifier');
var UserGroupFetcher = require('builder/data/users-group-fetcher');
var SQLUtils = require('builder/helpers/sql-utils');
var BuilderActivatedNotification = require('builder/components/onboardings/builder-activated/builder-activated-notification-view');
var UserNotifications = require('builder/data/user-notifications');
var layerTypesAndKinds = require('builder/data/layer-types-and-kinds');
var DatasetView = require('builder/dataset/dataset-view');

Expand All @@ -44,7 +42,6 @@ var tableData = window.tableData;
var layersData = window.layersData;
var frontendConfig = window.frontendConfig;
var authTokens = window.authTokens;
var dashboardNotifications = window.dashboardNotifications;

var configModel = new ConfigModel(
_.defaults(
Expand Down Expand Up @@ -154,25 +151,6 @@ if (tableModel.isOwner(userModel) && visModel.get('locked')) {
});
}

if (!configModel.get('cartodb_com_hosted')) {
if (userModel.get('actions').builder_enabled && userModel.get('show_builder_activated_message') &&
_.isEmpty(dashboardNotifications)) {
var builderActivatedNotification = new UserNotifications(dashboardNotifications, {
key: 'dashboard',
configModel: configModel
});

var builderActivatedNotificationView = new BuilderActivatedNotification({
builderActivatedNotification: builderActivatedNotification
});

$('.js-editor').addClass('Editor--topBar');
builderActivatedNotificationView.bind('clean', function () {
$('.js-editor').removeClass('Editor--topBar');
}, this);
}
}

var datasetView = new DatasetView({
router: Router,
modals: modals,
Expand Down
21 changes: 0 additions & 21 deletions lib/assets/javascripts/builder/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ var LegendsState = require('builder/data/legends/legends-state');
var LegendFactory = require('builder/editor/layers/layer-content-views/legend/legend-factory');
var EditorVisualizationWarningView = require('builder/components/modals/editor-visualization-warning/editor-visualization-warning-view');
var MapModeModel = require('./map-mode-model');
var BuilderActivatedNotification = require('builder/components/onboardings/builder-activated/builder-activated-notification-view');
var NodeGeometryTracker = require('./node-geometry-tracker');
var WidgetsService = require('builder/editor/widgets/widgets-service');
var DataServicesApiCheck = require('builder/editor/layers/layer-content-views/analyses/analyses-quota/analyses-quota-info');
Expand All @@ -83,7 +82,6 @@ var visualizationData = window.visualizationData;
var layersData = window.layersData;
var analysesData = window.analysesData;
var builderNotifications = window.builderNotifications;
var dashboardNotifications = window.dashboardNotifications;
var mapcapsData = window.mapcapsData;
var overlaysData = window.overlaysData;
var basemaps = window.basemaps;
Expand Down Expand Up @@ -275,25 +273,6 @@ WidgetsService.init({
var mapCreation = function () {
BuilderOnboardingLauncher.launch();

if (!configModel.get('cartodb_com_hosted')) {
if (userModel.get('actions').builder_enabled && userModel.get('show_builder_activated_message') &&
_.isEmpty(dashboardNotifications)) {
var builderActivatedNotification = new UserNotifications(dashboardNotifications, {
key: 'dashboard',
configModel: configModel
});

var builderActivatedNotificationView = new BuilderActivatedNotification({
builderActivatedNotification: builderActivatedNotification
});

$('.js-editor').addClass('Editor--topBar');
builderActivatedNotificationView.bind('clean', function () {
$('.js-editor').removeClass('Editor--topBar');
}, this);
}
}

deepInsights.createDashboard('#dashboard', vizJSON, {
apiKey: configModel.get('api_key'),
no_cdn: false,
Expand Down
15 changes: 0 additions & 15 deletions lib/assets/javascripts/dashboard/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const _ = require('underscore');
const Polyglot = require('node-polyglot');
const CartoNode = require('carto-node');
const AccountMainView = require('dashboard/views/account/account-main-view');
const UserNotificationView = require('dashboard/components/user-notification/user-notification-view');
const UserNotificationModel = require('dashboard/components/user-notification/user-notification-model');
const ConfigModel = require('dashboard/data/config-model');
const UserModel = require('dashboard/data/user-model');
const OrganizationModel = require('dashboard/data/organization-model');
Expand Down Expand Up @@ -38,7 +36,6 @@ const InitAccount = function () {

const dataLoaded = function (data) {
const ASSETS_VERSION = AssetsVersionHelper.getAssetsVersion(PACKAGE.version);
const dashboard_notifications = data.dashboard_notifications;
const organizationNotifications = data.organization_notifications;
const userData = data.user_data || {};

Expand Down Expand Up @@ -70,18 +67,6 @@ const InitAccount = function () {
}), userModelOptions
);

if (!configModel.get('cartodb_com_hosted') && userModel.get('actions').builder_enabled &&
userModel.get('show_builder_activated_message') && _.isEmpty(dashboard_notifications)) {
const userNotificationModel = new UserNotificationModel(dashboard_notifications, {
key: 'dashboard',
configModel
});

new UserNotificationView({ // eslint-disable-line no-new
notification: userNotificationModel
});
}

new AccountMainView({ // eslint-disable-line no-new
el: document.body,
userModel: userModel,
Expand Down
18 changes: 0 additions & 18 deletions lib/assets/javascripts/dashboard/api-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ const ConfigModel = require('dashboard/data/config-model');
const DashboardHeaderView = require('dashboard/components/dashboard-header-view');
const HeaderViewModel = require('dashboard/views/api-keys/header-view-model');
const UpgradeMessageView = require('dashboard/components/upgrade-message-view');
const UserNotificationView = require('dashboard/components/user-notification/user-notification-view');
const ApiKeysListView = require('dashboard/views/api-keys/api-keys-list-view');
const ApiKeysFormView = require('dashboard/views/api-keys/api-keys-form-view');
const StackLayoutView = require('builder/components/stack-layout/stack-layout-view');
const UserNotificationModel = require('dashboard/components/user-notification/user-notification-model');
const ApiKeysCollection = require('dashboard/data/api-keys-collection');
const UserTablesModel = require('dashboard/data/user-tables-model');
const getObjectValue = require('deep-insights/util/get-object-value');
Expand Down Expand Up @@ -110,20 +108,4 @@ $(function () {
});

$('.js-api-keys-new').append(stackLayout.render().el);

if (!userModel.get('cartodb_com_hosted')) {
if (userModel.get('actions').builder_enabled && userModel.get('show_builder_activated_message') &&
_.isEmpty(window.dashboard_notifications)) {
const userNotificationModel = new UserNotificationModel(window.dashboard_notifications, {
key: 'dashboard',
configModel: configModel
});

const dashboardNotification = new UserNotificationView({
notification: userNotificationModel
});

window.dashboardNotification = dashboardNotification;
}
}
});

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions lib/assets/javascripts/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const UserModel = require('dashboard/data/user-model');
const CreateDialog = require('dashboard/views/dashboard/dialogs/create-dialog/dialog-view');
const OrganizationModel = require('dashboard/data/organization-model');
const UserGroupsCollection = require('dashboard/data/user-groups-collection');
const UserNotificationView = require('dashboard/components/dashboard-header/notifications/user-notifications-view');
const UserNotificationModel = require('dashboard/components/user-notification/user-notification-model');
const DashboardBackgroundPollingModel = require('dashboard/data/background-polling/dashboard-background-polling-model');
const BackgroundPollingView = require('dashboard/views/dashboard/background-polling/background-polling-view');
const VisualizationsCollection = require('dashboard/data/visualizations-collection');
Expand Down Expand Up @@ -58,7 +56,6 @@ function getAssetsVersion (configModel) {
function dataLoaded (data) {
const userData = data.user_data;
const default_fallback_basemap = data.default_fallback_basemap;
const dashboard_notifications = data.dashboard_notifications;
const organizationNotifications = data.organization_notifications;
const isJustLoggedIn = data.isJustLoggedIn;
const isFirstTimeViewingDashboard = data.isFirstTimeViewingDashboard;
Expand Down Expand Up @@ -92,23 +89,6 @@ function dataLoaded (data) {
dashboardUrl: currentUser.viewUrl().dashboard()
});

if (!configModel.get('cartodb_com_hosted')) {
if (currentUser.get('actions').builder_enabled &&
currentUser.get('show_builder_activated_message') &&
_.isEmpty(dashboard_notifications)) {
const userNotificationModel = new UserNotificationModel(dashboard_notifications, {
key: 'dashboard',
configModel
});

new UserNotificationView({ // eslint-disable-line
notification: userNotificationModel,
user: currentUser,
configModel
});
}
}

// Why not have only one collection?
const collection = new VisualizationsCollection(null, { configModel });

Expand Down
Loading

0 comments on commit 2212dc7

Please sign in to comment.