Skip to content

Commit

Permalink
enhance: more clever URL param resolution, don't fail if it's missing…
Browse files Browse the repository at this point in the history
… or if the view in question doesn't exist
  • Loading branch information
marcelgerber committed Jul 25, 2024
1 parent 789950b commit 796cae3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 645 deletions.
9 changes: 3 additions & 6 deletions site/multiDim/MultiDimDataPageConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ export class MultiDimDataPageConfig {
* - If there is at least one available view for choices[leftmost, ..., cur], continue.
* - Otherwise, for dimension `cur`, find the first choice that has at least one available view.
*
* `selectedChoices` is expected to be fully-qualified, i.e. it should contain a choice for every available dimension.
*
* The method returns two values:
* - `selectedChoices` is the updated version of the input `selectedChoices`, where choices have been adapted to make sure there are available views.
* - `selectedChoices` is the updated version of the input `selectedChoices`, where choices have been adapted to make sure there are available views. It is fully-qualified, i.e. it has choices for all dimensions.
* - `dimensionsWithAvailableChoices` indicates for each dimension which choices are available, and excludes the ones that are excluded by choices left of it.
*
* - @marcelgerber, 2024-07-22
Expand All @@ -98,9 +96,8 @@ export class MultiDimDataPageConfig {
updatedSelectedChoices[currentDimSlug] =
selectedChoices[currentDimSlug]
} else {
throw new Error(
`Missing or invalid choice for dimension ${currentDimSlug}`
)
updatedSelectedChoices[currentDimSlug] =
availableViewsBeforeSelection[0].dimensions[currentDimSlug]
}

const availableViewsAfterSelection = this.filterViewsByDimensions(
Expand Down
Loading

0 comments on commit 796cae3

Please sign in to comment.