Merge different alerts to one component for AddSeats, Renew and Upgrade pages
On three pages AddSeats, Renew and Upgrade pages we show a similiar warning/alert combination, we could merge it into one
The following discussion from !5021 should be addressed:
-
@pslaughter started a discussion: (+1 comment) thought (non-blocking): If we do this check more than once
this.error?.code === ERROR_CODE_MAX_SEATS_EXCEEDED;
, maybe it'd be nice to have a single component to encapsulate this switch on how to present an error withalert-with-link
🤔
Proposal:
For AddSeats, Renew and Upgrade components, extract the combination of the AlertWithLink and ExceedeMaxSeatsError to a separate component.
// this should be a separate component
<exceeded-max-seats-error v-if="hasExceededUserCountForFreeUpgradeError" />
<alert-with-link v-else-if="errorMsg" :alert-message="errorMsg" />
This component should also handle the logic (this.error?.code === ERROR_CODE_MAX_SEATS_EXCEEDED
) when we show ExceedeUserCount warning and the generic error that we show otherwise.