osuite 2.9.8 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/reviewSurface.js CHANGED
@@ -133,8 +133,16 @@ export function buildReviewSurface(action = {}, options = {}) {
133
133
  ]
134
134
  : [];
135
135
 
136
- const replayUrl = options.baseUrl ? `${String(options.baseUrl).replace(/\/$/, '')}/replay/${actionId}` : null;
137
- const footer = replayUrl ? ['', `${colorize('Replay', BOLD, color)} ${replayUrl}`] : [];
136
+ const baseUrl = options.baseUrl ? String(options.baseUrl).replace(/\/$/, '') : null;
137
+ const replayUrl = baseUrl ? `${baseUrl}/replay/${actionId}` : null;
138
+ // A request still waiting is decided by a person in Studio, so point there.
139
+ const reviewUrl = baseUrl && action.status === 'pending_approval'
140
+ ? `${baseUrl}/approvals?action=${encodeURIComponent(actionId)}`
141
+ : null;
142
+ const footer = [
143
+ ...(reviewUrl ? ['', `${colorize('Review', BOLD, color)} ${reviewUrl}`] : []),
144
+ ...(replayUrl ? [reviewUrl ? null : '', `${colorize('Replay', BOLD, color)} ${replayUrl}`].filter((line) => line !== null) : []),
145
+ ];
138
146
 
139
147
  return [
140
148
  colorize(title, `${BOLD}${CYAN}`, color),