Skip to content

Commit 6a3b89d

Browse files
authored
fix: fix incorrect provider information (#4908)
* fix: fix incorrect provider information
1 parent 1f16998 commit 6a3b89d

File tree

1 file changed

+23
-19
lines changed
  • src/organizations/components/OrgProfileTab

1 file changed

+23
-19
lines changed

src/organizations/components/OrgProfileTab/index.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,46 @@ import CopyableLabeledData from 'src/organizations/components/OrgProfileTab/Copy
1616
import DeletePanel from 'src/organizations/components/OrgProfileTab/DeletePanel'
1717

1818
// Utils
19-
import {getOrg} from 'src/organizations/selectors'
2019
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
2120
import {CLOUD} from 'src/shared/constants'
21+
import {shouldUseQuartzIdentity} from 'src/identity/utils/shouldUseQuartzIdentity'
2222

23-
// Types
23+
// Selectors
2424
import {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
2632
import '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

3334
const 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

Comments
 (0)