Brandon Nicholls

Update eslint and fix new violations

......@@ -128,8 +128,7 @@ module.exports = {
}),
query.select('status_cd as statusCd', 'description').from('disclosure_status'),
query.select('type_cd as typeCd', 'description').from('project_type')
])
.then(function (result) {
]).then(function (result) {
var config = {};
config.matrixTypes = result[0];
config.matrixTypes.map(function (type) {
......
This diff is collapsed. Click to expand it.
......@@ -19,15 +19,16 @@
/* eslint-disable prefer-arrow-callback */
exports.up = function(knex) {
return knex.schema.table('config', function(table) {
table.string('user_id', 40);
})
.table('config', function(table) {
table.string('user_name', 100);
})
.table('config', function(table) {
table.dateTime('updated_date', true);
});
return knex.schema
.table('config', function(table) {
table.string('user_id', 40);
})
.table('config', function(table) {
table.string('user_name', 100);
})
.table('config', function(table) {
table.dateTime('updated_date', true);
});
};
exports.down = function() {
......
......@@ -19,12 +19,13 @@
/* eslint-disable prefer-arrow-callback */
exports.up = function(knex) {
return knex.schema.table('additional_reviewer', function(table) {
table.boolean('active').notNullable().defaultTo(true);
})
.table('additional_reviewer', function(table) {
table.text('dates'); //-- json collection of dates
});
return knex.schema
.table('additional_reviewer', function(table) {
table.boolean('active').notNullable().defaultTo(true);
})
.table('additional_reviewer', function(table) {
table.text('dates'); //-- json collection of dates
});
};
exports.down = function() {
......
......@@ -31,13 +31,13 @@ exports.up = function(knex) {
return knex('disclosure_status')
.update({description: 'Revision Required'})
.where({status_cd: 4})
.then(function() {
return knex('disclosure_status')
.insert({
status_cd: 7,
description: 'Update Needed'
.then(function() {
return knex('disclosure_status')
.insert({
status_cd: 7,
description: 'Update Needed'
});
});
});
};
exports.down = function() {
......
......@@ -19,22 +19,23 @@
/* eslint-disable prefer-arrow-callback, camelcase */
exports.up = function(knex) {
return knex.schema.table('notification_template', function(table) {
table.integer('value');
})
.table('notification_template', function(table) {
table.text('period');
})
.then(function() {
return knex('notification_template')
.insert({
template_id: 9,
type: 'Reporter Notifications',
description: 'Notify reporter when their expiration is about to expire.',
value: 30,
period: 'days'
});
});
return knex.schema
.table('notification_template', function(table) {
table.integer('value');
})
.table('notification_template', function(table) {
table.text('period');
})
.then(function() {
return knex('notification_template')
.insert({
template_id: 9,
type: 'Reporter Notifications',
description: 'Notify reporter when their expiration is about to expire.',
value: 30,
period: 'days'
});
});
};
exports.down = function() {
......
......@@ -19,23 +19,24 @@
/* eslint-disable prefer-arrow-callback, camelcase */
exports.up = function(knex) {
return knex.schema.table('disclosure', function(table) {
table.dropForeign('disposition_type_cd');
})
.table('disclosure', function(table) {
table.dropColumn('disposition_type_cd');
})
.dropTableIfExists('disposition_type')
.createTable('disposition_type', function(table) {
table.increments('type_cd').notNullable().primary();
table.string('description', 50).notNullable();
table.integer('order').notNullable();
table.boolean('active').notNullable();
table.engine('InnoDB');
}).
table('declaration', function(table) {
table.integer('disposition_type_cd').unsigned().references('type_cd').inTable('disposition_type');
});
return knex.schema
.table('disclosure', function(table) {
table.dropForeign('disposition_type_cd');
})
.table('disclosure', function(table) {
table.dropColumn('disposition_type_cd');
})
.dropTableIfExists('disposition_type')
.createTable('disposition_type', function(table) {
table.increments('type_cd').notNullable().primary();
table.string('description', 50).notNullable();
table.integer('order').notNullable();
table.boolean('active').notNullable();
table.engine('InnoDB');
})
.table('declaration', function(table) {
table.integer('disposition_type_cd').unsigned().references('type_cd').inTable('disposition_type');
});
};
exports.down = function() {
......
......@@ -31,12 +31,13 @@ exports.up = function(knex) {
var i = 0;
function updateRow() {
if (i < existingRows.length) {
knex('disposition_type').where('type_cd', existingRows[i].type_cd)
.update({description_copy: existingRows[i].description})
.then(function() {
i++;
updateRow();
}
knex('disposition_type')
.where('type_cd', existingRows[i].type_cd)
.update({description_copy: existingRows[i].description})
.then(function() {
i++;
updateRow();
}
);
} else {
resolve();
......
......@@ -20,10 +20,10 @@
exports.up = function(knex) {
return knex('disclosure_status')
.insert({
status_cd: 8,
description: 'Returned'
});
.insert({
status_cd: 8,
description: 'Returned'
});
};
exports.down = function() {
......
......@@ -29,7 +29,7 @@ export class Test extends LoadTest {
this.CONCURRENT_REQUESTS = 10;
this.method = 'POST';
this.postData = new Buffer(`\r\n------WebKitFormBoundaryTf0LsICBksypVtu7\r\nContent-Disposition: form-data; name="entity"\r\n\r\n{"active":1,"answers":[{"questionId":7,"answer":{"value":"No"}},{"questionId":6,"answer":{"value":["County Government"]}},{"questionId":8,"answer":{"value":"No"}},{"questionId":9,"answer":{"value":"d"}}],"name":"fsdfs","relationships":[{"personCd":1,"relationshipCd":1,"typeCd":1,"amountCd":1,"comments":"d","travel":{},"id":"TMP1448660628733","amount":"$1 - $5,000","type":"Stock","relationship":"Ownership","person":"Self"}]}\r\n------WebKitFormBoundaryTf0LsICBksypVtu7--`); // eslint-disable-line max-len
this.postData = new Buffer('\r\n------WebKitFormBoundaryTf0LsICBksypVtu7\r\nContent-Disposition: form-data; name="entity"\r\n\r\n{"active":1,"answers":[{"questionId":7,"answer":{"value":"No"}},{"questionId":6,"answer":{"value":["County Government"]}},{"questionId":8,"answer":{"value":"No"}},{"questionId":9,"answer":{"value":"d"}}],"name":"fsdfs","relationships":[{"personCd":1,"relationshipCd":1,"typeCd":1,"amountCd":1,"comments":"d","travel":{},"id":"TMP1448660628733","amount":"$1 - $5,000","type":"Stock","relationship":"Ownership","person":"Self"}]}\r\n------WebKitFormBoundaryTf0LsICBksypVtu7--'); // eslint-disable-line max-len
this.id = 0;
this.alreadyAccessed = true;
......
......@@ -81,12 +81,12 @@
"css-loader": "0.25.0",
"css-modules-require-hook": "4.0.5",
"enzyme": "2.4.1",
"eslint": "3.7.1",
"eslint": "3.11.1",
"eslint-plugin-contains": "0.0.1",
"eslint-plugin-custom": "file:eslint-plugin-custom",
"eslint-plugin-import": "2.0.1",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-module-name": "0.0.5",
"eslint-plugin-react": "6.4.1",
"eslint-plugin-react": "6.8.0",
"file": "0.2.2",
"jsdom": "9.6.0",
"mocha": "3.1.2",
......@@ -104,8 +104,8 @@
"sinon": "1.17.6",
"skin-deep": "0.16.0",
"style-loader": "0.13.1",
"stylelint": "7.4.2",
"stylelint-config-standard": "13.0.2",
"stylelint": "7.6.0",
"stylelint-config-standard": "15.0.0",
"supertest": "2.0.0",
"trace-line": "0.0.6",
"webpack": "1.13.2"
......
......@@ -190,8 +190,9 @@ async function getSubQuestions(knex, disclosureId) {
.from('questionnaire_answer as qa')
.innerJoin('disclosure_answer as da', 'da.questionnaire_answer_id', 'qa.id')
.where(function() {
this.where('da.disclosure_id', disclosureId)
.orWhereNull('da.disclosure_id');
this
.where('da.disclosure_id', disclosureId)
.orWhereNull('da.disclosure_id');
});
const config = await knex('config')
......
......@@ -58,11 +58,11 @@ describe('get /api/coi/disclosure-summaries', async () => {
}, 'id');
const dispositionType = await knex('disposition_type')
.insert(
{description: 'test',
order: 1,
active: 1
},'type_cd');
.insert({
description: 'test',
order: 1,
active: 1
}, 'type_cd');
dispositionTypeCd = dispositionType[0];
......