diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/organizations')
12 files changed, 33 insertions, 54 deletions
diff --git a/server/sonar-web/src/main/js/apps/organizations/actions.js b/server/sonar-web/src/main/js/apps/organizations/actions.js index 1782325a68e..3d732bce808 100644 --- a/server/sonar-web/src/main/js/apps/organizations/actions.js +++ b/server/sonar-web/src/main/js/apps/organizations/actions.js @@ -175,7 +175,12 @@ export const updateOrganizationMemberGroups = ( ...add.map(id => addUserToGroup(id, member.login)), ...remove.map(id => removeUserFromGroup(id, member.login)) ]; - return Promise.all(promises).then(() => { - dispatch(receiveUser({ ...member, groupCount: member.groupCount + add.length - remove.length })); - }, onFail(dispatch)); + return Promise.all(promises).then( + () => { + dispatch( + receiveUser({ ...member, groupCount: member.groupCount + add.length - remove.length }) + ); + }, + onFail(dispatch) + ); }; diff --git a/server/sonar-web/src/main/js/apps/organizations/components/MembersListItem.js b/server/sonar-web/src/main/js/apps/organizations/components/MembersListItem.js index 2324b9d4c7f..a3465c60a52 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/MembersListItem.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/MembersListItem.js @@ -53,7 +53,10 @@ export default class MembersListItem extends React.PureComponent { </td> {organization.canAdmin && <td className="text-right text-middle"> - {translateWithParameters('organization.members.x_groups', formatMeasure(member.groupCount || 0, 'INT'))} + {translateWithParameters( + 'organization.members.x_groups', + formatMeasure(member.groupCount || 0, 'INT') + )} </td>} {organization.canAdmin && <td className="nowrap text-middle text-right"> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.js b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.js index caf6cd849ef..ece826b126b 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.js @@ -67,8 +67,7 @@ class OrganizationDelete extends React.Component { contentLabel="modal form" className="modal" overlayClassName="modal-overlay" - onRequestClose={this.handleCloseModal} - > + onRequestClose={this.handleCloseModal}> <header className="modal-head"> <h2>{translate('organization.delete')}</h2> @@ -112,8 +111,7 @@ class OrganizationDelete extends React.Component { <button className="button-red" disabled={this.state.loading || this.state.deleting} - onClick={this.handleOpenModal} - > + onClick={this.handleOpenModal}> {translate('delete')} </button> {this.state.deleting && this.renderModal()} diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationGroupCheckbox.js b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationGroupCheckbox.js index f21f52b0094..ffe6fc463ce 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationGroupCheckbox.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationGroupCheckbox.js @@ -45,8 +45,7 @@ export default class OrganizationGroupCheckbox extends React.PureComponent { className="capitalize list-item-checkable-link" onClick={this.toggleCheck} tabIndex={0} - role="listitem" - > + role="listitem"> <Checkbox checked={this.props.checked} onCheck={this.onCheck} /> {' '}{this.props.group.name} </li> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersList-test.js b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersList-test.js index d96f62874d5..aeff08b58c7 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersList-test.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersList-test.js @@ -28,11 +28,6 @@ const members = [ ]; it('should render a list of members of an organization', () => { - const wrapper = shallow( - <MembersList - organization={organization} - members={members} - /> - ); + const wrapper = shallow(<MembersList organization={organization} members={members} />); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListHeader-test.js b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListHeader-test.js index 439f998b4b7..4844a99aca1 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListHeader-test.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListHeader-test.js @@ -22,15 +22,11 @@ import { shallow } from 'enzyme'; import MembersListHeader from '../MembersListHeader'; it('should render without the total', () => { - const wrapper = shallow( - <MembersListHeader handleSearch={jest.fn()} /> - ); + const wrapper = shallow(<MembersListHeader handleSearch={jest.fn()} />); expect(wrapper).toMatchSnapshot(); }); it('should render with the total', () => { - const wrapper = shallow( - <MembersListHeader handleSearch={jest.fn()} total={8} /> - ); + const wrapper = shallow(<MembersListHeader handleSearch={jest.fn()} total={8} />); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListItem-test.js b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListItem-test.js index dd97722ea42..1ed64e94cec 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListItem-test.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersListItem-test.js @@ -26,31 +26,20 @@ const admin = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: const john = { login: 'john', name: 'John Doe', avatar: '7daf6c79d4802916d83f6266e24850af' }; it('should not render actions and groups for non admin', () => { - const wrapper = shallow( - <MembersListItem - organization={organization} - member={admin} - /> - ); + const wrapper = shallow(<MembersListItem organization={organization} member={admin} />); expect(wrapper).toMatchSnapshot(); }); it('should render actions and groups for admin', () => { const wrapper = shallow( - <MembersListItem - organization={{ ...organization, canAdmin: true }} - member={admin} - /> + <MembersListItem organization={{ ...organization, canAdmin: true }} member={admin} /> ); expect(wrapper).toMatchSnapshot(); }); it('should groups at 0 if the groupCount field is not defined (just added user)', () => { const wrapper = shallow( - <MembersListItem - organization={{ ...organization, canAdmin: true }} - member={john} - /> + <MembersListItem organization={{ ...organization, canAdmin: true }} member={john} /> ); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersPageHeader-test.js b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersPageHeader-test.js index 4e8fd9a2760..1c431fbaf6f 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersPageHeader-test.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/MembersPageHeader-test.js @@ -22,9 +22,7 @@ import { shallow } from 'enzyme'; import MembersPageHeader from '../MembersPageHeader'; it('should render the members page header', () => { - const wrapper = shallow( - <MembersPageHeader /> - ); + const wrapper = shallow(<MembersPageHeader />); expect(wrapper).toMatchSnapshot(); wrapper.setProps({ loading: true }); expect(wrapper.find('.spinner')).toMatchSnapshot(); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/AddMemberForm.js b/server/sonar-web/src/main/js/apps/organizations/components/forms/AddMemberForm.js index 3ed2825cde5..c478be943d5 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/AddMemberForm.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/AddMemberForm.js @@ -69,8 +69,7 @@ export default class AddMemberForm extends React.PureComponent { contentLabel="modal form" className="modal" overlayClassName="modal-overlay" - onRequestClose={this.closeForm} - > + onRequestClose={this.closeForm}> <header className="modal-head"> <h2>{translate('users.add')}</h2> </header> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/ManageMemberGroupsForm.js b/server/sonar-web/src/main/js/apps/organizations/components/forms/ManageMemberGroupsForm.js index ac19d3e725f..14243d37f04 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/ManageMemberGroupsForm.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/ManageMemberGroupsForm.js @@ -107,15 +107,17 @@ export default class ManageMemberGroupsForm extends React.PureComponent { contentLabel="modal form" className="modal" overlayClassName="modal-overlay" - onRequestClose={this.closeForm} - > + onRequestClose={this.closeForm}> <header className="modal-head"> <h2>{translate('organization.members.manage_groups')}</h2> </header> <form onSubmit={this.handleSubmit}> <div className="modal-body"> <strong> - {translateWithParameters('organization.members.members_groups', this.props.member.name)} + {translateWithParameters( + 'organization.members.members_groups', + this.props.member.name + )} </strong>{' '}{this.state.loading && <i className="spinner" />} {!this.state.loading && <ul className="list-spaced"> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/RemoveMemberForm.js b/server/sonar-web/src/main/js/apps/organizations/components/forms/RemoveMemberForm.js index 888e13f5ba5..335b14cf1d9 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/RemoveMemberForm.js +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/RemoveMemberForm.js @@ -63,8 +63,7 @@ export default class RemoveMemberForm extends React.PureComponent { contentLabel="modal form" className="modal" overlayClassName="modal-overlay" - onRequestClose={this.closeForm} - > + onRequestClose={this.closeForm}> <header className="modal-head"> <h2>{translate('users.remove')}</h2> </header> diff --git a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js index 4e221313939..a38d9829abd 100644 --- a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js +++ b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js @@ -71,16 +71,14 @@ export default class OrganizationNavigation extends React.Component { <li> <Link to={`/organizations/${organization.key}/permission_templates`} - activeClassName="active" - > + activeClassName="active"> {translate('permission_templates')} </Link> </li> <li> <Link to={`/organizations/${organization.key}/projects_management`} - activeClassName="active" - > + activeClassName="active"> {translate('projects_management')} </Link> </li> @@ -136,8 +134,7 @@ export default class OrganizationNavigation extends React.Component { className="link-underline" href={organization.url} title={organization.url} - rel="nofollow" - > + rel="nofollow"> {organization.url} </a> </p> @@ -148,8 +145,7 @@ export default class OrganizationNavigation extends React.Component { <li> <Link to={`/organizations/${organization.key}/projects`} - className={isHomeActive ? 'active' : ''} - > + className={isHomeActive ? 'active' : ''}> {translate('projects.page')} </Link> </li> |