提交 b4eddc7b 编写于 作者: R rsercano

eslint issues fix

上级 d542c0c5
extends:
eslint:recommended
rules:
no-alert
camelcase
no-duplicate-imports
no-useless-constructor
parserOptions:
sourceType: module
......
......@@ -3,6 +3,7 @@ import {Session} from "meteor/session";
import Enums from "/lib/imports/enums";
import Helper from "/client/imports/helper";
import "./add_collection_options.html";
import $ from "jquery";
export const getOptions = function () {
const result = {};
......
......@@ -3,6 +3,7 @@ import {Session} from "meteor/session";
import Helper from "/client/imports/helper";
import "./filter_collection.html";
import {excludedCollectionsByFilter, filterRegex, setExcludedCollectionsByFilter, setFilterRegex} from "../navigation";
import $ from "jquery";
require('datatables.net')(window, $);
require('datatables.net-buttons')(window, $);
......
......@@ -13,6 +13,8 @@ import {resetForm as resetRenameForm} from "./rename_collection/rename_collectio
import {resetForm as resetValidationRulesForm} from "./validation_rules/validation_rules";
import {initializeFilterTable} from "./filter_collection/filter_collection";
import "./navigation.html";
import $ from "jquery";
const toastr = require('toastr');
......@@ -25,11 +27,7 @@ export const setFilterRegex = function (regex) {
};
const isFiltered = function () {
if (filterRegex.get() || excludedCollectionsByFilter.get().length !== 0) {
return true;
}
return false;
return filterRegex.get() || excludedCollectionsByFilter.get().length !== 0;
};
const dropAllCollections = function () {
......
......@@ -238,7 +238,7 @@
</h5>
</div>
<div id="div2dOptions" class="panel-collapse collapse" aria-expanded="false"
style="height: 0px;">
style="height: 0;">
<div class="panel-body">
<form class="form-horizontal">
<div class="form-group">
......@@ -279,7 +279,7 @@
</div>
<div id="div2dSphereOptions" class="panel-collapse collapse"
aria-expanded="false"
style="height: 0px;">
style="height: 0;">
<div class="panel-body">
<form class="form-horizontal">
<div class="form-group">
......@@ -305,7 +305,7 @@
</div>
<div id="divGeoHaystackOptions" class="panel-collapse collapse"
aria-expanded="false"
style="height: 0px;">
style="height: 0;">
<div class="panel-body">
<form class="form-horizontal">
<div class="form-group">
......
......@@ -137,9 +137,10 @@ const addFieldWeight = function (fieldName, val) {
const prepareFieldWeights = function () {
const divFieldWeight = $('.divFieldWeight:visible');
const divFieldSelector = $('.divField');
//add weights for TEXT index fields
for (let divField of $('.divField')) {
for (let divField of divFieldSelector) {
divField = $(divField);
const fieldVal = divField.find('.cmbIndexTypes').val();
const fieldName = divField.find('.txtFieldName').val();
......@@ -163,7 +164,7 @@ const prepareFieldWeights = function () {
const weightName = div.find('.txtFieldWeightName').val();
let found = false;
for (let divField of $('.divField')) {
for (let divField of divFieldSelector) {
divField = $(divField);
const fieldName = divField.find('.txtFieldName').val();
const fieldVal = divField.find('.cmbIndexTypes').val();
......
......@@ -108,9 +108,9 @@ const populateTableData = function (indexInfo, stats, indexStats) {
if (obj.key && Object.prototype.toString.call(obj.key) === '[object Object]') {
for (let field in obj.key) {
if (field === '_fts' || field === '_ftsx') {
continue;
}
if (field === '_fts' || field === '_ftsx') continue;
if (!obj.key.hasOwnProperty(field)) continue;
if (obj.key[field] === 1) {
index.asc_fields.push(field);
} else if (obj.key[field] === -1) {
......
......@@ -62,16 +62,17 @@ Template.storedFunctions.onRendered(function () {
let connections = this.subscribe('connections');
let modal = $('#editStoredFunctionModal');
modal.on('shown.bs.modal', function () {
Helper.initializeCodeMirror($('#divStoredFunction'), 'txtStoredFunction');
const divStoredFunction = $('#divStoredFunction');
Helper.initializeCodeMirror(divStoredFunction, 'txtStoredFunction');
if (modal.data('selected')) {
const data = modal.data('selected');
$('#storedFunctionModalTitle').html(data._id);
$('#inputStoredFunctionName').val(data._id);
Helper.setCodeMirrorValue($('#divStoredFunction'), data.value.$code, $('#txtStoredFunction'))
Helper.setCodeMirrorValue(divStoredFunction, data.value.$code, $('#txtStoredFunction'))
} else {
$('#storedFunctionModalTitle').html('Add Stored Function');
$('#inputStoredFunctionName').val('');
Helper.setCodeMirrorValue($('#divStoredFunction'), '', $('#txtStoredFunction'))
Helper.setCodeMirrorValue(divStoredFunction, '', $('#txtStoredFunction'))
}
});
......
......@@ -6,7 +6,6 @@ import {Template} from "meteor/templating";
import {Meteor} from "meteor/meteor";
import {Session} from "meteor/session";
import Helper from "/client/imports/helper";
import Enums from "/lib/imports/enums";
import {initExecuteQuery} from "/client/imports/views/pages/browse_collection/browse_collection";
import "./group.html";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册