equal
deleted
inserted
replaced
2 NONE: 0, |
2 NONE: 0, |
3 CREATED: 1, |
3 CREATED: 1, |
4 UPDATED: 2, |
4 UPDATED: 2, |
5 DELETED: 3 |
5 DELETED: 3 |
6 } |
6 } |
|
7 |
|
8 export const defaultAnnotationsCategories = [ |
|
9 { key: 'important', name: 'Important', color: '#F1C40F' }, |
|
10 { key: 'keyword', name: 'Mot-clé', color: '#2ECC71' }, |
|
11 { key: 'comment', name: 'Commentaire', color: '#3498DB', hasComment: true } |
|
12 ]; |
|
13 |
|
14 |
|
15 export const extractAnnotationCategories = (protocol) => { |
|
16 const metacategories = (protocol)?protocol['metacategories']:null; |
|
17 if(!metacategories) { |
|
18 return defaultAnnotationsCategories; |
|
19 } |
|
20 return metacategories.map((m) => { |
|
21 return { |
|
22 key: m.id, |
|
23 name: m.name, |
|
24 description: m.description, |
|
25 color: m.color, |
|
26 hasComment: m.has_comment |
|
27 } |
|
28 }) |
|
29 } |