@@ -16,42 +16,46 @@ import CopyableLabeledData from 'src/organizations/components/OrgProfileTab/Copy
1616import DeletePanel from 'src/organizations/components/OrgProfileTab/DeletePanel'
1717
1818// Utils
19- import { getOrg } from 'src/organizations/selectors'
2019import { isFlagEnabled } from 'src/shared/utils/featureFlag'
2120import { CLOUD } from 'src/shared/constants'
21+ import { shouldUseQuartzIdentity } from 'src/identity/utils/shouldUseQuartzIdentity'
2222
23- // Types
23+ // Selectors
2424import { getMe } from 'src/me/selectors'
25+ import { getOrg } from 'src/organizations/selectors'
26+ import { selectQuartzIdentity } from 'src/identity/selectors'
27+
28+ // Thunks
29+ import { getCurrentOrgDetailsThunk } from 'src/identity/actions/thunks'
2530
31+ // Styles
2632import 'src/organizations/components/OrgProfileTab/style.scss'
27- import {
28- getBillingProviderThunk ,
29- getCurrentOrgDetailsThunk ,
30- } from 'src/identity/actions/thunks'
31- import { shouldUseQuartzIdentity } from 'src/identity/utils/shouldUseQuartzIdentity'
3233
3334const OrgProfileTab : FC = ( ) => {
3435 const me = useSelector ( getMe )
3536 const org = useSelector ( getOrg )
36- const dispatch = useDispatch ( )
37+ const identity = useSelector ( selectQuartzIdentity )
3738
38- const expectQuartzData = CLOUD && isFlagEnabled ( 'uiUnificationFlag' )
39+ const dispatch = useDispatch ( )
3940
4041 useEffect ( ( ) => {
4142 if ( CLOUD && shouldUseQuartzIdentity ( ) ) {
42- if ( ! me . quartzMe . billingProvider ) {
43- dispatch ( getBillingProviderThunk ( ) )
44- }
45- if ( ! me . quartzMe . regionCode ) {
43+ if (
44+ ! me . quartzMe . regionCode ||
45+ ! me . quartzMe . regionName ||
46+ ! identity . org . provider
47+ ) {
4648 dispatch ( getCurrentOrgDetailsThunk ( ) )
4749 }
4850 }
4951 } , [ ] ) // eslint-disable-line react-hooks/exhaustive-deps
5052
53+ const expectQuartzData = CLOUD && isFlagEnabled ( 'uiUnificationFlag' )
54+
5155 const hasSomeQuartzOrgData =
52- me . quartzMe ?. billingProvider ||
53- me . quartzMe ?. regionCode ||
54- me . quartzMe ?. regionName
56+ identity . org ?. provider || me . quartzMe ?. regionCode || me . quartzMe ?. regionName
57+
58+ const orgProviderExists = ! ! identity . org ?. provider
5559
5660 const OrgProfile = ( ) => (
5761 < FlexBox . Child
@@ -72,10 +76,10 @@ const OrgProfileTab: FC = () => {
7276 margin = { ComponentSize . Medium }
7377 justifyContent = { JustifyContent . SpaceBetween }
7478 stretchToFitWidth = { true }
75- style = { { width : '85%' } }
79+ style = { orgProviderExists ? { width : '85%' } : { width : '48 %'} }
7680 >
77- { me . quartzMe ?. billingProvider && (
78- < LabeledData label = "Provider" src = { me . quartzMe . billingProvider } />
81+ { orgProviderExists && (
82+ < LabeledData label = "Cloud Provider" src = { identity . org . provider } />
7983 ) }
8084 { me . quartzMe ?. regionCode && (
8185 < LabeledData label = "Region" src = { me . quartzMe . regionCode } />
0 commit comments