Skip to content

Commit 149cc7e

Browse files
committed
[Frontend] lint fix
1 parent 9e9fc02 commit 149cc7e

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

src/editor/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import {
1515
savedAtRevision,
1616
useSaveFunction
1717
} from './manager/save';
18-
import {
19-
useExportFunction
20-
} from './manager/export';
2118
import {
2219
autoSaveInterval
2320
} from './config';
@@ -42,6 +39,9 @@ import {
4239
import {
4340
useAnnotationSessionStore
4441
} from '@/ts/stores/annotationSessionStore';
42+
import {
43+
useExportFunction
44+
} from './manager/export';
4545
import {
4646
useStatusStore
4747
} from '@/ts/stores/status';

src/editor/manager/export.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
import {
2-
annotations,
3-
boundingBoxes,
4-
fixations
2+
annotations,
3+
boundingBoxes,
4+
fixations
55
} from '../data';
66
import {
7-
onMounted,
8-
onUnmounted
7+
onMounted,
8+
onUnmounted
99
} from 'vue';
1010
import {
11-
useAnnotationSessionStore
11+
useAnnotationSessionStore
1212
} from '@/ts/stores/annotationSessionStore';
1313

1414
const CSV_HEADER = 'fixation_id,box_id';
1515

1616
const createCsv = () => {
17-
const rows = annotations.value.map( annotation => {
18-
const fixationId = fixations.value[ annotation.fixationIdx ]?.id ?? annotation.fixationIdx;
19-
const boxId = boundingBoxes.value[ annotation.boxIdx ]?.id ?? annotation.boxIdx;
17+
const rows = annotations.value.map( annotation => {
18+
const fixationId = fixations.value[ annotation.fixationIdx ]?.id ?? annotation.fixationIdx;
19+
const boxId = boundingBoxes.value[ annotation.boxIdx ]?.id ?? annotation.boxIdx;
2020

21-
return `${fixationId},${boxId}`;
22-
} );
21+
return `${ fixationId },${ boxId }`;
22+
} );
2323

24-
return [
25-
CSV_HEADER,
26-
...rows
27-
].join( '\n' );
24+
return [
25+
CSV_HEADER,
26+
...rows
27+
].join( '\n' );
2828
};
2929

3030
const downloadCsv = ( data: string, fileName: string ) => {
31-
const blob = new Blob( [ data ], {
32-
'type': 'text/csv;charset=utf-8;'
33-
} );
34-
const url = URL.createObjectURL( blob );
35-
const a = document.createElement( 'a' );
31+
const blob = new Blob( [ data ], {
32+
'type': 'text/csv;charset=utf-8;'
33+
} );
34+
const url = URL.createObjectURL( blob );
35+
const a = document.createElement( 'a' );
3636

37-
a.href = url;
38-
a.download = fileName;
39-
a.style.display = 'none';
37+
a.href = url;
38+
a.download = fileName;
39+
a.style.display = 'none';
4040

41-
document.body.appendChild( a );
42-
a.click();
43-
document.body.removeChild( a );
44-
URL.revokeObjectURL( url );
41+
document.body.appendChild( a );
42+
a.click();
43+
document.body.removeChild( a );
44+
URL.revokeObjectURL( url );
4545
};
4646

4747
export const useExportFunction = () => {
48-
const session = useAnnotationSessionStore();
48+
const session = useAnnotationSessionStore();
4949

50-
const exportCsv = () => {
51-
const sessionId = session.sessionIds[ session.sessionIdx ]?.sessionId ?? 'current';
52-
const fileName = `session-${ sessionId }-annotations.csv`;
50+
const exportCsv = () => {
51+
const sessionId = session.sessionIds[ session.sessionIdx ]?.sessionId ?? 'current';
52+
const fileName = `session-${ sessionId }-annotations.csv`;
5353

54-
downloadCsv( createCsv(), fileName );
55-
};
54+
downloadCsv( createCsv(), fileName );
55+
};
5656

57-
onMounted( () => {
58-
document.addEventListener( 'eyetap:export', exportCsv );
59-
} );
57+
onMounted( () => {
58+
document.addEventListener( 'eyetap:export', exportCsv );
59+
} );
6060

61-
onUnmounted( () => {
62-
document.removeEventListener( 'eyetap:export', exportCsv );
63-
} );
61+
onUnmounted( () => {
62+
document.removeEventListener( 'eyetap:export', exportCsv );
63+
} );
6464
};

src/views/app/AppHome.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
} from '@/types/dtos/ShallowAnnotationSessionDto';
1212
import UserCard from '@/components/home/UserCard.vue';
1313
import annotations from '@/ts/annotations';
14-
import {
14+
/* import {
1515
exportSurvey
16-
} from '@/ts/surveys';
16+
} from '@/ts/surveys'; */
1717
import router from '@/ts/router';
1818
import testData from '@/ts/dev/ShallowAnotationSessionDtoTestData.json';
1919
import {
@@ -111,11 +111,11 @@
111111
if ( annotationSessionStore.selected )
112112
router.push( '/app/editor' );
113113
};
114-
114+
/*
115115
const exportFile = () => {
116116
if ( annotationSessionStore.selected )
117117
exportSurvey( annotationSessionStore.sessionIds[ annotationSessionStore.sessionIdx ]!.sessionId );
118-
};
118+
}; */
119119
</script>
120120

121121
<template>

0 commit comments

Comments
 (0)