@@ -10,7 +10,11 @@ import {
1010 ServerStackIcon ,
1111 Squares2X2Icon ,
1212} from "@heroicons/react/20/solid" ;
13+ import { useLocation } from "react-use" ;
1314import { TaskIcon } from "~/assets/icons/TaskIcon" ;
15+ import { useEnvironment } from "~/hooks/useEnvironment" ;
16+ import { useOrganization } from "~/hooks/useOrganizations" ;
17+ import { useProject } from "~/hooks/useProject" ;
1418import { type MinimumEnvironment } from "~/presenters/SelectBestEnvironmentPresenter.server" ;
1519import {
1620 docsPath ,
@@ -22,20 +26,15 @@ import {
2226import { InlineCode } from "./code/InlineCode" ;
2327import { environmentFullTitle } from "./environments/EnvironmentLabel" ;
2428import { Feedback } from "./Feedback" ;
29+ import { EnvironmentSelector } from "./navigation/EnvironmentSelector" ;
2530import { Button , LinkButton } from "./primitives/Buttons" ;
2631import { Header1 } from "./primitives/Headers" ;
2732import { InfoPanel } from "./primitives/InfoPanel" ;
2833import { Paragraph } from "./primitives/Paragraph" ;
2934import { StepNumber } from "./primitives/StepNumber" ;
35+ import { TextLink } from "./primitives/TextLink" ;
3036import { InitCommandV3 , PackageManagerProvider , TriggerDevStepV3 } from "./SetupCommands" ;
3137import { 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" ;
3938
4039export function HasNoTasksDev ( ) {
4140 return (
@@ -79,20 +78,24 @@ export function HasNoTasksDev() {
7978export function HasNoTasksDeployed ( { environment } : { environment : MinimumEnvironment } ) {
8079 return (
8180 < InfoPanel
82- title = " You don't have any deployed tasks"
81+ title = { ` You don't have any deployed tasks in ${ environmentFullTitle ( environment ) } ` }
8382 icon = { TaskIcon }
8483 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+ }
8594 >
8695 < 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.
8898 </ Paragraph >
89- < LinkButton
90- to = { docsPath ( "deployment/overview" ) }
91- variant = "docs/medium"
92- LeadingIcon = { BookOpenIcon }
93- >
94- How to deploy tasks
95- </ LinkButton >
9699 </ InfoPanel >
97100 ) ;
98101}
@@ -104,18 +107,20 @@ export function SchedulesNoPossibleTaskPanel() {
104107 icon = { ClockIcon }
105108 iconClassName = "text-sun-500"
106109 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+ }
107119 >
108120 < Paragraph spacing variant = "small" >
109121 You have no scheduled tasks in your project. Before you can schedule a task you need to
110122 create a < InlineCode > schedules.task</ InlineCode > .
111123 </ Paragraph >
112- < LinkButton
113- to = { docsPath ( "v3/tasks-scheduled" ) }
114- variant = "docs/medium"
115- LeadingIcon = { BookOpenIcon }
116- >
117- View the docs
118- </ LinkButton >
119124 </ InfoPanel >
120125 ) ;
121126}
@@ -140,15 +145,16 @@ export function SchedulesNoneAttached() {
140145 < div className = "flex gap-2" >
141146 < LinkButton
142147 to = { `${ v3NewSchedulePath ( organization , project , environment ) } ${ location . search } ` }
143- variant = "primary/small "
148+ variant = "secondary/medium "
144149 LeadingIcon = { RectangleGroupIcon }
145150 className = "inline-flex"
151+ leadingIconClassName = "text-sun-500"
146152 >
147153 Use the dashboard
148154 </ LinkButton >
149155 < LinkButton
150156 to = { docsPath ( "v3/tasks-scheduled" ) }
151- variant = "primary/small "
157+ variant = "docs/medium "
152158 LeadingIcon = { BookOpenIcon }
153159 className = "inline-flex"
154160 >
@@ -166,14 +172,16 @@ export function BatchesNone() {
166172 icon = { Squares2X2Icon }
167173 iconClassName = "text-blue-500"
168174 panelClassName = "max-w-full"
175+ accessory = {
176+ < LinkButton to = { docsPath ( "triggering" ) } variant = "docs/small" LeadingIcon = { BookOpenIcon } >
177+ How to trigger batches
178+ </ LinkButton >
179+ }
169180 >
170181 < Paragraph spacing variant = "small" >
171182 You have no batches in this environment. You can trigger batches from your backend or from
172183 inside other tasks.
173184 </ Paragraph >
174- < LinkButton to = { docsPath ( "triggering" ) } variant = "docs/medium" LeadingIcon = { BookOpenIcon } >
175- How to trigger batches
176- </ LinkButton >
177185 </ InfoPanel >
178186 ) ;
179187}
@@ -182,23 +190,27 @@ export function TestHasNoTasks() {
182190 const organization = useOrganization ( ) ;
183191 const project = useProject ( ) ;
184192 const environment = useEnvironment ( ) ;
185-
186193 return (
187194 < InfoPanel
188- title = "No tasks to test"
195+ title = "You don't have any tasks to test"
189196 icon = { BeakerIcon }
190197 iconClassName = "text-lime-500"
191198 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+ }
192208 >
193209 < 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.
195213 </ Paragraph >
196- < LinkButton
197- to = { v3EnvironmentPath ( organization , project , environment ) }
198- variant = "tertiary/medium"
199- >
200- Add tasks
201- </ LinkButton >
202214 </ InfoPanel >
203215 ) ;
204216}
@@ -346,7 +358,15 @@ export function AlertsNoneDeployed() {
346358 and webhooks.
347359 </ Paragraph >
348360
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 >
350370 < LinkButton
351371 to = { v3NewProjectAlertPath ( organization , project , environment ) }
352372 variant = "primary/medium"
@@ -355,14 +375,6 @@ export function AlertsNoneDeployed() {
355375 >
356376 New alert
357377 </ 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 >
366378 </ div >
367379 </ InfoPanel >
368380 </ div >
@@ -376,20 +388,26 @@ export function QueuesHasNoTasks() {
376388
377389 return (
378390 < InfoPanel
379- title = "You have no queues"
391+ title = "You don't have any queues"
380392 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+ }
383404 >
384405 < 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.
386410 </ Paragraph >
387- < LinkButton
388- to = { v3EnvironmentPath ( organization , project , environment ) }
389- variant = "tertiary/medium"
390- >
391- Add tasks
392- </ LinkButton >
393411 </ InfoPanel >
394412 ) ;
395413}
0 commit comments