Commit 71a0af4
authored
sc-16940 handle nil options in report intializer (#5712)
Story card:
[sc-16940](https://app.shortcut.com/simpledotorg/story/16940/fix-template-error-in-user-analytics-dashbooard)
### Because
A NoMethodError was raised in Dashboard::DrRaiReport when the options
parameter was nil.
This caused the User Analytics (Dr. Rai Report) dashboard to fail
rendering.
### This addresses
Safely accesses optional parameters using
options&.dig(:selected_quarter) and options&.dig(:with_non_contactable)
instead of directly referencing options[:selected_quarter] and
options[:with_non_contactable].
### Test instructions
- Open the app.
- Click on the Sync API.
- Check whether the sync request fails or completes successfully.
- Ensure no errors are raised during sync.1 parent 91fbcb1 commit 71a0af4
File tree
2 files changed
+12
-4
lines changed- app/components/dashboard
- spec/components/dashboard
2 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
0 commit comments