@burdenoff/microfe-bigconsole 2026.1119.4 → 2026.1119.6

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.
@@ -0,0 +1,10 @@
1
+ import { PublishOwnerOption } from '../utils/publishOwner';
2
+ export interface UsePublishOwnerOptionsResult {
3
+ options: PublishOwnerOption[];
4
+ /** Owner to preselect; null means Personal. */
5
+ defaultOrganizationId: string | null;
6
+ loading: boolean;
7
+ /** Set when the organizations could not be loaded; Personal stays available. */
8
+ error: string | null;
9
+ }
10
+ export declare function usePublishOwnerOptions(enabled: boolean): UsePublishOwnerOptionsResult;
@@ -0,0 +1,48 @@
1
+ import { useBigConsole as e } from "../context/BigConsoleContext.js";
2
+ import { GetPublishOwnerOrganizationsDocument as t } from "../../generated/global-operations.js";
3
+ import "../graphql/storeTemplates.js";
4
+ import { buildPublishOwnerOptions as n, loadPublishOwnerOrganizations as r, readDevportalActiveOrg as i, resolveDefaultPublishOwner as a } from "../utils/publishOwner.js";
5
+ import { useEffect as o, useMemo as s, useState as c } from "react";
6
+ import { graphqlFetch as l } from "@burdenoff/fe-libs/shared/graphql";
7
+ import { print as u } from "graphql";
8
+ // src/bigconsole/hooks/usePublishOwnerOptions.ts
9
+ var d = "GetPublishOwnerOrganizations", f = u(t);
10
+ function p() {
11
+ try {
12
+ return typeof window > "u" ? null : window.localStorage;
13
+ } catch {
14
+ return null;
15
+ }
16
+ }
17
+ function m(t) {
18
+ let { currentUser: u } = e(), m = u?.id ?? null, [h, g] = c(null), [_, v] = c(!1);
19
+ return o(() => {
20
+ if (!t) return;
21
+ let e = new AbortController();
22
+ return g(null), v(!0), r(() => l({
23
+ gateway: "global",
24
+ query: f,
25
+ operationName: d,
26
+ responseCache: "reload",
27
+ signal: e.signal,
28
+ suppressGlobalErrorEvent: !0
29
+ })).then((t) => {
30
+ e.signal.aborted || (g(t), v(!1));
31
+ }), () => {
32
+ e.abort(), v(!1);
33
+ };
34
+ }, [t]), s(() => {
35
+ let e = n(h?.orgs ?? [], m);
36
+ return {
37
+ options: e,
38
+ defaultOrganizationId: a(e, i(p())),
39
+ loading: _,
40
+ error: h?.error ?? null
41
+ };
42
+ }, [
43
+ h,
44
+ _,
45
+ m
46
+ ]);
47
+ }
48
+ export { m as usePublishOwnerOptions };
@@ -90,12 +90,20 @@ export interface PublishToStoreArgs {
90
90
  tags?: string[];
91
91
  /** Embed a few real rows per data source so the board renders populated. */
92
92
  includeSampleData?: boolean;
93
+ /**
94
+ * Developer organization that owns the draft. Omitted/null creates a
95
+ * personally owned draft, which the Developer Portal lists under its
96
+ * "Personal" scope rather than under any organization (BOFF-10779).
97
+ */
98
+ developerOrganizationId?: string | null;
93
99
  }
94
100
  export interface PublishToStoreResult {
95
101
  success: boolean;
96
102
  /** The DRAFT devportal application created for this template. */
97
103
  applicationId?: string;
98
104
  status?: string;
105
+ /** Organization the draft was created under; null when personally owned. */
106
+ developerOrganizationId?: string | null;
99
107
  errorMessage?: string;
100
108
  /** Distinct data sinks the dashboard referenced, all tokenised into slots. */
101
109
  sinkCount: number;
@@ -154,7 +154,8 @@ function g(g = {}) {
154
154
  description: e.description,
155
155
  ...e.category ? { category: e.category } : {},
156
156
  tags: e.tags ?? [],
157
- compatibleProducts: ["bigconsole"]
157
+ compatibleProducts: ["bigconsole"],
158
+ ...e.developerOrganizationId ? { developerOrganizationId: e.developerOrganizationId } : {}
158
159
  } }
159
160
  })).data?.createApplication;
160
161
  return o ? (await b.mutate({
@@ -170,6 +171,7 @@ function g(g = {}) {
170
171
  success: !0,
171
172
  applicationId: o.id,
172
173
  status: o.status,
174
+ developerOrganizationId: e.developerOrganizationId ?? null,
173
175
  sinkCount: a,
174
176
  unknownSinkIds: s,
175
177
  sampleDataSinkCount: c