Skip to content

Commit

Permalink
Merge pull request #618 from pagopa/hotifx/pin-4173-fix-missing-upgra…
Browse files Browse the repository at this point in the history
…de-agreement-button

Hotfix: PIN-4173 - Fix missing upgrade agreement button
  • Loading branch information
ruggerocastagnola authored Oct 23, 2023
2 parents 67ae6ad + 44fdbf4 commit 3d5d958
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "interop-dashboard-frontend",
"version": "1.0.37",
"version": "1.0.38",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/agreement.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export const canAgreementBeUpgraded = (agreement?: Agreement) => {
const isActiveDescriptorPublishedOrSuspended = ['PUBLISHED', 'SUSPENDED'].includes(
eserviceActiveDescriptor.state
)
const hasNewVersion = eserviceActiveDescriptor.version > agreement.eservice.version
const hasNewVersion =
parseInt(eserviceActiveDescriptor.version, 10) > parseInt(agreement.eservice.version, 10)
const isAgreementActiveOrSuspended = ['ACTIVE', 'SUSPENDED'].includes(agreement.state)

return hasNewVersion && isActiveDescriptorPublishedOrSuspended && isAgreementActiveOrSuspended
Expand Down

0 comments on commit 3d5d958

Please sign in to comment.