Skip to content

Commit

Permalink
Merge pull request #467 from setlife-network/hotfix/1.2.4
Browse files Browse the repository at this point in the history
Hotfix/1.2.4
  • Loading branch information
otech47 authored Jul 16, 2021
2 parents d273d51 + 1fdb4b4 commit b284813
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 49 deletions.
6 changes: 5 additions & 1 deletion src/components/AddProjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const AddProjectDetails = (props) => {
const {
budgetTimeframe,
client,
projectBudget,
projectDate,
projectEndDate,
projectName,
Expand Down Expand Up @@ -136,6 +137,7 @@ const AddProjectDetails = (props) => {
variant='outlined'
currencySymbol={`${currencyInformation['symbol']}`}
minimumValue='0'
maximumValue='2147483647'
outputFormat='string'
decimalCharacter={`${currencyInformation['decimal']}`}
digitGroupSeparator={`${currencyInformation['thousand']}`}
Expand All @@ -155,7 +157,9 @@ const AddProjectDetails = (props) => {
value={budgetTimeframe}
onChange={(event) => (handleTimeframeChange(event.target.value))}
>
{renderTimeframeOptions({ timeframes: EXPECTED_BUDGET_TIMEFRAME_OPTIONS })}
{renderTimeframeOptions(
{ timeframes: EXPECTED_BUDGET_TIMEFRAME_OPTIONS }
)}
</Select>
</FormControl>
</Box>
Expand Down
1 change: 1 addition & 0 deletions src/components/AddProjectForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ const AddProjectForm = (props) => {
<AddProjectDetails
budgetTimeframe={budgetTimeframe}
client={client}
projectBudget={projectBudget}
projectDate={projectDate}
projectEndDate={projectEndDate}
projectName={projectName}
Expand Down
57 changes: 28 additions & 29 deletions src/components/AllocationAddForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const AllocationAddForm = (props) => {
//create allocation with that rate id
const allocationCreated = await createAllocation({
variables: {
amount: Number(rate.total_amount),
amount: Number(Number(rate.total_amount).toFixed(2)),
start_date: moment(startDate).format('YYYY-MM-DD'),
end_date: moment(endDate).format('YYYY-MM-DD'),
date_paid: null,
Expand Down Expand Up @@ -376,41 +376,40 @@ const AllocationAddForm = (props) => {
</DialogTitle>
<Grid container spacing={5} justify='center'>
<Grid item xs={12}>
{
project
{project
? (
<AllocationAddSpecifics
contributor={contributor}
contributors={contributors}
currency={clientCurrency}
payment={payment}
payments={payments}
project={project}
setNewAllocation={setNewAllocation}
selectedContributor={selectedContributor ? selectedContributor : contributors[0]}
setContributor={setSelectedContributor}
setPayment={setSelectedPayment}
/>
)
: client
? (
<AllocationAddSpecifics
contributor={contributor}
contributors={contributors}
currency={clientCurrency}
<AllocationClientSpecifics
client={client}
contributor={selectedContributor}
payment={payment}
payments={payments}
project={project}
project={selectedProject}
setNewAllocation={setNewAllocation}
selectedContributor={selectedContributor ? selectedContributor : contributors[0]}
setContributor={setSelectedContributor}
setProject={setSelectedProject}
/>
) : (
<AllocationProposeSpecifics
contributor={contributor}
setNewAllocation={setNewAllocation}
setPayment={setSelectedPayment}
setProject={setSelectedProject}
/>
)
: client
? (
<AllocationClientSpecifics
client={client}
contributor={selectedContributor}
payment={payment}
project={selectedProject}
setNewAllocation={setNewAllocation}
setContributor={setSelectedContributor}
setProject={setSelectedProject}
/>
) : (
<AllocationProposeSpecifics
contributor={contributor}
setNewAllocation={setNewAllocation}
setPayment={setSelectedPayment}
setProject={setSelectedProject}
/>
)
}
<hr/>
</Grid>
Expand Down
7 changes: 6 additions & 1 deletion src/components/AllocationOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ const AllocationOverview = (props) => {
if (!contributorAllocation) {
setContributorAllocation(allocation)
}

const editButtonDisabled = (
updatedAllocationRate.total_amount == allocationInfo.amount &&
updatedAllocationRate.hourly_rate == allocationInfo.rate.hourly_rate
)

return (
<Dialog
Expand Down Expand Up @@ -259,7 +264,7 @@ const AllocationOverview = (props) => {
<Button
variant='contained'
color='primary'
disabled={updatedAllocationRate.total_amount}
disabled={editButtonDisabled}
onClick={() => handleUpdateAllocation({
allocation: contributorAllocation,
contributor: contributorAllocation.contributor,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AllocationTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const AllocationTile = (props) => {
const weeksOfdDifference = moment.utc(allocation.end_date, 'x').diff(moment(), 'weeks')

return (

<Box
p={2}
boxShadow={3}
borderRadius='borderRadius'
className='AllocationTile'
>
<Grid container alignItems='center' onClick={() => setOpenAllocationOverview(true)}>
<Grid item xs={4} md={1}>
Expand Down
8 changes: 3 additions & 5 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ const Navigation = (props) => {
</Grid>
<Grid item xs={8} sm={6}>
<h2 className='navigation-title'>
{
capitalizeWord({
word: locationTitle.title || optionalLocationTitle
})
}
{capitalizeWord({
word: locationTitle.title || optionalLocationTitle
})}
</h2>
</Grid>
</Grid>
Expand Down
8 changes: 8 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ export const NAV_ITEMS = [
}
]
export const NAV_TITLES = [
{
title: 'Add Client',
locations: ['/client/add']
},
{
title: 'Add Payment',
locations: ['/payments/add']
},
{
title: 'Add Project',
locations: ['/project/add/']
Expand Down
6 changes: 0 additions & 6 deletions src/pages/AddPaymentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ class AddPaymentPage extends React.Component {
align='center'
className='PaymentsAdd'
>
<Header
title='Add Payment'
direction='row'
justify='center'
alignItems='center'
/>
<Grid item xs={10}>
<Typography align='left'>
<strong>
Expand Down
6 changes: 0 additions & 6 deletions src/pages/PaymentsAddPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ class PaymentsAddPage extends React.Component {
align='center'
className='PaymentsAdd'
>
<Header
title='Add Payment'
direction='row'
justify='center'
alignItems='center'
/>
<Grid item xs={10}>
<Typography align='left'>
<strong>
Expand Down

0 comments on commit b284813

Please sign in to comment.