Skip to content

Commit 4cd987e

Browse files
committed
pr review fixes
1 parent 2a6ff01 commit 4cd987e

File tree

6 files changed

+28
-26
lines changed

6 files changed

+28
-26
lines changed

src/api/billingAccounts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { axiosInstance as axios } from './requestInterceptor'
22
import { TC_API_URL } from '../config/constants'
33

44
/**
5-
* Get a user groups based on it's member id and membership type
5+
* Get billing accounts based on project id
66
*
77
* @param {String} projectId Id of the project
88
*

src/projects/detail/components/BillingAccountField/index.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ class BillingAccountField extends React.Component {
2626
.then(() => {
2727
if (this.props.billingAccountId) {
2828
this.setState(state => {
29-
const filteredArray = state.billingAccounts.filter(
30-
({tcBillingAccountId}) =>
31-
tcBillingAccountId === this.props.billingAccountId
32-
)
33-
if (filteredArray.length === 0) {
29+
const existentBillingAccount = _.find(state.billingAccounts, {
30+
tcBillingAccountId: this.props.billingAccountId
31+
})
32+
if (!existentBillingAccount) {
3433
const billingAccountObj = {
3534
name: '<Assigned Account>',
3635
tcBillingAccountId: this.props.billingAccountId
@@ -41,7 +40,7 @@ class BillingAccountField extends React.Component {
4140
}
4241
} else {
4342
return {
44-
selectedBillingAccount: this.mapOpts(filteredArray[0])
43+
selectedBillingAccount: this.mapOpts(existentBillingAccount)
4544
}
4645
}
4746
})
@@ -63,27 +62,22 @@ class BillingAccountField extends React.Component {
6362
}
6463

6564
render() {
66-
const mapOpts = opt => ({
67-
label: `${opt.name} (${opt.tcBillingAccountId})`,
68-
value: opt.tcBillingAccountId
69-
})
7065
return (
7166
<div className={styles.container}>
72-
<div>Choose a Billing Account</div>
67+
<div className={styles.fieldName}>Choose a Billing Account</div>
7368
<Select
7469
placeholder={
7570
this.state.billingAccounts.length > 0
7671
? 'Select billing account'
7772
: 'No Billing Account Available'
7873
}
79-
heightAuto
8074
onChange={this.handleChange}
8175
value={this.state.selectedBillingAccount}
82-
options={this.state.billingAccounts.map(mapOpts)}
76+
options={this.state.billingAccounts.map(this.mapOpts)}
8377
isDisabled={this.state.billingAccounts.length === 0}
8478
/>
8579
<a
86-
className="tc-link"
80+
className={styles.manageBillingAccountLink}
8781
href={`${SALESFORCE_PROJECT_LEAD_LINK}${this.props.projectId}`}
8882
target="_blank"
8983
rel="noopener noreferrer"
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
@import '~tc-ui/src/styles/tc-includes';
2+
13
.container {
2-
display: flex;
3-
flex-direction: column;
4-
gap: 10px;
4+
.fieldName {
5+
margin-bottom: 10px;
6+
}
7+
.manageBillingAccountLink {
8+
display: block;
9+
color: $tc-dark-blue-110;
10+
margin-top: 10px;
11+
&:hover {
12+
color: inherit;
13+
}
14+
}
515
}

src/projects/detail/components/EditProjectDefaultsForm/EditProjectDefaultsForm.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
.container {
77
padding: 50px 0 70px 0;
88
margin: 0 50px 20px 50px;
9-
display: flex;
10-
flex-direction: column;
11-
gap: 20px;
129
}
1310
.radio-group-options {
1411
flex-direction: column;
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.container {
2-
display: flex;
3-
flex-direction: column;
4-
gap: 10px;
5-
}
2+
margin: 10px 0 20px 0;
3+
.fieldName {
4+
margin-bottom: 10px;
5+
}
6+
}

src/projects/detail/components/GroupsField/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class GroupsField extends React.Component {
6767
render() {
6868
return (
6969
<div className={styles.container}>
70-
<div>Intended Work Groups</div>
70+
<div className={styles.fieldName}>Intended Work Groups</div>
7171
<FormsySelect
7272
name="groups-field"
7373
isMulti

0 commit comments

Comments
 (0)