@fleetbridge/ui 1.0.0 → 1.1.0

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": "@fleetbridge/ui",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "FleetBridge customer UI (search, results, booking, manage booking) for WordPress and custom sites.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/server.js CHANGED
@@ -610,22 +610,25 @@ var Tenant = class {
610
610
  /** Every place name once, for the search pickers (SearchController::ajax_public_branches). */
611
611
  async pickerLocations() {
612
612
  const rows = await this.rows(
613
- "SELECT {name}, {groupingName}, {countryCode}, {isAirportBranch}, {isInternational} FROM {Branches} WHERE {isArchived} = ? ORDER BY {groupingName} ASC, {name} ASC",
613
+ "SELECT {name}, {groupingName}, {countryCode}, {isAirportBranch}, {isInternational}, {physicalAddress} FROM {Branches} WHERE {isArchived} = ? ORDER BY {groupingName} ASC, {name} ASC",
614
614
  [false]
615
615
  );
616
616
  const byName = /* @__PURE__ */ new Map();
617
617
  for (const row of rows) {
618
618
  const name = String(row.name ?? "");
619
+ const address = String(row.physicalAddress ?? "").replace(/\s+/g, " ").trim();
619
620
  const existing = byName.get(name);
620
621
  if (!existing) {
621
622
  byName.set(name, {
622
623
  name,
623
624
  region: String(row.groupingName || row.countryCode || ""),
624
625
  isAirportBranch: bool(row.isAirportBranch),
625
- isInternational: bool(row.isInternational)
626
+ isInternational: bool(row.isInternational),
627
+ ...address ? { address } : {}
626
628
  });
627
- } else if (bool(row.isAirportBranch)) {
628
- existing.isAirportBranch = true;
629
+ } else {
630
+ if (bool(row.isAirportBranch)) existing.isAirportBranch = true;
631
+ if (!existing.address && address) existing.address = address;
629
632
  }
630
633
  }
631
634
  return [...byName.values()];
@@ -921,7 +924,9 @@ var Tenant = class {
921
924
  const row = {
922
925
  id,
923
926
  token,
924
- apiKey: truncate(quote.apiKey),
927
+ // The column may not be empty (null). A site that signs in with its own
928
+ // secret has no API key, so it is saved as an empty text instead.
929
+ apiKey: truncate(quote.apiKey) ?? "",
925
930
  customerId: quote.customerId ?? null,
926
931
  supplierId: truncate(quote.supplierId),
927
932
  supplierIdentifier: truncate(quote.supplierIdentifier),