bb-plugin-manifest 0.17.0 → 0.17.1
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/README.md +20 -7
- package/dist/app.js +3 -3
- package/dist/app.meta.json +1 -1
- package/dist/server.meta.json +1 -1
- package/package.json +1 -1
- package/ui/procurement/NeedSheet.tsx +16 -10
package/dist/app.meta.json
CHANGED
package/dist/server.meta.json
CHANGED
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import { errorText, useStatus, useTool } from "../hooks";
|
|
|
12
12
|
import { Note } from "../RegistryList";
|
|
13
13
|
import { Badge, ConfirmCard, KindLabel } from "../manifest";
|
|
14
14
|
import type { ImportPreview, Need } from "../types";
|
|
15
|
-
import { useOpenObject
|
|
15
|
+
import { useOpenObject } from "../workspace/state";
|
|
16
16
|
import { SectionTabs } from "../workspace/nav";
|
|
17
17
|
import { NEEDS_HUB, OPEN_SOURCE, takeSource } from "./paths";
|
|
18
18
|
import { Countries } from "./Countries";
|
|
@@ -36,16 +36,22 @@ function byCategory(items: Need[]): { category: string; items: Need[]; qty: numb
|
|
|
36
36
|
/** The «Закупочный лист» rail: the last sheet chat or a new one, the sheet on the right. */
|
|
37
37
|
export function NeedsPage(_: PluginNavPanelProps) {
|
|
38
38
|
const openObject = useOpenObject();
|
|
39
|
-
const
|
|
40
|
-
const [
|
|
39
|
+
const [error, setError] = useState<string | null>(null);
|
|
40
|
+
const [attempt, setAttempt] = useState(0);
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return <
|
|
42
|
+
// Resolve the sheet's live chats and restore its focus, even if that chat now shows
|
|
43
|
+
// another object. The shared rail timer must never replace this entry with a page
|
|
44
|
+
// without a chat (including a quick switch from mail or a repeated rail click).
|
|
45
|
+
setError(null);
|
|
46
|
+
void openObject(NEEDS_HUB).catch((e: unknown) => setError(errorText(e)));
|
|
47
|
+
}, [attempt, openObject]);
|
|
48
|
+
if (!error) return <Note>Открываем закупочный лист…</Note>;
|
|
49
|
+
return (
|
|
50
|
+
<div className="p-3">
|
|
51
|
+
<p role="alert" className="text-xs text-destructive">{error}</p>
|
|
52
|
+
<Button size="sm" variant="outline" className="mt-2" onClick={() => setAttempt((n) => n + 1)}>Повторить открытие</Button>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
|