Skip to content

Commit

Permalink
chore: Remove deprecated plan name field from plan and plan represent…
Browse files Browse the repository at this point in the history
…ation types (#1070)
  • Loading branch information
ajay-sentry authored Dec 20, 2024
1 parent f80d9d2 commit 9958e78
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 33 deletions.
12 changes: 6 additions & 6 deletions graphql_api/tests/test_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,18 +678,18 @@ def test_owner_available_plans(self):
query = """{
owner(username: "%s") {
availablePlans {
planName
value
}
}
}
""" % (current_org.username)
data = self.gql_request(query, owner=current_org)
assert data["owner"]["availablePlans"] == [
{"planName": "users-basic"},
{"planName": "users-pr-inappm"},
{"planName": "users-pr-inappy"},
{"planName": "users-teamm"},
{"planName": "users-teamy"},
{"value": "users-basic"},
{"value": "users-pr-inappm"},
{"value": "users-pr-inappy"},
{"value": "users-teamm"},
{"value": "users-teamy"},
]

def test_owner_query_with_no_service(self):
Expand Down
4 changes: 0 additions & 4 deletions graphql_api/tests/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_owner_plan_data_when_trialing(self):
trialStartDate
trialTotalDays
marketingName
planName
value
tierName
billingRate
Expand All @@ -75,7 +74,6 @@ def test_owner_plan_data_when_trialing(self):
"trialStartDate": "2023-06-19T00:00:00",
"trialTotalDays": None,
"marketingName": "Developer",
"planName": "users-trial",
"value": "users-trial",
"tierName": "pro",
"billingRate": None,
Expand Down Expand Up @@ -107,7 +105,6 @@ def test_owner_plan_data_with_account(self):
owner(username: "%s") {
plan {
marketingName
planName
value
tierName
billingRate
Expand All @@ -126,7 +123,6 @@ def test_owner_plan_data_with_account(self):
data = self.gql_request(query, owner=self.current_org)
assert data["owner"]["plan"] == {
"marketingName": "Pro",
"planName": "users-pr-inappy",
"value": "users-pr-inappy",
"tierName": "pro",
"billingRate": "annually",
Expand Down
2 changes: 0 additions & 2 deletions graphql_api/tests/test_plan_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def test_owner_pretrial_plan_data_when_trialing(self):
owner(username: "%s") {
pretrialPlan {
marketingName
planName
value
billingRate
baseUnitPrice
Expand All @@ -48,7 +47,6 @@ def test_owner_pretrial_plan_data_when_trialing(self):
data = self.gql_request(query, owner=current_org)
assert data["owner"]["pretrialPlan"] == {
"marketingName": "Developer",
"planName": "users-basic",
"value": "users-basic",
"billingRate": None,
"baseUnitPrice": 0,
Expand Down
4 changes: 0 additions & 4 deletions graphql_api/types/plan/plan.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ type Plan {
isTrialPlan: Boolean!
marketingName: String!
monthlyUploadLimit: Int
planName: String!
@deprecated(
reason: "Plan representations have used `value` for a while, making the frontend code hard to change"
)
planUserCount: Int
pretrialUsersCount: Int
tierName: String!
Expand Down
5 changes: 0 additions & 5 deletions graphql_api/types/plan/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ def resolve_marketing_name(plan_service: PlanService, info) -> str:
return plan_service.marketing_name


@plan_bindable.field("planName")
def resolve_plan_name(plan_service: PlanService, info) -> str:
return plan_service.plan_name


@plan_bindable.field("value")
def resolve_plan_name_as_value(plan_service: PlanService, info) -> str:
return plan_service.plan_name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
type PlanRepresentation {
marketingName: String!
planName: String!
@deprecated(
reason: "Plan representations have used `value` for a while, making the frontend code hard to change"
)
value: String!
billingRate: String
baseUnitPrice: Int!
benefits: [String!]!
billingRate: String
marketingName: String!
monthlyUploadLimit: Int
value: String!
}
5 changes: 0 additions & 5 deletions graphql_api/types/plan_representation/plan_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ def resolve_marketing_name(plan_data: PlanData, info) -> str:
return plan_data.marketing_name


@plan_representation_bindable.field("planName")
def resolve_plan_name(plan_data: PlanData, info) -> str:
return plan_data.value


@plan_representation_bindable.field("value")
def resolve_plan_value(plan_data: PlanData, info) -> str:
return plan_data.value
Expand Down

0 comments on commit 9958e78

Please sign in to comment.