@raketa-cloud/admin 1.10.12 → 1.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/application.css +699 -244
  2. package/package.json +4 -3
  3. package/src/cloud/Comments.js +88 -0
  4. package/src/cloud/Editors.js +20 -0
  5. package/src/cloud/documents/commentsDocuments.js +103 -0
  6. package/src/cloud/documents/editorsDocuments.js +27 -0
  7. package/src/handlers/resources/DiscussionsHandler.js +203 -0
  8. package/src/handlers/resources/HistoryHandler.js +7 -5
  9. package/src/handlers/resources/ResourcesHandler.js +6 -5
  10. package/src/helpers/commentMarkdown.js +94 -0
  11. package/src/helpers/fetchCommentCounts.js +14 -0
  12. package/src/helpers/historyUtils.js +11 -0
  13. package/src/helpers/utils.js +24 -0
  14. package/src/index.js +1 -0
  15. package/src/routeResourceModule.js +42 -0
  16. package/src/setupCloud.js +4 -0
  17. package/src/styles/application.css +56 -0
  18. package/src/tests/cloud/Comments.test.js +141 -0
  19. package/src/tests/cloud/Editors.test.js +47 -0
  20. package/src/tests/handlers/resources/DiscussionsHandler.test/create.test.js +108 -0
  21. package/src/tests/handlers/resources/DiscussionsHandler.test/destroy.test.js +55 -0
  22. package/src/tests/handlers/resources/DiscussionsHandler.test/index.test.js +195 -0
  23. package/src/tests/handlers/resources/DiscussionsHandler.test/update.test.js +87 -0
  24. package/src/tests/handlers/resources/HistoryHandler.test/index.test.js +9 -0
  25. package/src/tests/handlers/resources/ResourcesHandler.test/show.test.js +33 -0
  26. package/src/tests/handlers/resources/ResourcesHandler.test/show_reports.test.js +3 -0
  27. package/src/tests/helpers/commentMarkdown.test.js +166 -0
  28. package/src/tests/helpers/fetchCommentCounts.test.js +42 -0
  29. package/src/tests/helpers/historyUtils.test.js +26 -0
  30. package/src/tests/helpers/utils.test.js +21 -0
  31. package/src/tests/routeResourceModule.test.js +82 -2
  32. package/src/tests/setupCloud.test.js +4 -0
  33. package/src/tests/views/discussions.test.js +519 -0
  34. package/src/views/resources/_shared/_history_toolbar.ejs +10 -0
  35. package/src/views/resources/_shared/_tabs.ejs +21 -0
  36. package/src/views/resources/_shared/_toolbar.ejs +1 -1
  37. package/src/views/resources/discussions/_avatar.ejs +13 -0
  38. package/src/views/resources/discussions/_discussion_tabs.ejs +22 -0
  39. package/src/views/resources/discussions/index.ejs +729 -0
  40. package/src/views/resources/show.ejs +17 -0
@@ -4,6 +4,8 @@
4
4
  <%- render_partial('./_shared/_toolbar.ejs', { render_partial }) %>
5
5
  </div>
6
6
 
7
+ <%- render_partial('./_shared/_tabs.ejs', { active: 'overview' }) %>
8
+
7
9
  <%
8
10
  const openedRevisions = []
9
11
  const scheduledRevisions = []
@@ -65,6 +67,9 @@
65
67
  <th>Title</th>
66
68
  <th>Created by</th>
67
69
  <th>Last change</th>
70
+ <% if (_context.resourceConfig.comments) { %>
71
+ <th>Comments</th>
72
+ <% } %>
68
73
  <th>&nbsp;</th>
69
74
  </tr>
70
75
  </thead>
@@ -102,6 +107,18 @@
102
107
  </div>
103
108
  </td>
104
109
 
110
+ <% if (_context.resourceConfig.comments) { %>
111
+ <td class="whitespace-nowrap">
112
+ <% const commentsCount = (locals.commentCounts || {})[revision.id] || 0; %>
113
+ <a href="<%= `/${_context.locale}/${_context.resourceConfig.resourceTypePlural}/${resource.id}/discussions/${revision.id}` %>" class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-raketa-primary/20 bg-raketa-primary/5 hover:bg-raketa-primary/10 text-raketa-primary font-medium text-[11px] transition-colors cursor-pointer" title="Open the discussion of the revision">
114
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-3">
115
+ <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z" />
116
+ </svg>
117
+ <%= commentsCount === 0 ? "No comments" : `${commentsCount} ${commentsCount === 1 ? "comment" : "comments"}` %>
118
+ </a>
119
+ </td>
120
+ <% } %>
121
+
105
122
  <td class="whitespace-nowrap">
106
123
  <%- render_partial('./_shared/_revision_toolbar.ejs', { revision }) %>
107
124
  </td>