@social-mail/social-mail-client 1.2.476 → 1.3.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": "@social-mail/social-mail-client",
3
- "version": "1.2.476",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -154,13 +154,13 @@ export default class StoreItemListView extends AtomControl {
154
154
  itemRenderer={(item: IStoreItem) => <div class="store-item">
155
155
  <a
156
156
  class="name"
157
- title={item.name}
158
- text={item.name}
157
+ title={item.name || item.variantFor?.name || item.name}
158
+ text={item.name || item.variantFor?.name || item.name}
159
159
  href={storeItemLink(item)}/>
160
160
  <label
161
161
  class="description"
162
- title={item.description}
163
- text={item.description}
162
+ title={item.description || item.variantFor?.description || item.description}
163
+ text={item.description || item.variantFor?.description || item.description}
164
164
  />
165
165
  <img
166
166
  src={Bind.oneTimeAsync(() => this.downloadImage(item))}
@@ -169,7 +169,7 @@ export default class StoreItemListView extends AtomControl {
169
169
  class="buy"
170
170
  text="Buy"/>
171
171
  <div class="price">
172
- <label text={ formatPrice(item.storeItemPrices?.[0])}/>
172
+ <label text={ formatPrice(item.storeItemPrices?.[0] ?? item.variantFor?.storeItemPrices?.[0] )}/>
173
173
  </div>
174
174
  </div>}
175
175
  />
@@ -239,7 +239,6 @@ export default class StoreItemListView extends AtomControl {
239
239
  .where((x) =>
240
240
  x.itemType in [ "product", "service", "resource"]
241
241
  && x.sizeForID === null
242
- && x.variantForID === null
243
242
  );
244
243
  if (search) {
245
244
  search = search + "%";
@@ -260,7 +259,8 @@ export default class StoreItemListView extends AtomControl {
260
259
  const items = await q.orderByDescending((x) => x.storeItemID)
261
260
  .include((x) => [
262
261
  x.storeItemPrices,
263
- x.storeItemTags.forEach((t) => t.tag)
262
+ x.storeItemTags.forEach((t) => t.tag),
263
+ x.variantFor
264
264
  ])
265
265
  // .trace()
266
266
  .toPagedList({
@@ -3,4 +3,5 @@ import { toBase36 } from "../../common/toBase36";
3
3
  import { IStoreItem } from "../../model/model";
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-base-to-string
6
- export const storeItemLink = (item: IStoreItem) => apiPath(`/store/${toBase36(item.storeID)}/${ toBase36(item.storeItemID)}/${encodeURIComponent(item.name)}`);
6
+ export const storeItemLink = (item: IStoreItem) =>
7
+ apiPath(`/store/${toBase36(item.storeID)}/${ toBase36(item.variantForID ?? item.storeItemID)}/${encodeURIComponent(item.name)}`);