From ee2fab297a68aaebcdcb3b71b1fc49f2f89a5d46 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 30 Oct 2017 10:12:27 +0100 Subject: [PATCH] SONAR-10024 Group of buttons shouldn't look like tabs --- .../styles/components/search-navigator.css | 6 --- .../src/main/js/apps/coding-rules/styles.css | 4 +- .../templates/coding-rules-rule-details.hbs | 6 +-- .../coding-rules-workspace-list-item.hbs | 22 ++++---- .../rule/coding-rules-custom-rule.hbs | 8 ++- .../rule/coding-rules-custom-rules.hbs | 5 +- .../rule/coding-rules-rule-description.hbs | 17 +++---- .../templates/rule/coding-rules-rule-meta.hbs | 6 +-- .../rule/coding-rules-rule-profile.hbs | 44 ++++++++-------- .../rule/coding-rules-rule-profiles.hbs | 4 +- .../templates/custom-measures-header.hbs | 4 +- .../apps/groups/templates/groups-header.hbs | 4 +- .../marketplace/components/PluginActions.tsx | 2 +- .../apps/metrics/templates/metrics-header.hbs | 4 +- .../components/OrganizationMembers.js | 12 ++--- .../OrganizationMembers-test.js.snap | 22 ++++---- .../apps/project-admin/key/UpdateKeyForm.js | 14 +++--- .../src/main/js/apps/projects/styles.css | 18 ------- .../quality-gates/components/Condition.js | 50 +++++++++---------- .../quality-gates/components/DetailsHeader.js | 42 +++++++++------- .../quality-gates/components/ListHeader.js | 8 ++- .../apps/quality-profiles/home/PageHeader.tsx | 16 +++--- .../js/apps/users/templates/users-header.hbs | 4 +- 23 files changed, 130 insertions(+), 192 deletions(-) diff --git a/server/sonar-web/src/main/js/app/styles/components/search-navigator.css b/server/sonar-web/src/main/js/app/styles/components/search-navigator.css index 8f9294c9b77..39c48ca9fc9 100644 --- a/server/sonar-web/src/main/js/app/styles/components/search-navigator.css +++ b/server/sonar-web/src/main/js/app/styles/components/search-navigator.css @@ -743,12 +743,6 @@ a.search-navigator-facet:focus .facet-stat { font-size: var(--smallFontSize); } -.search-navigator-workspace-header .button-group, -.search-navigator-workspace-header .button-group > button, -.search-navigator-workspace-header .button-group > .button { - vertical-align: top; -} - .search-navigator-header-component { margin-left: 10px; white-space: nowrap; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/styles.css b/server/sonar-web/src/main/js/apps/coding-rules/styles.css index 2f6abeff06a..954965c874a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/styles.css +++ b/server/sonar-web/src/main/js/apps/coding-rules/styles.css @@ -80,8 +80,8 @@ vertical-align: middle; margin-right: 20px; font-size: var(--smallFontSize); - height: 22px; - line-height: 18px; + height: var(--controlHeight); + line-height: var(--controlHeight); } .coding-rules-detail-property .select2-search-field { diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-rule-details.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-rule-details.hbs index eba42ee65ef..9df22aef867 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-rule-details.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-rule-details.hbs @@ -4,10 +4,8 @@ {{#if isEditable}}
-
- - -
+ +
{{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs index bc729a5054a..4f87b2c55de 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/coding-rules-workspace-list-item.hbs @@ -53,18 +53,16 @@ {{#if canEditQualityProfile}} {{#unless isSelectedProfileBuiltIn}} -
- {{#if activation}} - - {{else}} - {{#unless isTemplate}} - - {{/unless}} - {{/if}} -
+ {{#if activation}} + + {{else}} + {{#unless isTemplate}} + + {{/unless}} + {{/if}} {{/unless}} {{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rule.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rule.hbs index eaff503fc17..32fff8638c6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rule.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rule.hbs @@ -19,10 +19,8 @@ {{#if canDeleteCustomRule}} -
- -
+ {{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rules.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rules.hbs index bd3899109cf..402c99a16c8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rules.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-custom-rules.hbs @@ -4,9 +4,8 @@

{{t 'coding_rules.custom_rules'}}

{{#if canCreateCustomRule}} -
- -
+ {{/if}} +
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-description.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-description.hbs index d0ab5457eeb..17b3e986141 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-description.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-description.hbs @@ -7,9 +7,7 @@
{{{htmlNote}}}
{{/if}} {{#if canCustomizeRule}} -
- -
+ {{/if}} @@ -25,14 +23,11 @@ -
- - {{#if mdNote}} - - {{/if}} -
- {{t 'cancel'}} + + {{#if mdNote}} + + {{/if}} + {{t 'cancel'}} {{> '../../../../components/common/templates/_markdown-tips' }} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-meta.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-meta.hbs index 8f6506a0dbc..4483e6e034f 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-meta.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-meta.hbs @@ -58,10 +58,8 @@ {{join sysTags ', '}}{{/if}} -
- -
- {{t 'cancel'}} + + {{t 'cancel'}} {{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profile.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profile.hbs index c4667774c96..c0b2bfe0619 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profile.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profile.hbs @@ -52,35 +52,31 @@ {{/unless}} - {{#if actions.edit}} - {{#unless isBuiltIn}} - -
- {{#unless isTemplate}} - - {{/unless}} - {{#if parent}} - {{#eq inherit 'OVERRIDES'}} - - {{/eq}} - {{else}} - + {{/unless}} + {{#if parent}} + {{#eq inherit 'OVERRIDES'}} + - {{/if}} -
- - {{/unless}} - {{/if}} + {{/eq}} + {{else}} + + {{/if}} + {{/unless}} + {{/if}} + {{else}} {{#if canWrite}}{{#unless isTemplate}} -
- -
+ {{/unless}}{{/if}} {{/if}} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profiles.hbs b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profiles.hbs index efd296d2074..44131fc2f28 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profiles.hbs +++ b/server/sonar-web/src/main/js/apps/coding-rules/templates/rule/coding-rules-rule-profiles.hbs @@ -5,9 +5,7 @@ {{#if canActivate}} {{#unless isTemplate}} -
- -
+ {{/unless}} {{/if}} diff --git a/server/sonar-web/src/main/js/apps/custom-measures/templates/custom-measures-header.hbs b/server/sonar-web/src/main/js/apps/custom-measures/templates/custom-measures-header.hbs index a8183635b8c..840706f77e2 100644 --- a/server/sonar-web/src/main/js/apps/custom-measures/templates/custom-measures-header.hbs +++ b/server/sonar-web/src/main/js/apps/custom-measures/templates/custom-measures-header.hbs @@ -1,9 +1,7 @@ diff --git a/server/sonar-web/src/main/js/apps/groups/templates/groups-header.hbs b/server/sonar-web/src/main/js/apps/groups/templates/groups-header.hbs index 3a63842e3c2..95ba488355d 100644 --- a/server/sonar-web/src/main/js/apps/groups/templates/groups-header.hbs +++ b/server/sonar-web/src/main/js/apps/groups/templates/groups-header.hbs @@ -2,9 +2,7 @@

{{t 'user_groups.page'}}

-
- -
+

{{t 'user_groups.page.description'}}

diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx index df898dbdbeb..0b8ce1308aa 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx @@ -93,7 +93,7 @@ export default class PluginActions extends React.PureComponent { {isPluginInstalled(plugin) && plugin.updates && plugin.updates.length > 0 && ( -
+
{plugin.updates.map((update, idx) => (

{{t 'custom_metrics.page'}}

-
- -
+

{{t 'custom_metrics.page.description'}}

diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationMembers.js b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationMembers.js index 19f82e66de2..082b013cadd 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationMembers.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationMembers.js @@ -92,13 +92,11 @@ export default class OrganizationMembers extends React.PureComponent { {organization.canAdmin && (
-
- -
+
)}
diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap index 9a13da1aa21..28a46b239f1 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap @@ -67,20 +67,16 @@ exports[`should render actions for admin 1`] = `
-
- -
+ } + />
-
- + - -
+
); } diff --git a/server/sonar-web/src/main/js/apps/projects/styles.css b/server/sonar-web/src/main/js/apps/projects/styles.css index 648972b0eeb..84756987169 100644 --- a/server/sonar-web/src/main/js/apps/projects/styles.css +++ b/server/sonar-web/src/main/js/apps/projects/styles.css @@ -200,24 +200,6 @@ padding-right: 10px; } -.projects-facet-sort { - float: right; - font-weight: normal; - font-size: 11px; - color: var(--secondFontColor); - text-transform: lowercase; -} - -.projects-facet-sort .button-group { - margin-top: -3px; -} - -.projects-facet-sort .button-small { - padding: 0 6px; - font-size: 11px; - font-weight: normal; -} - .projects-facets-header { margin-bottom: 10px; padding: 10px 0; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js index 07afcdc77d1..f1d109abc76 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js @@ -42,8 +42,9 @@ export default class Condition extends Component { componentDidMount() { const { condition } = this.props; - if (!condition.id) { - this.refs.operator.focus(); + // TODO looks like `this.opetator` is always null or undefined + if (!condition.id && this.operator) { + this.operator.focus(); } } @@ -51,10 +52,9 @@ export default class Condition extends Component { this.setState({ changed: true }); } - handleOperatorChange(option) { - const { value } = option; + handleOperatorChange = ({ value }) => { this.setState({ changed: true, op: value }); - } + }; handlePeriodChange(checked) { const period = checked ? '1' : undefined; @@ -69,9 +69,9 @@ export default class Condition extends Component { this.setState({ changed: true, error: value }); } - handleSaveClick(e) { + handleSaveClick = e => { const { qualityGate, condition, metric, onSaveCondition, onError, onResetError } = this.props; - const period = this.state.period; + const { period } = this.state; const data = { metric: condition.metric, op: metric.type === 'RATING' ? 'GT' : this.state.op, @@ -95,11 +95,11 @@ export default class Condition extends Component { onResetError(); }) .catch(onError); - } + }; - handleUpdateClick(e) { + handleUpdateClick = e => { const { condition, onSaveCondition, metric, onError, onResetError } = this.props; - const period = this.state.period; + const { period } = this.state; const data = { id: condition.id, metric: condition.metric, @@ -124,9 +124,9 @@ export default class Condition extends Component { onResetError(); }) .catch(onError); - } + }; - handleDeleteClick(e) { + handleDeleteClick = e => { const { qualityGate, condition, metric, onDeleteCondition } = this.props; e.preventDefault(); @@ -136,14 +136,14 @@ export default class Condition extends Component { metric, onDelete: () => onDeleteCondition(condition) }).render(); - } + }; - handleCancelClick(e) { + handleCancelClick = e => { const { condition, onDeleteCondition } = this.props; e.preventDefault(); onDeleteCondition(condition); - } + }; renderPeriodValue() { const { condition, metric } = this.props; @@ -201,14 +201,14 @@ export default class Condition extends Component { return (