Skip to content

Commit

Permalink
pr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pearl-truss committed Apr 18, 2024
1 parent 7784374 commit f555a3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export const ChangeHistoryV2 = ({
}: ChangeHistoryProps): React.ReactElement => {
const flattenedRevisions = (): flatRevisions[] => {
const result: flatRevisions[] = []
//Reverse revisions to order from earliest to latest revision. This is to correctly set version for each
// contract & recontract.
const reversedRevisions = [...contract.packageSubmissions].reverse()
reversedRevisions.forEach((r, index) => {
contract.packageSubmissions.forEach((r, index) => {
if (r.contractRevision.unlockInfo) {
const newUnlock: flatRevisions = {} as flatRevisions
newUnlock.updatedAt = r.contractRevision.unlockInfo.updatedAt
Expand All @@ -36,10 +33,8 @@ export const ChangeHistoryV2 = ({
if (r.contractRevision.submitInfo) {
const newSubmit: flatRevisions = {} as flatRevisions

// Only set revisionVersion if not the latest revision and if not unlocked. This is not the same
// as the order of change history. The version correlates with each submitted revision.
const revisionVersion =
index !== reversedRevisions.length - 1
index !== contract.packageSubmissions.length - 1
? String(index + 1) //Offset version, we want to start at 1
: undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ export const RateDetailsSummarySectionV2 = ({
const contractFormData =
contract.draftRevision?.formData ||
getLastContractSubmission(contract)?.contractRevision.formData
const rates =
getLastContractSubmission(contract)?.rateRevisions ||
contract.draftRates ||
[]
const rates = isEditing
? contract.draftRates
: getLastContractSubmission(contract)?.rateRevisions
const lastSubmittedDate =
getLastContractSubmission(contract)?.submitInfo.updatedAt

Expand Down

0 comments on commit f555a3b

Please sign in to comment.