@bakers-build/addon-bakers-ui 0.6.1-next.6 → 0.6.1-next.8
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.
|
@@ -9,7 +9,8 @@ export interface RunDetailInput {
|
|
|
9
9
|
export declare const runDetailInputContext: import("../../../Routing/context.js").ContextKey<RunDetailInput>;
|
|
10
10
|
/**
|
|
11
11
|
* Run detail — normal {@link AsyncScreen}. The document arrives via navigation
|
|
12
|
-
* context (or empty); refresh is the shared R / ui-refresh path
|
|
12
|
+
* context (or empty); refresh is the shared R / ui-refresh path, which refetches
|
|
13
|
+
* the ticket with its runs so a new run state shows.
|
|
13
14
|
*/
|
|
14
15
|
export declare class RunDetailScreen extends AsyncScreen<TicketDetailDocument> {
|
|
15
16
|
readonly frameId = "run";
|
|
@@ -31,6 +32,8 @@ export declare class RunDetailScreen extends AsyncScreen<TicketDetailDocument> {
|
|
|
31
32
|
* `router.back()` on a bare Esc carries no result on its own.
|
|
32
33
|
*/
|
|
33
34
|
private forwardResult;
|
|
35
|
+
/** Set by {@link reload}: the next load asks the server, not the snapshot. */
|
|
36
|
+
private refetch;
|
|
34
37
|
reload(context: ScreenContext): void;
|
|
35
38
|
protected load(context: ScreenContext): Promise<TicketDetailDocument>;
|
|
36
39
|
protected renderLoading(): string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
|
|
1
2
|
import { actionItem } from '../../../Component/footer-actions/index.js';
|
|
2
3
|
import { defineContext } from '../../../Routing/context.js';
|
|
3
4
|
import { AsyncScreen } from '../../../Screen/async-screen.js';
|
|
@@ -6,7 +7,8 @@ import { isRunCancellable } from '../Form/edit.js';
|
|
|
6
7
|
export const runDetailInputContext = defineContext('run-detail-input', 'input');
|
|
7
8
|
/**
|
|
8
9
|
* Run detail — normal {@link AsyncScreen}. The document arrives via navigation
|
|
9
|
-
* context (or empty); refresh is the shared R / ui-refresh path
|
|
10
|
+
* context (or empty); refresh is the shared R / ui-refresh path, which refetches
|
|
11
|
+
* the ticket with its runs so a new run state shows.
|
|
10
12
|
*/
|
|
11
13
|
export class RunDetailScreen extends AsyncScreen {
|
|
12
14
|
frameId = 'run';
|
|
@@ -30,10 +32,19 @@ export class RunDetailScreen extends AsyncScreen {
|
|
|
30
32
|
* `router.back()` on a bare Esc carries no result on its own.
|
|
31
33
|
*/
|
|
32
34
|
forwardResult;
|
|
35
|
+
/** Set by {@link reload}: the next load asks the server, not the snapshot. */
|
|
36
|
+
refetch = false;
|
|
33
37
|
reload(context) {
|
|
38
|
+
this.refetch = true;
|
|
34
39
|
this.retry(context);
|
|
35
40
|
}
|
|
36
41
|
load(context) {
|
|
42
|
+
const id = context.params?.ticketId;
|
|
43
|
+
if (this.refetch && context.services && id) {
|
|
44
|
+
this.refetch = false;
|
|
45
|
+
// Fetched here, not through the ticket slice's store: ticket imports run.
|
|
46
|
+
return context.services.client.get(`bb_ticket/bb_ticket/${id}`, new DrupalJsonApiParams().addInclude(['runs']));
|
|
47
|
+
}
|
|
37
48
|
if (context.contexts?.has(runDetailInputContext))
|
|
38
49
|
return Promise.resolve(context.contexts.get(runDetailInputContext).document);
|
|
39
50
|
return Promise.resolve({});
|
|
@@ -21,7 +21,7 @@ export interface RefreshSignal {
|
|
|
21
21
|
/** Stop watching and drop a pending reload. Called from the kernel's `finish()`. */
|
|
22
22
|
close(): void;
|
|
23
23
|
}
|
|
24
|
-
/** The signal file's basename inside the watched `.bakers` dir. */
|
|
24
|
+
/** The signal file's basename inside the watched `.bakers` dir; core owns it so the conductor's writer agrees. */
|
|
25
25
|
export declare const REFRESH_SIGNAL_FILE = "ui-refresh";
|
|
26
26
|
/**
|
|
27
27
|
* The coalescing window. Long enough that the several events one `touch`
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { statSync, watch } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { UI_REFRESH_FILE } from '@bakers-build/core';
|
|
4
|
+
/** The signal file's basename inside the watched `.bakers` dir; core owns it so the conductor's writer agrees. */
|
|
5
|
+
export const REFRESH_SIGNAL_FILE = UI_REFRESH_FILE;
|
|
5
6
|
/**
|
|
6
7
|
* The coalescing window. Long enough that the several events one `touch`
|
|
7
8
|
* produces are one reload, short enough that an operator reads it as immediate.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-bakers-ui",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.8",
|
|
4
4
|
"description": "bakers.build TUI: interactive terminal UI (dashboard, projects, tickets) as a dropsh `tui` renderer plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"zustand": "^5.0.15"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@bakers-build/core": "^0.6.1-next.
|
|
34
|
-
"@bakers-build/message": "^0.6.1-next.
|
|
33
|
+
"@bakers-build/core": "^0.6.1-next.8",
|
|
34
|
+
"@bakers-build/message": "^0.6.1-next.8"
|
|
35
35
|
},
|
|
36
36
|
"bakersBuild": {
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "a39a1b099521005460e4f9d9534aa7935ed88e91",
|
|
38
38
|
"channel": "next"
|
|
39
39
|
}
|
|
40
40
|
}
|