From acfe2c272eb11a08eac296ba50fd57c632d6cec3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Wed, 18 Oct 2017 12:23:17 +0200 Subject: [PATCH] LICENSE-72 Update set license component to work without an edition --- .../main/js/apps/marketplace/EditionBoxes.tsx | 4 +- .../components/LicenseEditionForm.tsx | 8 ++- .../components/LicenseEditionSet.tsx | 60 +++++++++++-------- .../__tests__/LicenseEditionForm-test.tsx | 1 + .../__tests__/LicenseEditionSet-test.tsx | 7 ++- .../LicenseEditionForm-test.tsx.snap | 14 +++++ .../LicenseEditionSet-test.tsx.snap | 3 +- 7 files changed, 67 insertions(+), 30 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/marketplace/EditionBoxes.tsx b/server/sonar-web/src/main/js/apps/marketplace/EditionBoxes.tsx index e1f5f373f1f..88fc6f4cebc 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/EditionBoxes.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/EditionBoxes.tsx @@ -108,9 +108,11 @@ export default class EditionBoxes extends React.PureComponent { )) )} - {installEdition && ( + {editions && + installEdition && ( diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx index fb513eba0bc..857a40e4058 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx @@ -25,6 +25,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; export interface Props { edition: Edition; + editions: Edition[]; onClose: () => void; updateEditionStatus: (editionStatus: EditionStatus) => void; } @@ -79,7 +80,7 @@ export default class LicenseEditionForm extends React.PureComponent