Skip to content

Commit 98f4f7a

Browse files
authored
feat: transition from /quartz/me to /quartz/identity endpoint (#4822)
1 parent b777467 commit 98f4f7a

File tree

29 files changed

+626
-71
lines changed

29 files changed

+626
-71
lines changed

cypress/e2e/cloud/explorer.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('DataExplorer', () => {
3636

3737
it('can use the dynamic flux function selector to build a query', () => {
3838
cy.setFeatureFlags({
39+
uiUnificationFlag: true,
3940
fluxDynamicDocs: true,
4041
}).then(() => {
4142
cy.get('.view-line').should('be.visible')
@@ -68,6 +69,7 @@ describe('DataExplorer', () => {
6869

6970
it('can use the dynamic flux function search bar to search by package or function name', () => {
7071
cy.setFeatureFlags({
72+
uiUnificationFlag: true,
7173
fluxDynamicDocs: true,
7274
}).then(() => {
7375
cy.get('.view-line').should('be.visible')

cypress/e2e/cloud/flows.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ describe('Flows', () => {
195195

196196
it('can use the dynamic flux function selector to build a query', () => {
197197
cy.setFeatureFlags({
198+
uiUnificationFlag: true,
198199
fluxDynamicDocs: true,
199200
}).then(() => {
200201
cy.getByTestID('preset-script')
@@ -288,7 +289,10 @@ describe('Flows with newQueryBuilder flag on', () => {
288289
cy.signin()
289290
cy.get('@org').then(({id}: Organization) =>
290291
cy.fixture('routes').then(({orgs}) => {
291-
cy.setFeatureFlags({newQueryBuilder: true}).then(() => {
292+
cy.setFeatureFlags({
293+
newQueryBuilder: true,
294+
uiUnificationFlag: true,
295+
}).then(() => {
292296
cy.visit(`${orgs}/${id}`)
293297
})
294298
})

cypress/e2e/cloud/helpBar.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ describe('Help bar support for free account users', () => {
66
cy.setFeatureFlags({
77
helpBar: true,
88
helpBarSfdcIntegration: true,
9+
uiUnificationFlag: true,
910
}).then(() => {
1011
cy.quartzProvision({
1112
accountType: 'free',
@@ -42,6 +43,7 @@ describe('Help bar support for PAYG users', () => {
4243
cy.setFeatureFlags({
4344
helpBar: true,
4445
helpBarSfdcIntegration: true,
46+
uiUnificationFlag: true,
4547
}).then(() => {
4648
cy.quartzProvision({
4749
accountType: 'pay_as_you_go',

cypress/e2e/cloud/home.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe('Home Page Tests', () => {
88
cy.getByTestID('home-page--header').should('be.visible')
99
cy.setFeatureFlags({
1010
alertsActivity: true,
11+
uiUnificationFlag: true,
1112
}).then(() => cy.getByTestID('nav-item-flows').should('be.visible'))
1213
})
1314
})

cypress/e2e/cloud/pinned.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('Pinned Items', () => {
99
orgID = id
1010
cy.setFeatureFlags({
1111
pinnedItems: true,
12+
uiUnificationFlag: true,
1213
})
1314
cy.getByTestID('tree-nav')
1415
})
@@ -26,6 +27,7 @@ describe('Pinned Items', () => {
2627
cy.createDashboard(orgID)
2728
cy.setFeatureFlags({
2829
pinnedItems: true,
30+
uiUnificationFlag: true,
2931
})
3032
cy.getByTestID('nav-item-dashboards').should('be.visible')
3133
cy.getByTestID('nav-item-dashboards').click()
@@ -218,6 +220,7 @@ from(bucket: "${name}"{rightarrow}
218220
beforeEach(() => {
219221
cy.setFeatureFlags({
220222
pinnedItems: true,
223+
uiUnificationFlag: true,
221224
})
222225
cy.intercept('GET', '/api/v2private/notebooks*').as('getNotebooks')
223226
cy.intercept('PATCH', '/api/v2private/notebooks/*').as('updateNotebook')

cypress/e2e/cloud/subscriptions.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ describe('Subscriptions', () => {
1212
cy.visit(`${orgs}/${id}/load-data/sources`)
1313
cy.setFeatureFlags({
1414
subscriptionsUI: true,
15+
uiUnificationFlag: true,
1516
})
1617
cy.getByTestID('subscriptions--tab').should('be.visible')
1718
cy.intercept('POST', `/api/v2private/broker/subs*`).as(
@@ -617,6 +618,7 @@ describe('Subscriptions', () => {
617618
cy.setFeatureFlags({
618619
subscriptionsUI: true,
619620
subscriptionsSinglePage: true,
621+
uiUnificationFlag: true,
620622
})
621623
let subscription = 'My Subscription'
622624
createBasicLPSubscription(subscription)
@@ -704,6 +706,7 @@ describe('Subscriptions', () => {
704706
cy.setFeatureFlags({
705707
subscriptionsUI: true,
706708
subscriptionsSinglePage: true,
709+
uiUnificationFlag: true,
707710
})
708711
let subscription = 'My Subscription 2'
709712
cy.getByTestID('subscriptions--tab').click()
@@ -889,6 +892,7 @@ describe('Subscriptions', () => {
889892
cy.setFeatureFlags({
890893
subscriptionsUI: true,
891894
subscriptionsSinglePage: true,
895+
uiUnificationFlag: true,
892896
})
893897

894898
let subscription = 'My Subscription 3'

cypress/e2e/cloud/usage.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe('Usage Page Free User No Data', () => {
1212
cy.flush().then(() =>
1313
cy.signin().then(() => {
1414
cy.get('@org').then(({id}: Organization) => {
15-
cy.setFeatureFlags({uiUnificationFlag: true}).then(() => {
15+
cy.setFeatureFlags({
16+
uiUnificationFlag: true,
17+
}).then(() => {
1618
cy.quartzProvision({
1719
hasData: false,
1820
accountType: 'free',
@@ -116,7 +118,9 @@ describe('Usage Page PAYG With Data', () => {
116118
cy.flush().then(() =>
117119
cy.signin().then(() => {
118120
cy.get('@org').then(({id}: Organization) => {
119-
cy.setFeatureFlags({uiUnificationFlag: true}).then(() => {
121+
cy.setFeatureFlags({
122+
uiUnificationFlag: true,
123+
}).then(() => {
120124
cy.quartzProvision({
121125
hasData: true,
122126
accountType: 'pay_as_you_go',

cypress/e2e/cloud/users.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('Users Page', () => {
55
cy.flush().then(() =>
66
cy.signin().then(() => {
77
cy.get('@org').then(({id}: Organization) => {
8-
cy.setFeatureFlags({uiUnificationFlag: true}).then(() => {
8+
cy.setFeatureFlags({
9+
uiUnificationFlag: true,
10+
}).then(() => {
911
cy.quartzProvision({
1012
hasUsers: true,
1113
}).then(() => {

cypress/e2e/cloud/zuoraOutage.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ describe('Billing Page Free Users', () => {
77
cy.get('@org').then(() => {
88
cy.setFeatureFlags({
99
quartzZuoraDisabled: true,
10+
uiUnificationFlag: true,
1011
}).then(() => {
1112
cy.quartzProvision({
1213
accountType: 'free',

src/billing/components/BillingPageContents.tsx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// Constants
2+
import {CLOUD} from 'src/shared/constants'
3+
14
// Libraries
2-
import React, {FC} from 'react'
3-
import {useSelector} from 'react-redux'
5+
import React, {FC, useEffect} from 'react'
6+
import {useSelector, useDispatch} from 'react-redux'
47

58
// Components
69
import BillingFree from 'src/billing/components/Free/Free'
@@ -10,14 +13,29 @@ import MarketplaceBilling from 'src/billing/components/marketplace/MarketplaceBi
1013
// Utils
1114
import {getQuartzMe} from 'src/me/selectors'
1215

16+
// Thunks
17+
import {getBillingProviderThunk} from 'src/identity/actions/thunks'
18+
import {shouldUseQuartzIdentity} from 'src/identity/utils/shouldUseQuartzIdentity'
19+
1320
const BillingPageContents: FC = () => {
21+
const dispatch = useDispatch()
1422
const quartzMe = useSelector(getQuartzMe)
1523

16-
if (
17-
(quartzMe?.accountType === 'pay_as_you_go' ||
18-
quartzMe?.accountType === 'contract') &&
19-
quartzMe?.billingProvider !== 'zuora'
20-
) {
24+
useEffect(() => {
25+
if (!CLOUD) {
26+
return
27+
}
28+
29+
if (shouldUseQuartzIdentity() && !quartzMe.billingProvider) {
30+
dispatch(getBillingProviderThunk())
31+
}
32+
}, []) // eslint-disable-line react-hooks/exhaustive-deps
33+
34+
if (quartzMe?.billingProvider === null) {
35+
return <BillingFree />
36+
}
37+
38+
if (quartzMe?.billingProvider !== 'zuora') {
2139
return <MarketplaceBilling />
2240
}
2341

0 commit comments

Comments
 (0)