@stapel/listings-react 0.3.1 → 0.7.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/CHANGELOG.md +122 -0
- package/MODULE.md +12 -6
- package/README.md +33 -17
- package/dist/api/generated/schema.d.ts +129 -3
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/api/listingsApi.d.ts +35 -22
- package/dist/api/listingsApi.d.ts.map +1 -1
- package/dist/api/listingsApi.js +17 -0
- package/dist/api/listingsApi.js.map +1 -1
- package/dist/api/types.d.ts +43 -2
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/default/FavoritesPane.d.ts +40 -3
- package/dist/default/FavoritesPane.d.ts.map +1 -1
- package/dist/default/FavoritesPane.js +30 -18
- package/dist/default/FavoritesPane.js.map +1 -1
- package/dist/default/ListingCard.d.ts +25 -4
- package/dist/default/ListingCard.d.ts.map +1 -1
- package/dist/default/ListingCard.js +19 -12
- package/dist/default/ListingCard.js.map +1 -1
- package/dist/default/ListingComposerPage.d.ts +163 -23
- package/dist/default/ListingComposerPage.d.ts.map +1 -1
- package/dist/default/ListingComposerPage.js +85 -43
- package/dist/default/ListingComposerPage.js.map +1 -1
- package/dist/default/ListingDetailPane.d.ts +41 -4
- package/dist/default/ListingDetailPane.d.ts.map +1 -1
- package/dist/default/ListingDetailPane.js +38 -25
- package/dist/default/ListingDetailPane.js.map +1 -1
- package/dist/default/ListingPhoto.d.ts +13 -1
- package/dist/default/ListingPhoto.d.ts.map +1 -1
- package/dist/default/ListingPhoto.js +47 -9
- package/dist/default/ListingPhoto.js.map +1 -1
- package/dist/default/ListingPrice.d.ts +13 -0
- package/dist/default/ListingPrice.d.ts.map +1 -0
- package/dist/default/ListingPrice.js +60 -0
- package/dist/default/ListingPrice.js.map +1 -0
- package/dist/default/MyListingsPane.d.ts +9 -17
- package/dist/default/MyListingsPane.d.ts.map +1 -1
- package/dist/default/MyListingsPane.js +148 -63
- package/dist/default/MyListingsPane.js.map +1 -1
- package/dist/default/SignInLink.js +8 -7
- package/dist/default/SignInLink.js.map +1 -1
- package/dist/default/StatusTags.d.ts +16 -5
- package/dist/default/StatusTags.d.ts.map +1 -1
- package/dist/default/StatusTags.js +19 -13
- package/dist/default/StatusTags.js.map +1 -1
- package/dist/default/index.d.ts +15 -9
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +13 -6
- package/dist/default/index.js.map +1 -1
- package/dist/headless/Favorites.d.ts +6 -0
- package/dist/headless/Favorites.d.ts.map +1 -1
- package/dist/headless/Favorites.js +4 -0
- package/dist/headless/Favorites.js.map +1 -1
- package/dist/headless/ListingActions.d.ts +12 -0
- package/dist/headless/ListingActions.d.ts.map +1 -1
- package/dist/headless/ListingActions.js +3 -0
- package/dist/headless/ListingActions.js.map +1 -1
- package/dist/headless/ListingComposer.d.ts +23 -0
- package/dist/headless/ListingComposer.d.ts.map +1 -1
- package/dist/headless/ListingComposer.js +33 -7
- package/dist/headless/ListingComposer.js.map +1 -1
- package/dist/headless/MyListings.d.ts +27 -12
- package/dist/headless/MyListings.d.ts.map +1 -1
- package/dist/headless/MyListings.js +29 -7
- package/dist/headless/MyListings.js.map +1 -1
- package/dist/i18n/es.d.ts +6 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +28 -6
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/generated/errors.es.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.es.gen.js +1 -1
- package/dist/i18n/generated/errors.gen.d.ts +6 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +3 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.ru.gen.js +1 -1
- package/dist/i18n/keys.d.ts +28 -4
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +49 -8
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts +16 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +40 -6
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/model/draft.d.ts +9 -6
- package/dist/model/draft.d.ts.map +1 -1
- package/dist/model/draft.js +3 -1
- package/dist/model/draft.js.map +1 -1
- package/dist/model/features.d.ts +21 -7
- package/dist/model/features.d.ts.map +1 -1
- package/dist/model/features.js +26 -0
- package/dist/model/features.js.map +1 -1
- package/dist/model/mine.d.ts +44 -0
- package/dist/model/mine.d.ts.map +1 -0
- package/dist/model/mine.js +52 -0
- package/dist/model/mine.js.map +1 -0
- package/dist/model/mineSource.d.ts +39 -34
- package/dist/model/mineSource.d.ts.map +1 -1
- package/dist/model/mineSource.js +10 -41
- package/dist/model/mineSource.js.map +1 -1
- package/dist/model/mutations.d.ts.map +1 -1
- package/dist/model/mutations.js +11 -4
- package/dist/model/mutations.js.map +1 -1
- package/dist/model/queryKeys.d.ts +7 -2
- package/dist/model/queryKeys.d.ts.map +1 -1
- package/dist/model/queryKeys.js +2 -0
- package/dist/model/queryKeys.js.map +1 -1
- package/dist/model/status.d.ts +12 -31
- package/dist/model/status.d.ts.map +1 -1
- package/dist/model/status.js +44 -0
- package/dist/model/status.js.map +1 -1
- package/llms.txt +11 -8
- package/manifest.json +88 -14
- package/nav-manifest.json +1 -1
- package/package.json +17 -12
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +129 -3
- package/src/api/listingsApi.ts +60 -21
- package/src/api/types.ts +46 -2
- package/src/default/FavoritesPane.tsx +156 -82
- package/src/default/ListingCard.tsx +88 -46
- package/src/default/ListingComposerPage.tsx +403 -187
- package/src/default/ListingDetailPane.tsx +200 -98
- package/src/default/ListingPhoto.tsx +89 -16
- package/src/default/ListingPrice.tsx +77 -0
- package/src/default/MyListingsPane.tsx +344 -222
- package/src/default/SignInLink.tsx +4 -4
- package/src/default/StatusTags.tsx +36 -18
- package/src/default/index.ts +18 -7
- package/src/headless/Favorites.tsx +10 -0
- package/src/headless/ListingActions.tsx +19 -0
- package/src/headless/ListingComposer.tsx +56 -5
- package/src/headless/MyListings.tsx +62 -22
- package/src/i18n/es.ts +36 -7
- package/src/i18n/generated/errors.es.gen.ts +1 -1
- package/src/i18n/generated/errors.gen.ts +3 -0
- package/src/i18n/generated/errors.json +9 -0
- package/src/i18n/generated/errors.ru.gen.ts +1 -1
- package/src/i18n/keys.ts +58 -9
- package/src/i18n/ru.ts +48 -7
- package/src/index.ts +16 -5
- package/src/model/draft.ts +12 -7
- package/src/model/features.ts +48 -7
- package/src/model/mine.ts +70 -0
- package/src/model/mineSource.ts +46 -41
- package/src/model/mutations.ts +11 -4
- package/src/model/queryKeys.ts +9 -2
- package/src/model/status.ts +15 -0
- package/dist/default/ErrorAlert.d.ts +0 -9
- package/dist/default/ErrorAlert.d.ts.map +0 -1
- package/dist/default/ErrorAlert.js +0 -27
- package/dist/default/ErrorAlert.js.map +0 -1
- package/dist/default/theme.d.ts +0 -25
- package/dist/default/theme.d.ts.map +0 -1
- package/dist/default/theme.js +0 -40
- package/dist/default/theme.js.map +0 -1
- package/src/default/ErrorAlert.tsx +0 -46
- package/src/default/theme.tsx +0 -67
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,sBA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,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,YAAY,EACV,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACpF,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrE,YAAY,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrF,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,iCAAiC,EACjC,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,GACZ,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -38,9 +38,10 @@
|
|
|
38
38
|
* a grey button and never a hidden one.
|
|
39
39
|
* 4. **An absence is never rendered as a zero.** A soft-deleted listing says
|
|
40
40
|
* it was removed rather than 404-ing like a typo; a stored feature this
|
|
41
|
-
* build cannot read is counted rather than dropped;
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* build cannot read is counted rather than dropped; an empty dashboard tab
|
|
42
|
+
* says WHICH emptiness it is; and a moderation takedown — the one status
|
|
43
|
+
* `my/counters` counts in no tab at all — is shown outside the tabs rather
|
|
44
|
+
* than falling out of the screen (`headless/MyListings.tsx`).
|
|
44
45
|
*
|
|
45
46
|
* ── The seams, and why they are not imports ────────────────────────────────
|
|
46
47
|
*
|
|
@@ -63,10 +64,11 @@
|
|
|
63
64
|
export { createListingsApi } from "./api/listingsApi.js";
|
|
64
65
|
export { DEFAULT_LISTING_CURRENCY, LISTING_STATUSES, MODERATION_STATUSES, } from "./api/types.js";
|
|
65
66
|
// ── model: the two axes ──────────────────────────────────────────────────────
|
|
66
|
-
export { MY_LISTINGS_TABS, MY_LISTINGS_TAB_STATUSES, isPubliclyVisible, lifecycleCaption, listingStatusView, moderationNotice, tabOf, } from "./model/status.js";
|
|
67
|
+
export { MY_LISTINGS_TABS, MY_LISTINGS_TAB_STATUSES, MY_LISTINGS_UNTABBED_STATUSES, isPubliclyVisible, lifecycleCaption, listingStatusView, moderationNotice, tabOf, } from "./model/status.js";
|
|
67
68
|
export { LISTING_TRANSITIONS, canDelete, canTransition } from "./model/transitions.js";
|
|
68
|
-
// ── model: the owner
|
|
69
|
-
export {
|
|
69
|
+
// ── model: the owner's own rows ──────────────────────────────────────────────
|
|
70
|
+
export { defaultMyListingsSource } from "./model/mineSource.js";
|
|
71
|
+
export { myListingImages, myListingPrice, myListingTitle, showsDraft, } from "./model/mine.js";
|
|
70
72
|
// ── model: the draft twin ────────────────────────────────────────────────────
|
|
71
73
|
export { EMPTY_LOCATION, createDraftBody, draftPatchFromValues, draftValuesFromDetail, draftValuesFromWire, droppedFeatureSlugs, emptyDraftValues, retainKnownFeatureValues, } from "./model/draft.js";
|
|
72
74
|
// ── model: the stored feature projection ─────────────────────────────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AA6BxB,gFAAgF;AAChF,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvF,gFAAgF;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAO1B,gFAAgF;AAChF,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,WAAW,E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oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,gFAAgF;AAChF,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,iCAAiC,EACjC,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
package/dist/model/draft.d.ts
CHANGED
|
@@ -22,12 +22,14 @@ import type { ListingDetail, ListingDraft, ListingDraftPatch } from "../api/type
|
|
|
22
22
|
* `geohash` that disagrees with the coordinates beside it is worse than no
|
|
23
23
|
* geohash — the pin and the bucket point at different places.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* `geohash` is SERVER-COMPUTED and read-only since stapel-listings 0.7.1.
|
|
26
|
+
* `Listing.save()` stamps `geohash_draft` from `lat_draft`/`lon_draft` through
|
|
27
|
+
* the `geo.geohash_encode` comm function, and `ListingDraftSerializer` marks
|
|
28
|
+
* the field `readOnly` — a value sent in the request body is silently ignored.
|
|
29
|
+
* So this member is something the composer READS BACK (a reopened draft, a
|
|
30
|
+
* published listing) and never something it sends: `draftPatchFromValues`
|
|
31
|
+
* omits it, and a picker that happens to know a geohash may keep it for its
|
|
32
|
+
* own display without expecting the wire to carry it.
|
|
31
33
|
*/
|
|
32
34
|
export interface ListingLocation {
|
|
33
35
|
/** Opaque id from whatever place directory the deployment uses. */
|
|
@@ -38,6 +40,7 @@ export interface ListingLocation {
|
|
|
38
40
|
* `55.796100` into `55.7961` and change what was submitted. */
|
|
39
41
|
readonly lat: string | null;
|
|
40
42
|
readonly lon: string | null;
|
|
43
|
+
/** Read-only: the server computes it from `lat`/`lon` (0.7.1). Never sent. */
|
|
41
44
|
readonly geohash: string;
|
|
42
45
|
}
|
|
43
46
|
export declare const EMPTY_LOCATION: ListingLocation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/model/draft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAGzB
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/model/draft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAGzB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;mEAC+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,eAM5B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1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zC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAOnC;AAED;;;eAGe;AACf,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,SAAS,MAAM,EAAE,CAKnB"}
|
package/dist/model/draft.js
CHANGED
|
@@ -134,7 +134,9 @@ export function draftPatchFromValues(values, features) {
|
|
|
134
134
|
images_draft: [...values.images],
|
|
135
135
|
location_id_draft: values.location.locationId,
|
|
136
136
|
location_label_draft: values.location.locationLabel,
|
|
137
|
-
geohash_draft
|
|
137
|
+
// No `geohash_draft`: stapel-listings 0.7.1 computes it in `Listing.save()`
|
|
138
|
+
// from the coordinates and marks the serializer field read-only, so a value
|
|
139
|
+
// sent here is discarded. Sending one would be a claim the wire ignores.
|
|
138
140
|
lat_draft: values.location.lat,
|
|
139
141
|
lon_draft: values.location.lon,
|
|
140
142
|
features_draft: toWireFeatures(features, values.features),
|
package/dist/model/draft.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../src/model/draft.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../src/model/draft.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAgC3D,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,UAAU,EAAE,EAAE;IACd,aAAa,EAAE,EAAE;IACjB,GAAG,EA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C,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACvB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAClC,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/model/features.d.ts
CHANGED
|
@@ -22,14 +22,28 @@
|
|
|
22
22
|
* `order`, `title`, `badge`) are simply ignored by every formatter. Copying a
|
|
23
23
|
* hand-picked subset instead would be a list to keep in step with ten types.
|
|
24
24
|
*
|
|
25
|
-
* ── What a DAO does NOT carry
|
|
25
|
+
* ── What a DAO does NOT carry, and the one line that repairs it ────────────
|
|
26
26
|
*
|
|
27
|
-
* `select`'s `options`. `
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* `
|
|
27
|
+
* `select`'s `options`. `SelectType.dto_to_dao` stores the chosen VALUES and
|
|
28
|
+
* the ui config, never the option table — the table lives on the CATEGORY, and
|
|
29
|
+
* not needing it is the whole point of the projection.
|
|
30
|
+
*
|
|
31
|
+
* The consequence was a defect the visual pass caught on every card and every
|
|
32
|
+
* spec row: `formatFeatureValue` resolves an option's copy by looking the
|
|
33
|
+
* value up in `config.options`, and with no table it falls through to
|
|
34
|
+
* `String(value)`. The stored value of a translatable catalogue IS a
|
|
35
|
+
* translation key, so a listing page printed `demo.condition.used` and
|
|
36
|
+
* `demo.brand.bosch` at people. (The server does not have this problem: its
|
|
37
|
+
* own `format_value` has the category's config in hand.)
|
|
38
|
+
*
|
|
39
|
+
* So the split below synthesizes the IDENTITY table — `{value: v, label: v}`
|
|
40
|
+
* for each stored value — which is exactly the table a translatable catalogue
|
|
41
|
+
* would have produced, since its labels ARE the keys. `formatFeatureValue`
|
|
42
|
+
* then runs the value through the host's `t` and a bundle carrying the
|
|
43
|
+
* catalogue copy reads "Used". A bundle that does not still shows the key, on
|
|
44
|
+
* purpose: a visible `option.condition.used` gets fixed, an invented "Used"
|
|
45
|
+
* ships wrong. A NON-translatable catalogue stores literal labels, `t` returns
|
|
46
|
+
* an unknown key unchanged, and the output is what it always was.
|
|
33
47
|
*/
|
|
34
48
|
import type { FeatureValueDto } from "@stapel/attributes-react";
|
|
35
49
|
import type { ListingFeatureDao, ListingFeatureView } from "../api/types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/model/features.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/model/features.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA8B7E;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,iBAAiB,GACrB,kBAAkB,GAAG,SAAS,CAuBhC;AAED;;;mCAGmC;AACnC,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI,GAAG,SAAS,GACpD,SAAS,kBAAkB,EAAE,CAO/B;AAED,qEAAqE;AACrE,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI,GAAG,SAAS,GACpD,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI,GAAG,SAAS,GACpD,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAM3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,iBAAiB,EAAE,CAE7E"}
|
package/dist/model/features.js
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
/** Keys that belong to the DAO envelope rather than to the type's config. */
|
|
2
2
|
const ENVELOPE = new Set(["slug", "value", "name", "order", "title", "badge"]);
|
|
3
|
+
/** The two types whose stored `value` is an option key rather than the thing
|
|
4
|
+
* itself. `hierarchical_select` is deliberately absent: its formatter joins
|
|
5
|
+
* the path with " / " and never consults an option table at all. */
|
|
6
|
+
const OPTION_VALUED = new Set(["select"]);
|
|
7
|
+
/**
|
|
8
|
+
* The identity option table for a stored `select` — see the module header.
|
|
9
|
+
*
|
|
10
|
+
* Returns `undefined` when there is nothing to add (another type, a config
|
|
11
|
+
* that already carries a table, a value that is not a list of strings), so the
|
|
12
|
+
* common path allocates nothing and a DAO that DOES carry options is left
|
|
13
|
+
* exactly as it arrived.
|
|
14
|
+
*/
|
|
15
|
+
function synthesizedOptions(dao, config) {
|
|
16
|
+
if (typeof dao.type !== "string" || !OPTION_VALUED.has(dao.type))
|
|
17
|
+
return undefined;
|
|
18
|
+
if (Array.isArray(config["options"]))
|
|
19
|
+
return undefined;
|
|
20
|
+
const raw = Array.isArray(dao.value) ? dao.value : [dao.value];
|
|
21
|
+
const values = raw.filter((item) => typeof item === "string");
|
|
22
|
+
if (values.length === 0)
|
|
23
|
+
return undefined;
|
|
24
|
+
return values.map((value) => ({ value, label: value }));
|
|
25
|
+
}
|
|
3
26
|
/**
|
|
4
27
|
* One DAO row → the definition/value pair the display half consumes.
|
|
5
28
|
*
|
|
@@ -16,6 +39,9 @@ export function featureFromDao(dao) {
|
|
|
16
39
|
if (!ENVELOPE.has(key))
|
|
17
40
|
config[key] = value;
|
|
18
41
|
}
|
|
42
|
+
const options = synthesizedOptions(dao, config);
|
|
43
|
+
if (options !== undefined)
|
|
44
|
+
config["options"] = options;
|
|
19
45
|
const feature = {
|
|
20
46
|
slug: dao.slug,
|
|
21
47
|
config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/model/features.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/model/features.ts"],"names":[],"mappings":"AAkDA,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/E;;oEAEoE;AACpE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE1C;;;;;;;GAOG;AACH,SAAS,kBAAkB,CACzB,GAAsB,EACtB,MAAyC;IAEzC,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACnF,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACvD,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC9E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,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,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,sBAAsB,CACpC,IAAqD;IAErD,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAqD;IAErD,MAAM,GAAG,GAAoC,EAAE,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IACpE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAsC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an owner's row SAYS, when half its fields may still be a draft.
|
|
3
|
+
*
|
|
4
|
+
* A listing carries every user-editable value twice: the `*_draft` twin the
|
|
5
|
+
* owner is writing, and the published field `publish` promotes it onto. The
|
|
6
|
+
* public card reads the published half — correct for a shop window, and empty
|
|
7
|
+
* for a listing that has never been published. A drafts tab built on it is a
|
|
8
|
+
* column of blank rows.
|
|
9
|
+
*
|
|
10
|
+
* So the rule, in one place rather than at three call sites: **show the
|
|
11
|
+
* published value when there is one, and the draft otherwise.** Not "always
|
|
12
|
+
* the draft" — a live listing being edited must go on reading as what
|
|
13
|
+
* strangers currently see, or the seller cannot tell what is on the shelf
|
|
14
|
+
* from what they are about to put there.
|
|
15
|
+
*
|
|
16
|
+
* Pure, so `test/mine.test.tsx` asserts the table directly.
|
|
17
|
+
*/
|
|
18
|
+
import type { MyListingCard } from "../api/types.js";
|
|
19
|
+
/**
|
|
20
|
+
* The row's heading: the published title, the draft title, or `undefined`.
|
|
21
|
+
*
|
|
22
|
+
* `undefined` and not the id: a caller that wants "Listing #41" as a last
|
|
23
|
+
* resort can say so, and one that wants to render a placeholder can do that
|
|
24
|
+
* instead. Inventing the fallback here would take the choice away.
|
|
25
|
+
*/
|
|
26
|
+
export declare function myListingTitle(row: MyListingCard): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The row's price, published half first. A decimal STRING on the wire
|
|
29
|
+
* (`DecimalField` → `"200.00"`), passed through untouched — formatting it is
|
|
30
|
+
* a skin's job and rounding it here would lose the trailing zero a currency
|
|
31
|
+
* needs.
|
|
32
|
+
*/
|
|
33
|
+
export declare function myListingPrice(row: MyListingCard): string | undefined;
|
|
34
|
+
/** The row's images, published half first — `[]` when neither has any. */
|
|
35
|
+
export declare function myListingImages(row: MyListingCard): readonly string[];
|
|
36
|
+
/**
|
|
37
|
+
* Is what this row shows the DRAFT rather than what strangers see?
|
|
38
|
+
*
|
|
39
|
+
* The half of the rule a person is owed on screen: a row whose title came off
|
|
40
|
+
* the draft twin is showing something nobody else can read yet, and a skin
|
|
41
|
+
* that did not mark it would be quietly claiming otherwise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function showsDraft(row: MyListingCard): boolean;
|
|
44
|
+
//# sourceMappingURL=mine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mine.d.ts","sourceRoot":"","sources":["../../src/model/mine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Is this string field's published half absent? `""` counts: the model
|
|
2
|
+
* declares `title = CharField(blank=True, default="")`, so an unpublished
|
|
3
|
+
* listing carries the empty string, not `null`. */
|
|
4
|
+
function empty(value) {
|
|
5
|
+
return value === null || value === undefined || value === "";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The row's heading: the published title, the draft title, or `undefined`.
|
|
9
|
+
*
|
|
10
|
+
* `undefined` and not the id: a caller that wants "Listing #41" as a last
|
|
11
|
+
* resort can say so, and one that wants to render a placeholder can do that
|
|
12
|
+
* instead. Inventing the fallback here would take the choice away.
|
|
13
|
+
*/
|
|
14
|
+
export function myListingTitle(row) {
|
|
15
|
+
if (!empty(row.title))
|
|
16
|
+
return row.title;
|
|
17
|
+
if (!empty(row.title_draft))
|
|
18
|
+
return row.title_draft;
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The row's price, published half first. A decimal STRING on the wire
|
|
23
|
+
* (`DecimalField` → `"200.00"`), passed through untouched — formatting it is
|
|
24
|
+
* a skin's job and rounding it here would lose the trailing zero a currency
|
|
25
|
+
* needs.
|
|
26
|
+
*/
|
|
27
|
+
export function myListingPrice(row) {
|
|
28
|
+
if (!empty(row.price))
|
|
29
|
+
return row.price;
|
|
30
|
+
if (!empty(row.price_draft))
|
|
31
|
+
return row.price_draft;
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/** The row's images, published half first — `[]` when neither has any. */
|
|
35
|
+
export function myListingImages(row) {
|
|
36
|
+
const published = row.images;
|
|
37
|
+
if (published !== null && published !== undefined && published.length > 0) {
|
|
38
|
+
return published;
|
|
39
|
+
}
|
|
40
|
+
return row.images_draft ?? [];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Is what this row shows the DRAFT rather than what strangers see?
|
|
44
|
+
*
|
|
45
|
+
* The half of the rule a person is owed on screen: a row whose title came off
|
|
46
|
+
* the draft twin is showing something nobody else can read yet, and a skin
|
|
47
|
+
* that did not mark it would be quietly claiming otherwise.
|
|
48
|
+
*/
|
|
49
|
+
export function showsDraft(row) {
|
|
50
|
+
return empty(row.title) && !empty(row.title_draft);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=mine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mine.js","sourceRoot":"","sources":["../../src/model/mine.ts"],"names":[],"mappings":"AAmBA;;mDAEmD;AACnD,SAAS,KAAK,CAAC,KAAgC;IAC7C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC;AAC/D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAe,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,GAAG,CAAC,WAAqB,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAe,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,GAAG,CAAC,WAAqB,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,eAAe,CAAC,GAAkB;IAChD,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;IAC7B,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAkB;IAC3C,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,47 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* THE GAP
|
|
2
|
+
* THE GAP, AND THE ROUTE THAT CLOSED IT.
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
5
|
-
*
|
|
4
|
+
* This file used to open "stapel-listings cannot list a person their own
|
|
5
|
+
* listings", and that was the only place in the pair where a contract was
|
|
6
|
+
* missing rather than awkward. `GET /listings/` answers `qs.published()` and
|
|
7
|
+
* takes no owner parameter (`views.ListingViewSet.get_queryset`): it returns
|
|
8
|
+
* the whole marketplace's shop window and can be narrowed to nobody. The only
|
|
9
|
+
* owner-scoped reads were `my/counters` (three integers) and `my/favorites`,
|
|
10
|
+
* so a seller's own DRAFTS were unreachable by any call the contract offered
|
|
11
|
+
* — and drafts are not indexed either, so routing around it through
|
|
12
|
+
* `@stapel/search-react`'s `owner=` would have returned the published subset
|
|
13
|
+
* and quietly called it "everything". The dashboard shipped with a
|
|
14
|
+
* host-injected source and NAMED the absence on screen, because "we cannot
|
|
15
|
+
* ask" and "you have no listings" are different sentences.
|
|
6
16
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* quietly call it "everything".
|
|
17
|
+
* **stapel-listings 0.7.0 answers it**: `GET /listings/my/listings/`, the
|
|
18
|
+
* caller's own rows in every status, `?status=` for a tab's set, the same
|
|
19
|
+
* `IDAnchorPagination` envelope the other two owner reads use. So
|
|
20
|
+
* {@link defaultMyListingsSource} is what the dashboard runs on now, and
|
|
21
|
+
* there is no failure state left to name — the missing-source error and its
|
|
22
|
+
* i18n key are gone rather than kept as a comment about a thing that no
|
|
23
|
+
* longer happens.
|
|
15
24
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* can be narrowed without a search module.
|
|
24
|
-
*
|
|
25
|
-
* Until then a host injects a {@link MyListingsSource} and the dashboard
|
|
26
|
-
* works completely; without one it shows the real counters and NAMES the
|
|
27
|
-
* absence, because "we cannot ask" and "you have no listings" are different
|
|
28
|
-
* sentences.
|
|
25
|
+
* {@link MyListingsSource} stays, as a seam and not as a workaround: a
|
|
26
|
+
* deployment that keeps its sellers' rows somewhere else (a read model, a
|
|
27
|
+
* legacy table, a host that has already fetched the page) hands one in and
|
|
28
|
+
* the dashboard renders it unchanged. What it must return is one page of the
|
|
29
|
+
* owner card — including the `moderation_status` and the `*_draft` twins,
|
|
30
|
+
* which is why the type is {@link PaginatedMyListingCards} and not the public
|
|
31
|
+
* card envelope.
|
|
29
32
|
*/
|
|
30
|
-
import {
|
|
31
|
-
import type {
|
|
33
|
+
import type { ListingsApi } from "../api/listingsApi.js";
|
|
34
|
+
import type { MyListingsParams, PaginatedMyListingCards } from "../api/types.js";
|
|
32
35
|
import type { MyListingsTab } from "./status.js";
|
|
33
|
-
/** One page of the caller's own listings, however the host
|
|
36
|
+
/** One page of the caller's own listings, however the host gets them. */
|
|
34
37
|
export type MyListingsSource = (args: {
|
|
35
38
|
readonly tab: MyListingsTab;
|
|
36
|
-
readonly page:
|
|
39
|
+
readonly page: MyListingsParams;
|
|
37
40
|
readonly signal?: AbortSignal;
|
|
38
|
-
}) => Promise<
|
|
41
|
+
}) => Promise<PaginatedMyListingCards>;
|
|
39
42
|
/**
|
|
40
|
-
* The
|
|
43
|
+
* The source the dashboard uses unless a host replaces it: the contract's own
|
|
44
|
+
* route, narrowed to the tab's statuses.
|
|
41
45
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
46
|
+
* The tab → statuses table is `MY_LISTINGS_TAB_STATUSES`, which is a copy of
|
|
47
|
+
* the SERVER's grouping in `views.my_counters`. That is the whole point: the
|
|
48
|
+
* rows this fetches and the count on the tab beside them are the same set,
|
|
49
|
+
* asserted upstream (`tests/test_my_listings.py`) and here.
|
|
45
50
|
*/
|
|
46
|
-
export declare
|
|
51
|
+
export declare function defaultMyListingsSource(api: ListingsApi): MyListingsSource;
|
|
47
52
|
//# sourceMappingURL=mineSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineSource.d.ts","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mineSource.d.ts","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE;IACpC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,gBAAgB,CAM1E"}
|
package/dist/model/mineSource.js
CHANGED
|
@@ -1,45 +1,14 @@
|
|
|
1
|
+
import { MY_LISTINGS_TAB_STATUSES } from "./status.js";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* The source the dashboard uses unless a host replaces it: the contract's own
|
|
4
|
+
* route, narrowed to the tab's statuses.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* (`views.ListingViewSet.get_queryset`): it returns the whole marketplace's
|
|
9
|
-
* shop window and can be narrowed to nobody. The only owner-scoped reads in
|
|
10
|
-
* the module are `my/counters` (three integers) and `my/favorites`. So a
|
|
11
|
-
* seller's own DRAFTS are unreachable by any call this contract offers — and
|
|
12
|
-
* drafts are not indexed either, so routing around it through
|
|
13
|
-
* `@stapel/search-react`'s `owner=` would return the published subset and
|
|
14
|
-
* quietly call it "everything".
|
|
15
|
-
*
|
|
16
|
-
* The storefront spec assumed `GET /listings/` was "for mine" (§4.1). It is
|
|
17
|
-
* not, and this pair records the gap rather than papering over it.
|
|
18
|
-
*
|
|
19
|
-
* Two upstream asks, in preference order:
|
|
20
|
-
* 1. an `?owner=me` filter (or a `my/listings` action) on the list endpoint,
|
|
21
|
-
* with the same `IDAnchorPagination` envelope the other two use;
|
|
22
|
-
* 2. failing that, a `status` filter on it, so at least the published subset
|
|
23
|
-
* can be narrowed without a search module.
|
|
24
|
-
*
|
|
25
|
-
* Until then a host injects a {@link MyListingsSource} and the dashboard
|
|
26
|
-
* works completely; without one it shows the real counters and NAMES the
|
|
27
|
-
* absence, because "we cannot ask" and "you have no listings" are different
|
|
28
|
-
* sentences.
|
|
29
|
-
*/
|
|
30
|
-
import { StapelApiError } from "@stapel/core";
|
|
31
|
-
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
32
|
-
/**
|
|
33
|
-
* The error a dashboard without a source reports.
|
|
34
|
-
*
|
|
35
|
-
* `status: 0` on purpose: this is a fact about the deployment's wiring, not
|
|
36
|
-
* something a server said, and a client-side refusal must never be
|
|
37
|
-
* indistinguishable from one that came over the wire.
|
|
6
|
+
* The tab → statuses table is `MY_LISTINGS_TAB_STATUSES`, which is a copy of
|
|
7
|
+
* the SERVER's grouping in `views.my_counters`. That is the whole point: the
|
|
8
|
+
* rows this fetches and the count on the tab beside them are the same set,
|
|
9
|
+
* asserted upstream (`tests/test_my_listings.py`) and here.
|
|
38
10
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"owner-scoped list endpoint to fall back on.",
|
|
43
|
-
status: 0,
|
|
44
|
-
});
|
|
11
|
+
export function defaultMyListingsSource(api) {
|
|
12
|
+
return ({ tab, page, signal }) => api.myListings({ ...page, status: MY_LISTINGS_TAB_STATUSES[tab] }, signal !== undefined ? { signal } : {});
|
|
13
|
+
}
|
|
45
14
|
//# sourceMappingURL=mineSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AASvD;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAgB;IACtD,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAC/B,GAAG,CAAC,UAAU,CACZ,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,wBAAwB,CAAC,GAAG,CAAC,EAAE,EAClD,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CACvC,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AA4CzB,mEAAmE;AACnE,wBAAgB,cAAc,IAAI,iBAAiB,CACjD,YAAY,EACZ,cAAc,EACd,iBAAiB,CAClB,CAeA;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,iBAAiB,CAC/C,YAAY,EACZ,cAAc,EACd,cAAc,CACf,CAUA;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CACpD,eAAe,EACf,cAAc,EACd,MAAM,CACP,CAUA;AAED;4EAC4E;AAC5E,wBAAgB,iBAAiB,IAAI,iBAAiB,CACpD,qBAAqB,EACrB,cAAc,EACd,MAAM,CACP,CAUA;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,qBAAqB,EACrB,cAAc,EACd,MAAM,CACP,CAUA;AAED;0CAC0C;AAC1C,wBAAgB,gBAAgB,IAAI,iBAAiB,CACnD,cAAc,EACd,cAAc,EACd,MAAM,CACP,CAWA;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,sBAAsB,EACtB,cAAc,EACd,aAAa,CACd,CAmBA"}
|
package/dist/model/mutations.js
CHANGED
|
@@ -16,10 +16,13 @@ import { listingsQueryKeys } from "./queryKeys.js";
|
|
|
16
16
|
* ── The invalidation rule ──────────────────────────────────────────────────
|
|
17
17
|
*
|
|
18
18
|
* A write that can move `status` or `moderation_status` invalidates the
|
|
19
|
-
* DETAIL, the STATUS probe and the
|
|
20
|
-
* three tabs are defined by status sets (`views.my_counters`),
|
|
21
|
-
* silently moves a row from "drafts" to "active" and a dashboard
|
|
22
|
-
* refetch would show the old number beside the new row
|
|
19
|
+
* DETAIL, the STATUS probe, the COUNTERS and the owner's ROWS — the counters
|
|
20
|
+
* because their three tabs are defined by status sets (`views.my_counters`),
|
|
21
|
+
* so a publish silently moves a row from "drafts" to "active" and a dashboard
|
|
22
|
+
* that did not refetch would show the old number beside the new row; the rows
|
|
23
|
+
* for the same reason, since stapel-listings 0.7.0 gave them a route and they
|
|
24
|
+
* are narrowed by exactly those status sets. Invalidating one and not the
|
|
25
|
+
* other is the shape of the bug where the badge says 2 and the tab shows 3.
|
|
23
26
|
*
|
|
24
27
|
* Nothing here is optimistic except the favourite toggle, and that exception
|
|
25
28
|
* is argued at its own hook.
|
|
@@ -34,6 +37,7 @@ function invalidateListing(queryClient, id) {
|
|
|
34
37
|
void queryClient.invalidateQueries({
|
|
35
38
|
queryKey: listingsQueryKeys.validateDraft(id),
|
|
36
39
|
});
|
|
40
|
+
void queryClient.invalidateQueries({ queryKey: listingsQueryKeys.allMine() });
|
|
37
41
|
}
|
|
38
42
|
/** Start a draft. The server forces `owner` and `status=draft`. */
|
|
39
43
|
export function useCreateDraft() {
|
|
@@ -46,6 +50,9 @@ export function useCreateDraft() {
|
|
|
46
50
|
void queryClient.invalidateQueries({
|
|
47
51
|
queryKey: listingsQueryKeys.myCounters(),
|
|
48
52
|
});
|
|
53
|
+
void queryClient.invalidateQueries({
|
|
54
|
+
queryKey: listingsQueryKeys.allMine(),
|
|
55
|
+
});
|
|
49
56
|
},
|
|
50
57
|
});
|
|
51
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWpE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWpE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,WAAwB,EAAE,EAAU;IAC7D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MAAM,EAAE,KAAK,EAAE,EAAE;YAClC,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;aAC7C,CAAC,CAAC;YACH,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,EAAE;aAC3C,CAAC,CAAC;YACH,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE;aACvC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -36,9 +36,14 @@ export declare const listingsQueryKeys: {
|
|
|
36
36
|
myCounters(): readonly ["listings", "my", "counters"];
|
|
37
37
|
/** The caller's favourites, one keyset page. */
|
|
38
38
|
myFavorites(page: ListingPageKey): readonly ["listings", "my", "favorites", ListingPageKey];
|
|
39
|
-
/** The owner's own rows, per tab
|
|
40
|
-
* this read goes through an injected source. */
|
|
39
|
+
/** The owner's own rows, per tab (`GET my/listings/?status=…`). */
|
|
41
40
|
mine(tab: string, page: ListingPageKey): readonly ["listings", "my", "listings", string, ListingPageKey];
|
|
41
|
+
/** The owner's rows no tab folds in — a takedown. A sibling of `mine` and
|
|
42
|
+
* not one of its tabs, because it answers a different question and must not
|
|
43
|
+
* be evicted when a tab pages. */
|
|
44
|
+
mineUntabbed(): readonly ["listings", "my", "listings", "untabbed"];
|
|
45
|
+
/** Every owner-row page, for an invalidation after a write. */
|
|
46
|
+
allMine(): readonly ["listings", "my", "listings"];
|
|
42
47
|
/** `GET /{pk}/validate-draft/` — the dry run of a publish. */
|
|
43
48
|
validateDraft(id: number): readonly ["listings", "validate-draft", number];
|
|
44
49
|
/** Every favourites PAGE, for an invalidation after a toggle — the cursor
|