@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
@@ -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(
@@ -0,0 +1,9 @@
1
+ const index = async (_ctx) => {
2
+ return {
3
+ assigns: {},
4
+ };
5
+ };
6
+
7
+ export default {
8
+ index,
9
+ };
@@ -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);
@@ -56,7 +56,7 @@ const setupAuthentication = (app, opts) => {
56
56
  secure: !isLocalhost,
57
57
  });
58
58
 
59
- return c.redirect("/en/pages");
59
+ return c.redirect("/en");
60
60
  });
61
61
 
62
62
  app.get("/logout", (c) => {
@@ -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="<%= `https://localhost:3000/${_context.locale}/${item.slug}` %>" class="body-3 text-raketa-foreground/50" target="_blank">
41
- /<%= item.slug %>
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
- <h1 class="heading-1"><%= resource.title %></h1>
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,5 @@
1
+ <div class="page-wrapper">
2
+ <div class="page-title">
3
+ <h1 class="heading-1">Dashboard</h1>
4
+ </div>
5
+ </div>
@@ -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="<%= `https://localhost:3000/${_context.locale}/${item.slug}` %>" class="body-3 text-raketa-foreground/50" target="_blank">
41
- /<%= item.slug %>
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
- <h1 class="heading-1"><%= resource.title %></h1>
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="<%= `https://localhost:3000/${_context.locale}/${item.slug}` %>" class="body-3 text-raketa-foreground/50" target="_blank">
41
- /<%= item.slug %>
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>
@@ -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
- <h1 class="heading-1"><%= resource.title %></h1>
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] %>