@remit/ui 0.0.183 → 0.0.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/ui",
3
- "version": "0.0.183",
3
+ "version": "0.0.185",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -280,6 +280,8 @@ export const Counting: Story = {
280
280
  * A bulk delete in progress reports a running total via `statusLabel` and a
281
281
  * determinate `ProgressBar`; the delete button shows its busy spinner (never
282
282
  * disables) and the overflow verbs drop out — nothing here can act mid-delete.
283
+ * Stop rides on the notice, the way it does while counting: the run outlives
284
+ * the wizard's run screen, so the bar has to be able to end it too.
283
285
  */
284
286
  export const DeletingWithProgress: Story = {
285
287
  args: {
@@ -287,6 +289,37 @@ export const DeletingWithProgress: Story = {
287
289
  statusLabel: "Deleting 1,200 of 3,412…",
288
290
  isBusy: true,
289
291
  progress: { value: 1200, max: 3412 },
292
+ notice: {
293
+ tone: "info",
294
+ text: "",
295
+ action: { label: "Stop", onClick: () => undefined },
296
+ },
297
+ },
298
+ };
299
+
300
+ /**
301
+ * The same run, as the user finds it after leaving the mailbox and coming back.
302
+ * The selection did not survive the route and nothing is ticked, so the count
303
+ * and the label are the run's own: an idle header over mail that is still being
304
+ * deleted would be the lie this replaces. Stop is the same press it was before
305
+ * they left.
306
+ */
307
+ export const RunResumedAfterLeaving: Story = {
308
+ args: {
309
+ count: 3412,
310
+ statusLabel: "Deleting 2,100 of 3,412…",
311
+ isBusy: true,
312
+ progress: { value: 2100, max: 3412 },
313
+ selectAll: {
314
+ checked: false,
315
+ indeterminate: false,
316
+ onChange: () => undefined,
317
+ },
318
+ notice: {
319
+ tone: "info",
320
+ text: "",
321
+ action: { label: "Stop", onClick: () => undefined },
322
+ },
290
323
  },
291
324
  };
292
325
 
@@ -641,7 +641,7 @@ describe("RunStepBody", () => {
641
641
  assert.match(html, /The rule itself is saved/);
642
642
  });
643
643
 
644
- it("says a stopped run was never sent rather than rejected", () => {
644
+ it("says a stopped run went unconfirmed rather than rejected", () => {
645
645
  const html = renderToString(
646
646
  createElement(RunStepBody, {
647
647
  ...runProps,
@@ -653,8 +653,8 @@ describe("RunStepBody", () => {
653
653
  }),
654
654
  );
655
655
  assert.match(html, /Stopped after 2/);
656
- assert.match(html, /nothing was sent for them/);
657
- assert.match(html, /Never sent/);
656
+ assert.match(html, /The rest were not sent/);
657
+ assert.match(html, /Not confirmed/);
658
658
  assert.doesNotMatch(html, /Server rejected/);
659
659
  });
660
660
 
@@ -998,9 +998,11 @@ export function RunStepBody(props: RunStepProps) {
998
998
  const { matched, applied, failures } = props;
999
999
  const outcome = runOutcomeOf(props);
1000
1000
  const copy = runCopy(outcome);
1001
- // A stopped run never sent these, so nothing rejected them.
1001
+ // A stopped run confirmed none of these: most were never sent, and the ones
1002
+ // on their way when the stop landed may have gone through anyway. Neither is
1003
+ // a rejection, so neither can be badged as one.
1002
1004
  const failureBadge =
1003
- props.state === "runStopped" ? "Never sent" : "Server rejected";
1005
+ props.state === "runStopped" ? "Not confirmed" : "Server rejected";
1004
1006
 
1005
1007
  return (
1006
1008
  <div className="space-y-4 pt-2">
@@ -588,12 +588,15 @@ describe("runCopy", () => {
588
588
 
589
589
  it("separates a run that stopped from a pass the server rejected", () => {
590
590
  // The bulk endpoints accept every id in a call that returns, so the only
591
- // failure the chunked runner can observe is a call that threw — and
592
- // everything after it was never sent. Saying the mail server rejected
593
- // those states a cause that did not happen.
591
+ // failure the chunked runner can observe is a call that threw or was
592
+ // aborted — and everything after it was never sent. Saying the mail server
593
+ // rejected those states a cause that did not happen. Stopping aborts the
594
+ // request on the wire without un-sending it (#113), so the copy stops short
595
+ // of promising that batch never landed either.
594
596
  const stopped = outcome("runStopped", "once");
595
597
  assert.equal(stopped.title, "Stopped after 10");
596
- assert.match(stopped.detail, /nothing was sent for them/);
598
+ assert.match(stopped.detail, /The rest were not sent/);
599
+ assert.match(stopped.detail, /may still have gone through/);
597
600
  assert.doesNotMatch(stopped.detail, /rejected/);
598
601
  assert.equal(stopped.retryLabel, "Retry 2");
599
602
  assert.equal(stopped.showProgress, true);
@@ -602,7 +602,7 @@ export const runCopy = ({
602
602
  return {
603
603
  ...shared,
604
604
  title: `Stopped after ${applied}`,
605
- detail: `${applied} of ${matched} ${done}. The run stopped before it reached the rest, so nothing was sent for them and nothing has happened to them.`,
605
+ detail: `${applied} of ${matched} ${done}. The rest were not sent, apart from the ones already on their way when you stopped — those may still have gone through.`,
606
606
  tone: "warning",
607
607
  dismissLabel: "Close",
608
608
  retryLabel: `Retry ${failed}`,