Remove unnecessary files

pull/14815/head
jesusbotella 6 years ago
parent 9b4fbde1be
commit a6a23e4b9c

@ -1,49 +0,0 @@
/**
* Public header, dance starts!
*
*/
cdb.open.Header = cdb.core.View.extend({
initialize: function() {
this.vis = this.options.vis;
this.template = cdb.templates.getTemplate('public/views/public_header');
this._initBinds();
},
render: function() {
this.clearSubViews();
this.$el.html(
this.template(
_.defaults({
vis_url: this.vis && this.vis.viewUrl(this.model) || '',
isMobileDevice: this.options.isMobileDevice,
owner_username: this.options.owner_username,
current_view: this.options.current_view
}, this.model.attributes)
)
);
this._initViews();
return this;
},
_initBinds: function() {
this.model.bind('change', this.render, this);
},
_initViews: function() {
if (this.$('.account').length > 0) {
var dropdown = new cdb.open.AccountDropdown({
target: this.$('a.account'),
model: this.model,
vertical_offset: 20,
width: 166
});
this.addView(dropdown);
cdb.god.bind("closeDialogs", dropdown.hide, dropdown);
this.add_related_model(cdb.god);
$('body').append(dropdown.render().el);
}
}
});

@ -1,75 +0,0 @@
describe("Public pages header tests", function() {
var view, $el, model;
beforeEach(function() {
$el = $('<header>').addClass("cartodb-public-header");
model = new cdb.open.AuthenticatedUser({});
table = new cdb.admin.CartoDBTableMetadata({ name: 'test_table', geometry_types: ['st_polygon'] });
view = new cdb.open.Header({
el: $el,
model: model,
vis: table,
current_view: "dashboard",
owner_username: "test",
isMobileDevice: false
});
cdb.config.set({
//Testing that it's SaaS (Related info: app/helpers/application_helper.rb)
cartodb_com_hosted: false
});
})
afterEach(function() {
view.clean();
});
it("should render properly when authenticated users are 'empty'", function() {
view.render();
expect(view.$('ul.options li a').size()).toBe(3);
expect(view.$('ul.options li a.account').size()).toBe(0);
expect(view.$('ul.options li a.login').size()).toBe(1);
});
it("should render properly when authenticated users are 'empty' and it is a mobile device", function() {
view.options.isMobileDevice = true;
view.render();
expect(view.$('ul.options li a').size()).toBe(2);
expect(view.$('ul.options li a.account').size()).toBe(0);
expect(view.$('ul.options li a.login').size()).toBe(1);
expect(view.$('ul.options li a.signup').size()).toBe(1);
});
it("should render properly when authenticated user is filled and it is in dashboard view", function() {
model.set({ urls: ['http://test.carto.com/dashboard'], username: "test" });
expect(view.$('ul.options li a').size()).toBe(1);
expect(view.$('ul.options li a.account').size()).toBe(1);
expect(view.$('ul.options li a.login').size()).toBe(0);
expect(view.$('ul.options li a.signup').size()).toBe(0);
});
it("should render properly when authenticated user is filled and it is in table or visualization view, edit button should appear", function() {
view.options.current_view = 'table';
model.set({ urls: ['http://test.carto.com/dashboard'], username: "test" });
expect(view.$('ul.options li a').size()).toBe(1);
expect(view.$('ul.options li a.account').size()).toBe(1);
expect(view.$('ul.options li a.login').size()).toBe(0);
expect(view.$('ul.options li a.signup').size()).toBe(0);
view.options.current_view = 'visualization';
view.vis = new cdb.open.PublicVisualization({ id: 'aaaa-bbbb-cccc-dddd', name: "fake_2" });
view.render();
expect(view.$('ul.options li a').size()).toBe(1);
expect(view.$('ul.options li a.account').size()).toBe(1);
expect(view.$('ul.options li a.login').size()).toBe(0);
expect(view.$('ul.options li a.signup').size()).toBe(0);
});
});

@ -41,8 +41,6 @@ var files = {
],
specs: [
'lib/assets/javascripts/cartodb/public/**/*.js', // VER SI SE PUEDE BORRAR LUEGO
'lib/assets/test/spec/cartodb/**/*.js',
// Test files that use browserify should be added in the tests bundle defined in lib/build/tasks/browserify.js
'!lib/assets/test/spec/cartodb/common/**/*.js',
@ -69,7 +67,6 @@ var files = {
],
table: [
'vendor/assets/javascripts/rails.js',
'vendor/assets/javascripts/codemirror.js',
'vendor/assets/javascripts/show-hint.js',
'vendor/assets/javascripts/anyword-hint.js',
@ -87,9 +84,6 @@ var files = {
'vendor/assets/javascripts/jquery.tipsy.js',
'vendor/assets/javascripts/d3.v2.js',
'vendor/assets/javascripts/colorpicker.js',
'vendor/assets/javascripts/jquery.fileupload.js',
'vendor/assets/javascripts/jquery.fileupload-fp.js',
'vendor/assets/javascripts/jquery.fileupload-ui.js',
'vendor/assets/javascripts/leaflet.draw.js',
'vendor/assets/javascripts/moment.js',
'vendor/assets/javascripts/markdown.js',
@ -103,7 +97,6 @@ var files = {
'lib/assets/javascripts/utils/draggable.js',
'lib/assets/javascripts/utils/carto.codemirror.js',
'lib/assets/javascripts/utils/color.keywords.js',
'vendor/assets/javascripts/models.js',
'lib/assets/javascripts/cartodb/old_common/utils.js',
'lib/assets/javascripts/cartodb/old_common/dropdown_menu.js',
'lib/assets/javascripts/cartodb/old_common/forms/string_field.js',

@ -13,14 +13,6 @@ var srcToDestHash = function (files, basePath, fileExt) {
};
exports.task = function () {
console.log({
js: {
files: srcToDestHash(require('../files/js_files'), '<%= editor_assets_dir %>/javascripts/', '.js')
},
css: {
files: srcToDestHash(require('../files/css_files'), '<%= editor_assets_dir %>/stylesheets/', '.css')
}
})
return {
js: {
files: srcToDestHash(require('../files/js_files'), '<%= editor_assets_dir %>/javascripts/', '.js')

Loading…
Cancel
Save