@@ -10,7 +10,11 @@ import {
10
10
ServerStackIcon ,
11
11
Squares2X2Icon ,
12
12
} from "@heroicons/react/20/solid" ;
13
+ import { useLocation } from "react-use" ;
13
14
import { TaskIcon } from "~/assets/icons/TaskIcon" ;
15
+ import { useEnvironment } from "~/hooks/useEnvironment" ;
16
+ import { useOrganization } from "~/hooks/useOrganizations" ;
17
+ import { useProject } from "~/hooks/useProject" ;
14
18
import { type MinimumEnvironment } from "~/presenters/SelectBestEnvironmentPresenter.server" ;
15
19
import {
16
20
docsPath ,
@@ -22,20 +26,15 @@ import {
22
26
import { InlineCode } from "./code/InlineCode" ;
23
27
import { environmentFullTitle } from "./environments/EnvironmentLabel" ;
24
28
import { Feedback } from "./Feedback" ;
29
+ import { EnvironmentSelector } from "./navigation/EnvironmentSelector" ;
25
30
import { Button , LinkButton } from "./primitives/Buttons" ;
26
31
import { Header1 } from "./primitives/Headers" ;
27
32
import { InfoPanel } from "./primitives/InfoPanel" ;
28
33
import { Paragraph } from "./primitives/Paragraph" ;
29
34
import { StepNumber } from "./primitives/StepNumber" ;
35
+ import { TextLink } from "./primitives/TextLink" ;
30
36
import { InitCommandV3 , PackageManagerProvider , TriggerDevStepV3 } from "./SetupCommands" ;
31
37
import { StepContentContainer } from "./StepContentContainer" ;
32
- import { useLocation } from "react-use" ;
33
- import { useEnvironment } from "~/hooks/useEnvironment" ;
34
- import { useOrganization } from "~/hooks/useOrganizations" ;
35
- import { useProject } from "~/hooks/useProject" ;
36
- import { TextLink } from "./primitives/TextLink" ;
37
- import { EnvironmentSelector } from "./navigation/EnvironmentSelector" ;
38
- import { Pi } from "lucide-react" ;
39
38
40
39
export function HasNoTasksDev ( ) {
41
40
return (
@@ -79,20 +78,24 @@ export function HasNoTasksDev() {
79
78
export function HasNoTasksDeployed ( { environment } : { environment : MinimumEnvironment } ) {
80
79
return (
81
80
< InfoPanel
82
- title = " You don't have any deployed tasks"
81
+ title = { ` You don't have any deployed tasks in ${ environmentFullTitle ( environment ) } ` }
83
82
icon = { TaskIcon }
84
83
iconClassName = "text-blue-500"
84
+ panelClassName = "max-w-full"
85
+ accessory = {
86
+ < LinkButton
87
+ to = { docsPath ( "deployment/overview" ) }
88
+ variant = "docs/small"
89
+ LeadingIcon = { BookOpenIcon }
90
+ >
91
+ How to deploy tasks
92
+ </ LinkButton >
93
+ }
85
94
>
86
95
< Paragraph spacing variant = "small" >
87
- You don't have any deployed tasks in { environmentFullTitle ( environment ) } .
96
+ Run the < TextLink to = { docsPath ( "deployment/overview" ) } > CLI deploy command</ TextLink > to
97
+ deploy your tasks to the { environmentFullTitle ( environment ) } environment.
88
98
</ Paragraph >
89
- < LinkButton
90
- to = { docsPath ( "deployment/overview" ) }
91
- variant = "docs/medium"
92
- LeadingIcon = { BookOpenIcon }
93
- >
94
- How to deploy tasks
95
- </ LinkButton >
96
99
</ InfoPanel >
97
100
) ;
98
101
}
@@ -104,18 +107,20 @@ export function SchedulesNoPossibleTaskPanel() {
104
107
icon = { ClockIcon }
105
108
iconClassName = "text-sun-500"
106
109
panelClassName = "max-w-full"
110
+ accessory = {
111
+ < LinkButton
112
+ to = { docsPath ( "v3/tasks-scheduled" ) }
113
+ variant = "docs/small"
114
+ LeadingIcon = { BookOpenIcon }
115
+ >
116
+ How to schedule tasks
117
+ </ LinkButton >
118
+ }
107
119
>
108
120
< Paragraph spacing variant = "small" >
109
121
You have no scheduled tasks in your project. Before you can schedule a task you need to
110
122
create a < InlineCode > schedules.task</ InlineCode > .
111
123
</ Paragraph >
112
- < LinkButton
113
- to = { docsPath ( "v3/tasks-scheduled" ) }
114
- variant = "docs/medium"
115
- LeadingIcon = { BookOpenIcon }
116
- >
117
- View the docs
118
- </ LinkButton >
119
124
</ InfoPanel >
120
125
) ;
121
126
}
@@ -140,15 +145,16 @@ export function SchedulesNoneAttached() {
140
145
< div className = "flex gap-2" >
141
146
< LinkButton
142
147
to = { `${ v3NewSchedulePath ( organization , project , environment ) } ${ location . search } ` }
143
- variant = "primary/small "
148
+ variant = "secondary/medium "
144
149
LeadingIcon = { RectangleGroupIcon }
145
150
className = "inline-flex"
151
+ leadingIconClassName = "text-sun-500"
146
152
>
147
153
Use the dashboard
148
154
</ LinkButton >
149
155
< LinkButton
150
156
to = { docsPath ( "v3/tasks-scheduled" ) }
151
- variant = "primary/small "
157
+ variant = "docs/medium "
152
158
LeadingIcon = { BookOpenIcon }
153
159
className = "inline-flex"
154
160
>
@@ -166,14 +172,16 @@ export function BatchesNone() {
166
172
icon = { Squares2X2Icon }
167
173
iconClassName = "text-blue-500"
168
174
panelClassName = "max-w-full"
175
+ accessory = {
176
+ < LinkButton to = { docsPath ( "triggering" ) } variant = "docs/small" LeadingIcon = { BookOpenIcon } >
177
+ How to trigger batches
178
+ </ LinkButton >
179
+ }
169
180
>
170
181
< Paragraph spacing variant = "small" >
171
182
You have no batches in this environment. You can trigger batches from your backend or from
172
183
inside other tasks.
173
184
</ Paragraph >
174
- < LinkButton to = { docsPath ( "triggering" ) } variant = "docs/medium" LeadingIcon = { BookOpenIcon } >
175
- How to trigger batches
176
- </ LinkButton >
177
185
</ InfoPanel >
178
186
) ;
179
187
}
@@ -182,23 +190,27 @@ export function TestHasNoTasks() {
182
190
const organization = useOrganization ( ) ;
183
191
const project = useProject ( ) ;
184
192
const environment = useEnvironment ( ) ;
185
-
186
193
return (
187
194
< InfoPanel
188
- title = "No tasks to test"
195
+ title = "You don't have any tasks to test"
189
196
icon = { BeakerIcon }
190
197
iconClassName = "text-lime-500"
191
198
panelClassName = "max-w-full"
199
+ accessory = {
200
+ < LinkButton
201
+ to = { v3EnvironmentPath ( organization , project , environment ) }
202
+ variant = "secondary/small"
203
+ LeadingIcon = { PlusIcon }
204
+ >
205
+ Create a task
206
+ </ LinkButton >
207
+ }
192
208
>
193
209
< Paragraph spacing variant = "small" >
194
- You have no tasks in this environment.
210
+ Before testing a task, you must first create one. Follow the instructions on the{ " " }
211
+ < TextLink to = { v3EnvironmentPath ( organization , project , environment ) } > Tasks page</ TextLink > { " " }
212
+ to create a task, then return here to test it.
195
213
</ Paragraph >
196
- < LinkButton
197
- to = { v3EnvironmentPath ( organization , project , environment ) }
198
- variant = "tertiary/medium"
199
- >
200
- Add tasks
201
- </ LinkButton >
202
214
</ InfoPanel >
203
215
) ;
204
216
}
@@ -346,7 +358,15 @@ export function AlertsNoneDeployed() {
346
358
and webhooks.
347
359
</ Paragraph >
348
360
349
- < div className = "flex gap-3" >
361
+ < div className = "flex items-center justify-between gap-3" >
362
+ < LinkButton
363
+ to = { docsPath ( "troubleshooting-alerts" ) }
364
+ variant = "docs/medium"
365
+ LeadingIcon = { BookOpenIcon }
366
+ className = "inline-flex"
367
+ >
368
+ Alerts docs
369
+ </ LinkButton >
350
370
< LinkButton
351
371
to = { v3NewProjectAlertPath ( organization , project , environment ) }
352
372
variant = "primary/medium"
@@ -355,14 +375,6 @@ export function AlertsNoneDeployed() {
355
375
>
356
376
New alert
357
377
</ LinkButton >
358
- < LinkButton
359
- to = { docsPath ( "troubleshooting-alerts" ) }
360
- variant = "docs/medium"
361
- LeadingIcon = { BookOpenIcon }
362
- className = "inline-flex"
363
- >
364
- Alert docs
365
- </ LinkButton >
366
378
</ div >
367
379
</ InfoPanel >
368
380
</ div >
@@ -376,20 +388,26 @@ export function QueuesHasNoTasks() {
376
388
377
389
return (
378
390
< InfoPanel
379
- title = "You have no queues"
391
+ title = "You don't have any queues"
380
392
icon = { RectangleStackIcon }
381
- iconClassName = "text-purple-500"
382
- panelClassName = "max-w-full"
393
+ iconClassName = "text-blue-500"
394
+ panelClassName = "max-w-md"
395
+ accessory = {
396
+ < LinkButton
397
+ to = { v3EnvironmentPath ( organization , project , environment ) }
398
+ variant = "secondary/small"
399
+ LeadingIcon = { PlusIcon }
400
+ >
401
+ Create a task
402
+ </ LinkButton >
403
+ }
383
404
>
384
405
< Paragraph spacing variant = "small" >
385
- This means you haven't got any tasks yet in this environment.
406
+ Queues will appear here when you have created a task in this environment. Follow the
407
+ instructions on the{ " " }
408
+ < TextLink to = { v3EnvironmentPath ( organization , project , environment ) } > Tasks page</ TextLink > { " " }
409
+ to create a task, then return here to see its queue.
386
410
</ Paragraph >
387
- < LinkButton
388
- to = { v3EnvironmentPath ( organization , project , environment ) }
389
- variant = "tertiary/medium"
390
- >
391
- Add tasks
392
- </ LinkButton >
393
411
</ InfoPanel >
394
412
) ;
395
413
}
0 commit comments