diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-25 16:53:22 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-30 09:20:37 +0100 |
commit | e4ef72e885308b113d89a7826d1b300c093134cf (patch) | |
tree | d747d066447c0924cf2cfb108bf107a8effd0144 /server/sonar-web/src/main/js/apps/quality-profiles/details | |
parent | eea79d51b8894ef98f1cd02388d06062df343e4d (diff) | |
download | sonarqube-e4ef72e885308b113d89a7826d1b300c093134cf.tar.gz sonarqube-e4ef72e885308b113d89a7826d1b300c093134cf.zip |
update web dependencies (#2752)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/details')
12 files changed, 71 insertions, 47 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx index 2327cd7acc0..204d6ff0348 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeParentForm.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; -import * as Select from 'react-select'; +import * as Modal from 'react-modal'; +import Select from 'react-select'; import { sortBy } from 'lodash'; import { changeProfileParent } from '../../../api/quality-profiles'; import { translate } from '../../../helpers/l10n'; @@ -120,11 +120,9 @@ export default class ChangeParentForm extends React.PureComponent<Props, State> onChange={this.handleSelectChange} options={options} value={ - this.state.selected != null ? ( - this.state.selected - ) : ( - this.props.profile.parentKey || '' - ) + this.state.selected != null + ? this.state.selected + : this.props.profile.parentKey || '' } /> </div> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx index 3467fb01b19..6e1095c4eac 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ChangeProjectsForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import * as escapeHtml from 'escape-html'; import SelectList from '../../../components/SelectList'; import { translate } from '../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx index 524a148dadd..4ffed5d56cc 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileDetails.tsx @@ -43,10 +43,13 @@ export default function ProfileDetails(props: Props) { <ProfileRules {...props} /> <ProfileExporters {...props} /> {profile.actions && - profile.actions.edit && - !profile.isBuiltIn && ( - <ProfilePermissions organization={props.organization || undefined} profile={profile} /> - )} + profile.actions.edit && + !profile.isBuiltIn && ( + <ProfilePermissions + organization={props.organization || undefined} + profile={profile} + /> + )} </div> <div className="quality-profile-grid-right"> <ProfileInheritance {...props} /> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx index 77f8a92a7f1..290ea8f3bb0 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.tsx @@ -120,14 +120,16 @@ export default class ProfileInheritance extends React.PureComponent<Props, State return ( <div className="boxed-group quality-profile-inheritance"> {profile.actions && - profile.actions.edit && - !profile.isBuiltIn && ( - <div className="boxed-group-actions"> - <button className="pull-right js-change-parent" onClick={this.handleChangeParentClick}> - {translate('quality_profiles.change_parent')} - </button> - </div> - )} + profile.actions.edit && + !profile.isBuiltIn && ( + <div className="boxed-group-actions"> + <button + className="pull-right js-change-parent" + onClick={this.handleChangeParentClick}> + {translate('quality_profiles.change_parent')} + </button> + </div> + )} <header className="boxed-group-header"> <h2>{translate('quality_profiles.profile_inheritance')}</h2> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx index 8d892127fc7..2431856c53c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import ProfilePermissionsFormSelect from './ProfilePermissionsFormSelect'; import { searchUsers, diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx index 911bf55cca4..fcf87c6cbe7 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsFormSelect.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import * as Select from 'react-select'; +import Select from 'react-select'; import { debounce, identity } from 'lodash'; import { User, Group } from './ProfilePermissions'; import Avatar from '../../../components/ui/Avatar'; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx index b809abd6a6f..9b1acd46c8e 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileProjects.tsx @@ -130,14 +130,14 @@ export default class ProfileProjects extends React.PureComponent<Props, State> { return ( <div className="boxed-group quality-profile-projects"> {profile.actions && - profile.actions.edit && - !profile.isDefault && ( - <div className="boxed-group-actions"> - <button className="js-change-projects" onClick={this.handleChangeClick}> - {translate('quality_profiles.change_projects')} - </button> - </div> - )} + profile.actions.edit && + !profile.isDefault && ( + <div className="boxed-group-actions"> + <button className="js-change-projects" onClick={this.handleChangeClick}> + {translate('quality_profiles.change_projects')} + </button> + </div> + )} <header className="boxed-group-header"> <h2>{translate('projects')}</h2> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx index b2ab6732921..facde0a4a34 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx @@ -184,14 +184,14 @@ export default class ProfileRules extends React.PureComponent<Props, State> { </table> {profile.actions && - profile.actions.edit && - !profile.isBuiltIn && ( - <div className="text-right big-spacer-top"> - <Link to={activateMoreUrl} className="button js-activate-rules"> - {translate('quality_profiles.activate_more')} - </Link> - </div> - )} + profile.actions.edit && + !profile.isBuiltIn && ( + <div className="text-right big-spacer-top"> + <Link to={activateMoreUrl} className="button js-activate-rules"> + {translate('quality_profiles.activate_more')} + </Link> + </div> + )} </div> {profile.activeDeprecatedRuleCount > 0 && ( <ProfileRulesDeprecatedWarning @@ -201,15 +201,15 @@ export default class ProfileRules extends React.PureComponent<Props, State> { /> )} {compareToSonarWay != null && - compareToSonarWay.missingRuleCount > 0 && ( - <ProfileRulesSonarWayComparison - language={profile.language} - organization={organization} - profile={profile.key} - sonarway={compareToSonarWay.profile} - sonarWayMissingRules={compareToSonarWay.missingRuleCount} - /> - )} + compareToSonarWay.missingRuleCount > 0 && ( + <ProfileRulesSonarWayComparison + language={profile.language} + organization={organization} + profile={profile.key} + sonarway={compareToSonarWay.profile} + sonarWayMissingRules={compareToSonarWay.missingRuleCount} + /> + )} </div> ); } diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissions-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissions-test.tsx.snap index 806ca57c73c..9dd2c1d6c47 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissions-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissions-test.tsx.snap @@ -45,6 +45,7 @@ exports[`renders 2`] = ` className="big-spacer-top" > <ProfilePermissionsUser + key="luke" onDelete={[Function]} profile={ Object { @@ -65,6 +66,7 @@ exports[`renders 2`] = ` "name": "Lambda", } } + key="Lambda" onDelete={[Function]} profile={ Object { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsForm-test.tsx.snap index d8b0f2354d0..7acbdb7e005 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsForm-test.tsx.snap @@ -12,7 +12,9 @@ exports[`adds group 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" @@ -72,7 +74,9 @@ exports[`adds group 2`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" @@ -137,7 +141,9 @@ exports[`adds group 3`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" @@ -205,7 +211,9 @@ exports[`adds user 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" @@ -265,7 +273,9 @@ exports[`adds user 2`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" @@ -330,7 +340,9 @@ exports[`adds user 3`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} > <header className="modal-head" diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsFormSelect-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsFormSelect-test.tsx.snap index 10e1ea582f7..818fc5af342 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsFormSelect-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfilePermissionsFormSelect-test.tsx.snap @@ -13,6 +13,7 @@ exports[`renders 1`] = ` clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + closeOnSelect={true} deleteRemoves={true} delimiter="," disabled={false} @@ -34,6 +35,8 @@ exports[`renders 1`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} + onSelectResetsInput={true} + openOnClick={true} optionComponent={[Function]} optionRenderer={[Function]} options={Array []} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap index 315e117ffba..6d92fb9ab26 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/__snapshots__/ProfileRules-test.tsx.snap @@ -28,12 +28,14 @@ exports[`should render the quality profiles rules with sonarway comparison 1`] = <tbody> <ProfileRulesRowTotal count={68} + key="all" organization="foo" qprofile="foo" total={243} /> <ProfileRulesRowOfType count={68} + key="BUG" organization="foo" qprofile="foo" total={68} @@ -41,6 +43,7 @@ exports[`should render the quality profiles rules with sonarway comparison 1`] = /> <ProfileRulesRowOfType count={0} + key="VULNERABILITY" organization="foo" qprofile="foo" total={7} @@ -48,6 +51,7 @@ exports[`should render the quality profiles rules with sonarway comparison 1`] = /> <ProfileRulesRowOfType count={0} + key="CODE_SMELL" organization="foo" qprofile="foo" total={168} |