Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post create team redirection and changed internal name as machine name #885

Merged
merged 4 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules/apigee_edge_teams/src/Entity/Form/TeamForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ public function form(array $form, FormStateInterface $form_state) {
$team = $this->entity;

$form['name'] = [
'#title' => $this->t('Internal name'),
'#title' => $this->t('Machine name'),
'#type' => 'machine_name',
'#machine_name' => [
'source' => ['displayName', 'widget', 0, 'value'],
'label' => $this->t('Internal name'),
'label' => $this->t('Machine name'),
'exists' => [$this, 'exists'],
],
'#field_prefix' => $team->isNew() ? $this->team_prefix : "",
Expand Down Expand Up @@ -308,7 +308,8 @@ public function save(array $form, FormStateInterface $form_state) {
}

}
$form_state->setRedirectUrl($team->toUrl('collection'));
// Redirecting user to team view page to manage the team members and apps.
$form_state->setRedirectUrl($team->toUrl('canonical'));

return $result;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/Form/AppForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public function form(array $form, FormStateInterface $form_state) {
'#type' => 'machine_name',
'#machine_name' => [
'source' => ['displayName', 'widget', 0, 'value'],
'label' => $this->t('Internal name'),
'label' => $this->t('Machine name'),
'exists' => [$this, 'appExists'],
],
'#title' => $this->t('Internal name'),
'#title' => $this->t('Machine name'),
// It should/can not be changed if app is not new.
'#disabled' => !$app->isNew(),
'#default_value' => $app->getName(),
Expand Down