@microlight/core 0.9.7 → 0.9.9

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.
@@ -47,17 +47,15 @@ export default function ViewTask({
47
47
  const [loading, setLoading] = useState(false);
48
48
  const RightButtons = function () {
49
49
  return <>
50
- {task?.links?.map(link => {
51
- return <>
52
- <MuiLink underline="none" variant="outlined" color="neutral" target='_blank' href={link.href} startDecorator={<i class="fa-solid fa-up-right-from-square"></i>} sx={{
53
- mx: 0.5,
54
- px: 1,
55
- py: 0.5,
56
- borderRadius: 'md'
57
- }}>
50
+ {task?.links?.map((link, index) => {
51
+ return <MuiLink key={index} underline="none" variant="outlined" color="neutral" target='_blank' href={link.href} startDecorator={<i className="fa-solid fa-up-right-from-square"></i>} sx={{
52
+ mx: 0.5,
53
+ px: 1,
54
+ py: 0.5,
55
+ borderRadius: 'md'
56
+ }}>
58
57
  {link.title}
59
- </MuiLink>
60
- </>;
58
+ </MuiLink>;
61
59
  })}
62
60
  </>;
63
61
  };
@@ -70,10 +68,7 @@ export default function ViewTask({
70
68
  formData,
71
69
  task
72
70
  });
73
- if (result.success)
74
- // console.log('something went wrong');
75
- console.log(`/tasks/${task.slug}/runs/${result.run.id}`);
76
- redirect(`/tasks/${task.slug}/runs/${result.run.id}`);
71
+ if (result.success) redirect(`/tasks/${task.slug}/runs/${result.run.id}`);
77
72
  };
78
73
  return <Container>
79
74
  <PageHeader breadcrumbs={breadcrumbs} header={{
@@ -89,9 +84,7 @@ export default function ViewTask({
89
84
  maxWidth: 400
90
85
  }}>
91
86
  <form onSubmit={handleSubmit}>
92
- {Object.keys(task.inputs).map(slug => <>
93
- <MLInput key={slug} slug={slug} def={task.inputs[slug]} searchParams={searchParams} />
94
- </>)}
87
+ {Object.keys(task.inputs).map(slug => <MLInput key={slug} slug={slug} def={task.inputs[slug]} searchParams={searchParams} />)}
95
88
  <ButtonGroup spacing={1}>
96
89
  {/* <Button type="submit" fullWidth color="primary" variant="solid" startDecorator={<FilterAltIcon />}>Apply filter</Button> */}
97
90
  <Button loading={loading} disabled={loading} type="submit" color='primary' variant="solid">Execute task</Button>
@@ -147,7 +140,7 @@ export default function ViewTask({
147
140
  </td>
148
141
  <td style={{
149
142
  overflow: 'auto',
150
- '&::-webkit-scrollbar': {
143
+ '&::WebkitScrollbar': {
151
144
  display: 'none'
152
145
  },
153
146
  height: 0,
@@ -157,7 +150,7 @@ export default function ViewTask({
157
150
  }}>
158
151
  <pre style={{
159
152
  margin: 0
160
- }}>{JSON.stringify(schedule?.inputs, null, 2).slice(2, -2)}</pre>
153
+ }}>{schedule?.inputs ? JSON.stringify(schedule?.inputs, null, 2).slice(2, -2) : ""}</pre>
161
154
  </td>
162
155
  <td>
163
156
  {schedule.is_enabled ? 'enabled' : 'disabled'}
@@ -220,7 +213,7 @@ export default function ViewTask({
220
213
  </td>
221
214
  <td style={{
222
215
  overflow: 'auto',
223
- '&::-webkit-scrollbar': {
216
+ '&::WebkitScrollbar': {
224
217
  display: 'none'
225
218
  },
226
219
  height: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microlight/core",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -16,7 +16,8 @@
16
16
  "prepare:server": "microlight-core prepare server",
17
17
  "prepare2": "microlight-core prepare all",
18
18
  "start": "next start",
19
- "lint": "next lint"
19
+ "lint": "next lint",
20
+ "test": "jest"
20
21
  },
21
22
  "files": [
22
23
  "dist",
@@ -29,6 +30,8 @@
29
30
  "@babel/generator": "^7.26.10",
30
31
  "@babel/parser": "^7.26.10",
31
32
  "@mui/joy": "^5.0.0-beta.51",
33
+ "@testing-library/jest-dom": "^6.6.4",
34
+ "@testing-library/react": "^16.3.0",
32
35
  "async": "^3.2.6",
33
36
  "commander": "^13.1.0",
34
37
  "cronstrue": "^2.53.0",
@@ -46,5 +49,13 @@
46
49
  "sequelize": "^6.37.5",
47
50
  "sqlite3": "^5.1.7",
48
51
  "switchless": "0.19.1"
52
+ },
53
+ "devDependencies": {
54
+ "@babel/cli": "^7.28.3",
55
+ "@babel/preset-env": "^7.28.0",
56
+ "@babel/preset-react": "^7.27.1",
57
+ "babel-plugin-module-resolver": "^5.0.2",
58
+ "jest": "^30.0.4",
59
+ "jest-environment-jsdom": "^30.0.5"
49
60
  }
50
61
  }