From 9d77694bb804ee26fdfd09cbc4c0efffefae4c47 Mon Sep 17 00:00:00 2001 From: Mirjam Aulbach Date: Wed, 27 Sep 2023 10:06:17 +0200 Subject: [PATCH 1/2] Update ClaimBanner Signed-off-by: Mirjam Aulbach --- coral/src/app/features/components/ClaimBanner.test.tsx | 10 +++++----- coral/src/app/features/components/ClaimBanner.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/coral/src/app/features/components/ClaimBanner.test.tsx b/coral/src/app/features/components/ClaimBanner.test.tsx index ae42474bae..ce18353610 100644 --- a/coral/src/app/features/components/ClaimBanner.test.tsx +++ b/coral/src/app/features/components/ClaimBanner.test.tsx @@ -12,7 +12,7 @@ const testProps = { claimEntity: mockClaimEntity, isError: false, hasOpenClaimRequest: false, - hasOpenRequest: false, + hasOpenRequestOnAnyEnv: false, entityOwner: "teamname", }; @@ -70,7 +70,7 @@ describe("ClaimBanner", () => { ); }); @@ -92,7 +92,7 @@ describe("ClaimBanner", () => { ); }); @@ -115,7 +115,7 @@ describe("ClaimBanner", () => { {...testProps} entityType={"topic"} hasOpenClaimRequest={true} - hasOpenRequest={true} + hasOpenRequestOnAnyEnv={true} />, { memoryRouter: true, @@ -151,7 +151,7 @@ describe("ClaimBanner", () => { {...testProps} entityType={"connector"} hasOpenClaimRequest={true} - hasOpenRequest={true} + hasOpenRequestOnAnyEnv={true} />, { memoryRouter: true, diff --git a/coral/src/app/features/components/ClaimBanner.tsx b/coral/src/app/features/components/ClaimBanner.tsx index c976a50c33..a2f665ef56 100644 --- a/coral/src/app/features/components/ClaimBanner.tsx +++ b/coral/src/app/features/components/ClaimBanner.tsx @@ -5,7 +5,7 @@ import illustration from "src/app/images/topic-details-banner-Illustration.svg"; interface ClaimBannerProps { entityType: "topic" | "connector"; entityName: string; - hasOpenRequest: boolean; + hasOpenRequestOnAnyEnv: boolean; hasOpenClaimRequest: boolean; claimEntity: () => void; isError: boolean; @@ -17,14 +17,14 @@ const ClaimBanner = ({ entityType, entityName, hasOpenClaimRequest, - hasOpenRequest, + hasOpenRequestOnAnyEnv, claimEntity, isError, errorMessage, entityOwner, }: ClaimBannerProps) => { - // if there is an open claim request, hasOpenRequest is true, too - if (hasOpenRequest && !hasOpenClaimRequest) { + // if there is an open claim request, hasOpenRequestOnAnyEnv is true, too + if (hasOpenRequestOnAnyEnv && !hasOpenClaimRequest) { // We do not render an InternalLinkButton to the Requests page for this state... // .. because a user cannot see the requests opened by members of other teams return ( From 8e137d7ef42dc451c25a2d7ff7d6a17d2f2c5ee1 Mon Sep 17 00:00:00 2001 From: Mirjam Aulbach Date: Wed, 27 Sep 2023 10:12:13 +0200 Subject: [PATCH 2/2] Use new property when using ClaimBanner Signed-off-by: Mirjam Aulbach --- .../src/app/features/connectors/details/ConnectorDetails.tsx | 4 +++- coral/src/app/features/topics/details/TopicDetails.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/coral/src/app/features/connectors/details/ConnectorDetails.tsx b/coral/src/app/features/connectors/details/ConnectorDetails.tsx index 7fc3abfcff..69ccdaadba 100644 --- a/coral/src/app/features/connectors/details/ConnectorDetails.tsx +++ b/coral/src/app/features/connectors/details/ConnectorDetails.tsx @@ -187,7 +187,9 @@ function ConnectorDetails(props: ConnectorOverviewProps) { connectorData?.connectorInfo.hasOpenClaimRequest } entityOwner={connectorData.connectorInfo.teamName} - hasOpenRequest={connectorData?.connectorInfo.hasOpenRequest} + hasOpenRequestOnAnyEnv={ + connectorData?.connectorInfo.hasOpenRequestOnAnyEnv + } claimEntity={() => setShowClaimModal(true)} isError={isErrorCreateClaimConnectorRequest} errorMessage={claimErrorMessage} diff --git a/coral/src/app/features/topics/details/TopicDetails.tsx b/coral/src/app/features/topics/details/TopicDetails.tsx index b1a4688236..3b23011386 100644 --- a/coral/src/app/features/topics/details/TopicDetails.tsx +++ b/coral/src/app/features/topics/details/TopicDetails.tsx @@ -178,7 +178,9 @@ function TopicDetails(props: TopicOverviewProps) { entityName={topicName} hasOpenClaimRequest={topicData?.topicInfo.hasOpenClaimRequest} entityOwner={topicData.topicInfo.teamname} - hasOpenRequest={topicData?.topicInfo.hasOpenRequest} + hasOpenRequestOnAnyEnv={ + topicData?.topicInfo.hasOpenRequestOnAnyEnv + } claimEntity={() => setShowClaimModal(true)} isError={createClaimTopicRequestIsError} errorMessage={claimErrorMessage}