Commit dc0f77e
fix(product-pages): gate program certificate row on certificate_available
The program InfoBox rendered "Certificate: Program certificate on
completion" unconditionally, claiming a certificate could be earned even
for a program with no paid enrollment mode (free-only, or no modes). Gate
the row on `program.certificate_available` — the API's own signal, computed
server-side as `any(mode.requires_payment)` — the same flag
MitxOnlineResourceCard already trusts.
Visibility stays independent of product data: a paid mode with no
purchasable product still shows its (odd) certificate card. That's a
bad-data combination we deliberately don't police in the frontend.
Pin the existing cert-row tests to certificate_available (the factory
default is a random boolean).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0d2f395 commit dc0f77e
3 files changed
Lines changed: 19 additions & 2 deletions
File tree
- frontends/main/src/app-pages/ProductPages
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| 173 | + | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | | - | |
| 1112 | + | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | 1115 | | |
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1123 | 1130 | | |
1124 | 1131 | | |
1125 | 1132 | | |
| |||
1137 | 1144 | | |
1138 | 1145 | | |
1139 | 1146 | | |
| 1147 | + | |
1140 | 1148 | | |
1141 | 1149 | | |
1142 | 1150 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
719 | 721 | | |
720 | 722 | | |
721 | 723 | | |
| |||
0 commit comments