learninglocker
learninglocker copied to clipboard
fix(Exports): Columns ordered incorrectly after JSON edit. (LL-175)
What version were you using?
4.4.0
What steps can we follow to reproduce the behaviour?
- Create a JSON model for the export expl :
{
"_id": 1,
"id": "$statement.id",
"WHO_NT": "$statement.actor.name",
"WHO_EMAIL": "$statement.actor.mbox",
"SUCCESS": "$statement.result.success",
"POINTS": "$statement.result.score.raw",
"MAX_POINTS": "$statement.result.score.max",
"PERCENTAGE": "$statement.result.score.scaled",
"DURATION": "$statement.result.duration",
"WHEN": "$statement.timestamp",
"WHAT": "$statement.object.id"
}
- Source > Export Panel > Manage > Add new
- Click the "ion-code" button to display the textarea
- paste the JSON model
- Click the "ion-code" button again to display the the model as table
What is the actual behaviour?
The row are listed in another order than the one of the JSON model
| Column | Source |
|---|---|
| POINTS | $statement.result.score.raw |
| SUCCESS | $statement.result.success |
| WHAT | $statement.object.id |
| WHO_NT | $statement.actor.name |
| DURATION | $statement.result.duration |
| PERCENTAGE | $statement.result.score.scaled |
| WHEN | $statement.timestamp |
| id | $statement.id |
| WHO_EMAIL | $statement.actor.mbox |
| MAX_POINTS | $statement.result.score.max |
What is the expected behavior?
The row SHOULD be listed in the same order than the one of the JSON model hence,
| Column | Source |
|---|---|
| id | $statement.id |
| WHO_NT | $statement.actor.name |
| WHO_EMAIL | $statement.actor.mbox |
| SUCCESS | $statement.result.success |
| POINTS | $statement.result.score.raw |
| MAX_POINTS | $statement.result.score.max |
| PERCENTAGE | $statement.result.score.scaled |
| DURATION | $statement.result.duration |
| WHEN | $statement.timestamp |
| WHAT | $statement.object.id |
Is there any additional information that will help us replicate/understand the problem?
With a JSON model with 8 attributes or less the order is respected.
{
"_id": 1,
"id": "$statement.id",
"WHO_NT": "$statement.actor.name",
"WHO_EMAIL": "$statement.actor.mbox",
"SUCCESS": "$statement.result.success",
"POINTS": "$statement.result.score.raw",
"MAX_POINTS": "$statement.result.score.max",
"PERCENTAGE": "$statement.result.score.scaled"
}
Gives
| Column | Source |
|---|---|
| id | $statement.id |
| WHO_NT | $statement.actor.name |
| WHO_EMAIL | $statement.actor.mbox |
| SUCCESS | $statement.result.success |
| POINTS | $statement.result.score.raw |
| MAX_POINTS | $statement.result.score.max |
| PERCENTAGE | $statement.result.score.scaled |
Tracked internally by https://learningpool.atlassian.net/browse/LL-175