Compare commits

...

3 commits

Author SHA1 Message Date
cadf30b704 chore(release): v1.6.8-aio.4
Some checks failed
lint.yml / chore(release): v1.6.8-aio.4 (push) Failing after 0s
- #68 ticket waves never rendered in the organiser table. The chip built
  its label inline with `LNbits.utils.formatCurrency(...)`, but Vue
  resolves template expressions against the component instance, where the
  `LNbits` global is not in scope. It threw "Cannot read properties of
  undefined (reading 'utils')" and the whole v-for rendered nothing, so
  every event showed an empty wave list however many waves it had.
  Organisers could not see or edit a wave from the LNbits UI at all.

The line came in with the v1.6.8 merge: it is upstream's, and the only
`LNbits.` reference in any template here — display.vue and ticket.vue
have none. `waveSummary` now builds the label in index.js, and trims the
time off wave dates for display.

Frontend only; no Python, no schema, no migration.

Verified in a browser against a two-wave event before tagging: both
chips render with formatted currency and no TypeError.
2026-10-03 21:06:55 +02:00
0e9cc76fef Merge pull request 'Ticket waves never rendered in the organiser table' (#68) from fix/wave-chip-lnbits-global into main
Some checks failed
lint.yml / Merge pull request 'Ticket waves never rendered in the organiser table' (#68) from fix/wave-chip-lnbits-global into main (push) Failing after 0s
Reviewed-on: #68
2026-10-03 19:05:55 +00:00
b4ca9fe65d fix(ui): ticket waves never rendered in the organiser table
Some checks failed
lint.yml / fix(ui): ticket waves never rendered in the organiser table (pull_request) Failing after 0s
The expanded event row showed "Ticket waves" with a + button and an
empty list, however many waves the event had. Reported from aio-demo and
reproduced in a fresh incognito window, so not a caching artifact.

The chip built its label inline with `LNbits.utils.formatCurrency(...)`.
Vue resolves template expressions against the component instance, where
the `LNbits` global is not in scope, so the expression threw

    TypeError: Cannot read properties of undefined (reading 'utils')

and the whole v-for rendered nothing. The promo-code chips beside it
were unaffected, which is what made the list look like a data problem —
the waves were always present in the response.

That line arrived with the v1.6.8 merge: it is upstream's, and upstream
is the only `LNbits.` reference in any template in this extension
(display.vue and ticket.vue have none). So the convention here was
already "format in a method", and the merge quietly broke it.

`waveSummary` now builds the label in index.js, where the global is in
scope. It also trims the day off wave dates for display — closing_date
defaults from event_end_date and can carry a time, which was rendering
as "2026-12-09T16:00:00+01:00" in the chip.

Verified in a browser against a two-wave event: both chips render as
"Primary wave - 2026-10-03 to 2026-11-02 - €30.00 - 50 tickets - 0 sold"
with no TypeError.
2026-10-03 20:53:27 +02:00
3 changed files with 22 additions and 18 deletions

View file

@ -1,6 +1,6 @@
{ {
"id": "events", "id": "events",
"version": "1.6.8-aio.3", "version": "1.6.8-aio.4",
"name": "Events", "name": "Events",
"repo": "https://git.atitlan.io/aiolabs/events", "repo": "https://git.atitlan.io/aiolabs/events",
"short_description": "Sell and register event tickets", "short_description": "Sell and register event tickets",

View file

@ -414,6 +414,26 @@ window.PageEvents = {
this.ticketImageUploadTarget = null this.ticketImageUploadTarget = null
} }
}, },
waveSummary(eventId, wave) {
// Built here, not in the template. Vue resolves template expressions
// against the component instance, where the `LNbits` global is NOT
// in scope — upstream's v1.6.8 chip called `LNbits.utils` inline and
// threw "Cannot read properties of undefined (reading 'utils')",
// which killed the whole v-for and left the wave list looking empty.
// No other template in this extension touches `LNbits` directly.
const price = this.isFiatCurrency(wave.currency)
? LNbits.utils.formatCurrency(
Number(wave.price_per_ticket || 0).toFixed(2),
wave.currency
)
: `${wave.price_per_ticket} sats`
// Wave dates can carry a time (closing_date defaults from
// event_end_date); show the day only.
const opens = String(wave.opening_date || '').slice(0, 10)
const closes = String(wave.closing_date || '').slice(0, 10)
const sold = this.soldTicketsForWave(eventId, wave.id)
return `${wave.title} - ${opens} to ${closes} - ${price} - ${wave.amount_tickets} tickets - ${sold} sold`
},
soldTicketsForWave(eventId, waveId) { soldTicketsForWave(eventId, waveId) {
return this.allPaidTickets.filter( return this.allPaidTickets.filter(
ticket => ticket =>

View file

@ -271,23 +271,7 @@
> >
<span <span
style="white-space: normal; line-height: 1.3" style="white-space: normal; line-height: 1.3"
v-text=" v-text="waveSummary(props.row.id, wave)"
`${wave.title} - ${wave.opening_date} to ${
wave.closing_date
} - ${
isFiatCurrency(wave.currency)
? LNbits.utils.formatCurrency(
Number(
wave.price_per_ticket || 0
).toFixed(2),
wave.currency
)
: `${wave.price_per_ticket} sats`
} - ${wave.amount_tickets} tickets - ${soldTicketsForWave(
props.row.id,
wave.id
)} sold`
"
></span> ></span>
</q-chip> </q-chip>
</div> </div>