Skip to content

Commit

Permalink
Expiry date hence changed to now and developer renamed to members (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli authored Jul 14, 2023
1 parent 639e6a3 commit 2c5ca06
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apigee_edge.module
Original file line number Diff line number Diff line change
Expand Up @@ -1186,11 +1186,11 @@ function template_preprocess_app_credential(array &$variables) {
/** @var \DateTimeInterface $value */
if ($value !== -1) {
$time_diff = \Drupal::time()->getRequestTime() - intval($value / 1000);
if ($time_diff > 0) {
if ($time_diff >= 0) {
$value = t('@time ago', ['@time' => $dateFormatter->formatTimeDiffSince(intval($value / 1000))]);
}
else {
$value = t('@time hence', ['@time' => $dateFormatter->formatTimeDiffUntil(intval($value / 1000))]);
$value = t('@time from now', ['@time' => $dateFormatter->formatTimeDiffUntil(intval($value / 1000))]);
}
}
else {
Expand Down
4 changes: 2 additions & 2 deletions modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ protected function actions(array $form, FormStateInterface $form_state) {
// Hide the Delete button.
$actions['delete']['#access'] = FALSE;
// Cancel button to redirect the user to team app listing page.
$actions['cancel'] = array (
$actions['cancel'] = [
'#type' => 'link',
'#title' => $this->t('Cancel'),
'#attributes' => ['class' => ['btn btn-outline-primary']],
'#url' => $this->entity->toUrl('collection-by-team'),
);
];
return $actions;
}

Expand Down
4 changes: 2 additions & 2 deletions modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public function buildForm(array $form, FormStateInterface $form_state, TeamInter
$role_options = $this->getRoleOptions();

$form['developers'] = [
'#title' => $this->t('Developers'),
'#description' => $this->t('Enter the email of one or more developers to invite them to the @team, separated by comma.', [
'#title' => $this->t('Email address(es)'),
'#description' => $this->t('Enter the email of one or more developers, separated by commas, to invite them to the @team.', [
'@team' => mb_strtolower($this->team->getEntityType()->getSingularLabel()),
]),
'#type' => 'textarea',
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/DeveloperAppUITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function testCreateAppWithModifiedCredentialLifetime() {
$this->assertSession()->pageTextContains($name);
$this->clickLink($name);
// Result depends on how fast the response was.
$this->assertSession()->pageTextMatches('/1 week (2|3) days hence/');
$this->assertSession()->pageTextMatches('/1 week (2|3) days from now/');

// Change credential lifetime to 0 (Never) days from 10.
$this->drupalGet($url);
Expand Down

0 comments on commit 2c5ca06

Please sign in to comment.