@propeller-commerce/propeller-v2-react-ui 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.6.1] - 2026-07-23
12
+
13
+ ### Fixed
14
+
15
+ - **Login viewer inputs** — `LoginForm` now forwards the resolved `configuration`
16
+ (from `<PropellerDepsProvider>` via `useInfraProps`) into `useAuth`, so the
17
+ login `getViewer` requests the configured track attributes and pagination
18
+ inputs — `companyTrackAttributes` (→ `MY_INSTALLATIONS`),
19
+ `customerTrackAttributes`, `contactPAConfigInput`, and the newly-forwarded
20
+ `contactCompaniesSearchInput`. Previously the header login returned a viewer
21
+ with no companies/attributes until a later `refreshUser`. `useAuth` also now
22
+ guards `contactPAConfigInput` with `isViewerSearchInput` (a non-array object)
23
+ so a misconfigured empty array `[]` is omitted rather than 400-ing the viewer.
24
+
11
25
  ## [0.6.0] - 2026-07-21
12
26
 
13
27
  ### Added
package/dist/index.cjs CHANGED
@@ -248,6 +248,7 @@ function useAddress(options) {
248
248
  );
249
249
  return { loading, error, createAddress, updateAddress, deleteAddress, setDefaultAddress };
250
250
  }
251
+ var isViewerSearchInput = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
251
252
  function useAuth(options) {
252
253
  const { graphqlClient, language = "NL", onAuthHeaderUpdate, configuration } = options;
253
254
  const [loading, setLoading] = React6.useState(false);
@@ -284,8 +285,14 @@ function useAuth(options) {
284
285
  ...configuration?.companyTrackAttributes?.length && {
285
286
  companyAttributesInput: { attributeDescription: { names: configuration.companyTrackAttributes } }
286
287
  },
287
- ...configuration?.contactPAConfigInput && {
288
+ // Contact-scoped pagination inputs — only when the host supplies a real
289
+ // input object (an empty array `[]` is truthy but 400s the viewer). See
290
+ // isViewerSearchInput.
291
+ ...isViewerSearchInput(configuration?.contactPAConfigInput) && {
288
292
  contactPAConfigInput: configuration.contactPAConfigInput
293
+ },
294
+ ...isViewerSearchInput(configuration?.contactCompaniesSearchInput) && {
295
+ contactCompaniesSearchInput: configuration.contactCompaniesSearchInput
289
296
  }
290
297
  };
291
298
  const viewer = await userService.getViewer(viewerInput);
@@ -3466,7 +3473,13 @@ function LoginForm(rawProps) {
3466
3473
  const [email, setEmail] = React6.useState("");
3467
3474
  const [password, setPassword] = React6.useState("");
3468
3475
  const { loading, error: authError, login } = useAuth({
3469
- graphqlClient: props.graphqlClient
3476
+ graphqlClient: props.graphqlClient,
3477
+ // Resolved from <PropellerDepsProvider> by useInfraProps (the app's full
3478
+ // `config`), so the login viewer requests the configured track attributes +
3479
+ // pagination inputs (companyTrackAttributes → MY_INSTALLATIONS,
3480
+ // contactCompaniesSearchInput, contactPAConfigInput). Without this the header
3481
+ // login returns a viewer with no companies/attributes until a later refresh.
3482
+ configuration: props.configuration
3470
3483
  });
3471
3484
  propellerV2CoreUi.getLabel(props.labels, "email", "Email");
3472
3485
  propellerV2CoreUi.getLabel(props.labels, "password", "Password");