Skip to content

Commit 8b06127

Browse files
committed
[local-explorer-ui] Adjusted labels for (ex-)Custom Crons and some times.
1 parent 7774cc3 commit 8b06127

3 files changed

Lines changed: 32 additions & 18 deletions

File tree

packages/local-explorer-ui/src/__e2e__/cron-triggers/cron-triggers.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("Cron Triggers", () => {
5959
await page
6060
.getByRole("heading", { name: "No Cron Triggers configured" })
6161
.waitFor();
62-
expect(await page.getByRole("button", { name: "Add custom" }).count()).toBe(
62+
expect(await page.getByRole("button", { name: "Add draft" }).count()).toBe(
6363
0
6464
);
6565
expect(
@@ -76,7 +76,7 @@ describe("Cron Triggers", () => {
7676
const configuredPane = page.getByRole("region", {
7777
name: "Configured crons",
7878
});
79-
const customPane = page.getByRole("region", { name: "Custom crons" });
79+
const customPane = page.getByRole("region", { name: "Draft crons" });
8080
const [configuredBox, customBox] = await Promise.all([
8181
configuredPane.boundingBox(),
8282
customPane.boundingBox(),
@@ -231,7 +231,7 @@ describe("Cron Triggers", () => {
231231
const configuredPane = page.getByRole("region", {
232232
name: "Configured crons",
233233
});
234-
const customPane = page.getByRole("region", { name: "Custom crons" });
234+
const customPane = page.getByRole("region", { name: "Draft crons" });
235235
const [configuredBox, customBox] = await Promise.all([
236236
configuredPane.boundingBox(),
237237
customPane.boundingBox(),

packages/local-explorer-ui/src/components/cron-triggers/CronRowCard.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ function CronBuilder({
358358
>
359359
<legend className="px-1 text-sm font-medium text-kumo-default">
360360
<span className="inline-flex items-center gap-1">
361-
Build a UTC expression
361+
Build a Cron expression (UTC)
362362
<Tooltip
363363
asChild
364364
content={
@@ -427,7 +427,7 @@ function CronBuilder({
427427
<BuilderNumber
428428
errors={generated.errors}
429429
field="hour"
430-
label="Hour (UTC)"
430+
label="Hour"
431431
onChange={updateField}
432432
rowId={rowId}
433433
value={value.hour}
@@ -437,7 +437,7 @@ function CronBuilder({
437437
<BuilderNumber
438438
errors={generated.errors}
439439
field="minute"
440-
label="Minute (UTC)"
440+
label="Minute"
441441
onChange={updateField}
442442
rowId={rowId}
443443
value={value.minute}
@@ -598,7 +598,6 @@ function CustomTimeEditor({
598598
{row.customTimeInputMode === "calendar" ? (
599599
<div className="grid min-w-0 gap-1">
600600
<label className="grid min-w-0 gap-1 text-sm text-kumo-default">
601-
Date and Time (UTC)
602601
<input
603602
aria-describedby={
604603
calendar?.kind === "invalid"
@@ -651,7 +650,6 @@ function CustomTimeEditor({
651650
) : (
652651
<div className="grid min-w-0 gap-1">
653652
<label className="grid min-w-0 gap-1 text-sm text-kumo-default">
654-
Epoch milliseconds
655653
<input
656654
aria-describedby={
657655
parseEpochMilliseconds(row.epochValue ?? "").error

packages/local-explorer-ui/src/components/cron-triggers/CronTriggersPage.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,17 @@ export function CronTriggersPage({
173173
size="sm"
174174
variant="secondary"
175175
>
176-
Add custom
176+
Add draft
177177
</Button>
178178
) : null
179179
}
180+
help="Draft crons are stored locally and do not modify your Worker configuration."
180181
pane="custom"
181-
title="Custom crons"
182+
title="Draft crons"
182183
>
183184
{customRows.length === 0 ? (
184185
<p className="px-1 py-2 text-sm text-kumo-subtle">
185-
Custom crons you add or duplicate appear here.
186+
Draft crons you add or duplicate appear here.
186187
</p>
187188
) : null}
188189
{customRows.map(renderRow)}
@@ -199,11 +200,13 @@ export function CronTriggersPage({
199200
function CronPane({
200201
action,
201202
children,
203+
help,
202204
pane,
203205
title,
204206
}: {
205207
action?: JSX.Element | null;
206208
children: React.ReactNode;
209+
help?: string;
207210
pane: CronPaneKind;
208211
title: string;
209212
}): JSX.Element {
@@ -214,13 +217,26 @@ function CronPane({
214217
data-cron-pane={pane}
215218
>
216219
<header className="flex h-14 shrink-0 items-center justify-between gap-3 border-b border-kumo-fill bg-kumo-base px-5">
217-
<h2
218-
className="text-base font-semibold text-kumo-default"
219-
data-cron-pane-heading
220-
tabIndex={-1}
221-
>
222-
{title}
223-
</h2>
220+
<div className="inline-flex items-center gap-1">
221+
<h2
222+
className="text-base font-semibold text-kumo-default"
223+
data-cron-pane-heading
224+
tabIndex={-1}
225+
>
226+
{title}
227+
</h2>
228+
{help ? (
229+
<Tooltip asChild content={help}>
230+
<button
231+
aria-label={`${title} help`}
232+
className="focus-visible:ring-kumo-ring inline-flex h-5 w-5 items-center justify-center rounded-md text-kumo-subtle outline-none hover:bg-kumo-tint focus-visible:ring-2"
233+
type="button"
234+
>
235+
<InfoIcon size={14} />
236+
</button>
237+
</Tooltip>
238+
) : null}
239+
</div>
224240
{action}
225241
</header>
226242
<div

0 commit comments

Comments
 (0)