From: Pascal Mugnier Date: Thu, 12 Apr 2018 13:10:51 +0000 (+0200) Subject: Feature/pm/hardening 10 04 (#130) X-Git-Tag: 7.5~1364 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eccdc7a58857bf96be6a4721981b2de0f5dbe3c2;p=sonarqube.git Feature/pm/hardening 10 04 (#130) --- diff --git a/server/sonar-web/src/main/js/app/styles/components/page.css b/server/sonar-web/src/main/js/app/styles/components/page.css index 9e9996aea7b..c493b82d22c 100644 --- a/server/sonar-web/src/main/js/app/styles/components/page.css +++ b/server/sonar-web/src/main/js/app/styles/components/page.css @@ -255,6 +255,7 @@ flex-grow: 1; min-width: 740px; padding: 20px; + z-index: var(--pageMainZIndex); } .layout-page-main-inner { diff --git a/server/sonar-web/src/main/js/app/theme.js b/server/sonar-web/src/main/js/app/theme.js index 434a6bc2ecc..37ff59c71bd 100644 --- a/server/sonar-web/src/main/js/app/theme.js +++ b/server/sonar-web/src/main/js/app/theme.js @@ -93,6 +93,8 @@ module.exports = { belowNormalZIndex: '1', // ui elements + pageMainZIndex: '50', + tooltipZIndex: '8000', dropdownMenuZIndex: '7500', diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx index 17d496bfae5..a58ead1f8c7 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx @@ -202,7 +202,7 @@ export default class BulkChangeModal extends React.PureComponent { const query = pickBy( { add_tags: this.state.addTags && this.state.addTags.map(t => t.value).join(), - assign: this.state.assignee, + assign: this.state.assignee ? this.state.assignee.value : null, comment: this.state.comment, do_transition: this.state.transition, remove_tags: this.state.removeTags && this.state.removeTags.map(t => t.value).join(), diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx index 24dac728e91..949bc4e1d78 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/App.tsx @@ -32,6 +32,7 @@ import { import { translate } from '../../../helpers/l10n'; import { getValues } from '../../../api/settings'; import { formatMeasure } from '../../../helpers/measures'; +import Tooltip from '../../../components/controls/Tooltip'; interface Props { branchLikes: BranchLike[]; @@ -77,6 +78,10 @@ export default class App extends React.PureComponent { ); } + isOrphan = (branchLike: BranchLike) => { + return (isShortLivingBranch(branchLike) || isPullRequest(branchLike)) && branchLike.isOrphan; + }; + renderBranchLifeTime() { const { branchLifeTime } = this.state; if (!branchLifeTime) { @@ -140,18 +145,30 @@ export default class App extends React.PureComponent { - {sortBranchesAsTree(branchLikes).map(branchLike => ( - - ))} + {sortBranchesAsTree(branchLikes).map((branchLike, index) => { + const isOrphan = this.isOrphan(branchLike); + const previous = index > 0 ? branchLikes[index - 1] : undefined; + const isPreviousOrphan = previous !== undefined && this.isOrphan(previous); + const showOrphanHeader = isOrphan && !isPreviousOrphan; + return ( + + {showOrphanHeader && ( +
  • + {translate('branches.orphan_branches')} + + + +
  • + )} + +
    + ); + })} diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx index ee90b112e98..36faa6a97e2 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/App-test.tsx @@ -40,11 +40,24 @@ beforeEach(() => { }); it('renders sorted list of branches', () => { - const branchLikes: [MainBranch, LongLivingBranch, ShortLivingBranch, PullRequest] = [ + const branchLikes: [ + MainBranch, + LongLivingBranch, + ShortLivingBranch, + PullRequest, + ShortLivingBranch + ] = [ { isMain: true, name: 'master' }, { isMain: false, name: 'branch-1.0', type: BranchType.LONG }, { isMain: false, mergeBranch: 'master', name: 'feature', type: BranchType.SHORT }, - { base: 'master', branch: 'feature', key: '1234', title: 'Feature PR' } + { base: 'master', branch: 'feature', key: '1234', title: 'Feature PR' }, + { + isMain: false, + mergeBranch: 'foobar', + isOrphan: true, + name: 'feature', + type: BranchType.SHORT + } ]; const wrapper = shallow( - - + + + - + + + - + + + + > + + + +
  • + branches.orphan_branches + + + +
  • + +