Przeglądaj źródła

Merge branch 'feature/578_add_api_for_workspace/apps' of github.com:tracim/tracim_backend into fix/better_api_doc

Guénaël Muller 6 lat temu
rodzic
commit
1522357032

+ 2 - 2
tracim/lib/webdav/design.py Wyświetl plik

164
                     <td>%s</td>
164
                     <td>%s</td>
165
                 </tr>
165
                 </tr>
166
                 ''' % ('warning' if event.id == content_revision.revision_id else '',
166
                 ''' % ('warning' if event.id == content_revision.revision_id else '',
167
-                       event.type.icon,
167
+                       event.type.fa_icon,
168
                        label,
168
                        label,
169
                        date,
169
                        date,
170
                        event.owner.display_name,
170
                        event.owner.display_name,
282
                         </div>
282
                         </div>
283
                     </div>
283
                     </div>
284
                     ''' % ('warning' if t.id == content_revision.revision_id else '',
284
                     ''' % ('warning' if t.id == content_revision.revision_id else '',
285
-                           t.type.icon,
285
+                           t.type.fa_icon,
286
                            t.owner.display_name,
286
                            t.owner.display_name,
287
                            t.create_readable_date(),
287
                            t.create_readable_date(),
288
                            label,
288
                            label,

+ 19 - 7
tracim/models/applications.py Wyświetl plik

10
             self,
10
             self,
11
             label: str,
11
             label: str,
12
             slug: str,
12
             slug: str,
13
-            icon: str,
13
+            fa_icon: str,
14
             hexcolor: str,
14
             hexcolor: str,
15
             is_active: bool,
15
             is_active: bool,
16
             config: typing.Dict[str, str],
16
             config: typing.Dict[str, str],
17
             main_route: str,
17
             main_route: str,
18
     ) -> None:
18
     ) -> None:
19
+        """
20
+        @param label: public label of application
21
+        @param slug: identifier of application
22
+        @param icon: font awesome icon class
23
+        @param hexcolor: hexa color of application main color
24
+        @param is_active: True if application enable, False if inactive
25
+        @param config: a dict with eventual application config
26
+        @param main_route: the route of the frontend "home" screen of
27
+        the application. For exemple, if you have an application
28
+        called "calendar", the main route will be something
29
+        like /#/workspace/{wid}/calendar.
30
+        """
19
         self.label = label
31
         self.label = label
20
         self.slug = slug
32
         self.slug = slug
21
-        self.icon = icon
33
+        self.fa_icon = fa_icon
22
         self.hexcolor = hexcolor
34
         self.hexcolor = hexcolor
23
         self.is_active = is_active
35
         self.is_active = is_active
24
         self.config = config
36
         self.config = config
29
 calendar = Application(
41
 calendar = Application(
30
     label='Calendar',
42
     label='Calendar',
31
     slug='calendar',
43
     slug='calendar',
32
-    icon='calendar-alt',
44
+    fa_icon='calendar-alt',
33
     hexcolor='#757575',
45
     hexcolor='#757575',
34
     is_active=True,
46
     is_active=True,
35
     config={},
47
     config={},
39
 thread = Application(
51
 thread = Application(
40
     label='Threads',
52
     label='Threads',
41
     slug='contents/threads',
53
     slug='contents/threads',
42
-    icon='comments-o',
54
+    fa_icon='comments-o',
43
     hexcolor='#ad4cf9',
55
     hexcolor='#ad4cf9',
44
     is_active=True,
56
     is_active=True,
45
     config={},
57
     config={},
50
 _file = Application(
62
 _file = Application(
51
     label='Files',
63
     label='Files',
52
     slug='contents/files',
64
     slug='contents/files',
53
-    icon='paperclip',
65
+    fa_icon='paperclip',
54
     hexcolor='#FF9900',
66
     hexcolor='#FF9900',
55
     is_active=True,
67
     is_active=True,
56
     config={},
68
     config={},
60
 markdownpluspage = Application(
72
 markdownpluspage = Application(
61
     label='Markdown Plus Documents',  # TODO - G.M - 24-05-2018 - Check label
73
     label='Markdown Plus Documents',  # TODO - G.M - 24-05-2018 - Check label
62
     slug='contents/markdownpluspage',
74
     slug='contents/markdownpluspage',
63
-    icon='file-code',
75
+    fa_icon='file-code',
64
     hexcolor='#f12d2d',
76
     hexcolor='#f12d2d',
65
     is_active=True,
77
     is_active=True,
66
     config={},
78
     config={},
70
 htmlpage = Application(
82
 htmlpage = Application(
71
     label='Text Documents',  # TODO - G.M - 24-05-2018 - Check label
83
     label='Text Documents',  # TODO - G.M - 24-05-2018 - Check label
72
     slug='contents/htmlpage',
84
     slug='contents/htmlpage',
73
-    icon='file-text-o',
85
+    fa_icon='file-text-o',
74
     hexcolor='#3f52e3',
86
     hexcolor='#3f52e3',
75
     is_active=True,
87
     is_active=True,
76
     config={},
88
     config={},

+ 9 - 8
tracim/models/data.py Wyświetl plik

162
     #
162
     #
163
     #
163
     #
164
     # @property
164
     # @property
165
-    # def icon(self):
165
+    # def fa_icon(self):
166
     #     return UserRoleInWorkspace.ICON[self.role]
166
     #     return UserRoleInWorkspace.ICON[self.role]
167
     #
167
     #
168
     # @property
168
     # @property
200
     def __init__(self, role_id):
200
     def __init__(self, role_id):
201
         self.role_type_id = role_id
201
         self.role_type_id = role_id
202
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
202
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
203
-        # self.icon = UserRoleInWorkspace.ICON[role_id]
203
+        # self.fa_icon = UserRoleInWorkspace.ICON[role_id]
204
         # self.role_label = UserRoleInWorkspace.LABEL[role_id]
204
         # self.role_label = UserRoleInWorkspace.LABEL[role_id]
205
         # self.css_style = UserRoleInWorkspace.STYLE[role_id]
205
         # self.css_style = UserRoleInWorkspace.STYLE[role_id]
206
 
206
 
265
     def __init__(self, id):
265
     def __init__(self, id):
266
         assert id in ActionDescription.allowed_values()
266
         assert id in ActionDescription.allowed_values()
267
         self.id = id
267
         self.id = id
268
-        # FIXME - G.M - 17-04-2018 - Label and icon needed for webdav
268
+        # FIXME - G.M - 17-04-2018 - Label and fa_icon needed for webdav
269
         #  design template,
269
         #  design template,
270
         # find a way to not rely on this.
270
         # find a way to not rely on this.
271
         self.label = self.id
271
         self.label = self.id
272
-        self.icon = ActionDescription._ICONS[id]
272
+        self.fa_icon = ActionDescription._ICONS[id]
273
+        #self.icon = self.fa_icon
273
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
274
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
274
         # self.label = ActionDescription._LABELS[id]
275
         # self.label = ActionDescription._LABELS[id]
275
 
276
 
343
         self.id = id
344
         self.id = id
344
         self.label = self.id
345
         self.label = self.id
345
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
346
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
346
-        # self.icon = ContentStatus._ICONS[id]
347
+        # self.fa_icon = ContentStatus._ICONS[id]
347
         # self.css = ContentStatus._CSS[id]
348
         # self.css = ContentStatus._CSS[id]
348
         #
349
         #
349
         # if type==ContentType.Thread:
350
         # if type==ContentType.Thread:
520
     def __init__(self, type):
521
     def __init__(self, type):
521
         self.id = type
522
         self.id = type
522
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
523
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
523
-        # self.icon = ContentType._CSS_ICONS[type]
524
+        # self.fa_icon = ContentType._CSS_ICONS[type]
524
         # self.color = ContentType._CSS_COLORS[type]  # deprecated
525
         # self.color = ContentType._CSS_COLORS[type]  # deprecated
525
         # self.css = ContentType._CSS_COLORS[type]
526
         # self.css = ContentType._CSS_COLORS[type]
526
         # self.label = ContentType._LABEL[type]
527
         # self.label = ContentType._LABEL[type]
530
         return dict(id=self.type,
531
         return dict(id=self.type,
531
                     type=self.type,
532
                     type=self.type,
532
                     # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
533
                     # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
533
-                    # icon=self.icon,
534
+                    # fa_icon=self.fa_icon,
534
                     # color=self.color,
535
                     # color=self.color,
535
                     # label=self.label,
536
                     # label=self.label,
536
                     priority=self.priority)
537
                     priority=self.priority)
1457
         assert hasattr(type, 'id')
1458
         assert hasattr(type, 'id')
1458
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
1459
         # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
1459
         # assert hasattr(type, 'css')
1460
         # assert hasattr(type, 'css')
1460
-        # assert hasattr(type, 'icon')
1461
+        # assert hasattr(type, 'fa_icon')
1461
         # assert hasattr(type, 'label')
1462
         # assert hasattr(type, 'label')
1462
 
1463
 
1463
     def created_as_delta(self, delta_from_datetime:datetime=None):
1464
     def created_as_delta(self, delta_from_datetime:datetime=None):

+ 5 - 5
tracim/models/workspace_menu_entries.py Wyświetl plik

14
             self,
14
             self,
15
             label: str,
15
             label: str,
16
             slug: str,
16
             slug: str,
17
-            icon: str,
17
+            fa_icon: str,
18
             hexcolor: str,
18
             hexcolor: str,
19
             route: str,
19
             route: str,
20
     ) -> None:
20
     ) -> None:
22
         self.label = label
22
         self.label = label
23
         self.route = route
23
         self.route = route
24
         self.hexcolor = hexcolor
24
         self.hexcolor = hexcolor
25
-        self.icon = icon
25
+        self.fa_icon = fa_icon
26
 
26
 
27
 dashboard_menu_entry = WorkspaceMenuEntry(
27
 dashboard_menu_entry = WorkspaceMenuEntry(
28
   slug='dashboard',
28
   slug='dashboard',
29
   label='Dashboard',
29
   label='Dashboard',
30
   route='/#/workspaces/{workspace_id}/dashboard',
30
   route='/#/workspaces/{workspace_id}/dashboard',
31
   hexcolor='#252525',
31
   hexcolor='#252525',
32
-  icon="",
32
+  fa_icon="",
33
 )
33
 )
34
 all_content_menu_entry = WorkspaceMenuEntry(
34
 all_content_menu_entry = WorkspaceMenuEntry(
35
   slug="contents/all",
35
   slug="contents/all",
36
   label="All Contents",
36
   label="All Contents",
37
   route="/#/workspaces/{workspace_id}/contents",
37
   route="/#/workspaces/{workspace_id}/contents",
38
   hexcolor="#fdfdfd",
38
   hexcolor="#fdfdfd",
39
-  icon="",
39
+  fa_icon="",
40
 )
40
 )
41
 
41
 
42
 # TODO - G.M - 08-06-2018 - This is hardcoded default menu entry,
42
 # TODO - G.M - 08-06-2018 - This is hardcoded default menu entry,
57
                 slug=app.slug,
57
                 slug=app.slug,
58
                 label=app.label,
58
                 label=app.label,
59
                 hexcolor=app.hexcolor,
59
                 hexcolor=app.hexcolor,
60
-                icon=app.icon,
60
+                fa_icon=app.fa_icon,
61
                 route=app.main_route
61
                 route=app.main_route
62
             )
62
             )
63
             menu_entries.append(new_entry)
63
             menu_entries.append(new_entry)

+ 5 - 5
tracim/tests/functional/test_system.py Wyświetl plik

26
         application = res[0]
26
         application = res[0]
27
         assert application['label'] == "Text Documents"
27
         assert application['label'] == "Text Documents"
28
         assert application['slug'] == 'contents/htmlpage'
28
         assert application['slug'] == 'contents/htmlpage'
29
-        assert application['icon'] == 'file-text-o'
29
+        assert application['fa_icon'] == 'file-text-o'
30
         assert application['hexcolor'] == '#3f52e3'
30
         assert application['hexcolor'] == '#3f52e3'
31
         assert application['is_active'] is True
31
         assert application['is_active'] is True
32
         assert 'config' in application
32
         assert 'config' in application
33
         application = res[1]
33
         application = res[1]
34
         assert application['label'] == "Markdown Plus Documents"
34
         assert application['label'] == "Markdown Plus Documents"
35
         assert application['slug'] == 'contents/markdownpluspage'
35
         assert application['slug'] == 'contents/markdownpluspage'
36
-        assert application['icon'] == 'file-code'
36
+        assert application['fa_icon'] == 'file-code'
37
         assert application['hexcolor'] == '#f12d2d'
37
         assert application['hexcolor'] == '#f12d2d'
38
         assert application['is_active'] is True
38
         assert application['is_active'] is True
39
         assert 'config' in application
39
         assert 'config' in application
40
         application = res[2]
40
         application = res[2]
41
         assert application['label'] == "Files"
41
         assert application['label'] == "Files"
42
         assert application['slug'] == 'contents/files'
42
         assert application['slug'] == 'contents/files'
43
-        assert application['icon'] == 'paperclip'
43
+        assert application['fa_icon'] == 'paperclip'
44
         assert application['hexcolor'] == '#FF9900'
44
         assert application['hexcolor'] == '#FF9900'
45
         assert application['is_active'] is True
45
         assert application['is_active'] is True
46
         assert 'config' in application
46
         assert 'config' in application
47
         application = res[3]
47
         application = res[3]
48
         assert application['label'] == "Threads"
48
         assert application['label'] == "Threads"
49
         assert application['slug'] == 'contents/threads'
49
         assert application['slug'] == 'contents/threads'
50
-        assert application['icon'] == 'comments-o'
50
+        assert application['fa_icon'] == 'comments-o'
51
         assert application['hexcolor'] == '#ad4cf9'
51
         assert application['hexcolor'] == '#ad4cf9'
52
         assert application['is_active'] is True
52
         assert application['is_active'] is True
53
         assert 'config' in application
53
         assert 'config' in application
54
         application = res[4]
54
         application = res[4]
55
         assert application['label'] == "Calendar"
55
         assert application['label'] == "Calendar"
56
         assert application['slug'] == 'calendar'
56
         assert application['slug'] == 'calendar'
57
-        assert application['icon'] == 'calendar-alt'
57
+        assert application['fa_icon'] == 'calendar-alt'
58
         assert application['hexcolor'] == '#757575'
58
         assert application['hexcolor'] == '#757575'
59
         assert application['is_active'] is True
59
         assert application['is_active'] is True
60
         assert 'config' in application
60
         assert 'config' in application

+ 7 - 7
tracim/tests/functional/test_user.py Wyświetl plik

37
         assert sidebar_entry['label'] == 'Dashboard'
37
         assert sidebar_entry['label'] == 'Dashboard'
38
         assert sidebar_entry['route'] == '/#/workspaces/1/dashboard'  # nopep8
38
         assert sidebar_entry['route'] == '/#/workspaces/1/dashboard'  # nopep8
39
         assert sidebar_entry['hexcolor'] == "#252525"
39
         assert sidebar_entry['hexcolor'] == "#252525"
40
-        assert sidebar_entry['icon'] == ""
40
+        assert sidebar_entry['fa_icon'] == ""
41
 
41
 
42
         sidebar_entry = workspace['sidebar_entries'][1]
42
         sidebar_entry = workspace['sidebar_entries'][1]
43
         assert sidebar_entry['slug'] == 'contents/all'
43
         assert sidebar_entry['slug'] == 'contents/all'
44
         assert sidebar_entry['label'] == 'All Contents'
44
         assert sidebar_entry['label'] == 'All Contents'
45
         assert sidebar_entry['route'] == "/#/workspaces/1/contents"  # nopep8
45
         assert sidebar_entry['route'] == "/#/workspaces/1/contents"  # nopep8
46
         assert sidebar_entry['hexcolor'] == "#fdfdfd"
46
         assert sidebar_entry['hexcolor'] == "#fdfdfd"
47
-        assert sidebar_entry['icon'] == ""
47
+        assert sidebar_entry['fa_icon'] == ""
48
 
48
 
49
         sidebar_entry = workspace['sidebar_entries'][2]
49
         sidebar_entry = workspace['sidebar_entries'][2]
50
         assert sidebar_entry['slug'] == 'contents/htmlpage'
50
         assert sidebar_entry['slug'] == 'contents/htmlpage'
51
         assert sidebar_entry['label'] == 'Text Documents'
51
         assert sidebar_entry['label'] == 'Text Documents'
52
         assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage'  # nopep8
52
         assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage'  # nopep8
53
         assert sidebar_entry['hexcolor'] == "#3f52e3"
53
         assert sidebar_entry['hexcolor'] == "#3f52e3"
54
-        assert sidebar_entry['icon'] == "file-text-o"
54
+        assert sidebar_entry['fa_icon'] == "file-text-o"
55
 
55
 
56
         sidebar_entry = workspace['sidebar_entries'][3]
56
         sidebar_entry = workspace['sidebar_entries'][3]
57
         assert sidebar_entry['slug'] == 'contents/markdownpluspage'
57
         assert sidebar_entry['slug'] == 'contents/markdownpluspage'
58
         assert sidebar_entry['label'] == 'Markdown Plus Documents'
58
         assert sidebar_entry['label'] == 'Markdown Plus Documents'
59
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage"    # nopep8
59
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage"    # nopep8
60
         assert sidebar_entry['hexcolor'] == "#f12d2d"
60
         assert sidebar_entry['hexcolor'] == "#f12d2d"
61
-        assert sidebar_entry['icon'] == "file-code"
61
+        assert sidebar_entry['fa_icon'] == "file-code"
62
 
62
 
63
         sidebar_entry = workspace['sidebar_entries'][4]
63
         sidebar_entry = workspace['sidebar_entries'][4]
64
         assert sidebar_entry['slug'] == 'contents/files'
64
         assert sidebar_entry['slug'] == 'contents/files'
65
         assert sidebar_entry['label'] == 'Files'
65
         assert sidebar_entry['label'] == 'Files'
66
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
66
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
67
         assert sidebar_entry['hexcolor'] == "#FF9900"
67
         assert sidebar_entry['hexcolor'] == "#FF9900"
68
-        assert sidebar_entry['icon'] == "paperclip"
68
+        assert sidebar_entry['fa_icon'] == "paperclip"
69
 
69
 
70
         sidebar_entry = workspace['sidebar_entries'][5]
70
         sidebar_entry = workspace['sidebar_entries'][5]
71
         assert sidebar_entry['slug'] == 'contents/threads'
71
         assert sidebar_entry['slug'] == 'contents/threads'
72
         assert sidebar_entry['label'] == 'Threads'
72
         assert sidebar_entry['label'] == 'Threads'
73
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
73
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
74
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
74
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
75
-        assert sidebar_entry['icon'] == "comments-o"
75
+        assert sidebar_entry['fa_icon'] == "comments-o"
76
 
76
 
77
         sidebar_entry = workspace['sidebar_entries'][6]
77
         sidebar_entry = workspace['sidebar_entries'][6]
78
         assert sidebar_entry['slug'] == 'calendar'
78
         assert sidebar_entry['slug'] == 'calendar'
79
         assert sidebar_entry['label'] == 'Calendar'
79
         assert sidebar_entry['label'] == 'Calendar'
80
         assert sidebar_entry['route'] == "/#/workspaces/1/calendar"  # nopep8
80
         assert sidebar_entry['route'] == "/#/workspaces/1/calendar"  # nopep8
81
         assert sidebar_entry['hexcolor'] == "#757575"
81
         assert sidebar_entry['hexcolor'] == "#757575"
82
-        assert sidebar_entry['icon'] == "calendar-alt"
82
+        assert sidebar_entry['fa_icon'] == "calendar-alt"
83
 
83
 
84
     def test_api__get_user_workspaces__err_403__unallowed_user(self):
84
     def test_api__get_user_workspaces__err_403__unallowed_user(self):
85
         """
85
         """

+ 7 - 7
tracim/tests/functional/test_workspaces.py Wyświetl plik

38
         assert sidebar_entry['label'] == 'Dashboard'
38
         assert sidebar_entry['label'] == 'Dashboard'
39
         assert sidebar_entry['route'] == '/#/workspaces/1/dashboard'  # nopep8
39
         assert sidebar_entry['route'] == '/#/workspaces/1/dashboard'  # nopep8
40
         assert sidebar_entry['hexcolor'] == "#252525"
40
         assert sidebar_entry['hexcolor'] == "#252525"
41
-        assert sidebar_entry['icon'] == ""
41
+        assert sidebar_entry['fa_icon'] == ""
42
 
42
 
43
         sidebar_entry = workspace['sidebar_entries'][1]
43
         sidebar_entry = workspace['sidebar_entries'][1]
44
         assert sidebar_entry['slug'] == 'contents/all'
44
         assert sidebar_entry['slug'] == 'contents/all'
45
         assert sidebar_entry['label'] == 'All Contents'
45
         assert sidebar_entry['label'] == 'All Contents'
46
         assert sidebar_entry['route'] == "/#/workspaces/1/contents"  # nopep8
46
         assert sidebar_entry['route'] == "/#/workspaces/1/contents"  # nopep8
47
         assert sidebar_entry['hexcolor'] == "#fdfdfd"
47
         assert sidebar_entry['hexcolor'] == "#fdfdfd"
48
-        assert sidebar_entry['icon'] == ""
48
+        assert sidebar_entry['fa_icon'] == ""
49
 
49
 
50
         sidebar_entry = workspace['sidebar_entries'][2]
50
         sidebar_entry = workspace['sidebar_entries'][2]
51
         assert sidebar_entry['slug'] == 'contents/htmlpage'
51
         assert sidebar_entry['slug'] == 'contents/htmlpage'
52
         assert sidebar_entry['label'] == 'Text Documents'
52
         assert sidebar_entry['label'] == 'Text Documents'
53
         assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage'  # nopep8
53
         assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=htmlpage'  # nopep8
54
         assert sidebar_entry['hexcolor'] == "#3f52e3"
54
         assert sidebar_entry['hexcolor'] == "#3f52e3"
55
-        assert sidebar_entry['icon'] == "file-text-o"
55
+        assert sidebar_entry['fa_icon'] == "file-text-o"
56
 
56
 
57
         sidebar_entry = workspace['sidebar_entries'][3]
57
         sidebar_entry = workspace['sidebar_entries'][3]
58
         assert sidebar_entry['slug'] == 'contents/markdownpluspage'
58
         assert sidebar_entry['slug'] == 'contents/markdownpluspage'
59
         assert sidebar_entry['label'] == 'Markdown Plus Documents'
59
         assert sidebar_entry['label'] == 'Markdown Plus Documents'
60
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage"    # nopep8
60
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=markdownpluspage"    # nopep8
61
         assert sidebar_entry['hexcolor'] == "#f12d2d"
61
         assert sidebar_entry['hexcolor'] == "#f12d2d"
62
-        assert sidebar_entry['icon'] == "file-code"
62
+        assert sidebar_entry['fa_icon'] == "file-code"
63
 
63
 
64
         sidebar_entry = workspace['sidebar_entries'][4]
64
         sidebar_entry = workspace['sidebar_entries'][4]
65
         assert sidebar_entry['slug'] == 'contents/files'
65
         assert sidebar_entry['slug'] == 'contents/files'
66
         assert sidebar_entry['label'] == 'Files'
66
         assert sidebar_entry['label'] == 'Files'
67
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
67
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
68
         assert sidebar_entry['hexcolor'] == "#FF9900"
68
         assert sidebar_entry['hexcolor'] == "#FF9900"
69
-        assert sidebar_entry['icon'] == "paperclip"
69
+        assert sidebar_entry['fa_icon'] == "paperclip"
70
 
70
 
71
         sidebar_entry = workspace['sidebar_entries'][5]
71
         sidebar_entry = workspace['sidebar_entries'][5]
72
         assert sidebar_entry['slug'] == 'contents/threads'
72
         assert sidebar_entry['slug'] == 'contents/threads'
73
         assert sidebar_entry['label'] == 'Threads'
73
         assert sidebar_entry['label'] == 'Threads'
74
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
74
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
75
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
75
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
76
-        assert sidebar_entry['icon'] == "comments-o"
76
+        assert sidebar_entry['fa_icon'] == "comments-o"
77
 
77
 
78
         sidebar_entry = workspace['sidebar_entries'][6]
78
         sidebar_entry = workspace['sidebar_entries'][6]
79
         assert sidebar_entry['slug'] == 'calendar'
79
         assert sidebar_entry['slug'] == 'calendar'
80
         assert sidebar_entry['label'] == 'Calendar'
80
         assert sidebar_entry['label'] == 'Calendar'
81
         assert sidebar_entry['route'] == "/#/workspaces/1/calendar"  # nopep8
81
         assert sidebar_entry['route'] == "/#/workspaces/1/calendar"  # nopep8
82
         assert sidebar_entry['hexcolor'] == "#757575"
82
         assert sidebar_entry['hexcolor'] == "#757575"
83
-        assert sidebar_entry['icon'] == "calendar-alt"
83
+        assert sidebar_entry['fa_icon'] == "calendar-alt"
84
 
84
 
85
     def test_api__get_workspace__err_403__unallowed_user(self) -> None:
85
     def test_api__get_workspace__err_403__unallowed_user(self) -> None:
86
         """
86
         """

+ 2 - 2
tracim/views/core_api/schemas.py Wyświetl plik

114
                     'which must be replaced on backend size '
114
                     'which must be replaced on backend size '
115
                     '(the route must be ready-to-use)'
115
                     '(the route must be ready-to-use)'
116
     )
116
     )
117
-    icon = marshmallow.fields.String(
117
+    fa_icon = marshmallow.fields.String(
118
         example='file-text-o',
118
         example='file-text-o',
119
         description='CSS class of the icon. Example: file-o for using Fontawesome file-text-o icon',  # nopep8
119
         description='CSS class of the icon. Example: file-o for using Fontawesome file-text-o icon',  # nopep8
120
     )
120
     )
170
 class ApplicationSchema(marshmallow.Schema):
170
 class ApplicationSchema(marshmallow.Schema):
171
     label = marshmallow.fields.String(example='Calendar')
171
     label = marshmallow.fields.String(example='Calendar')
172
     slug = marshmallow.fields.String(example='calendar')
172
     slug = marshmallow.fields.String(example='calendar')
173
-    icon = marshmallow.fields.String(
173
+    fa_icon = marshmallow.fields.String(
174
         example='file-o',
174
         example='file-o',
175
         description='CSS class of the icon. Example: file-o for using Fontawesome file-o icon',  # nopep8
175
         description='CSS class of the icon. Example: file-o for using Fontawesome file-o icon',  # nopep8
176
     )
176
     )