Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
Remove blank lines and shadowed variables
Browse files Browse the repository at this point in the history
No functional change, just tightening up the linter a little bit.
  • Loading branch information
gws committed May 17, 2019
1 parent 1326fa2 commit dbdaf9a
Show file tree
Hide file tree
Showing 140 changed files with 8 additions and 261 deletions.
2 changes: 0 additions & 2 deletions client/src/action/county/auditBoardSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import createSubmitAction from 'corla/action/createSubmitAction';

import { format } from 'corla/adapter/establishBoard';


const url = endpoint('audit-board-sign-in');

const auditBoardSignIn = createSubmitAction({
Expand All @@ -15,7 +14,6 @@ const auditBoardSignIn = createSubmitAction({
url,
});


export default (index: number, board: AuditBoard) => {
auditBoardSignIn(format(index, board));
};
2 changes: 0 additions & 2 deletions client/src/action/county/auditBoardSignOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('audit-board-sign-out');

const auditBoardSignOut = createSubmitAction({
Expand All @@ -13,5 +12,4 @@ const auditBoardSignOut = createSubmitAction({
url,
});


export default (index: number) => auditBoardSignOut(index);
2 changes: 0 additions & 2 deletions client/src/action/county/ballotNotFound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


interface Payload {
auditBoardIndex: number;
comment?: string;
Expand Down Expand Up @@ -39,5 +38,4 @@ const ballotNotFound = (
action(payload);
};


export default ballotNotFound;
2 changes: 0 additions & 2 deletions client/src/action/county/dashboardRefresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


const url = endpoint('county-dashboard');


export default createFetchAction({
failType: 'COUNTY_DASHBOARD_REFRESH_FAIL',
networkFailType: 'COUNTY_DASHBOARD_REFRESH_NETWORK_FAIL',
Expand Down
3 changes: 0 additions & 3 deletions client/src/action/county/deleteFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import { empty } from 'corla/util';

const deleteFileUrl = endpoint('delete-file');


async function deleteFile(fileType: string) {
const init: RequestInit = {
body: JSON.stringify( { fileType } ),
credentials: 'include',
method: 'post',
};


try {
action('DELETE_FILE_SEND', { fileType });

Expand All @@ -28,7 +26,6 @@ async function deleteFile(fileType: string) {
action('DELETE_FILE_OK', {fileType, received});
return true;


} catch (e) {
action('DELETE_FILE_NETWORK_FAIL', {fileType});

Expand Down
1 change: 0 additions & 1 deletion client/src/action/county/downloadCvrsToAuditCsv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { endpoint } from 'corla/config';


export default (round: number) => {
const params = `round=${round}&include_audited`;
const url = `${endpoint('cvr-to-audit-download')}?${params}`;
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/county/fetchAuditBoardASMState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


const url = endpoint('audit-board-asm-state');


export default createFetchAction({
failType: 'FETCH_AUDIT_BOARD_ASM_STATE_FAIL',
networkFailType: 'FETCH_AUDIT_BOARD_ASM_STATE_NETWORK_FAIL',
Expand Down
1 change: 0 additions & 1 deletion client/src/action/county/fetchContests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


export default (id: number) => {
const e = endpoint('contest/county');
const url = `${e}?${id}`;
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/county/fetchCountyASMState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


const url = endpoint('county-asm-state');


export default createFetchAction({
failType: 'FETCH_COUNTY_ASM_STATE_FAIL',
networkFailType: 'FETCH_COUNTY_ASM_STATE_NETWORK_FAIL',
Expand Down
1 change: 0 additions & 1 deletion client/src/action/county/fetchCvr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


export default (id: number) => {
const e = endpoint('cvr/id');
const url = `${e}/${id}`;
Expand Down
1 change: 0 additions & 1 deletion client/src/action/county/fetchCvrsToAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


export default (round: number) => {
const params = `round=${round}&include_audited`;
const url = `${endpoint('cvr-to-audit-list')}?${params}`;
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/county/fetchReport.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { endpoint } from 'corla/config';


const url = endpoint('county-report');


export default () => window.location.replace(url);
2 changes: 0 additions & 2 deletions client/src/action/county/finishAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('audit-report');

const finishAudit = createSubmitAction({
Expand All @@ -13,5 +12,4 @@ const finishAudit = createSubmitAction({
url,
});


export default () => finishAudit({});
3 changes: 0 additions & 3 deletions client/src/action/county/roundSignOff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('sign-off-audit-round');

const roundSignOff = createSubmitAction({
Expand All @@ -13,7 +12,6 @@ const roundSignOff = createSubmitAction({
url,
});


function format(auditBoardIndex: number, electors: Elector[]): object {
return {
audit_board: electors.map(e => ({
Expand All @@ -24,6 +22,5 @@ function format(auditBoardIndex: number, electors: Elector[]): object {
};
}


export default (auditBoardIndex: number, electors: Elector[]) =>
roundSignOff(format(auditBoardIndex, electors));
1 change: 0 additions & 1 deletion client/src/action/county/setNumberOfAuditBoards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('set-audit-board-count');

const setAuditBoardCount = createSubmitAction({
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/county/uploadAcvr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import createSubmitAction from 'corla/action/createSubmitAction';

import { format } from 'corla/adapter/uploadAcvr';


const url = endpoint('upload-audit-cvr');

const uploadAcvr = (
Expand All @@ -27,5 +26,4 @@ const uploadAcvr = (
action(body);
};


export default uploadAcvr;
2 changes: 0 additions & 2 deletions client/src/action/county/uploadBallotManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { empty } from 'corla/util';
const importUrl = endpoint('import-ballot-manifest');
const uploadUrl = endpoint('upload-file');


function createFormData(file: Blob, hash: string): FormData {
const formData = new FormData();

Expand Down Expand Up @@ -78,5 +77,4 @@ async function uploadBallotManifest(countyId: number, file: Blob, hash: string)

}


export default uploadBallotManifest;
2 changes: 0 additions & 2 deletions client/src/action/county/uploadCvrExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { empty } from 'corla/util';
const importUrl = endpoint('import-cvr-export');
const uploadUrl = endpoint('upload-file');


function createFormData(file: Blob, hash: string): FormData {
const formData = new FormData();

Expand Down Expand Up @@ -78,5 +77,4 @@ async function uploadCvrExport(countyId: number, file: Blob, hash: string) {

}


export default uploadCvrExport;
2 changes: 0 additions & 2 deletions client/src/action/createFetchAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { empty } from 'corla/util';

import action from '.';


interface CreateFetchConfig {
failType: string;
networkFailType: string;
Expand Down Expand Up @@ -52,5 +51,4 @@ function createFetchAction(config: CreateFetchConfig) {
return fetchAction;
}


export default createFetchAction;
2 changes: 0 additions & 2 deletions client/src/action/createSubmitAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { empty } from 'corla/util';

import action from '.';


type CreateDataFn<S, R> = (sent: S, received: R) => Action.SubmitData<S, R>;

interface CreateSubmitConfig<S, R> {
Expand Down Expand Up @@ -67,5 +66,4 @@ function createSubmitAction<S, R>(config: CreateSubmitConfig<S, R>) {
return submitAction;
}


export default createSubmitAction;
2 changes: 0 additions & 2 deletions client/src/action/dos/dashboardRefresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


const url = endpoint('dos-dashboard');


export default createFetchAction({
failType: 'DOS_DASHBOARD_REFRESH_FAIL',
networkFailType: 'DOS_DASHBOARD_REFRESH_NETWORK_FAIL',
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/dos/fetchContests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createFetchAction from 'corla/action/createFetchAction';


const url = endpoint('contest');


export default createFetchAction({
failType: 'DOS_FETCH_CONTESTS_FAIL',
networkFailType: 'DOS_FETCH_CONTESTS_NETWORK_FAIL',
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/dos/fetchReport.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { endpoint } from 'corla/config';


const url = endpoint('publish-audit-report')
+ '?reportType=audit'
+ '&contentType=zip';


export default () => window.location.replace(url);
2 changes: 0 additions & 2 deletions client/src/action/dos/publishBallotsToAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('start-audit-round');


export default createSubmitAction({
failType: 'PUBLISH_BALLOTS_TO_AUDIT_FAIL',
networkFailType: 'PUBLISH_BALLOTS_TO_AUDIT_NETWORK_FAIL',
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/dos/resetDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('reset-database');

const resetDatabase = createSubmitAction({
Expand All @@ -13,5 +12,4 @@ const resetDatabase = createSubmitAction({
url,
});


export default () => resetDatabase({});
2 changes: 0 additions & 2 deletions client/src/action/dos/selectContestsForAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import createSubmitAction from 'corla/action/createSubmitAction';

import { format } from 'corla/adapter/contestsForAudit';


const url = endpoint('select-contests');

const selectContestsForAudit = createSubmitAction({
Expand All @@ -15,6 +14,5 @@ const selectContestsForAudit = createSubmitAction({
url,
});


export default (data: DOS.Form.SelectContests.FormData) =>
selectContestsForAudit(format(data));
1 change: 0 additions & 1 deletion client/src/action/dos/setHandCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('hand-count');

const setHandCount = createSubmitAction({
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/dos/startNextRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('start-audit-round');

const startNextRound = createSubmitAction({
Expand All @@ -13,7 +12,6 @@ const startNextRound = createSubmitAction({
url,
});


export default () => startNextRound({
multiplier: 1,
use_estimates: true,
Expand Down
2 changes: 0 additions & 2 deletions client/src/action/dos/uploadRandomSeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('random-seed');

const uploadRandomSeed = createSubmitAction({
Expand All @@ -13,5 +12,4 @@ const uploadRandomSeed = createSubmitAction({
url,
});


export default (seed: string) => uploadRandomSeed({ seed });
1 change: 0 additions & 1 deletion client/src/action/downloadFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { endpoint } from 'corla/config';


export default (id: number) => {
const params = `fileId=${id}`;
const url = `${endpoint('download-file')}?${params}`;
Expand Down
1 change: 0 additions & 1 deletion client/src/action/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import store from 'corla/store';


export default function action<D>(type: string, data: (D | {}) = {}) {
store.dispatch({ data, type });
}
2 changes: 0 additions & 2 deletions client/src/action/login1F.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endpoint } from 'corla/config';

import createSubmitAction from 'corla/action/createSubmitAction';


const url = endpoint('auth-admin');

const login1F = createSubmitAction({
Expand All @@ -13,6 +12,5 @@ const login1F = createSubmitAction({
url,
});


export default (username: string, password: string) =>
login1F({ username, password });
Loading

0 comments on commit dbdaf9a

Please sign in to comment.