From 0dd6629a2dba7c011e03c5f39659dc516da28456 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 24 Apr 2020 08:40:54 -0400 Subject: [PATCH] Automatically add default user as reviewer. Contributions looked like they had no reviewer when reviewed by the default user. --- .../pgBackRestDoc/Custom/DocCustomRelease.pm | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm b/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm index c89035a0b..7abda3e3b 100644 --- a/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm +++ b/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm @@ -173,6 +173,26 @@ sub contributorTextGet push @{$stryItemContributor}, $self->{strContributorDefault} } + # Add the default user as a reviewer if there are no reviewers listed and default user is not already a contributor + if (@$stryItemContributor == 0 && $strContributorType eq XML_RELEASE_ITEM_REVIEWER) + { + my $bFound = false; + + foreach my $strContributor (@{$$hItemContributorType{&XML_RELEASE_ITEM_CONTRIBUTOR}}) + { + if ($strContributor eq $self->{strContributorDefault}) + { + $bFound = true; + last; + } + } + + if (!$bFound) + { + push @{$stryItemContributor}, $self->{strContributorDefault} + } + } + $$hItemContributorType{$strContributorType} = $stryItemContributor; } @@ -197,7 +217,7 @@ sub contributorTextGet } # Remove the default user if they are the only one in a group (to prevent the entire page from being splattered with one name) - foreach my $strContributorType (XML_RELEASE_ITEM_IDEATOR, XML_RELEASE_ITEM_CONTRIBUTOR, XML_RELEASE_ITEM_REVIEWER) + foreach my $strContributorType (XML_RELEASE_ITEM_IDEATOR, XML_RELEASE_ITEM_CONTRIBUTOR) { if (@{$$hItemContributorType{$strContributorType}} == 1 && @{$$hItemContributorType{$strContributorType}}[0] eq $self->{strContributorDefault})