Skip to content

Commit de17557

Browse files
committed
'YourBookings (fix): resolve reactivity issue with vue3.4.0'
Tidied up the computed values in YourBooking to stop relying on one computed value looking to another for updates - the reactivity is no longer propagating via this message and appears to be intentional behaviour of the new refactored reactivity system. The filter on bookings was removed as it did not work anyway because the descriptions were not populated. Policies limit users to typically a couple of bookings, so the filter bar adds visual clutter without value. Fixes #30
1 parent f27229c commit de17557

5 files changed

Lines changed: 11 additions & 102 deletions

File tree

src/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"bootstrap": "^5.2.3",
1616
"dayjs": "^1.11.7",
1717
"mustache": "^4.2.0",
18-
"vue": "~3.3.13",
19-
"vue-router": "^4.1.6",
20-
"xstate": "^4.35.4"
18+
"vue": "^3.5.13",
19+
"vue-router": "^4.5.0",
20+
"xstate": "^4.38.3"
2121
},
2222
"devDependencies": {
23-
"@vitejs/plugin-vue": "^4.0.0",
23+
"@vitejs/plugin-vue": "^4.6.2",
2424
"sass": "^1.58.3",
25-
"vite": "^4.1.1"
25+
"vite": "^4.5.5"
2626
}
2727
}

src/src/components/YourBooking.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/src/components/YourBooking.vue

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/src/components/YourBookings.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,19 @@
1-
import YourBooking from "./YourBooking.vue";
21
import DisplayBooking from "./DisplayBooking.vue";
32
import { useBookingService } from "./bookingMachine.js";
43

54
export default {
65
props: [],
76
components: {
8-
YourBooking,
9-
DisplayBooking,
7+
DisplayBooking,
108
},
119
computed: {
1210
bookings() {
13-
return this.state.context.bookings;
14-
},
15-
filteredBookings() {
16-
var filter = this.filter.toLowerCase();
17-
var items = Object.entries(this.bookings);
18-
11+
var items = Object.entries(this.state.context.bookings);
12+
1913
//each item is an array with two elements [0] key and [1] object
2014
items.sort((a, b) => (a[0] > b[0] ? 1 : -1));
2115

22-
if (filter == "") {
23-
return Object.fromEntries(items);
24-
}
25-
let results = items.filter((obj) => {
26-
return obj[1].description.name.toLowerCase().includes(filter);
27-
});
28-
29-
return Object.fromEntries(results);
16+
return Object.fromEntries(items);
3017
},
3118
},
3219
data() {

src/src/components/YourBookings.vue

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,11 @@
88
<div class="col">
99
</div>
1010
<div class="col">
11-
1211
</div>
1312
</div>
1413
<div class="row">
15-
<input v-model="filter" placeholder="filter...">
16-
</div>
17-
<div class="row">
18-
<!--your-booking
19-
v-for="(booking,key) in filteredBookings"
20-
:key="key"
21-
:booking="booking">
22-
</your-booking-->
23-
<display-booking
24-
v-for="(booking,key) in filteredBookings"
14+
<display-booking
15+
v-for="(booking,key) in bookings"
2516
:key="key"
2617
:booking="booking">
2718
</display-booking>

0 commit comments

Comments
 (0)