@wix/himalaya-cli 0.1253.0 → 0.1254.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 +2 -2
- package/templates/beauty-salon-owner/dev/index.ts +7 -5
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/community-club-owner/dev/index.ts +7 -5
- package/templates/community-club-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/community-club-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/community-club-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/community-club-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/community-club-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/events-meetups-owner/dev/index.ts +7 -5
- package/templates/events-meetups-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/events-meetups-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/gym-fitness-owner/dev/index.ts +7 -5
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/nonprofit-cause-owner/dev/index.ts +7 -5
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/owner-lite/dev/index.ts +7 -5
- package/templates/owner-lite/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/owner-lite/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/owner-lite/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/owner-lite/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/owner-lite/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/podcast-creator-owner/dev/index.ts +7 -5
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/portfolio-creative-owner/dev/index.ts +7 -5
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/restaurant-owner/dev/index.ts +7 -5
- package/templates/restaurant-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/restaurant-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/retail-store-owner/dev/index.ts +7 -5
- package/templates/retail-store-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/retail-store-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
- package/templates/yoga-studio-owner/dev/index.ts +7 -5
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-module-data.ts +78 -7
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-order-attention.ts +18 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-drawer/index.ts +321 -9
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-home/index.ts +2 -10
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-search/index.ts +5 -1
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-search/logic.ts +36 -9
|
@@ -10,6 +10,7 @@ import { countSites } from "@himalaya/wix-site-list";
|
|
|
10
10
|
import { searchOrders, type WixOrder } from "@himalaya/wix-ecom";
|
|
11
11
|
import { queryBookings } from "@himalaya/wix-bookings";
|
|
12
12
|
import { UPCOMING_BOOKING_STATUSES, upcomingBookingCount } from "../_shared/owner-bookings.js";
|
|
13
|
+
import { ownerOrderAttentionFilter } from "../_shared/owner-order-attention.js";
|
|
13
14
|
import { queryMembers } from "@himalaya/wix-members";
|
|
14
15
|
import { queryReviews } from "@himalaya/wix-reviews";
|
|
15
16
|
import { queryReservations } from "@himalaya/wix-table-reservations";
|
|
@@ -102,8 +103,6 @@ const UPCOMING_RESERVATION_STATUSES = ["HELD", "RESERVED", "REQUESTED"];
|
|
|
102
103
|
const UPCOMING_EVENT_STATUSES = ["UPCOMING", "SCHEDULED"];
|
|
103
104
|
const ATTENTION_MEMBER_STATUSES = ["PENDING"];
|
|
104
105
|
const ATTENTION_REVIEW_STATUSES = ["IN_MODERATION", "SUBMITTED"];
|
|
105
|
-
const ATTENTION_PAYMENT_STATUSES = ["NOT_PAID", "PARTIALLY_PAID"];
|
|
106
|
-
const ATTENTION_FULFILLMENT_STATUSES = ["NOT_FULFILLED", "PARTIALLY_FULFILLED"];
|
|
107
106
|
const SOURCE_LABELS: Record<HomeSourceId, string> = {
|
|
108
107
|
products: "Products", posts: "Posts", events: "Events", sites: "Sites",
|
|
109
108
|
orders: "Orders", bookings: "Bookings", members: "Members",
|
|
@@ -469,14 +468,7 @@ async function loadSourcePart(source: HomeSourceId, part: SourcePart): Promise<S
|
|
|
469
468
|
case "sites": return countSites({}) as Promise<SourcePayload>;
|
|
470
469
|
case "orders": {
|
|
471
470
|
if (part === "primary") return searchOrders({ search: {
|
|
472
|
-
filter:
|
|
473
|
-
archived: false,
|
|
474
|
-
status: { $nin: ["CANCELED", "CANCELLED"] },
|
|
475
|
-
$or: [
|
|
476
|
-
{ paymentStatus: { $in: ATTENTION_PAYMENT_STATUSES } },
|
|
477
|
-
{ paymentStatus: "PAID", fulfillmentStatus: { $in: ATTENTION_FULFILLMENT_STATUSES } },
|
|
478
|
-
],
|
|
479
|
-
},
|
|
471
|
+
filter: ownerOrderAttentionFilter(),
|
|
480
472
|
sort: [{ fieldName: "createdDate", order: "DESC" }, { fieldName: "id", order: "ASC" }],
|
|
481
473
|
cursorPaging: { limit: TODAY_PAGE },
|
|
482
474
|
} }) as Promise<SourcePayload>;
|
|
@@ -213,7 +213,10 @@ function copyFromParams(): SearchCopy {
|
|
|
213
213
|
allFailed: copyParam("ownerSearch.allFailed", DEFAULT_COPY.allFailed),
|
|
214
214
|
loadedOnly: copyParam("ownerSearch.loadedOnly", DEFAULT_COPY.loadedOnly),
|
|
215
215
|
loadingSummary: copyParam("ownerSearch.loading", DEFAULT_COPY.loadingSummary),
|
|
216
|
-
|
|
216
|
+
// Keep the pre-worker-heading copy key alive for existing copy packs. The
|
|
217
|
+
// newer `empty` key takes precedence when present; both flow through the
|
|
218
|
+
// query interpolator so neither can hide what the owner searched.
|
|
219
|
+
emptySummary: copyParam("ownerSearch.empty", copyParam("ownerSearch.emptyTitle", DEFAULT_COPY.emptySummary)),
|
|
217
220
|
idleSummary: copyParam("ownerSearch.idle", DEFAULT_COPY.idleSummary),
|
|
218
221
|
permission: copyParam("ownerSearch.permission", DEFAULT_COPY.permission),
|
|
219
222
|
setup: copyParam("ownerSearch.setup", DEFAULT_COPY.setup),
|
|
@@ -240,6 +243,7 @@ const IDLE: State = {
|
|
|
240
243
|
anyLoading: false,
|
|
241
244
|
showEmpty: false,
|
|
242
245
|
hideEmpty: true,
|
|
246
|
+
emptyTitle: "",
|
|
243
247
|
};
|
|
244
248
|
|
|
245
249
|
/** Rebuilt on `load`, because the allowlist arrives with the descriptor. */
|
|
@@ -106,6 +106,14 @@ export interface SearchItem {
|
|
|
106
106
|
/** Stable across refreshes, so a re-fetch cannot re-key a row under the
|
|
107
107
|
* user's finger: `h:<source>`, `r:<source>:<id>`, `f:<source>`. */
|
|
108
108
|
key: string;
|
|
109
|
+
/** The row's LIST identity — always equal to `key`, never blank.
|
|
110
|
+
*
|
|
111
|
+
* A bound list keys its rows on `id` (the web BoundList does, verbatim). This
|
|
112
|
+
* carried the record id, which left every heading and footer at `""` and let
|
|
113
|
+
* two domains that reuse a record id collide — so React reconciled headings
|
|
114
|
+
* onto each other as groups landed and painted "Contacts" three times.
|
|
115
|
+
* What a record OPENS is `recordId`. */
|
|
116
|
+
id: string;
|
|
109
117
|
/** The source this row belongs to — a retry or a pager addresses it. */
|
|
110
118
|
sourceId: string;
|
|
111
119
|
// Exactly one kind is true. Pre-negated, because a `hiddenWhen` takes one path.
|
|
@@ -122,7 +130,9 @@ export interface SearchItem {
|
|
|
122
130
|
isLoading: boolean;
|
|
123
131
|
notLoading: boolean;
|
|
124
132
|
// Record.
|
|
125
|
-
id
|
|
133
|
+
/** The record this row opens — the destination loads it by this id. Blank on
|
|
134
|
+
* headings and footers, which open nothing. */
|
|
135
|
+
recordId: string;
|
|
126
136
|
title: string;
|
|
127
137
|
subtitle: string;
|
|
128
138
|
statusLabel: string;
|
|
@@ -163,6 +173,10 @@ export interface SearchState {
|
|
|
163
173
|
* nobody has typed into yet, and again over every result still in flight. */
|
|
164
174
|
showEmpty: boolean;
|
|
165
175
|
hideEmpty: boolean;
|
|
176
|
+
/** The empty state's heading, naming the query ("No records match “mug”").
|
|
177
|
+
* Blank unless `showEmpty` — and while it shows, `summary` is blank, because
|
|
178
|
+
* the two sat one above the other saying the same sentence. */
|
|
179
|
+
emptyTitle: string;
|
|
166
180
|
}
|
|
167
181
|
|
|
168
182
|
export interface SearchCopy {
|
|
@@ -192,7 +206,9 @@ export const DEFAULT_COPY: SearchCopy = {
|
|
|
192
206
|
allFailed: "No area could be searched",
|
|
193
207
|
loadedOnly: "{n} in loaded records",
|
|
194
208
|
loadingSummary: "Searching…",
|
|
195
|
-
|
|
209
|
+
/** The empty state's heading. `{q}` is the query the owner typed, so the
|
|
210
|
+
* state says WHAT matched nothing rather than only that something did not. */
|
|
211
|
+
emptySummary: "No records match “{q}”",
|
|
196
212
|
idleSummary: "Search your business records",
|
|
197
213
|
permission: "You don’t have access to this area",
|
|
198
214
|
setup: "This area isn’t set up on this site",
|
|
@@ -231,6 +247,14 @@ function fill(template: string, n: number, token = "{n}"): string {
|
|
|
231
247
|
return template.includes(token) ? template.split(token).join(String(n)) : `${template} ${n}`;
|
|
232
248
|
}
|
|
233
249
|
|
|
250
|
+
/** `{q}` → the query. Custom copy stays query-specific even when it omits the
|
|
251
|
+
* placeholder, so the empty state always identifies what was searched. */
|
|
252
|
+
function fillQuery(template: string, query: string): string {
|
|
253
|
+
return template.includes("{q}")
|
|
254
|
+
? template.split("{q}").join(query)
|
|
255
|
+
: `${template}: “${query}”`;
|
|
256
|
+
}
|
|
257
|
+
|
|
234
258
|
function idleGroup(adapter: SearchAdapter): SearchGroup {
|
|
235
259
|
return decorate({
|
|
236
260
|
id: adapter.id,
|
|
@@ -273,9 +297,9 @@ function baseItem(sourceId: string): SearchItem {
|
|
|
273
297
|
isHeader: false, notHeader: true,
|
|
274
298
|
isRecord: false, notRecord: true,
|
|
275
299
|
isFooter: false, notFooter: true,
|
|
276
|
-
label: "", countLabel: "",
|
|
300
|
+
id: "", label: "", countLabel: "",
|
|
277
301
|
isLoading: false, notLoading: true,
|
|
278
|
-
|
|
302
|
+
recordId: "", title: "", subtitle: "", statusLabel: "", image: "", screenId: "",
|
|
279
303
|
error: "", hasError: false, noError: true,
|
|
280
304
|
canLoadMore: false, cannotLoadMore: true, isLoadingMore: false,
|
|
281
305
|
};
|
|
@@ -302,7 +326,7 @@ export function projectItems(groups: SearchGroup[]): SearchItem[] {
|
|
|
302
326
|
if (silent) continue;
|
|
303
327
|
items.push({
|
|
304
328
|
...baseItem(group.id),
|
|
305
|
-
key: `h:${group.id}`,
|
|
329
|
+
key: `h:${group.id}`, id: `h:${group.id}`,
|
|
306
330
|
isHeader: true, notHeader: false,
|
|
307
331
|
label: group.label,
|
|
308
332
|
// A count is only shown once there is something to count: "0" under a
|
|
@@ -313,9 +337,9 @@ export function projectItems(groups: SearchGroup[]): SearchItem[] {
|
|
|
313
337
|
for (const row of group.rows) {
|
|
314
338
|
items.push({
|
|
315
339
|
...baseItem(group.id),
|
|
316
|
-
key: `r:${group.id}:${row.id}`,
|
|
340
|
+
key: `r:${group.id}:${row.id}`, id: `r:${group.id}:${row.id}`,
|
|
317
341
|
isRecord: true, notRecord: false,
|
|
318
|
-
|
|
342
|
+
recordId: row.id, title: row.title, subtitle: row.subtitle,
|
|
319
343
|
statusLabel: row.statusLabel, image: row.image, screenId: row.screenId,
|
|
320
344
|
});
|
|
321
345
|
}
|
|
@@ -325,7 +349,7 @@ export function projectItems(groups: SearchGroup[]): SearchItem[] {
|
|
|
325
349
|
if (group.hasError || group.problem !== "" || group.canLoadMore) {
|
|
326
350
|
items.push({
|
|
327
351
|
...baseItem(group.id),
|
|
328
|
-
key: `f:${group.id}`,
|
|
352
|
+
key: `f:${group.id}`, id: `f:${group.id}`,
|
|
329
353
|
isFooter: true, notFooter: false,
|
|
330
354
|
error: group.error,
|
|
331
355
|
hasError: group.error !== "", noError: group.error === "",
|
|
@@ -393,7 +417,9 @@ export function createGroupedSearch(
|
|
|
393
417
|
: anyLoading && total === 0
|
|
394
418
|
? copy.loadingSummary
|
|
395
419
|
: total === 0
|
|
396
|
-
|
|
420
|
+
// Empty and answered: the empty block carries the sentence, so the
|
|
421
|
+
// summary line above it steps aside rather than repeating it.
|
|
422
|
+
? (anyAnswered ? "" : copy.allFailed)
|
|
397
423
|
: total === 1
|
|
398
424
|
? copy.resultsOne
|
|
399
425
|
: areas === 1
|
|
@@ -416,6 +442,7 @@ export function createGroupedSearch(
|
|
|
416
442
|
anyLoading,
|
|
417
443
|
showEmpty: emptyAndAnswered,
|
|
418
444
|
hideEmpty: !emptyAndAnswered,
|
|
445
|
+
emptyTitle: emptyAndAnswered ? fillQuery(copy.emptySummary, query) : "",
|
|
419
446
|
};
|
|
420
447
|
};
|
|
421
448
|
|