@raketa-cloud/admin 0.0.52 → 0.0.53
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.
- package/package.json +1 -1
- package/src/HonoAdapter.js +5 -0
- package/src/handlers/DashboardsHandler.js +9 -0
- package/src/routeStandard.js +17 -0
- package/src/setupAuthentication.js +1 -1
- package/src/tests/handlers/DashboardsHandler.test/index.test.js +17 -0
- package/src/views/articles/_shared/_title.ejs +8 -0
- package/src/views/articles/index.ejs +4 -2
- package/src/views/articles/show.ejs +2 -1
- package/src/views/dashboard/index.ejs +5 -0
- package/src/views/events/_shared/_title.ejs +8 -0
- package/src/views/events/index.ejs +4 -2
- package/src/views/events/show.ejs +2 -1
- package/src/views/pages/_shared/_title.ejs +8 -0
- package/src/views/pages/index.ejs +4 -2
- package/src/views/pages/show.ejs +2 -1
package/package.json
CHANGED
package/src/HonoAdapter.js
CHANGED
|
@@ -43,6 +43,10 @@ export default class HonoAdapter extends Adapter {
|
|
|
43
43
|
cookie_key: "cms-starter-slim",
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
router.get("/", (c) => {
|
|
48
|
+
return c.redirect("/en");
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
setGlobalContext(globalCtx) {
|
|
@@ -116,6 +120,7 @@ export default class HonoAdapter extends Adapter {
|
|
|
116
120
|
},
|
|
117
121
|
resourceConfig: resourceConfig,
|
|
118
122
|
adminJwt: ctx.authentication.token,
|
|
123
|
+
remoteConfig: { ...this.globalConfig.remoteConfig },
|
|
119
124
|
};
|
|
120
125
|
|
|
121
126
|
ctx.logger.info(
|
package/src/routeStandard.js
CHANGED
|
@@ -5,8 +5,25 @@ import routeArticlesModule from "./routeArticlesModule";
|
|
|
5
5
|
import routeEventsModule from "./routeEventsModule";
|
|
6
6
|
import RedirectsHandler from "./handlers/RedirectsHandler";
|
|
7
7
|
import TagsHandler from "./handlers/TagsHandler";
|
|
8
|
+
import DashboardsHandler from "./handlers/DashboardsHandler";
|
|
8
9
|
|
|
9
10
|
function routeStandard(adapter) {
|
|
11
|
+
adapter.routeCollection(
|
|
12
|
+
[
|
|
13
|
+
[
|
|
14
|
+
"GET",
|
|
15
|
+
"",
|
|
16
|
+
"dashboard",
|
|
17
|
+
"dashboard",
|
|
18
|
+
"index",
|
|
19
|
+
DashboardsHandler.index,
|
|
20
|
+
undefined,
|
|
21
|
+
undefined,
|
|
22
|
+
],
|
|
23
|
+
],
|
|
24
|
+
{}
|
|
25
|
+
);
|
|
26
|
+
|
|
10
27
|
routeCollection(adapter, "redirects", RedirectsHandler);
|
|
11
28
|
routeCollection(adapter, "tags", TagsHandler);
|
|
12
29
|
routeSettings(adapter);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DashboardsHandler from "../../../handlers/DashboardsHandler";
|
|
2
|
+
|
|
3
|
+
describe("Redirects", () => {
|
|
4
|
+
function buildCtx() {
|
|
5
|
+
return {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
test("index", async () => {
|
|
9
|
+
const ctx = buildCtx();
|
|
10
|
+
|
|
11
|
+
const result = await DashboardsHandler.index(ctx);
|
|
12
|
+
|
|
13
|
+
expect(result).toEqual({
|
|
14
|
+
assigns: {},
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<h1 class="heading-1"><%= resource.title %></h1>
|
|
3
|
+
<% if (resource.visibility !== "private") { %>
|
|
4
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.articleType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
5
|
+
<%= _context.remoteConfig.resourcePath(resource, _context.resourceConfig.articleType, _context.locale) %>
|
|
6
|
+
</a>
|
|
7
|
+
<% } %>
|
|
8
|
+
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
36
|
<span class="bg-orange-100 chip text-orange-700 dark:bg-orange-900/50 dark:text-orange-300"><%= item.revisionsCount !== 1 ? `${item.revisionsCount} open revisions` : 'Open revision' %></span>
|
|
37
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.articleType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.articleType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
3
|
<div class="flex items-center gap-4">
|
|
4
|
-
|
|
4
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
5
|
+
|
|
5
6
|
<div class="flex flex-wrap items-center gap-1">
|
|
6
7
|
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
8
|
<% const { name, _code, flag} = _context.locales[key] %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<h1 class="heading-1"><%= resource.title %></h1>
|
|
3
|
+
<% if (resource.visibility !== "private") { %>
|
|
4
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.eventType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
5
|
+
<%= _context.remoteConfig.resourcePath(resource, _context.resourceConfig.eventType, _context.locale) %>
|
|
6
|
+
</a>
|
|
7
|
+
<% } %>
|
|
8
|
+
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
36
|
<span class="bg-orange-100 chip text-orange-700 dark:bg-orange-900/50 dark:text-orange-300"><%= item.revisionsCount !== 1 ? `${item.revisionsCount} open revisions` : 'Open revision' %></span>
|
|
37
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.eventType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.eventType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
3
|
<div class="flex items-center gap-4">
|
|
4
|
-
|
|
4
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
5
|
+
|
|
5
6
|
<div class="flex flex-wrap items-center gap-1">
|
|
6
7
|
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
8
|
<% const { name, _code, flag} = _context.locales[key] %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<h1 class="heading-1"><%= resource.title %></h1>
|
|
3
|
+
<% if (resource.visibility !== "private") { %>
|
|
4
|
+
<a href="<%= _context.remoteConfig.resourceUrl(resource, _context.resourceConfig.pageType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
5
|
+
<%= _context.remoteConfig.resourcePath(resource, _context.resourceConfig.pageType, _context.locale) %>
|
|
6
|
+
</a>
|
|
7
|
+
<% } %>
|
|
8
|
+
</div>
|
|
@@ -36,11 +36,13 @@
|
|
|
36
36
|
<span class="bg-orange-100 chip text-orange-700 dark:bg-orange-900/50 dark:text-orange-300"><%= item.revisionsCount !== 1 ? `${item.revisionsCount} open revisions` : 'Open revision' %></span>
|
|
37
37
|
<% } %>
|
|
38
38
|
|
|
39
|
+
<% if (item.visibility !== "private") { %>
|
|
39
40
|
<div class="mt-1">
|
|
40
|
-
<a href="<%=
|
|
41
|
-
|
|
41
|
+
<a href="<%= _context.remoteConfig.resourceUrl(item, _context.resourceConfig.pageType, _context.locale) %>" class="body-3 text-raketa-foreground/50" target="_blank">
|
|
42
|
+
<%= _context.remoteConfig.resourcePath(item, _context.resourceConfig.pageType, _context.locale) %>
|
|
42
43
|
</a>
|
|
43
44
|
</div>
|
|
45
|
+
<% } %>
|
|
44
46
|
</td>
|
|
45
47
|
|
|
46
48
|
<td>
|
package/src/views/pages/show.ejs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<div class="page-wrapper">
|
|
2
2
|
<div class="page-title">
|
|
3
3
|
<div class="flex items-center gap-4">
|
|
4
|
-
|
|
4
|
+
<%- render_partial('./_shared/_title.ejs') %>
|
|
5
|
+
|
|
5
6
|
<div class="flex flex-wrap items-center gap-1">
|
|
6
7
|
<% Object.keys(_context.locales).forEach(key => { %>
|
|
7
8
|
<% const { name, _code, flag} = _context.locales[key] %>
|