Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fix usage of subscription id and externalId #400

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export const CustomerSubscriptionsList = forwardRef<
{isDowngrading && !!nextPlan && (
<SubscriptionItem
ref={subscriptionItemRef}
subscriptionId={externalId}
subscriptionId={id}
subscriptionExternalId={externalId}
subscriptionName={nextName}
date={nextPendingStartDate}
plan={nextPlan}
Expand All @@ -126,7 +127,8 @@ export const CustomerSubscriptionsList = forwardRef<
)}
<SubscriptionItem
ref={subscriptionItemRef}
subscriptionId={externalId}
subscriptionId={id}
subscriptionExternalId={externalId}
subscriptionName={name}
date={startedAt}
plan={plan}
Expand Down
15 changes: 13 additions & 2 deletions src/components/customers/subscriptions/SubscriptionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gql`

interface SubscriptionItemProps {
subscriptionId: string
subscriptionExternalId: string
subscriptionName?: string | null
date: string
plan: SubscriptionItemPlanFragment
Expand All @@ -46,7 +47,17 @@ export interface SubscriptionItemRef {
}

export const SubscriptionItem = forwardRef<SubscriptionItemRef, SubscriptionItemProps>(
({ subscriptionId, subscriptionName, date, plan, isPending }: SubscriptionItemProps, ref) => {
(
{
subscriptionId,
subscriptionExternalId,
subscriptionName,
date,
plan,
isPending,
}: SubscriptionItemProps,
ref
) => {
const { translate } = useInternationalization()
const { addSubscriptionDialogRef, editSubscriptionDialogRef, terminateSubscriptionDialogRef } =
(ref as MutableRefObject<SubscriptionItemRef>)?.current
Expand Down Expand Up @@ -134,7 +145,7 @@ export const SubscriptionItem = forwardRef<SubscriptionItemRef, SubscriptionItem
variant="quaternary"
align="left"
onClick={() => {
navigator.clipboard.writeText(subscriptionId)
navigator.clipboard.writeText(subscriptionExternalId)
addToast({
severity: 'info',
translateKey: 'text_62d94cc9ccc5eebcc03160a0',
Expand Down