Comments (1)
Alright, let us fix this. And by "us", I actually mean someone on the BAYMS web dev team. (In other words, not me.)
Problem
The problem lies in the way the piece ordering system was designed. Fix the piece ordering, and the piece approval process will work much better than before.
Right now, to set the piece order, numerous AJAX calls are being made, one call for each piece in the program. Furthermore, each call is delayed by a couple hundred milliseconds in order to stop the database from locking up. This is a terrible way of handling it, but it was also the simplest way to get a prototype up and running in time for the first event of the year.
Solution
- Modify "bayms.php"; add an
orderPieces
function which accepts an associative array which maps piece_id's to piece_order's. This will allow us to set all the piece_orders in a single API call. - Modify
api.php
; add aorder_pieces
API call which will decode a JSON object containing the piece_order's from the REQUEST variable. Call the orderPieces function using this object. - Modify
app.js
; change thesaveOrder
function so that it sends all the piece_order values in a single AJAX request.
Extras
To further improve the efficiency, consider minimizing the number of piece_order values being sent. If a value hasn't changed, then don't send it.
To make it even more efficient, consider spacing out the values. Instead of "1, 2, 3, 4, 5...", consider using "10, 20, 30, 40, 50..."; using larger intervals will allow you to later set piece_order's to intermediate values such as 15 and only send a single change... at least, until you run out of room.
from bayms.web.
Related Issues (20)
- Add ensemble_choir, ensemble_woodwind, and ensemble_solo. HOT 1
- Better link handling HOT 1
- Required fields HOT 1
- Search/filter for "members" HOT 1
- Flexible authentication
- Inefficient piece-handling code
- Profanity filter
- Google Sign-In fails in Edge Browser (and Internet Explorer)
- Carpool Map fails on Edge and IE HOT 1
- Add Password Recovery HOT 1
- Add event logging
- User interface for admins to retrieve student/parent emails. HOT 1
- Geocode for carpool_map goes over query limit
- iPad could not see carpool map HOT 2
- Add internal doc only for member to see HOT 1
- Profile Pictures
- Can deleteEvent($event_id) remove all pieces linked with $event_id? HOT 1
- China vs Google HOT 1
- Merge bayms.org and dev.bayms.org HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayms.web.