Skip to content

Commit c0248c8

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

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

src/commands/stack/deploy.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import {
1919
import { sanitizeStackDefinition } from "../../lib/resources/stack/sanitize.js";
2020
import { enrichStackDefinition } from "../../lib/resources/stack/enrich.js";
2121
import { Success } from "../../rendering/react/components/Success.js";
22-
import { Value } from "../../rendering/react/components/Value.js";
2322
import { loadStackFromTemplate } from "../../lib/resources/stack/template-loader.js";
2423
import { parseEnvironmentVariablesFromStr } from "../../lib/util/parser.js";
2524
import { RawStackInput } from "../../lib/resources/stack/types.js";
2625

2726
interface DeployResult {
2827
restartedServices: string[];
28+
deletedServices: string[];
2929
}
3030

3131
type StackRequest =
@@ -117,8 +117,7 @@ This flag is mutually exclusive with --compose-file.`,
117117
);
118118

119119
if (!confirmed) {
120-
renderer.addInfo("deployment cancelled by user");
121-
await renderer.complete(<></>);
120+
await renderer.error("deployment cancelled by user");
122121
ux.exit(1);
123122
}
124123

@@ -244,7 +243,7 @@ This flag is mutually exclusive with --compose-file.`,
244243
);
245244
const confirmed = await this.confirmDeletion(servicesToDelete, r);
246245
if (!confirmed) {
247-
return { restartedServices: [] };
246+
return { restartedServices: [], deletedServices: [] };
248247
}
249248

250249
const declaredStack = await this.deployStack(stackId, stackDefinition, r);
@@ -254,20 +253,22 @@ This flag is mutually exclusive with --compose-file.`,
254253
r,
255254
);
256255

257-
return { restartedServices };
256+
return { restartedServices, deletedServices: servicesToDelete };
258257
}
259258

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-
259+
protected render({
260+
restartedServices,
261+
deletedServices,
262+
}: DeployResult): ReactNode {
267263
return (
268264
<Success>
269-
Deployment successful. The following services were restarted:{" "}
270-
<Value>{restartedServices.join(", ")}</Value>
265+
Deployment successful.{" "}
266+
{restartedServices.length > 0
267+
? `The following services were restarted: ${restartedServices.join(", ")}`
268+
: "No services were restarted."}{" "}
269+
{deletedServices.length > 0
270+
? `The following services were deleted: ${deletedServices.join(", ")}`
271+
: "No services were deleted."}
271272
</Success>
272273
);
273274
}

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)