Pārlūkot izejas kodu

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

Skylsmoi 6 gadus atpakaļ
vecāks
revīzija
ccd1d9b6c0

+ 4 - 4
backend/tracim_backend/models/applications.py Parādīt failu

@@ -50,7 +50,7 @@ calendar = Application(
50 50
 
51 51
 thread = Application(
52 52
     label='Threads',
53
-    slug='contents/threads',
53
+    slug='contents/thread',
54 54
     fa_icon='comments-o',
55 55
     hexcolor='#ad4cf9',
56 56
     is_active=True,
@@ -61,7 +61,7 @@ thread = Application(
61 61
 
62 62
 _file = Application(
63 63
     label='Files',
64
-    slug='contents/files',
64
+    slug='contents/file',
65 65
     fa_icon='paperclip',
66 66
     hexcolor='#FF9900',
67 67
     is_active=True,
@@ -81,12 +81,12 @@ markdownpluspage = Application(
81 81
 
82 82
 html_documents = Application(
83 83
     label='Text Documents',  # TODO - G.M - 24-05-2018 - Check label
84
-    slug='contents/html-documents',
84
+    slug='contents/html-document',
85 85
     fa_icon='file-text-o',
86 86
     hexcolor='#3f52e3',
87 87
     is_active=True,
88 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 91
 # TODO - G.M - 08-06-2018 - This is hardcoded lists of app, make this dynamic.
92 92
 # List of applications

+ 1 - 1
backend/tracim_backend/models/contents.py Parādīt failu

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

+ 1 - 1
backend/tracim_backend/tests/__init__.py Parādīt failu

@@ -50,7 +50,7 @@ def set_html_document_slug_to_legacy(session_factory) -> None:
50 50
     )
51 51
     content_query = dbsession.query(ContentRevisionRO).filter(ContentRevisionRO.type == 'page').filter(ContentRevisionRO.content_id == 6)  # nopep8
52 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 54
     html_documents_query.update({ContentRevisionRO.type: 'page'})
55 55
     transaction.commit()
56 56
     assert content_query.count() > 0

+ 9 - 9
backend/tracim_backend/tests/functional/test_contents.py Parādīt failu

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

+ 4 - 4
backend/tracim_backend/tests/functional/test_system.py Parādīt failu

@@ -25,7 +25,7 @@ class TestApplicationEndpoint(FunctionalTest):
25 25
         res = res.json_body
26 26
         application = res[0]
27 27
         assert application['label'] == "Text Documents"
28
-        assert application['slug'] == 'contents/html-documents'
28
+        assert application['slug'] == 'contents/html-document'
29 29
         assert application['fa_icon'] == 'file-text-o'
30 30
         assert application['hexcolor'] == '#3f52e3'
31 31
         assert application['is_active'] is True
@@ -39,14 +39,14 @@ class TestApplicationEndpoint(FunctionalTest):
39 39
         assert 'config' in application
40 40
         application = res[2]
41 41
         assert application['label'] == "Files"
42
-        assert application['slug'] == 'contents/files'
42
+        assert application['slug'] == 'contents/file'
43 43
         assert application['fa_icon'] == 'paperclip'
44 44
         assert application['hexcolor'] == '#FF9900'
45 45
         assert application['is_active'] is True
46 46
         assert 'config' in application
47 47
         application = res[3]
48 48
         assert application['label'] == "Threads"
49
-        assert application['slug'] == 'contents/threads'
49
+        assert application['slug'] == 'contents/thread'
50 50
         assert application['fa_icon'] == 'comments-o'
51 51
         assert application['hexcolor'] == '#ad4cf9'
52 52
         assert application['is_active'] is True
@@ -124,7 +124,7 @@ class TestContentsTypesEndpoint(FunctionalTest):
124 124
         assert len(content_type['available_statuses']) == 4
125 125
 
126 126
         content_type = res[3]
127
-        assert content_type['slug'] == 'html-documents'
127
+        assert content_type['slug'] == 'html-document'
128 128
         assert content_type['fa_icon'] == 'file-text-o'
129 129
         assert content_type['hexcolor'] == '#3f52e3'
130 130
         assert content_type['label'] == 'Text Document'

+ 4 - 4
backend/tracim_backend/tests/functional/test_user.py Parādīt failu

@@ -762,9 +762,9 @@ class TestUserWorkspaceEndpoint(FunctionalTest):
762 762
         assert sidebar_entry['fa_icon'] == "th"
763 763
 
764 764
         sidebar_entry = workspace['sidebar_entries'][2]
765
-        assert sidebar_entry['slug'] == 'contents/html-documents'
765
+        assert sidebar_entry['slug'] == 'contents/html-document'
766 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 768
         assert sidebar_entry['hexcolor'] == "#3f52e3"
769 769
         assert sidebar_entry['fa_icon'] == "file-text-o"
770 770
 
@@ -776,14 +776,14 @@ class TestUserWorkspaceEndpoint(FunctionalTest):
776 776
         assert sidebar_entry['fa_icon'] == "file-code-o"
777 777
 
778 778
         sidebar_entry = workspace['sidebar_entries'][4]
779
-        assert sidebar_entry['slug'] == 'contents/files'
779
+        assert sidebar_entry['slug'] == 'contents/file'
780 780
         assert sidebar_entry['label'] == 'Files'
781 781
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=file"  # nopep8
782 782
         assert sidebar_entry['hexcolor'] == "#FF9900"
783 783
         assert sidebar_entry['fa_icon'] == "paperclip"
784 784
 
785 785
         sidebar_entry = workspace['sidebar_entries'][5]
786
-        assert sidebar_entry['slug'] == 'contents/threads'
786
+        assert sidebar_entry['slug'] == 'contents/thread'
787 787
         assert sidebar_entry['label'] == 'Threads'
788 788
         assert sidebar_entry['route'] == "/#/workspaces/1/contents?type=thread"  # nopep8
789 789
         assert sidebar_entry['hexcolor'] == "#ad4cf9"

+ 46 - 46
backend/tracim_backend/tests/functional/test_workspaces.py Parādīt failu

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

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

+ 1 - 1
frontend/src/css/Workspace.styl Parādīt failu

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