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

Added team notice when renaming or moving a project. #2718

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.Tl("edit_prompt_name_notice", "", params.Namespace.Owner, params.ProjectName)
daved marked this conversation as resolved.
Show resolved Hide resolved
}

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

defaultChoice := !e.out.Config().Interactive
Expand Down
7 changes: 4 additions & 3 deletions internal/runners/projects/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ 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.Tl("move_prompt", "",
params.Namespace.String(),
params.NewOwner,
params.Namespace.Project), &defaultChoice)
daved marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return locale.WrapError(err, "err_move_prompt", "Could not prompt for move confirmation")
}
Expand Down