Browse Source

Merge branch 'develop' of github.com:tracim/tracim_v2 into develop

Skylsmoi 6 years ago
parent
commit
ccd1d9b6c0

+ 4 - 4
backend/tracim_backend/models/applications.py View File

50
 
50
 
51
 thread = Application(
51
 thread = Application(
52
     label='Threads',
52
     label='Threads',
53
-    slug='contents/threads',
53
+    slug='contents/thread',
54
     fa_icon='comments-o',
54
     fa_icon='comments-o',
55
     hexcolor='#ad4cf9',
55
     hexcolor='#ad4cf9',
56
     is_active=True,
56
     is_active=True,
61
 
61
 
62
 _file = Application(
62
 _file = Application(
63
     label='Files',
63
     label='Files',
64
-    slug='contents/files',
64
+    slug='contents/file',
65
     fa_icon='paperclip',
65
     fa_icon='paperclip',
66
     hexcolor='#FF9900',
66
     hexcolor='#FF9900',
67
     is_active=True,
67
     is_active=True,
81
 
81
 
82
 html_documents = Application(
82
 html_documents = Application(
83
     label='Text Documents',  # TODO - G.M - 24-05-2018 - Check label
83
     label='Text Documents',  # TODO - G.M - 24-05-2018 - Check label
84
-    slug='contents/html-documents',
84
+    slug='contents/html-document',
85
     fa_icon='file-text-o',
85
     fa_icon='file-text-o',
86
     hexcolor='#3f52e3',
86
     hexcolor='#3f52e3',
87
     is_active=True,
87
     is_active=True,
88
     config={},
88
     config={},
89
-    main_route='/#/workspaces/{workspace_id}/contents?type=html-documents',
89
+    main_route='/#/workspaces/{workspace_id}/contents?type=html-document',
90
 )
90
 )
91
 # TODO - G.M - 08-06-2018 - This is hardcoded lists of app, make this dynamic.
91
 # TODO - G.M - 08-06-2018 - This is hardcoded lists of app, make this dynamic.
92
 # List of applications
92
 # List of applications

+ 1 - 1
backend/tracim_backend/models/contents.py View File

164
 )
164
 )
165
 
165
 
166
 html_documents_type = NewContentType(
166
 html_documents_type = NewContentType(
167
-    slug='html-documents',
167
+    slug='html-document',
168
     fa_icon=html_documents.fa_icon,
168
     fa_icon=html_documents.fa_icon,
169
     hexcolor=html_documents.hexcolor,
169
     hexcolor=html_documents.hexcolor,
170
     label='Text Document',
170
     label='Text Document',

+ 1 - 1
backend/tracim_backend/tests/__init__.py View File

50
     )
50
     )
51
     content_query = dbsession.query(ContentRevisionRO).filter(ContentRevisionRO.type == 'page').filter(ContentRevisionRO.content_id == 6)  # nopep8
51
     content_query = dbsession.query(ContentRevisionRO).filter(ContentRevisionRO.type == 'page').filter(ContentRevisionRO.content_id == 6)  # nopep8
52
     assert content_query.count() == 0
52
     assert content_query.count() == 0
53
-    html_documents_query = dbsession.query(ContentRevisionRO).filter(ContentRevisionRO.type == 'html-documents')  # nopep8
53
+    html_documents_query = dbsession.query(ContentRevisionRO).filter(ContentRevisionRO.type == 'html-document')  # nopep8
54
     html_documents_query.update({ContentRevisionRO.type: 'page'})
54
     html_documents_query.update({ContentRevisionRO.type: 'page'})
55
     transaction.commit()
55
     transaction.commit()
56
     assert content_query.count() > 0
56
     assert content_query.count() > 0

+ 9 - 9
backend/tracim_backend/tests/functional/test_contents.py View File

51
             status=200
51
             status=200
52
         )
52
         )
53
         content = res.json_body
53
         content = res.json_body
54
-        assert content['content_type'] == 'html-documents'
54
+        assert content['content_type'] == 'html-document'
55
         assert content['content_id'] == 6
55
         assert content['content_id'] == 6
56
         assert content['is_archived'] is False
56
         assert content['is_archived'] is False
57
         assert content['is_deleted'] is False
57
         assert content['is_deleted'] is False
92
             status=200
92
             status=200
93
         )
93
         )
94
         content = res.json_body
94
         content = res.json_body
95
-        assert content['content_type'] == 'html-documents'
95
+        assert content['content_type'] == 'html-document'
96
         assert content['content_id'] == 6
96
         assert content['content_id'] == 6
97
         assert content['is_archived'] is False
97
         assert content['is_archived'] is False
98
         assert content['is_deleted'] is False
98
         assert content['is_deleted'] is False
255
             status=200
255
             status=200
256
         )
256
         )
257
         content = res.json_body
257
         content = res.json_body
258
-        assert content['content_type'] == 'html-documents'
258
+        assert content['content_type'] == 'html-document'
259
         assert content['content_id'] == 6
259
         assert content['content_id'] == 6
260
         assert content['is_archived'] is False
260
         assert content['is_archived'] is False
261
         assert content['is_deleted'] is False
261
         assert content['is_deleted'] is False
282
             status=200
282
             status=200
283
         )
283
         )
284
         content = res.json_body
284
         content = res.json_body
285
-        assert content['content_type'] == 'html-documents'
285
+        assert content['content_type'] == 'html-document'
286
         assert content['content_id'] == 6
286
         assert content['content_id'] == 6
287
         assert content['is_archived'] is False
287
         assert content['is_archived'] is False
288
         assert content['is_deleted'] is False
288
         assert content['is_deleted'] is False
324
         revisions = res.json_body
324
         revisions = res.json_body
325
         assert len(revisions) == 3
325
         assert len(revisions) == 3
326
         revision = revisions[0]
326
         revision = revisions[0]
327
-        assert revision['content_type'] == 'html-documents'
327
+        assert revision['content_type'] == 'html-document'
328
         assert revision['content_id'] == 6
328
         assert revision['content_id'] == 6
329
         assert revision['is_archived'] is False
329
         assert revision['is_archived'] is False
330
         assert revision['is_deleted'] is False
330
         assert revision['is_deleted'] is False
346
         assert revision['author']['avatar_url'] is None
346
         assert revision['author']['avatar_url'] is None
347
         assert revision['author']['public_name'] == 'Global manager'
347
         assert revision['author']['public_name'] == 'Global manager'
348
         revision = revisions[1]
348
         revision = revisions[1]
349
-        assert revision['content_type'] == 'html-documents'
349
+        assert revision['content_type'] == 'html-document'
350
         assert revision['content_id'] == 6
350
         assert revision['content_id'] == 6
351
         assert revision['is_archived'] is False
351
         assert revision['is_archived'] is False
352
         assert revision['is_deleted'] is False
352
         assert revision['is_deleted'] is False
368
         assert revision['author']['avatar_url'] is None
368
         assert revision['author']['avatar_url'] is None
369
         assert revision['author']['public_name'] == 'Global manager'
369
         assert revision['author']['public_name'] == 'Global manager'
370
         revision = revisions[2]
370
         revision = revisions[2]
371
-        assert revision['content_type'] == 'html-documents'
371
+        assert revision['content_type'] == 'html-document'
372
         assert revision['content_id'] == 6
372
         assert revision['content_id'] == 6
373
         assert revision['is_archived'] is False
373
         assert revision['is_archived'] is False
374
         assert revision['is_deleted'] is False
374
         assert revision['is_deleted'] is False
411
             status=200
411
             status=200
412
         )
412
         )
413
         content = res.json_body
413
         content = res.json_body
414
-        assert content['content_type'] == 'html-documents'
414
+        assert content['content_type'] == 'html-document'
415
         assert content['content_id'] == 6
415
         assert content['content_id'] == 6
416
         assert content['status'] == 'open'
416
         assert content['status'] == 'open'
417
 
417
 
428
             status=200
428
             status=200
429
         )
429
         )
430
         content = res.json_body
430
         content = res.json_body
431
-        assert content['content_type'] == 'html-documents'
431
+        assert content['content_type'] == 'html-document'
432
         assert content['content_id'] == 6
432
         assert content['content_id'] == 6
433
         assert content['status'] == 'closed-deprecated'
433
         assert content['status'] == 'closed-deprecated'
434
 
434
 

+ 4 - 4
backend/tracim_backend/tests/functional/test_system.py View File

25
         res = res.json_body
25
         res = res.json_body
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/html-documents'
28
+        assert application['slug'] == 'contents/html-document'
29
         assert application['fa_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
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/file'
43
         assert application['fa_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/thread'
50
         assert application['fa_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
124
         assert len(content_type['available_statuses']) == 4
124
         assert len(content_type['available_statuses']) == 4
125
 
125
 
126
         content_type = res[3]
126
         content_type = res[3]
127
-        assert content_type['slug'] == 'html-documents'
127
+        assert content_type['slug'] == 'html-document'
128
         assert content_type['fa_icon'] == 'file-text-o'
128
         assert content_type['fa_icon'] == 'file-text-o'
129
         assert content_type['hexcolor'] == '#3f52e3'
129
         assert content_type['hexcolor'] == '#3f52e3'
130
         assert content_type['label'] == 'Text Document'
130
         assert content_type['label'] == 'Text Document'

+ 4 - 4
backend/tracim_backend/tests/functional/test_user.py View File

762
         assert sidebar_entry['fa_icon'] == "th"
762
         assert sidebar_entry['fa_icon'] == "th"
763
 
763
 
764
         sidebar_entry = workspace['sidebar_entries'][2]
764
         sidebar_entry = workspace['sidebar_entries'][2]
765
-        assert sidebar_entry['slug'] == 'contents/html-documents'
765
+        assert sidebar_entry['slug'] == 'contents/html-document'
766
         assert sidebar_entry['label'] == 'Text Documents'
766
         assert sidebar_entry['label'] == 'Text Documents'
767
-        assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=html-documents'  # nopep8
767
+        assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=html-document'  # nopep8
768
         assert sidebar_entry['hexcolor'] == "#3f52e3"
768
         assert sidebar_entry['hexcolor'] == "#3f52e3"
769
         assert sidebar_entry['fa_icon'] == "file-text-o"
769
         assert sidebar_entry['fa_icon'] == "file-text-o"
770
 
770
 
776
         assert sidebar_entry['fa_icon'] == "file-code-o"
776
         assert sidebar_entry['fa_icon'] == "file-code-o"
777
 
777
 
778
         sidebar_entry = workspace['sidebar_entries'][4]
778
         sidebar_entry = workspace['sidebar_entries'][4]
779
-        assert sidebar_entry['slug'] == 'contents/files'
779
+        assert sidebar_entry['slug'] == 'contents/file'
780
         assert sidebar_entry['label'] == 'Files'
780
         assert sidebar_entry['label'] == 'Files'
781
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
781
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
782
         assert sidebar_entry['hexcolor'] == "#FF9900"
782
         assert sidebar_entry['hexcolor'] == "#FF9900"
783
         assert sidebar_entry['fa_icon'] == "paperclip"
783
         assert sidebar_entry['fa_icon'] == "paperclip"
784
 
784
 
785
         sidebar_entry = workspace['sidebar_entries'][5]
785
         sidebar_entry = workspace['sidebar_entries'][5]
786
-        assert sidebar_entry['slug'] == 'contents/threads'
786
+        assert sidebar_entry['slug'] == 'contents/thread'
787
         assert sidebar_entry['label'] == 'Threads'
787
         assert sidebar_entry['label'] == 'Threads'
788
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
788
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
789
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
789
         assert sidebar_entry['hexcolor'] == "#ad4cf9"

+ 46 - 46
backend/tracim_backend/tests/functional/test_workspaces.py View File

58
         assert sidebar_entry['fa_icon'] == "th"
58
         assert sidebar_entry['fa_icon'] == "th"
59
 
59
 
60
         sidebar_entry = workspace['sidebar_entries'][2]
60
         sidebar_entry = workspace['sidebar_entries'][2]
61
-        assert sidebar_entry['slug'] == 'contents/html-documents'
61
+        assert sidebar_entry['slug'] == 'contents/html-document'
62
         assert sidebar_entry['label'] == 'Text Documents'
62
         assert sidebar_entry['label'] == 'Text Documents'
63
-        assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=html-documents'  # nopep8
63
+        assert sidebar_entry['route'] == '/#/workspaces/1/contents?type=html-document'  # nopep8
64
         assert sidebar_entry['hexcolor'] == "#3f52e3"
64
         assert sidebar_entry['hexcolor'] == "#3f52e3"
65
         assert sidebar_entry['fa_icon'] == "file-text-o"
65
         assert sidebar_entry['fa_icon'] == "file-text-o"
66
 
66
 
72
         assert sidebar_entry['fa_icon'] == "file-code-o"
72
         assert sidebar_entry['fa_icon'] == "file-code-o"
73
 
73
 
74
         sidebar_entry = workspace['sidebar_entries'][4]
74
         sidebar_entry = workspace['sidebar_entries'][4]
75
-        assert sidebar_entry['slug'] == 'contents/files'
75
+        assert sidebar_entry['slug'] == 'contents/file'
76
         assert sidebar_entry['label'] == 'Files'
76
         assert sidebar_entry['label'] == 'Files'
77
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
77
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
78
         assert sidebar_entry['hexcolor'] == "#FF9900"
78
         assert sidebar_entry['hexcolor'] == "#FF9900"
79
         assert sidebar_entry['fa_icon'] == "paperclip"
79
         assert sidebar_entry['fa_icon'] == "paperclip"
80
 
80
 
81
         sidebar_entry = workspace['sidebar_entries'][5]
81
         sidebar_entry = workspace['sidebar_entries'][5]
82
-        assert sidebar_entry['slug'] == 'contents/threads'
82
+        assert sidebar_entry['slug'] == 'contents/thread'
83
         assert sidebar_entry['label'] == 'Threads'
83
         assert sidebar_entry['label'] == 'Threads'
84
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
84
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
85
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
85
         assert sidebar_entry['hexcolor'] == "#ad4cf9"
643
         assert content['show_in_ui'] is True
643
         assert content['show_in_ui'] is True
644
         assert content['slug'] == 'tools'
644
         assert content['slug'] == 'tools'
645
         assert content['status'] == 'open'
645
         assert content['status'] == 'open'
646
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
646
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
647
         assert content['workspace_id'] == 1
647
         assert content['workspace_id'] == 1
648
         content = res[1]
648
         content = res[1]
649
         assert content['content_id'] == 2
649
         assert content['content_id'] == 2
655
         assert content['show_in_ui'] is True
655
         assert content['show_in_ui'] is True
656
         assert content['slug'] == 'menus'
656
         assert content['slug'] == 'menus'
657
         assert content['status'] == 'open'
657
         assert content['status'] == 'open'
658
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
658
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
659
         assert content['workspace_id'] == 1
659
         assert content['workspace_id'] == 1
660
         content = res[2]
660
         content = res[2]
661
         assert content['content_id'] == 11
661
         assert content['content_id'] == 11
662
-        assert content['content_type'] == 'html-documents'
662
+        assert content['content_type'] == 'html-document'
663
         assert content['is_archived'] is False
663
         assert content['is_archived'] is False
664
         assert content['is_deleted'] is False
664
         assert content['is_deleted'] is False
665
         assert content['label'] == 'Current Menu'
665
         assert content['label'] == 'Current Menu'
667
         assert content['show_in_ui'] is True
667
         assert content['show_in_ui'] is True
668
         assert content['slug'] == 'current-menu'
668
         assert content['slug'] == 'current-menu'
669
         assert content['status'] == 'open'
669
         assert content['status'] == 'open'
670
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
670
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
671
         assert content['workspace_id'] == 1
671
         assert content['workspace_id'] == 1
672
 
672
 
673
     def test_api__get_workspace_content__ok_200__get_default_html_documents(self):
673
     def test_api__get_workspace_content__ok_200__get_default_html_documents(self):
682
             )
682
             )
683
         )
683
         )
684
         params = {
684
         params = {
685
-            'content_type': 'html-documents',
685
+            'content_type': 'html-document',
686
         }
686
         }
687
         res = self.testapp.get('/api/v2/workspaces/1/contents', status=200, params=params).json_body   # nopep8
687
         res = self.testapp.get('/api/v2/workspaces/1/contents', status=200, params=params).json_body   # nopep8
688
         assert len(res) == 1
688
         assert len(res) == 1
689
         content = res[0]
689
         content = res[0]
690
         assert content
690
         assert content
691
         assert content['content_id'] == 11
691
         assert content['content_id'] == 11
692
-        assert content['content_type'] == 'html-documents'
692
+        assert content['content_type'] == 'html-document'
693
         assert content['is_archived'] is False
693
         assert content['is_archived'] is False
694
         assert content['is_deleted'] is False
694
         assert content['is_deleted'] is False
695
         assert content['label'] == 'Current Menu'
695
         assert content['label'] == 'Current Menu'
697
         assert content['show_in_ui'] is True
697
         assert content['show_in_ui'] is True
698
         assert content['slug'] == 'current-menu'
698
         assert content['slug'] == 'current-menu'
699
         assert content['status'] == 'open'
699
         assert content['status'] == 'open'
700
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
700
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
701
         assert content['workspace_id'] == 1
701
         assert content['workspace_id'] == 1
702
 
702
 
703
     # Root related
703
     # Root related
727
         # TODO - G.M - 30-05-2018 - Check this test
727
         # TODO - G.M - 30-05-2018 - Check this test
728
         assert len(res) == 4
728
         assert len(res) == 4
729
         content = res[1]
729
         content = res[1]
730
-        assert content['content_type'] == 'html-documents'
730
+        assert content['content_type'] == 'html-document'
731
         assert content['content_id'] == 15
731
         assert content['content_id'] == 15
732
         assert content['is_archived'] is False
732
         assert content['is_archived'] is False
733
         assert content['is_deleted'] is False
733
         assert content['is_deleted'] is False
736
         assert content['show_in_ui'] is True
736
         assert content['show_in_ui'] is True
737
         assert content['slug'] == 'new-fruit-salad'
737
         assert content['slug'] == 'new-fruit-salad'
738
         assert content['status'] == 'open'
738
         assert content['status'] == 'open'
739
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
739
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
740
         assert content['workspace_id'] == 3
740
         assert content['workspace_id'] == 3
741
 
741
 
742
         content = res[2]
742
         content = res[2]
743
-        assert content['content_type'] == 'html-documents'
743
+        assert content['content_type'] == 'html-document'
744
         assert content['content_id'] == 16
744
         assert content['content_id'] == 16
745
         assert content['is_archived'] is True
745
         assert content['is_archived'] is True
746
         assert content['is_deleted'] is False
746
         assert content['is_deleted'] is False
749
         assert content['show_in_ui'] is True
749
         assert content['show_in_ui'] is True
750
         assert content['slug'].startswith('fruit-salad')
750
         assert content['slug'].startswith('fruit-salad')
751
         assert content['status'] == 'open'
751
         assert content['status'] == 'open'
752
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
752
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
753
         assert content['workspace_id'] == 3
753
         assert content['workspace_id'] == 3
754
 
754
 
755
         content = res[3]
755
         content = res[3]
756
-        assert content['content_type'] == 'html-documents'
756
+        assert content['content_type'] == 'html-document'
757
         assert content['content_id'] == 17
757
         assert content['content_id'] == 17
758
         assert content['is_archived'] is False
758
         assert content['is_archived'] is False
759
         assert content['is_deleted'] is True
759
         assert content['is_deleted'] is True
762
         assert content['show_in_ui'] is True
762
         assert content['show_in_ui'] is True
763
         assert content['slug'].startswith('bad-fruit-salad')
763
         assert content['slug'].startswith('bad-fruit-salad')
764
         assert content['status'] == 'open'
764
         assert content['status'] == 'open'
765
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
765
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
766
         assert content['workspace_id'] == 3
766
         assert content['workspace_id'] == 3
767
 
767
 
768
     def test_api__get_workspace_content__ok_200__get_all_root_content(self):
768
     def test_api__get_workspace_content__ok_200__get_all_root_content(self):
790
         # TODO - G.M - 30-05-2018 - Check this test
790
         # TODO - G.M - 30-05-2018 - Check this test
791
         assert len(res) == 4
791
         assert len(res) == 4
792
         content = res[1]
792
         content = res[1]
793
-        assert content['content_type'] == 'html-documents'
793
+        assert content['content_type'] == 'html-document'
794
         assert content['content_id'] == 15
794
         assert content['content_id'] == 15
795
         assert content['is_archived'] is False
795
         assert content['is_archived'] is False
796
         assert content['is_deleted'] is False
796
         assert content['is_deleted'] is False
799
         assert content['show_in_ui'] is True
799
         assert content['show_in_ui'] is True
800
         assert content['slug'] == 'new-fruit-salad'
800
         assert content['slug'] == 'new-fruit-salad'
801
         assert content['status'] == 'open'
801
         assert content['status'] == 'open'
802
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
802
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
803
         assert content['workspace_id'] == 3
803
         assert content['workspace_id'] == 3
804
 
804
 
805
         content = res[2]
805
         content = res[2]
806
-        assert content['content_type'] == 'html-documents'
806
+        assert content['content_type'] == 'html-document'
807
         assert content['content_id'] == 16
807
         assert content['content_id'] == 16
808
         assert content['is_archived'] is True
808
         assert content['is_archived'] is True
809
         assert content['is_deleted'] is False
809
         assert content['is_deleted'] is False
812
         assert content['show_in_ui'] is True
812
         assert content['show_in_ui'] is True
813
         assert content['slug'].startswith('fruit-salad')
813
         assert content['slug'].startswith('fruit-salad')
814
         assert content['status'] == 'open'
814
         assert content['status'] == 'open'
815
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
815
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
816
         assert content['workspace_id'] == 3
816
         assert content['workspace_id'] == 3
817
 
817
 
818
         content = res[3]
818
         content = res[3]
819
-        assert content['content_type'] == 'html-documents'
819
+        assert content['content_type'] == 'html-document'
820
         assert content['content_id'] == 17
820
         assert content['content_id'] == 17
821
         assert content['is_archived'] is False
821
         assert content['is_archived'] is False
822
         assert content['is_deleted'] is True
822
         assert content['is_deleted'] is True
825
         assert content['show_in_ui'] is True
825
         assert content['show_in_ui'] is True
826
         assert content['slug'].startswith('bad-fruit-salad')
826
         assert content['slug'].startswith('bad-fruit-salad')
827
         assert content['status'] == 'open'
827
         assert content['status'] == 'open'
828
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
828
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
829
         assert content['workspace_id'] == 3
829
         assert content['workspace_id'] == 3
830
 
830
 
831
     def test_api__get_workspace_content__ok_200__get_only_active_root_content(self):  # nopep8
831
     def test_api__get_workspace_content__ok_200__get_only_active_root_content(self):  # nopep8
853
         # TODO - G.M - 30-05-2018 - Check this test
853
         # TODO - G.M - 30-05-2018 - Check this test
854
         assert len(res) == 2
854
         assert len(res) == 2
855
         content = res[1]
855
         content = res[1]
856
-        assert content['content_type'] == 'html-documents'
856
+        assert content['content_type'] == 'html-document'
857
         assert content['content_id'] == 15
857
         assert content['content_id'] == 15
858
         assert content['is_archived'] is False
858
         assert content['is_archived'] is False
859
         assert content['is_deleted'] is False
859
         assert content['is_deleted'] is False
862
         assert content['show_in_ui'] is True
862
         assert content['show_in_ui'] is True
863
         assert content['slug'] == 'new-fruit-salad'
863
         assert content['slug'] == 'new-fruit-salad'
864
         assert content['status'] == 'open'
864
         assert content['status'] == 'open'
865
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
865
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
866
         assert content['workspace_id'] == 3
866
         assert content['workspace_id'] == 3
867
 
867
 
868
     def test_api__get_workspace_content__ok_200__get_only_archived_root_content(self):  # nopep8
868
     def test_api__get_workspace_content__ok_200__get_only_archived_root_content(self):  # nopep8
889
         ).json_body   # nopep8
889
         ).json_body   # nopep8
890
         assert len(res) == 1
890
         assert len(res) == 1
891
         content = res[0]
891
         content = res[0]
892
-        assert content['content_type'] == 'html-documents'
892
+        assert content['content_type'] == 'html-document'
893
         assert content['content_id'] == 16
893
         assert content['content_id'] == 16
894
         assert content['is_archived'] is True
894
         assert content['is_archived'] is True
895
         assert content['is_deleted'] is False
895
         assert content['is_deleted'] is False
898
         assert content['show_in_ui'] is True
898
         assert content['show_in_ui'] is True
899
         assert content['slug'].startswith('fruit-salad')
899
         assert content['slug'].startswith('fruit-salad')
900
         assert content['status'] == 'open'
900
         assert content['status'] == 'open'
901
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
901
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
902
         assert content['workspace_id'] == 3
902
         assert content['workspace_id'] == 3
903
 
903
 
904
     def test_api__get_workspace_content__ok_200__get_only_deleted_root_content(self):  # nopep8
904
     def test_api__get_workspace_content__ok_200__get_only_deleted_root_content(self):  # nopep8
927
 
927
 
928
         assert len(res) == 1
928
         assert len(res) == 1
929
         content = res[0]
929
         content = res[0]
930
-        assert content['content_type'] == 'html-documents'
930
+        assert content['content_type'] == 'html-document'
931
         assert content['content_id'] == 17
931
         assert content['content_id'] == 17
932
         assert content['is_archived'] is False
932
         assert content['is_archived'] is False
933
         assert content['is_deleted'] is True
933
         assert content['is_deleted'] is True
936
         assert content['show_in_ui'] is True
936
         assert content['show_in_ui'] is True
937
         assert content['slug'].startswith('bad-fruit-salad')
937
         assert content['slug'].startswith('bad-fruit-salad')
938
         assert content['status'] == 'open'
938
         assert content['status'] == 'open'
939
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
939
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
940
         assert content['workspace_id'] == 3
940
         assert content['workspace_id'] == 3
941
 
941
 
942
     def test_api__get_workspace_content__ok_200__get_nothing_root_content(self):
942
     def test_api__get_workspace_content__ok_200__get_nothing_root_content(self):
1058
         assert content['show_in_ui'] is True
1058
         assert content['show_in_ui'] is True
1059
         assert content['slug'] == 'test-thread'
1059
         assert content['slug'] == 'test-thread'
1060
         assert content['status'] == 'open'
1060
         assert content['status'] == 'open'
1061
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1061
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1062
         assert content['workspace_id'] == 1
1062
         assert content['workspace_id'] == 1
1063
 
1063
 
1064
     def test_api__get_workspace_content__ok_200__get_all_filter_content_html_and_legacy_page(self):  # nopep8
1064
     def test_api__get_workspace_content__ok_200__get_all_filter_content_html_and_legacy_page(self):  # nopep8
1130
             'show_archived': 1,
1130
             'show_archived': 1,
1131
             'show_deleted': 1,
1131
             'show_deleted': 1,
1132
             'show_active': 1,
1132
             'show_active': 1,
1133
-            'content_type': 'html-documents',
1133
+            'content_type': 'html-document',
1134
         }
1134
         }
1135
         self.testapp.authorization = (
1135
         self.testapp.authorization = (
1136
             'Basic',
1136
             'Basic',
1146
         ).json_body
1146
         ).json_body
1147
         assert len(res) == 2
1147
         assert len(res) == 2
1148
         content = res[0]
1148
         content = res[0]
1149
-        assert content['content_type'] == 'html-documents'
1149
+        assert content['content_type'] == 'html-document'
1150
         assert content['content_id']
1150
         assert content['content_id']
1151
         assert content['is_archived'] is False
1151
         assert content['is_archived'] is False
1152
         assert content['is_deleted'] is False
1152
         assert content['is_deleted'] is False
1155
         assert content['show_in_ui'] is True
1155
         assert content['show_in_ui'] is True
1156
         assert content['slug'] == 'test-page'
1156
         assert content['slug'] == 'test-page'
1157
         assert content['status'] == 'open'
1157
         assert content['status'] == 'open'
1158
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1158
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1159
         assert content['workspace_id'] == 1
1159
         assert content['workspace_id'] == 1
1160
         content = res[1]
1160
         content = res[1]
1161
-        assert content['content_type'] == 'html-documents'
1161
+        assert content['content_type'] == 'html-document'
1162
         assert content['content_id']
1162
         assert content['content_id']
1163
         assert content['is_archived'] is False
1163
         assert content['is_archived'] is False
1164
         assert content['is_deleted'] is False
1164
         assert content['is_deleted'] is False
1167
         assert content['show_in_ui'] is True
1167
         assert content['show_in_ui'] is True
1168
         assert content['slug'] == 'test-html-page'
1168
         assert content['slug'] == 'test-html-page'
1169
         assert content['status'] == 'open'
1169
         assert content['status'] == 'open'
1170
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1170
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1171
         assert content['workspace_id'] == 1
1171
         assert content['workspace_id'] == 1
1172
         assert res[0]['content_id'] != res[1]['content_id']
1172
         assert res[0]['content_id'] != res[1]['content_id']
1173
 
1173
 
1196
         ).json_body   # nopep8
1196
         ).json_body   # nopep8
1197
         assert len(res) == 3
1197
         assert len(res) == 3
1198
         content = res[0]
1198
         content = res[0]
1199
-        assert content['content_type'] == 'html-documents'
1199
+        assert content['content_type'] == 'html-document'
1200
         assert content['content_id'] == 12
1200
         assert content['content_id'] == 12
1201
         assert content['is_archived'] is False
1201
         assert content['is_archived'] is False
1202
         assert content['is_deleted'] is False
1202
         assert content['is_deleted'] is False
1205
         assert content['show_in_ui'] is True
1205
         assert content['show_in_ui'] is True
1206
         assert content['slug'] == 'new-fruit-salad'
1206
         assert content['slug'] == 'new-fruit-salad'
1207
         assert content['status'] == 'open'
1207
         assert content['status'] == 'open'
1208
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1208
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1209
         assert content['workspace_id'] == 2
1209
         assert content['workspace_id'] == 2
1210
 
1210
 
1211
         content = res[1]
1211
         content = res[1]
1212
-        assert content['content_type'] == 'html-documents'
1212
+        assert content['content_type'] == 'html-document'
1213
         assert content['content_id'] == 13
1213
         assert content['content_id'] == 13
1214
         assert content['is_archived'] is True
1214
         assert content['is_archived'] is True
1215
         assert content['is_deleted'] is False
1215
         assert content['is_deleted'] is False
1218
         assert content['show_in_ui'] is True
1218
         assert content['show_in_ui'] is True
1219
         assert content['slug'].startswith('fruit-salad')
1219
         assert content['slug'].startswith('fruit-salad')
1220
         assert content['status'] == 'open'
1220
         assert content['status'] == 'open'
1221
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1221
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1222
         assert content['workspace_id'] == 2
1222
         assert content['workspace_id'] == 2
1223
 
1223
 
1224
         content = res[2]
1224
         content = res[2]
1225
-        assert content['content_type'] == 'html-documents'
1225
+        assert content['content_type'] == 'html-document'
1226
         assert content['content_id'] == 14
1226
         assert content['content_id'] == 14
1227
         assert content['is_archived'] is False
1227
         assert content['is_archived'] is False
1228
         assert content['is_deleted'] is True
1228
         assert content['is_deleted'] is True
1231
         assert content['show_in_ui'] is True
1231
         assert content['show_in_ui'] is True
1232
         assert content['slug'].startswith('bad-fruit-salad')
1232
         assert content['slug'].startswith('bad-fruit-salad')
1233
         assert content['status'] == 'open'
1233
         assert content['status'] == 'open'
1234
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1234
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1235
         assert content['workspace_id'] == 2
1235
         assert content['workspace_id'] == 2
1236
 
1236
 
1237
     def test_api__get_workspace_content__ok_200__get_only_active_folder_content(self):  # nopep8
1237
     def test_api__get_workspace_content__ok_200__get_only_active_folder_content(self):  # nopep8
1267
         assert content['show_in_ui'] is True
1267
         assert content['show_in_ui'] is True
1268
         assert content['slug'] == 'new-fruit-salad'
1268
         assert content['slug'] == 'new-fruit-salad'
1269
         assert content['status'] == 'open'
1269
         assert content['status'] == 'open'
1270
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1270
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1271
         assert content['workspace_id'] == 2
1271
         assert content['workspace_id'] == 2
1272
 
1272
 
1273
     def test_api__get_workspace_content__ok_200__get_only_archived_folder_content(self):  # nopep8
1273
     def test_api__get_workspace_content__ok_200__get_only_archived_folder_content(self):  # nopep8
1294
         ).json_body   # nopep8
1294
         ).json_body   # nopep8
1295
         assert len(res) == 1
1295
         assert len(res) == 1
1296
         content = res[0]
1296
         content = res[0]
1297
-        assert content['content_type'] == 'html-documents'
1297
+        assert content['content_type'] == 'html-document'
1298
         assert content['content_id'] == 13
1298
         assert content['content_id'] == 13
1299
         assert content['is_archived'] is True
1299
         assert content['is_archived'] is True
1300
         assert content['is_deleted'] is False
1300
         assert content['is_deleted'] is False
1303
         assert content['show_in_ui'] is True
1303
         assert content['show_in_ui'] is True
1304
         assert content['slug'].startswith('fruit-salad')
1304
         assert content['slug'].startswith('fruit-salad')
1305
         assert content['status'] == 'open'
1305
         assert content['status'] == 'open'
1306
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1306
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1307
         assert content['workspace_id'] == 2
1307
         assert content['workspace_id'] == 2
1308
 
1308
 
1309
     def test_api__get_workspace_content__ok_200__get_only_deleted_folder_content(self):  # nopep8
1309
     def test_api__get_workspace_content__ok_200__get_only_deleted_folder_content(self):  # nopep8
1331
 
1331
 
1332
         assert len(res) == 1
1332
         assert len(res) == 1
1333
         content = res[0]
1333
         content = res[0]
1334
-        assert content['content_type'] == 'html-documents'
1334
+        assert content['content_type'] == 'html-document'
1335
         assert content['content_id'] == 14
1335
         assert content['content_id'] == 14
1336
         assert content['is_archived'] is False
1336
         assert content['is_archived'] is False
1337
         assert content['is_deleted'] is True
1337
         assert content['is_deleted'] is True
1340
         assert content['show_in_ui'] is True
1340
         assert content['show_in_ui'] is True
1341
         assert content['slug'].startswith('bad-fruit-salad')
1341
         assert content['slug'].startswith('bad-fruit-salad')
1342
         assert content['status'] == 'open'
1342
         assert content['status'] == 'open'
1343
-        assert set(content['sub_content_types']) == {'thread', 'html-documents', 'folder', 'file'}  # nopep8
1343
+        assert set(content['sub_content_types']) == {'thread', 'html-document', 'folder', 'file'}  # nopep8
1344
         assert content['workspace_id'] == 2
1344
         assert content['workspace_id'] == 2
1345
 
1345
 
1346
     def test_api__get_workspace_content__ok_200__get_nothing_folder_content(self):  # nopep8
1346
     def test_api__get_workspace_content__ok_200__get_nothing_folder_content(self):  # nopep8

+ 2 - 2
backend/tracim_backend/views/core_api/schemas.py View File

645
         description='Title of the content to create'
645
         description='Title of the content to create'
646
     )
646
     )
647
     content_type = marshmallow.fields.String(
647
     content_type = marshmallow.fields.String(
648
-        example='html-documents',
648
+        example='html-document',
649
         validate=OneOf(ContentType.allowed_types_for_folding()),  # nopep8
649
         validate=OneOf(ContentType.allowed_types_for_folding()),  # nopep8
650
     )
650
     )
651
     parent_id = marshmallow.fields.Integer(
651
     parent_id = marshmallow.fields.Integer(
677
     )
677
     )
678
     label = marshmallow.fields.Str(example='Intervention Report 12')
678
     label = marshmallow.fields.Str(example='Intervention Report 12')
679
     content_type = marshmallow.fields.Str(
679
     content_type = marshmallow.fields.Str(
680
-        example='html-documents',
680
+        example='html-document',
681
         validate=OneOf(ContentType.allowed_types()),
681
         validate=OneOf(ContentType.allowed_types()),
682
     )
682
     )
683
     sub_content_types = marshmallow.fields.List(
683
     sub_content_types = marshmallow.fields.List(

+ 1 - 1
frontend/src/css/Workspace.styl View File

8
     &__button
8
     &__button
9
       display flex
9
       display flex
10
       justify-content flex-end
10
       justify-content flex-end
11
-      margin 50px 15px 0 0
11
+      margin 45px 15px 45px 0
12
       width 100%
12
       width 100%
13
       &__btnaddworkspace
13
       &__btnaddworkspace
14
         margin-bottom 50px
14
         margin-bottom 50px