@raketa-cloud/admin 1.10.3 → 1.10.5

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": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "main": "src/index.js",
5
5
  "files": [
6
6
  "src/",
@@ -23,13 +23,14 @@
23
23
  "@babel/preset-env": "7.29.0",
24
24
  "@babel/preset-typescript": "7.28.5",
25
25
  "@repo/typescript-config": "*",
26
- "@tailwindcss/forms": "0.5.7",
27
- "@tailwindcss/typography": "0.5.13",
26
+ "@tailwindcss/cli": "4.3.3",
27
+ "@tailwindcss/forms": "0.5.11",
28
+ "@tailwindcss/typography": "0.5.20",
28
29
  "@types/node": "24.10.1",
29
- "babel-jest": "29.7.0",
30
- "jest": "29.7.0",
31
- "jest-environment-node": "29.7.0",
32
- "tailwindcss": "3.4.4",
30
+ "babel-jest": "30.5.2",
31
+ "jest": "30.5.2",
32
+ "jest-environment-node": "30.5.2",
33
+ "tailwindcss": "4.3.3",
33
34
  "typescript": "5.9.3"
34
35
  },
35
36
  "dependencies": {
@@ -24,26 +24,21 @@ export const buildResourceUrl = (resource, globalConfig) => {
24
24
  return `/${locale}/${route}/${id}`;
25
25
  };
26
26
 
27
- export const hasUnattachedKeys = (task) => {
28
- if (!task) return false;
27
+ export const unattachedKeys = (task) => {
28
+ const keys = task?.lokaliseWorkflow?.settings?.unattached_keys;
29
+ const values = keys?.names || keys?.ids;
29
30
 
30
- const unattachedKeys = task.lokaliseWorkflow?.settings?.unattached_keys;
31
- const ids = unattachedKeys?.ids;
31
+ if (Array.isArray(values)) return values;
32
32
 
33
- if (Array.isArray(ids)) {
34
- return ids.length > 0;
35
- }
36
-
37
- return Boolean(ids);
33
+ return values ? [values] : [];
38
34
  };
39
35
 
40
- export const unattachedKeyIds = (task) => {
41
- const unattachedKeys = task?.lokaliseWorkflow?.settings?.unattached_keys;
42
- const ids = unattachedKeys?.ids;
36
+ export const hasUnattachedKeys = (task) => unattachedKeys(task).length > 0;
43
37
 
44
- if (Array.isArray(ids)) {
45
- return ids.join(", ");
46
- }
38
+ export const unattachedKeyUrl = (task, key) => {
39
+ const keys = task?.lokaliseWorkflow?.settings?.unattached_keys;
40
+
41
+ if (!keys?.names || !keys.url) return null;
47
42
 
48
- return ids ? String(ids) : "";
43
+ return `${keys.url}${encodeURIComponent(key)}`;
49
44
  };
@@ -1,6 +1,28 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import "tailwindcss";
2
+ @plugin "@tailwindcss/forms";
3
+ @plugin "@tailwindcss/typography";
4
+ @source "../**/*.{html,js,ejs}";
5
+ @source "../../../apps/**/*.{html,js,ejs}";
6
+
7
+ @theme {
8
+ --color-raketa-background: rgb(var(--background));
9
+ --color-raketa-foreground: rgb(var(--foreground));
10
+ --color-raketa-primary: rgb(var(--primary));
11
+ --color-raketa-primary-light: rgb(var(--primary-light));
12
+ --color-raketa-primary-dark: rgb(var(--primary-dark));
13
+ --color-mono-purple-25: #f0f0f8;
14
+ --color-mono-purple-100: #9d9dd2;
15
+ --color-mono-purple-300: #6e6eb2;
16
+ --color-mono-25: #eaeaea;
17
+ --color-mono-50: #d0d1d2;
18
+ --color-mono-100: #f6f6f6;
19
+ --color-mono-200: #b7b7b7;
20
+ --color-mono-300: #737373;
21
+ --color-mono-800: #33333c;
22
+ --color-mono-850: #232324;
23
+ --color-mono-900: #1a1a1a;
24
+ --color-mono-950: #1c1c1e;
25
+ }
4
26
 
5
27
  :root {
6
28
  --background: 255, 255, 255;
@@ -40,7 +62,7 @@ body {
40
62
  }
41
63
 
42
64
  .help {
43
- @apply bg-orange-50 body-2 p-4 rounded sticky top-6 dark:bg-raketa-primary/20;
65
+ @apply bg-orange-50 leading-[1.5] text-sm p-4 rounded sticky top-6 dark:bg-raketa-primary/20;
44
66
 
45
67
  .heading-3 {
46
68
  @apply text-raketa-foreground;
@@ -228,7 +250,7 @@ body {
228
250
 
229
251
  /* Tables */
230
252
  .data-grid {
231
- @apply text-sm text-left body-1 w-full text-raketa-foreground/60 rounded-t overflow-hidden;
253
+ @apply text-sm text-left leading-[1.5] text-base w-full text-raketa-foreground/60 rounded-t overflow-hidden;
232
254
 
233
255
  th,
234
256
  td {
@@ -2,7 +2,8 @@ import {
2
2
  workflowsMap,
3
3
  buildResourceUrl,
4
4
  hasUnattachedKeys,
5
- unattachedKeyIds,
5
+ unattachedKeys,
6
+ unattachedKeyUrl,
6
7
  } from "../../helpers/content_tasks_helper";
7
8
 
8
9
  describe("content_tasks_helper", () => {
@@ -114,46 +115,89 @@ describe("content_tasks_helper", () => {
114
115
  ).toBe(false);
115
116
  });
116
117
 
117
- test("returns true when task is in progress and has unattached key ids", () => {
118
+ test("returns true when the task has unattached key ids or names", () => {
118
119
  expect(
119
120
  hasUnattachedKeys({
120
- completedAt: null,
121
- failedAt: null,
122
121
  lokaliseWorkflow: {
123
122
  settings: { unattached_keys: { ids: [101, 102] } },
124
123
  },
125
124
  }),
126
125
  ).toBe(true);
126
+ expect(
127
+ hasUnattachedKeys({
128
+ lokaliseWorkflow: {
129
+ settings: { unattached_keys: { names: ["key_a"] } },
130
+ },
131
+ }),
132
+ ).toBe(true);
127
133
  });
128
134
  });
129
135
 
130
- describe("unattachedKeyIds", () => {
131
- test("returns empty string when no unattached keys exist", () => {
132
- expect(unattachedKeyIds(null)).toBe("");
133
- expect(unattachedKeyIds({})).toBe("");
134
- expect(
135
- unattachedKeyIds({
136
- lokaliseWorkflow: { settings: { unattached_keys: {} } },
137
- }),
138
- ).toBe("");
136
+ describe("unattachedKeys", () => {
137
+ test("returns an empty array when no unattached keys exist", () => {
138
+ expect(unattachedKeys(null)).toEqual([]);
139
+ expect(unattachedKeys({})).toEqual([]);
139
140
  });
140
141
 
141
- test("returns comma separated string of ids", () => {
142
+ test("prefers names and falls back to ids", () => {
142
143
  expect(
143
- unattachedKeyIds({
144
+ unattachedKeys({
144
145
  lokaliseWorkflow: {
145
- settings: { unattached_keys: { ids: [101, 102, 103] } },
146
+ settings: {
147
+ unattached_keys: { names: ["key_a", "key_b"], ids: [101, 102] },
148
+ },
146
149
  },
147
150
  }),
148
- ).toBe("101, 102, 103");
149
-
151
+ ).toEqual(["key_a", "key_b"]);
150
152
  expect(
151
- unattachedKeyIds({
153
+ unattachedKeys({
152
154
  lokaliseWorkflow: {
153
- settings: { unattached_keys: { ids: ["key_a", "key_b"] } },
155
+ settings: { unattached_keys: { ids: [101, 102] } },
154
156
  },
155
157
  }),
156
- ).toBe("key_a, key_b");
158
+ ).toEqual([101, 102]);
159
+ });
160
+ });
161
+
162
+ describe("unattachedKeyUrl", () => {
163
+ const task = {
164
+ lokaliseWorkflow: {
165
+ settings: {
166
+ unattached_keys: {
167
+ names: ["key one"],
168
+ url: "https://app.lokalise.com/project/123/?search=",
169
+ },
170
+ },
171
+ },
172
+ };
173
+
174
+ test("builds a Lokalise URL for a key name", () => {
175
+ expect(unattachedKeyUrl(task, "key one")).toBe(
176
+ "https://app.lokalise.com/project/123/?search=key%20one",
177
+ );
178
+ });
179
+
180
+ test("returns null for legacy ids or when the URL is missing", () => {
181
+ expect(
182
+ unattachedKeyUrl(
183
+ {
184
+ lokaliseWorkflow: {
185
+ settings: { unattached_keys: { ids: [101] } },
186
+ },
187
+ },
188
+ 101,
189
+ ),
190
+ ).toBeNull();
191
+ expect(
192
+ unattachedKeyUrl(
193
+ {
194
+ lokaliseWorkflow: {
195
+ settings: { unattached_keys: { names: ["key_a"] } },
196
+ },
197
+ },
198
+ "key_a",
199
+ ),
200
+ ).toBeNull();
157
201
  });
158
202
  });
159
203
  });
@@ -1,6 +1,6 @@
1
1
  <% if (tasks.length > 0) { %>
2
2
  <table class="data-grid alt">
3
- <thead>
3
+ <thead class="whitespace-nowrap">
4
4
  <tr>
5
5
  <% if (showAllDetails) { %>
6
6
  <th>Resource</th>
@@ -26,7 +26,7 @@
26
26
  <td class="w-1/3">
27
27
  <% if (resources && resources.length > 0) { %>
28
28
  <% resources.forEach((resource, idx) => { %>
29
- <div class="<%= idx > 0 ? 'mt-2' : '' %>">
29
+ <div class="body-3 <%= idx > 0 ? 'mt-2' : '' %>">
30
30
 
31
31
  <a href="<%= content_tasks.buildResourceUrl(resource, _context.globalConfig) %>" target="_blank" class="btn-text">
32
32
  <div class="flex gap-1 items-center">
@@ -46,13 +46,13 @@
46
46
  </div>
47
47
  <% }) %>
48
48
  <% } else { %>
49
- <span class="text-raketa-foreground/50">—</span>
49
+ <span class="body-3 text-raketa-foreground/50">—</span>
50
50
  <% } %>
51
51
  </td>
52
52
 
53
53
  <td>
54
54
  <% if (resources[0]?.resourceType) { %>
55
- <%= Inflector.humanize(Inflector.capitalize(resources[0].resourceType)) %>
55
+ <span class="body-3"><%= Inflector.humanize(Inflector.capitalize(resources[0].resourceType)) %></span>
56
56
  <% } else { %>
57
57
  <span class="text-raketa-foreground/50">—</span>
58
58
  <% } %>
@@ -60,18 +60,40 @@
60
60
  <% } %>
61
61
 
62
62
  <td>
63
- <span class="body-2">
63
+ <span class="body-3">
64
64
  <%= content_tasks.workflowsMap(task.workflow) %>
65
65
  </span>
66
66
 
67
67
  <% if (isMarked) { %>
68
- <div class="body-3 text-raketa-foreground/50">
69
- <%= content_tasks.unattachedKeyIds(task) %>
70
- </div>
68
+ <details class="body-3 text-raketa-foreground/50">
69
+ <summary class="cursor-pointer whitespace-nowrap" onclick="event.preventDefault(); this.parentElement.nextElementSibling.showModal()">Unattached keys</summary>
70
+ </details>
71
+
72
+ <dialog class="w-full max-w-2xl rounded-lg bg-raketa-background p-0 text-raketa-foreground shadow-xl backdrop:bg-black/50">
73
+ <div class="flex items-center justify-between border-b p-4 dark:border-neutral-700">
74
+ <h2 class="heading-3">Unattached keys</h2>
75
+ <form method="dialog">
76
+ <button type="submit" class="btn-text" aria-label="Close">Close</button>
77
+ </form>
78
+ </div>
79
+
80
+ <ul class="max-h-[70vh] divide-y overflow-y-auto dark:divide-neutral-700">
81
+ <% content_tasks.unattachedKeys(task).forEach((key) => { %>
82
+ <% const keyUrl = content_tasks.unattachedKeyUrl(task, key) %>
83
+ <li class="p-4 break-all">
84
+ <% if (keyUrl) { %>
85
+ <a href="<%= keyUrl %>" target="_blank" title="<%= key %>" class="btn-text"><%= key %></a>
86
+ <% } else { %>
87
+ <span title="<%= key %>"><%= key %></span>
88
+ <% } %>
89
+ </li>
90
+ <% }) %>
91
+ </ul>
92
+ </dialog>
71
93
  <% } %>
72
94
  </td>
73
95
 
74
- <td>
96
+ <td class="whitespace-nowrap">
75
97
  <div class="body-3 text-raketa-foreground/50">
76
98
  <div class="flex items-center gap-1 mb-0.5">
77
99
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4 text-raketa-foreground">
@@ -92,7 +114,7 @@
92
114
  </td>
93
115
 
94
116
  <% if (showAllDetails) { %>
95
- <td>
117
+ <td class="whitespace-nowrap">
96
118
  <div class="body-3 text-raketa-foreground/50">
97
119
  <% const dueDate = task.lokaliseWorkflow?.settings?.due_date %>
98
120
 
@@ -109,7 +131,7 @@
109
131
  </div>
110
132
  </td>
111
133
 
112
- <td>
134
+ <td class="whitespace-nowrap">
113
135
  <% if (task.completedAt || task.failedAt) { %>
114
136
  <div class="body-3 text-raketa-foreground/50">
115
137
  <div class="flex items-center gap-1">
@@ -127,7 +149,7 @@
127
149
  </td>
128
150
  <% } %>
129
151
 
130
- <td>
152
+ <td class="whitespace-nowrap">
131
153
  <% if (task.completedAt) { %>
132
154
  <span class="bg-emerald-100 chip text-emerald-700 dark:bg-emerald-900/50 dark:text-emerald-300">
133
155
  Completed