blob: 0f35c40febf3a207cc3948d62e3b9577dd2e7816 [file] [log] [blame]
/**
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template.CombinedCheckStateUpdatedHtml}
import * as mailTemplate from 'com/google/gerrit/server/mail/Private.soy';
/**
* The .CombinedCheckStateUpdatedHtml template will determine the contents of the email related to
* a change for which the combined check state was updated.
*/
{template .CombinedCheckStateUpdatedHtml}
{@param email: ?}
{@param patchSet: ?}
{@param checker: ?}
{@param oldCombinedCheckState: ?}
{@param newCombinedCheckState: ?}
{@param allCheckers: ?}
<p>
The combined check state has been updated to <strong>{$newCombinedCheckState}</strong> for{sp}
patch set {$patchSet.patchSetId} of this{sp}
{if $email.changeUrl}
<a href="{$email.changeUrl}">change</a>
{else}
change
{/if}.
</p>
{if $checker and $checker.check.state == 'FAILED'
and ($newCombinedCheckState == 'FAILED'
or ($newCombinedCheckState == 'WARNING' and $oldCombinedCheckState != 'FAILED'))}
<p>
Checker{sp}
{if $checker.url}
<a href="{$checker.url}">{$checker.name}</a>
{else}
<strong>{$checker.name}</strong>
{/if}
{sp}updated the check state to{sp}
{if $checker.check.url}
<a href="{$checker.check.url}">{$checker.check.state}</a>
{else}
{$checker.check.state}
{/if}
{if $checker.check.message}
:<br>{$checker.check.message}
{else}
.
{/if}
</p>
{/if}
{if $allCheckers}
<p><u><strong>All checks:</strong></u><br>
{call .PrintCheckers}
{param state: 'Successful' /}
{param checkers: $allCheckers.successful /}
{/call}
{call .PrintCheckers}
{param state: 'Not Relevant' /}
{param checkers: $allCheckers.notRelevant /}
{/call}
{call .PrintCheckers}
{param state: 'Failed' /}
{param checkers: $allCheckers.failed /}
{/call}
{call .PrintCheckers}
{param state: 'Running' /}
{param checkers: $allCheckers.running /}
{/call}
{call .PrintCheckers}
{param state: 'Scheduled' /}
{param checkers: $allCheckers.scheduled /}
{/call}
{call .PrintCheckers}
{param state: 'Not Started' /}
{param checkers: $allCheckers.notStarted /}
{/call}
</p>
{/if}
{if $email.changeUrl}
<p>
{call mailTemplate.ViewChangeButton data="all" /}
</p>
{/if}
{/template}
{template .PrintCheckers}
{@param state: ?}
{@param checkers: ?}
{if length($checkers) > 0}
<strong>{$state}:</strong>{sp}
{for $checker in $checkers}
{if $checker.check.url}
<a href="{$checker.check.url}">{$checker.name}</a>
{else}
{$checker.name}
{/if}
{if not isLast($checker)},{sp}{/if}
{/for}
<br>
{/if}
{/template}