Skip to content

Commit 5c18ce8

Browse files
chore: ux fine-tuning
1 parent 5111c1d commit 5c18ce8

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/commands/stack/deploy.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { RawStackInput } from "../../lib/resources/stack/types.js";
2626

2727
interface DeployResult {
2828
restartedServices: string[];
29+
deletedServices: string[];
2930
}
3031

3132
type StackRequest =
@@ -117,8 +118,7 @@ This flag is mutually exclusive with --compose-file.`,
117118
);
118119

119120
if (!confirmed) {
120-
renderer.addInfo("deployment cancelled by user");
121-
await renderer.complete(<></>);
121+
await renderer.error("deployment cancelled by user");
122122
ux.exit(1);
123123
}
124124

@@ -244,7 +244,7 @@ This flag is mutually exclusive with --compose-file.`,
244244
);
245245
const confirmed = await this.confirmDeletion(servicesToDelete, r);
246246
if (!confirmed) {
247-
return { restartedServices: [] };
247+
return { restartedServices: [], deletedServices: [] };
248248
}
249249

250250
const declaredStack = await this.deployStack(stackId, stackDefinition, r);
@@ -254,20 +254,22 @@ This flag is mutually exclusive with --compose-file.`,
254254
r,
255255
);
256256

257-
return { restartedServices };
257+
return { restartedServices, deletedServices: servicesToDelete };
258258
}
259259

260-
protected render({ restartedServices }: DeployResult): ReactNode {
261-
if (restartedServices.length === 0) {
262-
return (
263-
<Success>Deployment successful. No services were restarted.</Success>
264-
);
265-
}
266-
260+
protected render({
261+
restartedServices,
262+
deletedServices,
263+
}: DeployResult): ReactNode {
267264
return (
268265
<Success>
269-
Deployment successful. The following services were restarted:{" "}
270-
<Value>{restartedServices.join(", ")}</Value>
266+
Deployment successful.{" "}
267+
{restartedServices.length > 0
268+
? `The following services were restarted: ${restartedServices.join(", ")}`
269+
: "No services were restarted."}{" "}
270+
{deletedServices.length > 0
271+
? `The following services were deleted: ${deletedServices.join(", ")}`
272+
: "No services were deleted."}
271273
</Success>
272274
);
273275
}

src/rendering/process/components/ProcessStateIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const ProcessStateIcon: React.FC<{ step: ProcessStep }> = ({ step }) => {
1010
step.type === "input" ||
1111
step.type === "select"
1212
) {
13-
return <Text></Text>;
13+
return <Text> </Text>;
1414
} else if (step.phase === "completed") {
1515
return <Text></Text>;
1616
} else if (step.phase === "aborted") {

0 commit comments

Comments
 (0)