From e0c8eb98c14ad54b8b561e0715dfa00f58c1583c Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 7 Nov 2023 11:52:49 +0000 Subject: [PATCH] Show the git sync modal to read-only users (#15301) GitOrigin-RevId: e002815fa7c18d497260e6344a4e8de95d7bacef --- services/web/app/src/Features/Project/ProjectController.js | 6 ++++-- services/web/frontend/extracted-translations.json | 1 + services/web/locales/en.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index fcf7952e39..33192c4a21 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -834,10 +834,12 @@ const ProjectController = { !userHasInstitutionLicence const showPersonalAccessToken = - !Features.hasFeature('saas') || - req.query?.personal_access_token === 'true' + userId && + (!Features.hasFeature('saas') || + req.query?.personal_access_token === 'true') const optionalPersonalAccessToken = + userId && !showPersonalAccessToken && personalAccessTokenAssignment.variant === 'enabled' // `?personal-access-token=enabled` diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 1e3262d405..5f700e9331 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -413,6 +413,7 @@ "git_bridge_modal_description": "", "git_bridge_modal_enter_authentication_token": "", "git_bridge_modal_git_authentication_tokens": "", + "git_bridge_modal_read_only": "", "git_bridge_modal_see_once": "", "git_bridge_modal_tokens_description": "", "git_bridge_modal_use_previous_token": "", diff --git a/services/web/locales/en.json b/services/web/locales/en.json index c67379f785..77c47ba078 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -664,6 +664,7 @@ "git_bridge_modal_description": "You can git clone your project using the link displayed below.", "git_bridge_modal_enter_authentication_token": "When prompted for a password, enter your new authentication token:", "git_bridge_modal_git_authentication_tokens": "Git authentication tokens", + "git_bridge_modal_read_only": "You have read-only access to this project. This means you can pull from __appName__ but you can’t push any changes you make back to this project.", "git_bridge_modal_see_once": "You’ll only see this token once. To delete it or generate a new one, visit Account Settings. For detailed instructions and troubleshooting, read our <0>help page.", "git_bridge_modal_tokens_description": "To git clone your project you’ll need the link below and a Git authentication token.", "git_bridge_modal_use_previous_token": "If you’re prompted for a password, you can use a previously generated Git authentication token. Or you can generate a new one in Account Settings. For more support, read our <0>help page.",