]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9165 hide tooltips on permissions page, update message
authorStas Vilchik <vilchiks@gmail.com>
Tue, 9 May 2017 08:50:30 +0000 (10:50 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 9 May 2017 08:50:30 +0000 (10:50 +0200)
server/sonar-web/src/main/js/apps/permission-templates/components/ListHeader.js
server/sonar-web/src/main/js/apps/permission-templates/components/Template.js
server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 7f6a6fae4db112074897712cadf43bc2bd2d2131..327003ebb85248678bcb044b3c696cc818850774 100644 (file)
@@ -32,7 +32,7 @@ export default class ListHeader extends React.PureComponent {
       ? <div>
           {permission.description}
           <div className="alert alert-warning spacer-top">
-            {translate('projects_role', permission.key, 'public_projects_warning')}
+            {translate('projects_role.public_projects_warning')}
           </div>
         </div>
       : permission.description);
index f924d2d31b710a4dff0beb7a60ded1ac0c254ad4..5152cb22960651c7f3e16fd27c5eb92245cd05fe 100644 (file)
@@ -206,6 +206,7 @@ export default class Template extends React.PureComponent {
           selectedPermission={this.state.selectedPermission}
           users={allUsers}
           groups={this.state.groups}
+          showPublicProjectsWarning={true}
           onSelectPermission={this.handleSelectPermission}
           onToggleUser={this.handleToggleUser}
           onToggleGroup={this.handleToggleGroup}>
index 4816241040a89dc2396e87ca69ed8194f23a603e..d5c216d865d1a57ef3288ae0551a364d149e9647 100644 (file)
@@ -29,11 +29,16 @@ export default class HoldersList extends React.PureComponent {
     users: React.PropTypes.array.isRequired,
     groups: React.PropTypes.array.isRequired,
     selectedPermission: React.PropTypes.string,
+    showPublicProjectsWarning: React.PropTypes.bool,
     onSelectPermission: React.PropTypes.func.isRequired,
     onToggleUser: React.PropTypes.func.isRequired,
     onToggleGroup: React.PropTypes.func.isRequired
   };
 
+  static defaultProps = {
+    showPublicProjectsWarning: false
+  };
+
   handlePermissionClick = event => {
     event.preventDefault();
     event.currentTarget.blur();
@@ -41,11 +46,12 @@ export default class HoldersList extends React.PureComponent {
   };
 
   renderTooltip = permission =>
-    (permission.key === 'user' || permission.key === 'codeviewer'
+    (this.props.showPublicProjectsWarning &&
+      (permission.key === 'user' || permission.key === 'codeviewer')
       ? <div>
           {permission.description}
           <div className="alert alert-warning spacer-top">
-            {translate('projects_role', permission.key, 'public_projects_warning')}
+            {translate('projects_role.public_projects_warning')}
           </div>
         </div>
       : permission.description);
index 09ef00e5afea760668c02142245a0b49159f697b..d1e6ff744cf3e7559070c81883f0b55ee695cb6a 100644 (file)
@@ -2426,10 +2426,8 @@ projects_role.issueadmin=Administer Issues
 projects_role.issueadmin.desc=Perform advanced editing on issues: marking an issue False Positive / Won't Fix, and changing an Issue's severity. (Users will also need "Browse" permission)
 projects_role.user=Browse
 projects_role.user.desc=Access a project, browse its measures, and create/edit issues for it.
-projects_role.user.public_projects_warning=This option is not editable for public projects. Anyone will still be able to browse even if you apply a template with this option unchecked.
 projects_role.codeviewer=See Source Code
 projects_role.codeviewer.desc=View the project's source code. (Users will also need "Browse" permission)
-projects_role.codeviewer.public_projects_warning=This option is not editable for public projects. Source code will will always be visible even if you apply a template with this option unchecked.
 projects_role.scan=Execute Analysis
 projects_role.scan.desc=Ability to get all settings required to perform an analysis (including the secured settings like passwords) and to push analysis results to the SonarQube server.
 projects_role.bulk_change=Bulk Change
@@ -2441,6 +2439,7 @@ projects_role.turn_x_to_public=Turn "{0}" to Public
 projects_role.turn_project_to_public=Turn Project to Public
 projects_role.are_you_sure_to_turn_project_to_public=Are you sure you want to turn your project to public?
 projects_role.are_you_sure_to_turn_project_to_public.2=Everybody will be able to browse and see the source code of your project.
+projects_role.public_projects_warning=This permission is always granted by default to everybody (anonymous or authenticated user) for public projects. Therefore, the selection made on this page will be applied to private projects only.