Skip to content

Commit

Permalink
Merge pull request #2718 from ActiveState/mitchell/dx-1971
Browse files Browse the repository at this point in the history
Added team notice when renaming or moving a project.
  • Loading branch information
mitchell-as authored Aug 22, 2023
2 parents 3b64f46 + 13328c8 commit 59bbb9c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions internal/locale/locales/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2078,6 +2078,14 @@ err_country_blocked:
other: This service is not available in your region.
err_shortcutdir_writable:
other: Could not continue as we don't have permission to create [ACTIONABLE]{{.V0}}[/RESET].
move_prompt:
other: |
You are about to move the project [NOTICE]{{.V0}}[/RESET] to the organization [NOTICE]{{.V1}}[/RESET].
This action will invalidate any local checkouts that already exist for this project. If you or your team members have checked out this project anywhere else, please update them with the new namespace: [ACTIONABLE]{{.V1}}/{{.V2}}[/RESET].
Continue?
edit_prompt_name_notice:
other: |
Renaming a project will invalidate any local checkouts that already exist for this project. If you or your team members have checked out this project anywhere else, please update them with the new namespace: [ACTIONABLE]{{.V0}}/{{.V1}}[/RESET].
err_edit_local_checkouts:
other: Could not update local checkouts
err_edit_project_mapping:
Expand Down
5 changes: 5 additions & 0 deletions internal/runners/projects/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func (e *Edit) Run(params *EditParams) error {
editMsg += locale.Tl("edit_prompt_repo", " - Repository: {{.V0}}\n", params.Repository)
editable.RepoURL = &params.Repository
}

if params.ProjectName != "" {
editMsg += locale.Tr("edit_prompt_name_notice", params.Namespace.Owner, params.ProjectName)
}

editMsg += locale.Tl("edit_prompt_confirm", "Continue?")

defaultChoice := !e.out.Config().Interactive
Expand Down
4 changes: 1 addition & 3 deletions internal/runners/projects/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ func (m *Move) Run(params *MoveParams) error {
}

defaultChoice := !m.out.Config().Interactive
move, err := m.prompt.Confirm("", locale.Tl("move_prompt",
"You are about to move the project [NOTICE]{{.V0}}[/RESET] to the organization [NOTICE]{{.V1}}[/RESET].\nContinue?",
params.Namespace.String(), params.NewOwner), &defaultChoice)
move, err := m.prompt.Confirm("", locale.Tr("move_prompt", params.Namespace.String(), params.NewOwner, params.Namespace.Project), &defaultChoice)
if err != nil {
return locale.WrapError(err, "err_move_prompt", "Could not prompt for move confirmation")
}
Expand Down

0 comments on commit 59bbb9c

Please sign in to comment.