import {
getCorsJSON,
getJSON,
- postJSON,
post,
+ postJSON,
requestTryAndRepeatUntil
} from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getJSON, postJSON, post, RequestData } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
export interface BaseSearchProjectsParameters {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { post, getJSON } from 'sonar-ui-common/helpers/request';
+import { getJSON, post } from 'sonar-ui-common/helpers/request';
export function getFavorites(): Promise<any> {
return getJSON('/api/favorites/search');
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
-import { RawIssue } from '../helpers/issues';
import throwGlobalError from '../app/utils/throwGlobalError';
import getCoverageStatus from '../components/SourceViewer/helpers/getCoverageStatus';
+import { RawIssue } from '../helpers/issues';
export interface IssueResponse {
components?: Array<{ key: string; name: string }>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getJSON, RequestData, postJSON, post } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
export function getMeasures(
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
-import { BaseSearchProjectsParameters } from './components';
import throwGlobalError from '../app/utils/throwGlobalError';
+import { BaseSearchProjectsParameters } from './components';
const PAGE_SIZE = 100;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { findLastIndex } from 'lodash';
-import { isDefined } from 'sonar-ui-common/helpers/types';
import { getJSON, post } from 'sonar-ui-common/helpers/request';
+import { isDefined } from 'sonar-ui-common/helpers/types';
import throwGlobalError from '../app/utils/throwGlobalError';
export interface Plugin {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getJSON, postJSON, post, RequestData } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
export function getProjectActivity(
import { map } from 'lodash';
import { csvEscape } from 'sonar-ui-common/helpers/csv';
import {
- request,
checkStatus,
- parseJSON,
getJSON,
+ parseJSON,
post,
postJSON,
+ request,
RequestData
} from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { post, getJSON, postJSON } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
export interface GetRulesAppResponse {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { omitBy } from 'lodash';
-import { getJSON, RequestData, post, postJSON } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON, RequestData } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
import { isCategoryDefinition } from '../apps/settings/utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getJSON, postJSON, post } from 'sonar-ui-common/helpers/request';
+import { getJSON, post, postJSON } from 'sonar-ui-common/helpers/request';
import throwGlobalError from '../app/utils/throwGlobalError';
/** List tokens for given user login */
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import AdminContext, { defaultPendingPlugins, defaultSystemStatus } from './AdminContext';
-import SettingsNav from './nav/settings/SettingsNav';
-import { getAppState, Store } from '../../store/rootReducer';
import { getSettingsNavigation } from '../../api/nav';
-import { setAdminPages } from '../../store/appState';
-import { PluginPendingResult, getPendingPlugins } from '../../api/plugins';
-import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
+import { getPendingPlugins, PluginPendingResult } from '../../api/plugins';
import { getSystemStatus, waitSystemUPStatus } from '../../api/system';
+import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
+import { setAdminPages } from '../../store/appState';
+import { getAppState, Store } from '../../store/rootReducer';
+import AdminContext, { defaultPendingPlugins, defaultSystemStatus } from './AdminContext';
+import SettingsNav from './nav/settings/SettingsNav';
interface Props {
appState: Pick<T.AppState, 'adminPages' | 'canAdmin' | 'organizationsEnabled'>;
import * as React from 'react';
import { connect } from 'react-redux';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import { fetchLanguages } from '../../store/rootActions';
import { fetchMyOrganizations } from '../../apps/account/organizations/actions';
import { isSonarCloud } from '../../helpers/system';
-import { getCurrentUser, getAppState, getGlobalSettingValue, Store } from '../../store/rootReducer';
import { isLoggedIn } from '../../helpers/users';
+import { fetchLanguages } from '../../store/rootActions';
+import { getAppState, getCurrentUser, getGlobalSettingValue, Store } from '../../store/rootReducer';
const PageTracker = lazyLoad(() => import('./PageTracker'));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { differenceBy } from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
-import { differenceBy } from 'lodash';
-import { ComponentContext } from './ComponentContext';
-import ComponentContainerNotFound from './ComponentContainerNotFound';
-import ComponentNav from './nav/component/ComponentNav';
import { getBranches, getPullRequests } from '../../api/branches';
-import { getTasksForComponent, getAnalysisStatus } from '../../api/ce';
+import { getAnalysisStatus, getTasksForComponent } from '../../api/ce';
import { getComponentData } from '../../api/components';
import { getComponentNavigation } from '../../api/nav';
-import {
- fetchOrganization,
- requireAuthorization,
- registerBranchStatus
-} from '../../store/rootActions';
import { STATUSES } from '../../apps/background-tasks/constants';
+import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import {
- isPullRequest,
+ getBranchLikeQuery,
isBranch,
- isMainBranch,
isLongLivingBranch,
- isShortLivingBranch,
- getBranchLikeQuery
+ isMainBranch,
+ isPullRequest,
+ isShortLivingBranch
} from '../../helpers/branches';
import { isSonarCloud } from '../../helpers/system';
-import { withRouter, Router, Location } from '../../components/hoc/withRouter';
+import {
+ fetchOrganization,
+ registerBranchStatus,
+ requireAuthorization
+} from '../../store/rootActions';
+import ComponentContainerNotFound from './ComponentContainerNotFound';
+import { ComponentContext } from './ComponentContext';
+import ComponentNav from './nav/component/ComponentNav';
interface Props {
children: React.ReactElement;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import GlobalNav from './nav/global/GlobalNav';
-import StartupModal from './StartupModal';
-import GlobalFooterContainer from './GlobalFooterContainer';
-import GlobalMessagesContainer from './GlobalMessagesContainer';
-import SuggestionsProvider from './embed-docs-modal/SuggestionsProvider';
+import Workspace from '../../components/workspace/Workspace';
import A11yProvider from './a11y/A11yProvider';
import A11ySkipLinks from './a11y/A11ySkipLinks';
-import Workspace from '../../components/workspace/Workspace';
+import SuggestionsProvider from './embed-docs-modal/SuggestionsProvider';
+import GlobalFooterContainer from './GlobalFooterContainer';
+import GlobalMessagesContainer from './GlobalMessagesContainer';
+import GlobalNav from './nav/global/GlobalNav';
+import StartupModal from './StartupModal';
export interface Props {
children: React.ReactNode;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import GlobalFooterSonarCloud from './GlobalFooterSonarCloud';
-import GlobalFooterBranding from './GlobalFooterBranding';
-import InstanceMessage from '../../components/common/InstanceMessage';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { EDITIONS } from '../../apps/marketplace/utils';
+import InstanceMessage from '../../components/common/InstanceMessage';
import { isSonarCloud } from '../../helpers/system';
+import GlobalFooterBranding from './GlobalFooterBranding';
+import GlobalFooterSonarCloud from './GlobalFooterSonarCloud';
interface Props {
hideLoggedInInfo?: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import GlobalFooter from './GlobalFooter';
import { getAppState, Store } from '../../store/rootReducer';
+import GlobalFooter from './GlobalFooter';
interface StateProps {
productionDatabase: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as getYear from 'date-fns/get_year';
+import * as React from 'react';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
*/
import { connect } from 'react-redux';
import GlobalMessages from 'sonar-ui-common/components/controls/GlobalMessages';
-import { getGlobalMessages, Store } from '../../store/rootReducer';
import { closeGlobalMessage } from '../../store/globalMessages';
+import { getGlobalMessages, Store } from '../../store/rootReducer';
const mapStateToProps = (state: Store) => ({
messages: getGlobalMessages(state)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
import * as React from 'react';
-import { withRouter, WithRouterProps } from 'react-router';
import { connect } from 'react-redux';
-import { Location } from 'history';
-import { getCurrentUser, Store } from '../../store/rootReducer';
+import { withRouter, WithRouterProps } from 'react-router';
import { getHomePageUrl } from '../../helpers/urls';
import { isLoggedIn } from '../../helpers/users';
+import { getCurrentUser, Store } from '../../store/rootReducer';
interface StateProps {
currentUser: T.CurrentUser | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { connect } from 'react-redux';
import Helmet from 'react-helmet';
+import { connect } from 'react-redux';
import { Location, withRouter } from '../../components/hoc/withRouter';
import { gtm } from '../../helpers/analytics';
import { installScript } from '../../helpers/extensions';
import { getWebAnalyticsPageHandlerFromCache } from '../../helpers/extensionsHandler';
import { getInstance } from '../../helpers/system';
-import { getGlobalSettingValue, Store, getAppState } from '../../store/rootReducer';
+import { getAppState, getGlobalSettingValue, Store } from '../../store/rootReducer';
interface Props {
location: Location;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import A11ySkipTarget from './a11y/A11ySkipTarget';
import handleRequiredAuthorization from '../utils/handleRequiredAuthorization';
+import A11ySkipTarget from './a11y/A11ySkipTarget';
interface Props {
children: JSX.Element;
*/
import * as React from 'react';
import NavBar from 'sonar-ui-common/components/ui/NavBar';
-import GlobalFooterContainer from './GlobalFooterContainer';
import { rawSizes } from '../theme';
+import GlobalFooterContainer from './GlobalFooterContainer';
interface Props {
children?: React.ReactNode;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
+import * as React from 'react';
import { connect } from 'react-redux';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { parseDate, toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
-import { save, get } from 'sonar-ui-common/helpers/storage';
import { hasMessage } from 'sonar-ui-common/helpers/l10n';
-import { OnboardingContext } from './OnboardingContext';
-import { getCurrentUser, getAppState, Store } from '../../store/rootReducer';
-import { skipOnboarding } from '../../store/users';
+import { get, save } from 'sonar-ui-common/helpers/storage';
import { showLicense } from '../../api/marketplace';
+import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import { isSonarCloud } from '../../helpers/system';
import { isLoggedIn } from '../../helpers/users';
-import { withRouter, Router, Location } from '../../components/hoc/withRouter';
+import { getAppState, getCurrentUser, Store } from '../../store/rootReducer';
+import { skipOnboarding } from '../../store/users';
+import { OnboardingContext } from './OnboardingContext';
const OnboardingModal = lazyLoad(() => import('../../apps/tutorials/onboarding/OnboardingModal'));
const LicensePromptModal = lazyLoad(
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AccountDeleted from '../AccountDeleted';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { AdminContainer } from '../AdminContainer';
+import * as React from 'react';
import { mockLocation } from '../../../helpers/testMocks';
+import { AdminContainer } from '../AdminContainer';
it('should render correctly', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { ComponentContainer } from '../ComponentContainer';
import { getBranches, getPullRequests } from '../../../api/branches';
import { getTasksForComponent } from '../../../api/ce';
import { getComponentData } from '../../../api/components';
import { STATUSES } from '../../../apps/background-tasks/constants';
import { isSonarCloud } from '../../../helpers/system';
import {
- mockLocation,
- mockRouter,
mockComponent,
- mockPullRequest,
+ mockLocation,
mockLongLivingBranch,
- mockShortLivingBranch,
- mockMainBranch
+ mockMainBranch,
+ mockPullRequest,
+ mockRouter,
+ mockShortLivingBranch
} from '../../../helpers/testMocks';
+import { ComponentContainer } from '../ComponentContainer';
jest.mock('../../../api/branches', () => {
const { mockMainBranch, mockPullRequest } = require.requireActual('../../../helpers/testMocks');
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import GlobalContainer, { Props } from '../GlobalContainer';
+import * as React from 'react';
import { mockLocation } from '../../../helpers/testMocks';
+import GlobalContainer, { Props } from '../GlobalContainer';
jest.mock('../embed-docs-modal/SuggestionsProvider', () => {
class SuggestionsProvider extends React.Component {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import GlobalFooter from '../GlobalFooter';
+import * as React from 'react';
import { EditionKey } from '../../../apps/marketplace/utils';
import { isSonarCloud } from '../../../helpers/system';
+import GlobalFooter from '../GlobalFooter';
jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GlobalFooterSonarCloud from '../GlobalFooterSonarCloud';
jest.mock('date-fns/get_year', () => jest.fn(() => '20XX'));
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { PageTracker } from '../PageTracker';
+import * as React from 'react';
import { gtm } from '../../../helpers/analytics';
-import { mockLocation } from '../../../helpers/testMocks';
import { installScript } from '../../../helpers/extensions';
import { getWebAnalyticsPageHandlerFromCache } from '../../../helpers/extensionsHandler';
+import { mockLocation } from '../../../helpers/testMocks';
+import { PageTracker } from '../PageTracker';
jest.mock('../../../helpers/extensions', () => ({
installScript: jest.fn().mockResolvedValue({})
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
-import ProjectAdminContainer from '../ProjectAdminContainer';
+import * as React from 'react';
import handleRequiredAuthorization from '../../../app/utils/handleRequiredAuthorization';
import { mockComponent } from '../../../helpers/testMocks';
+import ProjectAdminContainer from '../ProjectAdminContainer';
jest.mock('../../utils/handleRequiredAuthorization', () => {
return { default: jest.fn() };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { hasMessage } from 'sonar-ui-common/helpers/l10n';
-import { save, get } from 'sonar-ui-common/helpers/storage';
+import { get, save } from 'sonar-ui-common/helpers/storage';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { StartupModal, ModalKey } from '../StartupModal';
import { showLicense } from '../../../api/marketplace';
import { EditionKey } from '../../../apps/marketplace/utils';
import { mockOrganization, mockRouter } from '../../../helpers/testMocks';
+import { ModalKey, StartupModal } from '../StartupModal';
jest.mock('../../../api/marketplace', () => ({
showLicense: jest.fn().mockResolvedValue(undefined)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { A11yContext } from './A11yContext';
interface State {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { A11yContextShape } from '../A11yContext';
import A11yProvider from '../A11yProvider';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import A11ySkipLinks from '../A11ySkipLinks';
jest.mock('../A11yContext', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount } from 'enzyme';
+import * as React from 'react';
import { A11ySkipTargetInner } from '../A11ySkipTarget';
it('should render correctly, and (un)register the link when (un)mounted', () => {
*/
import * as React from 'react';
import { Link } from 'react-router';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
+import { isSonarCloud } from '../../../helpers/system';
import ProductNewsMenuItem from './ProductNewsMenuItem';
import { SuggestionsContext } from './SuggestionsContext';
-import { isSonarCloud } from '../../../helpers/system';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import { translate } from 'sonar-ui-common/helpers/l10n';
const EmbedDocsPopup = lazyLoad(() => import('./EmbedDocsPopup'));
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
import { connect } from 'react-redux';
+import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { fetchPrismicRefs, fetchPrismicNews, PrismicNews } from '../../../api/news';
-import { getGlobalSettingValue, Store } from '../../../store/rootReducer';
+import { fetchPrismicNews, fetchPrismicRefs, PrismicNews } from '../../../api/news';
import DateFormatter from '../../../components/intl/DateFormatter';
import PlaceholderBar from '../../../components/ui/PlaceholderBar';
+import { getGlobalSettingValue, Store } from '../../../store/rootReducer';
interface OwnProps {
tag?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import suggestionsJson from 'Docs/EmbedDocsSuggestions.json';
-import { SuggestionsContext } from './SuggestionsContext';
+import * as React from 'react';
import { isSonarCloud } from '../../../helpers/system';
+import { SuggestionsContext } from './SuggestionsContext';
type SuggestionsJson = T.Dict<T.SuggestionLink[]>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import EmbedDocsPopup from '../EmbedDocsPopup';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { fetchPrismicNews, fetchPrismicRefs } from '../../../../api/news';
import { ProductNewsMenuItem } from '../ProductNewsMenuItem';
-import { fetchPrismicRefs, fetchPrismicNews } from '../../../../api/news';
jest.mock('../../../../api/news', () => ({
fetchPrismicRefs: jest.fn().mockResolvedValue({ id: 'master', ref: 'master-ref' }),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import SuggestionsProvider from '../SuggestionsProvider';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import SuggestionsProvider from '../SuggestionsProvider';
jest.mock(
'Docs/EmbedDocsSuggestions.json',
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { injectIntl, InjectedIntlProps } from 'react-intl';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import getStore from '../../utils/getStore';
import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
import { getExtensionStart } from '../../../helpers/extensions';
import { addGlobalErrorMessage } from '../../../store/globalMessages';
-import { Store, getCurrentUser } from '../../../store/rootReducer';
+import { getCurrentUser, Store } from '../../../store/rootReducer';
import * as theme from '../../theme';
+import getStore from '../../utils/getStore';
interface Props extends InjectedIntlProps {
currentUser: T.CurrentUser;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import Extension from './Extension';
-import NotFound from '../NotFound';
import { getAppState, Store } from '../../../store/rootReducer';
+import NotFound from '../NotFound';
+import Extension from './Extension';
interface Props {
adminPages: T.Extension[] | undefined;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import Extension from './Extension';
-import NotFound from '../NotFound';
import { getAppState, Store } from '../../../store/rootReducer';
+import NotFound from '../NotFound';
+import Extension from './Extension';
interface Props {
globalPages: T.Extension[] | undefined;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import Extension from './Extension';
-import NotFound from '../NotFound';
-import { getOrganizationByKey, Store } from '../../../store/rootReducer';
import { fetchOrganization } from '../../../store/rootActions';
+import { getOrganizationByKey, Store } from '../../../store/rootReducer';
+import NotFound from '../NotFound';
+import Extension from './Extension';
interface StateToProps {
organization?: T.Organization;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
import * as React from 'react';
import { connect } from 'react-redux';
-import { Location } from 'history';
-import Extension from './Extension';
-import NotFound from '../NotFound';
import { addGlobalErrorMessage } from '../../../store/globalMessages';
+import NotFound from '../NotFound';
+import Extension from './Extension';
interface Props {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import Extension from './Extension';
import NotFound from '../NotFound';
+import Extension from './Extension';
interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { Extension } from '../Extension';
-import { mockCurrentUser, mockLocation, mockRouter } from '../../../../helpers/testMocks';
import { getExtensionStart } from '../../../../helpers/extensions';
+import { mockCurrentUser, mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import { Extension } from '../Extension';
jest.mock('../../../../helpers/extensions', () => ({
getExtensionStart: jest.fn().mockResolvedValue(jest.fn())
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { FormattedMessage } from 'react-intl';
import * as ReactRedux from 'react-redux';
import * as ReactRouter from 'react-router';
-import { FormattedMessage } from 'react-intl';
+import ActionsDropdown, {
+ ActionsDropdownItem
+} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import {
+ Button,
+ EditButton,
+ ResetButtonLink,
+ SubmitButton
+} from 'sonar-ui-common/components/controls/buttons';
+import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import Modal from 'sonar-ui-common/components/controls/Modal';
+import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
+import ReloadButton from 'sonar-ui-common/components/controls/ReloadButton';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import SearchSelect from 'sonar-ui-common/components/controls/SearchSelect';
+import Select from 'sonar-ui-common/components/controls/Select';
+import SelectList from 'sonar-ui-common/components/controls/SelectList';
+import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon';
import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon';
import ClearIcon from 'sonar-ui-common/components/icons/ClearIcon';
-import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
-import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
+import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon';
import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
import LockIcon from 'sonar-ui-common/components/icons/LockIcon';
-import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
+import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon';
import PullRequestIcon from 'sonar-ui-common/components/icons/PullRequestIcon';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import * as request from 'sonar-ui-common/helpers/request';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import {
- EditButton,
- Button,
- SubmitButton,
- ResetButtonLink
-} from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import Modal from 'sonar-ui-common/components/controls/Modal';
-import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
-import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
+import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
import Level from 'sonar-ui-common/components/ui/Level';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
import Rating from 'sonar-ui-common/components/ui/Rating';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import ActionsDropdown, {
- ActionsDropdownItem
-} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
-import ReloadButton from 'sonar-ui-common/components/controls/ReloadButton';
-import Select from 'sonar-ui-common/components/controls/Select';
-import SelectList from 'sonar-ui-common/components/controls/SelectList';
-import SearchSelect from 'sonar-ui-common/components/controls/SearchSelect';
-import throwGlobalError from '../../utils/throwGlobalError';
-import addGlobalSuccessMessage from '../../utils/addGlobalSuccessMessage';
-import Suggestions from '../embed-docs-modal/Suggestions';
-import * as measures from '../../../helpers/measures';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import * as request from 'sonar-ui-common/helpers/request';
+import NotFound from '../../../app/components/NotFound';
+import Favorite from '../../../components/controls/Favorite';
+import HomePageSelect from '../../../components/controls/HomePageSelect';
+import BranchIcon from '../../../components/icons-components/BranchIcon';
+import DateFormatter from '../../../components/intl/DateFormatter';
+import DateFromNow from '../../../components/intl/DateFromNow';
+import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
+import CoverageRating from '../../../components/ui/CoverageRating';
import {
getBranchLikeQuery,
isBranch,
isLongLivingBranch,
isPullRequest
} from '../../../helpers/branches';
-import { getComponentIssuesUrl, getRulesUrl } from '../../../helpers/urls';
+import * as measures from '../../../helpers/measures';
import {
getStandards,
renderCWECategory,
renderSansTop25Category,
renderSonarSourceSecurityCategory
} from '../../../helpers/security-standard';
-import DateFromNow from '../../../components/intl/DateFromNow';
-import DateFormatter from '../../../components/intl/DateFormatter';
-import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
-import Favorite from '../../../components/controls/Favorite';
-import HomePageSelect from '../../../components/controls/HomePageSelect';
-import BranchIcon from '../../../components/icons-components/BranchIcon';
-import CoverageRating from '../../../components/ui/CoverageRating';
-import NotFound from '../../../app/components/NotFound';
+import { getComponentIssuesUrl, getRulesUrl } from '../../../helpers/urls';
+import addGlobalSuccessMessage from '../../utils/addGlobalSuccessMessage';
+import throwGlobalError from '../../utils/throwGlobalError';
import A11ySkipTarget from '../a11y/A11ySkipTarget';
+import Suggestions from '../embed-docs-modal/Suggestions';
const exposeLibraries = () => {
const global = window as any;
*/
import * as React from 'react';
import ContextNavBar from 'sonar-ui-common/components/ui/ContextNavBar';
-import ComponentNavHeader from './ComponentNavHeader';
-import ComponentNavMeta from './ComponentNavMeta';
-import ComponentNavMenu from './ComponentNavMenu';
-import ComponentNavBgTaskNotif from './ComponentNavBgTaskNotif';
-import RecentHistory from '../../RecentHistory';
-import { rawSizes } from '../../../theme';
import { STATUSES } from '../../../../apps/background-tasks/constants';
+import { rawSizes } from '../../../theme';
+import RecentHistory from '../../RecentHistory';
import './ComponentNav.css';
+import ComponentNavBgTaskNotif from './ComponentNavBgTaskNotif';
+import ComponentNavHeader from './ComponentNavHeader';
+import ComponentNavMenu from './ComponentNavMenu';
+import ComponentNavMeta from './ComponentNavMeta';
interface Props {
branchLikes: T.BranchLike[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
-import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
+import { Link } from 'react-router';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import ComponentNavLicenseNotif from './ComponentNavLicenseNotif';
+import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
import { STATUSES } from '../../../../apps/background-tasks/constants';
import { getComponentBackgroundTaskUrl } from '../../../../helpers/urls';
+import ComponentNavLicenseNotif from './ComponentNavLicenseNotif';
interface Props {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Toggler from 'sonar-ui-common/components/controls/Toggler';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import ComponentNavBranchesMenu from './ComponentNavBranchesMenu';
-import BranchIcon from '../../../../components/icons-components/BranchIcon';
+import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../../components/docs/DocTooltip';
-import { colors } from '../../../theme';
+import { withAppState } from '../../../../components/hoc/withAppState';
+import BranchIcon from '../../../../components/icons-components/BranchIcon';
import {
- isShortLivingBranch,
- isSameBranchLike,
getBranchLikeDisplayName,
- isPullRequest
+ isPullRequest,
+ isSameBranchLike,
+ isShortLivingBranch
} from '../../../../helpers/branches';
import { isSonarCloud } from '../../../../helpers/system';
import { getPortfolioAdminUrl } from '../../../../helpers/urls';
-import { withAppState } from '../../../../components/hoc/withAppState';
+import { colors } from '../../../theme';
+import ComponentNavBranchesMenu from './ComponentNavBranchesMenu';
interface Props {
appState: Pick<T.AppState, 'branchesEnabled'>;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
-import ComponentNavBranchesMenuItem from './ComponentNavBranchesMenuItem';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
+import { Router, withRouter } from '../../../../components/hoc/withRouter';
import {
- sortBranchesAsTree,
- isLongLivingBranch,
- isShortLivingBranch,
- isSameBranchLike,
getBranchLikeKey,
+ isBranch,
+ isLongLivingBranch,
isPullRequest,
- isBranch
+ isSameBranchLike,
+ isShortLivingBranch,
+ sortBranchesAsTree
} from '../../../../helpers/branches';
import { getBranchLikeUrl } from '../../../../helpers/urls';
-import { withRouter, Router } from '../../../../components/hoc/withRouter';
+import ComponentNavBranchesMenuItem from './ComponentNavBranchesMenuItem';
interface Props {
branchLikes: T.BranchLike[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import BranchIcon from '../../../../components/icons-components/BranchIcon';
import BranchStatus from '../../../../components/common/BranchStatus';
+import BranchIcon from '../../../../components/icons-components/BranchIcon';
import {
- isShortLivingBranch,
getBranchLikeDisplayName,
getBranchLikeKey,
isMainBranch,
- isPullRequest
+ isPullRequest,
+ isShortLivingBranch
} from '../../../../helpers/branches';
import { getBranchLikeUrl } from '../../../../helpers/urls';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { connect } from 'react-redux';
import { Link } from 'react-router';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import ComponentNavBranch from './ComponentNavBranch';
-import { getOrganizationByKey, Store } from '../../../../store/rootReducer';
import OrganizationAvatar from '../../../../components/common/OrganizationAvatar';
import OrganizationHelmet from '../../../../components/common/OrganizationHelmet';
import OrganizationLink from '../../../../components/ui/OrganizationLink';
import { sanitizeAlmId } from '../../../../helpers/almIntegrations';
-import { getProjectUrl } from '../../../../helpers/urls';
-import { isSonarCloud } from '../../../../helpers/system';
import { isMainBranch } from '../../../../helpers/branches';
+import { isSonarCloud } from '../../../../helpers/system';
+import { getProjectUrl } from '../../../../helpers/urls';
+import { getOrganizationByKey, Store } from '../../../../store/rootReducer';
+import ComponentNavBranch from './ComponentNavBranch';
interface StateProps {
organization?: T.Organization;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { isValidLicense } from '../../../../api/marketplace';
import { withAppState } from '../../../../components/hoc/withAppState';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
+import { Link } from 'react-router';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import NavBarTabs from 'sonar-ui-common/components/ui/NavBarTabs';
-import { Link } from 'react-router';
-import * as classNames from 'classnames';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import { withAppState } from '../../../../components/hoc/withAppState';
import {
- isShortLivingBranch,
- isPullRequest,
+ getBranchLikeQuery,
isMainBranch,
- getBranchLikeQuery
+ isPullRequest,
+ isShortLivingBranch
} from '../../../../helpers/branches';
import { isSonarCloud } from '../../../../helpers/system';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
import { connect } from 'react-redux';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import ComponentNavWarnings from './ComponentNavWarnings';
+import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import BranchStatus from '../../../../components/common/BranchStatus';
-import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter';
import Favorite from '../../../../components/controls/Favorite';
import HomePageSelect from '../../../../components/controls/HomePageSelect';
+import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter';
import {
- isShortLivingBranch,
isLongLivingBranch,
isMainBranch,
- isPullRequest
+ isPullRequest,
+ isShortLivingBranch
} from '../../../../helpers/branches';
import { isLoggedIn } from '../../../../helpers/users';
import { getCurrentUser, Store } from '../../../../store/rootReducer';
+import ComponentNavWarnings from './ComponentNavWarnings';
export interface Props {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import WarningIcon from 'sonar-ui-common/components/icons/WarningIcon';
import { FormattedMessage } from 'react-intl';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import WarningIcon from 'sonar-ui-common/components/icons/WarningIcon';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
const AnalysisWarningsModal = lazyLoad(() =>
import('../../../../components/common/AnalysisWarningsModal')
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentNav from '../ComponentNav';
const component = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentNavBgTaskNotif from '../ComponentNavBgTaskNotif';
jest.mock('sonar-ui-common/helpers/l10n', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { ComponentNavBranch } from '../ComponentNavBranch';
import { isSonarCloud } from '../../../../../helpers/system';
import {
- mockPullRequest,
- mockShortLivingBranch,
+ mockLongLivingBranch,
mockMainBranch,
- mockLongLivingBranch
+ mockPullRequest,
+ mockShortLivingBranch
} from '../../../../../helpers/testMocks';
+import { ComponentNavBranch } from '../ComponentNavBranch';
jest.mock('../../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { elementKeydown } from 'sonar-ui-common/helpers/testUtils';
-import { ComponentNavBranchesMenu } from '../ComponentNavBranchesMenu';
import {
- mockPullRequest,
- mockShortLivingBranch,
mockLongLivingBranch,
- mockMainBranch
+ mockMainBranch,
+ mockPullRequest,
+ mockShortLivingBranch
} from '../../../../../helpers/testMocks';
+import { ComponentNavBranchesMenu } from '../ComponentNavBranchesMenu';
const component = { key: 'component' } as T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentNavBranchesMenuItem, { Props } from '../ComponentNavBranchesMenuItem';
const component = { key: 'component' } as T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { ComponentNavHeader } from '../ComponentNavHeader';
+import * as React from 'react';
import { isSonarCloud } from '../../../../../helpers/system';
+import { ComponentNavHeader } from '../ComponentNavHeader';
jest.mock('../../../../../helpers/system', () => ({
isSonarCloud: jest.fn().mockReturnValue(false)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { ComponentNavLicenseNotif } from '../ComponentNavLicenseNotif';
import { isValidLicense } from '../../../../../api/marketplace';
+import { ComponentNavLicenseNotif } from '../ComponentNavLicenseNotif';
jest.mock('sonar-ui-common/helpers/l10n', () => ({
...jest.requireActual('sonar-ui-common/helpers/l10n'),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { ComponentNavMenu } from '../ComponentNavMenu';
const mainBranch: T.MainBranch = { isMain: true, name: 'master' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { ComponentNavMeta, getCurrentPage, Props } from '../ComponentNavMeta';
+import * as React from 'react';
import {
- mockShortLivingBranch,
mockComponent,
+ mockCurrentUser,
+ mockLoggedInUser,
mockLongLivingBranch,
mockPullRequest,
- mockCurrentUser,
- mockLoggedInUser
+ mockShortLivingBranch
} from '../../../../../helpers/testMocks';
+import { ComponentNavMeta, getCurrentPage, Props } from '../ComponentNavMeta';
describe('#ComponentNavMeta', () => {
it('renders status of short-living branch', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentNavWarnings from '../ComponentNavWarnings';
it('should render', () => {
*/
import * as React from 'react';
import { connect } from 'react-redux';
+import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import NavBar from 'sonar-ui-common/components/ui/NavBar';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import GlobalNavBranding, { SonarCloudNavBranding } from './GlobalNavBranding';
-import GlobalNavMenu from './GlobalNavMenu';
-import GlobalNavExplore from './GlobalNavExplore';
-import GlobalNavUserContainer from './GlobalNavUserContainer';
-import Search from '../../search/Search';
-import EmbedDocsPopupHelper from '../../embed-docs-modal/EmbedDocsPopupHelper';
-import { rawSizes } from '../../../theme';
import {
- fetchPrismicRefs,
fetchPrismicFeatureNews,
+ fetchPrismicRefs,
PrismicFeatureNews
} from '../../../../api/news';
+import { isSonarCloud } from '../../../../helpers/system';
+import { isLoggedIn } from '../../../../helpers/users';
import {
+ getAppState,
getCurrentUser,
getCurrentUserSetting,
- getAppState,
getGlobalSettingValue,
Store
} from '../../../../store/rootReducer';
-import { isSonarCloud } from '../../../../helpers/system';
-import { isLoggedIn } from '../../../../helpers/users';
-import { OnboardingContext } from '../../OnboardingContext';
import { setCurrentUserSetting } from '../../../../store/users';
+import { rawSizes } from '../../../theme';
+import EmbedDocsPopupHelper from '../../embed-docs-modal/EmbedDocsPopupHelper';
+import { OnboardingContext } from '../../OnboardingContext';
+import Search from '../../search/Search';
import './GlobalNav.css';
+import GlobalNavBranding, { SonarCloudNavBranding } from './GlobalNavBranding';
+import GlobalNavExplore from './GlobalNavExplore';
+import GlobalNavMenu from './GlobalNavMenu';
+import GlobalNavUserContainer from './GlobalNavUserContainer';
const GlobalNavPlus = lazyLoad(() => import('./GlobalNavPlus'), 'GlobalNavPlus');
const NotificationsSidebar = lazyLoad(
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router';
import { connect } from 'react-redux';
+import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { getGlobalSettingValue, Store } from '../../../../store/rootReducer';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import { isMySet } from '../../../../apps/issues/utils';
import { isSonarCloud } from '../../../../helpers/system';
-import { isLoggedIn } from '../../../../helpers/users';
import { getQualityGatesUrl } from '../../../../helpers/urls';
+import { isLoggedIn } from '../../../../helpers/users';
interface Props {
appState: Pick<T.AppState, 'canAdmin' | 'globalPages' | 'organizationsEnabled' | 'qualifiers'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import PlusIcon from 'sonar-ui-common/components/icons/PlusIcon';
import { Link, withRouter, WithRouterProps } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import CreateFormShim from '../../../../apps/portfolio/components/CreateFormShim';
-import { OnboardingContextShape } from '../../OnboardingContext';
+import PlusIcon from 'sonar-ui-common/components/icons/PlusIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getComponentNavigation } from '../../../../api/nav';
+import CreateFormShim from '../../../../apps/portfolio/components/CreateFormShim';
import { getExtensionStart } from '../../../../helpers/extensions';
import { isSonarCloud } from '../../../../helpers/system';
import { getPortfolioAdminUrl, getPortfolioUrl } from '../../../../helpers/urls';
import { hasGlobalPermission } from '../../../../helpers/users';
+import { OnboardingContextShape } from '../../OnboardingContext';
interface Props {
appState: Pick<T.AppState, 'qualifiers'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { Link } from 'react-router';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import { rawSizes } from '../../../theme';
+import { Router, withRouter } from '../../../../components/hoc/withRouter';
import Avatar from '../../../../components/ui/Avatar';
import OrganizationListItem from '../../../../components/ui/OrganizationListItem';
import { isLoggedIn } from '../../../../helpers/users';
-import { withRouter, Router } from '../../../../components/hoc/withRouter';
+import { rawSizes } from '../../../theme';
interface Props {
appState: { organizationsEnabled?: boolean };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import GlobalNavUser from './GlobalNavUser';
import { getMyOrganizations, Store } from '../../../../store/rootReducer';
+import GlobalNavUser from './GlobalNavUser';
interface StateProps {
organizations: T.Organization[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
-import { GlobalNav } from '../GlobalNav';
-import { isSonarCloud } from '../../../../../helpers/system';
+import * as React from 'react';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import {
- fetchPrismicRefs,
fetchPrismicFeatureNews,
+ fetchPrismicRefs,
PrismicFeatureNews
} from '../../../../../api/news';
+import { isSonarCloud } from '../../../../../helpers/system';
+import { GlobalNav } from '../GlobalNav';
jest.mock('../../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GlobalNavMenu from '../GlobalNavMenu';
it('should work with extensions', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { GlobalNavPlus } from '../GlobalNavPlus';
import { isSonarCloud } from '../../../../../helpers/system';
import { mockRouter } from '../../../../../helpers/testMocks';
+import { GlobalNavPlus } from '../GlobalNavPlus';
jest.mock('../../../../../helpers/system', () => ({
isSonarCloud: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { GlobalNavUser } from '../GlobalNavUser';
const currentUser = { avatar: 'abcd1234', isLoggedIn: true, name: 'foo', email: 'foo@bar.baz' };
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { cancelPendingPlugins, PluginPendingResult } from '../../../../api/plugins';
import InstanceMessage from '../../../../components/common/InstanceMessage';
import RestartButton from '../../../../components/common/RestartButton';
-import { cancelPendingPlugins, PluginPendingResult } from '../../../../api/plugins';
interface Props {
fetchSystemStatus: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { IndexLink, Link } from 'react-router';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import ContextNavBar from 'sonar-ui-common/components/ui/ContextNavBar';
import NavBarTabs from 'sonar-ui-common/components/ui/NavBarTabs';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import { PluginPendingResult } from '../../../../api/plugins';
+import { rawSizes } from '../../../theme';
import PendingPluginsActionNotif from './PendingPluginsActionNotif';
import SystemRestartNotif from './SystemRestartNotif';
-import { rawSizes } from '../../../theme';
-import { PluginPendingResult } from '../../../../api/plugins';
interface Props {
extensions: T.Extension[];
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getInstance } from '../../../../helpers/system';
export default function SystemRestartNotif() {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import PendingPluginsActionNotif from '../PendingPluginsActionNotif';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SettingsNav from '../SettingsNav';
it('should work with extensions', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SystemRestartNotif from '../SystemRestartNotif';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInSeconds from 'date-fns/difference_in_seconds';
-import NotificationIcon from 'sonar-ui-common/components/icons/NotificationIcon';
+import * as React from 'react';
import ClearIcon from 'sonar-ui-common/components/icons/ClearIcon';
+import NotificationIcon from 'sonar-ui-common/components/icons/NotificationIcon';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { PrismicFeatureNews } from '../../../api/news';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import * as differenceInSeconds from 'date-fns/difference_in_seconds';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import DateFormatter from '../../../components/intl/DateFormatter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { PrismicFeatureNews } from '../../../api/news';
+import DateFormatter from '../../../components/intl/DateFormatter';
export interface Props {
fetchMoreFeatureNews: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import NavLatestNotification from '../NavLatestNotification';
import { PrismicFeatureNews } from '../../../../api/news';
+import NavLatestNotification from '../NavLatestNotification';
it('should render correctly if there are new features, and the user has not opted out', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import NotificationsSidebar, {
- Props,
+ Feature,
isUnread,
Notification,
- Feature
+ Props
} from '../NotificationsSidebar';
const news: Props['news'] = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import ClockIcon from 'sonar-ui-common/components/icons/ClockIcon';
import * as key from 'keymaster';
import { debounce, keyBy, uniqBy } from 'lodash';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { withRouter, WithRouterProps } from 'react-router';
-import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import OutsideClickHandler from 'sonar-ui-common/components/controls/OutsideClickHandler';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
-import { sortQualifiers, More, Results, ComponentResult } from './utils';
-import RecentHistory from '../RecentHistory';
+import ClockIcon from 'sonar-ui-common/components/icons/ClockIcon';
+import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
import { getSuggestions } from '../../../api/components';
-import { getProjectUrl, getCodeUrl } from '../../../helpers/urls';
+import { getCodeUrl, getProjectUrl } from '../../../helpers/urls';
+import RecentHistory from '../RecentHistory';
import './Search.css';
+import { ComponentResult, More, Results, sortQualifiers } from './utils';
const SearchResults = lazyLoad(() => import('./SearchResults'));
const SearchResult = lazyLoad(() => import('./SearchResult'));
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Link } from 'react-router';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import ClockIcon from 'sonar-ui-common/components/icons/ClockIcon';
import FavoriteIcon from 'sonar-ui-common/components/icons/FavoriteIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
-import { Link } from 'react-router';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { getCodeUrl, getProjectUrl } from '../../../helpers/urls';
import { ComponentResult } from './utils';
-import { getProjectUrl, getCodeUrl } from '../../../helpers/urls';
interface Props {
appState: Pick<T.AppState, 'organizationsEnabled'>;
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import SearchShowMore from './SearchShowMore';
-import { sortQualifiers, More, ComponentResult, Results } from './utils';
+import { ComponentResult, More, Results, sortQualifiers } from './utils';
export interface Props {
allowMore: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
allowMore: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { elementKeydown } from 'sonar-ui-common/helpers/testUtils';
import { Search } from '../Search';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchResult from '../SearchResult';
jest.useFakeTimers();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchResults, { Props } from '../SearchResults';
it('renders different components and dividers between them', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import SearchShowMore from '../SearchShowMore';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { installGlobal, DEFAULT_LANGUAGE, requestMessages } from 'sonar-ui-common/helpers/l10n';
-import { request, parseJSON } from 'sonar-ui-common/helpers/request';
+import { DEFAULT_LANGUAGE, installGlobal, requestMessages } from 'sonar-ui-common/helpers/l10n';
+import { parseJSON, request } from 'sonar-ui-common/helpers/request';
import { installExtensionsHandler, installWebAnalyticsHandler } from '../helpers/extensionsHandler';
import { getSystemStatus } from '../helpers/system';
import './styles/sonar.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import throwGlobalError from '../throwGlobalError';
import getStore from '../getStore';
+import throwGlobalError from '../throwGlobalError';
it('should put the error message in the store', async () => {
const response: any = { json: jest.fn().mockResolvedValue({ errors: [{ msg: 'error 1' }] }) };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import getStore from './getStore';
import * as globalMessages from '../../store/globalMessages';
+import getStore from './getStore';
export default function addGlobalSuccessMessage(message: string): void {
const store = getStore();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import getHistory from 'sonar-ui-common/helpers/getHistory';
-import getStore from './getStore';
import { requireAuthorization } from '../../store/appState';
+import getStore from './getStore';
export default function handleRequiredAuthorization() {
const store = getStore();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable react/jsx-sort-props */
+import { Location } from 'history';
import * as React from 'react';
import { render } from 'react-dom';
-import { IndexRoute, Redirect, Route, RouteConfig, RouteProps, Router } from 'react-router';
-import { Provider } from 'react-redux';
import { IntlProvider } from 'react-intl';
-import { Location } from 'history';
+import { Provider } from 'react-redux';
+import { IndexRoute, Redirect, Route, RouteConfig, RouteProps, Router } from 'react-router';
+import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import ThemeContext from 'sonar-ui-common/components/ThemeContext';
import getHistory from 'sonar-ui-common/helpers/getHistory';
-import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import getStore from './getStore';
-import MigrationContainer from '../components/MigrationContainer';
-import * as theme from '../theme';
-import App from '../components/App';
-import GlobalContainer from '../components/GlobalContainer';
import aboutRoutes from '../../apps/about/routes';
import accountRoutes from '../../apps/account/routes';
import backgroundTasksRoutes from '../../apps/background-tasks/routes';
import codingRulesRoutes from '../../apps/coding-rules/routes';
import componentMeasuresRoutes from '../../apps/component-measures/routes';
import customMeasuresRoutes from '../../apps/custom-measures/routes';
-import groupsRoutes from '../../apps/groups/routes';
-import Issues from '../../apps/issues/components/AppContainer';
+import customMetricsRoutes from '../../apps/custom-metrics/routes';
+import documentationRoutes from '../../apps/documentation/routes';
import Explore from '../../apps/explore/Explore';
import ExploreIssues from '../../apps/explore/ExploreIssues';
import ExploreProjects from '../../apps/explore/ExploreProjects';
+import groupsRoutes from '../../apps/groups/routes';
+import Issues from '../../apps/issues/components/AppContainer';
import IssuesPageSelector from '../../apps/issues/IssuesPageSelector';
+import { maintenanceRoutes, setupRoutes } from '../../apps/maintenance/routes';
import marketplaceRoutes from '../../apps/marketplace/routes';
-import customMetricsRoutes from '../../apps/custom-metrics/routes';
-import overviewRoutes from '../../apps/overview/routes';
-import onboardingRoutes from '../../apps/tutorials/routes';
import organizationsRoutes from '../../apps/organizations/routes';
+import overviewRoutes from '../../apps/overview/routes';
import permissionTemplatesRoutes from '../../apps/permission-templates/routes';
+import { globalPermissionsRoutes, projectPermissionsRoutes } from '../../apps/permissions/routes';
import portfolioRoutes from '../../apps/portfolio/routes';
import projectActivityRoutes from '../../apps/projectActivity/routes';
import projectBranchesRoutes from '../../apps/projectBranches/routes';
import sessionsRoutes from '../../apps/sessions/routes';
import settingsRoutes from '../../apps/settings/routes';
import systemRoutes from '../../apps/system/routes';
+import onboardingRoutes from '../../apps/tutorials/routes';
import usersRoutes from '../../apps/users/routes';
import webAPIRoutes from '../../apps/web-api/routes';
-import documentationRoutes from '../../apps/documentation/routes';
import webhooksRoutes from '../../apps/webhooks/routes';
-import { maintenanceRoutes, setupRoutes } from '../../apps/maintenance/routes';
-import { globalPermissionsRoutes, projectPermissionsRoutes } from '../../apps/permissions/routes';
import { isSonarCloud } from '../../helpers/system';
+import App from '../components/App';
+import GlobalContainer from '../components/GlobalContainer';
+import MigrationContainer from '../components/MigrationContainer';
+import * as theme from '../theme';
+import getStore from './getStore';
function handleUpdate(this: { state: { location: Location } }) {
const { action } = this.state.location;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { parseError } from 'sonar-ui-common/helpers/request';
-import getStore from './getStore';
import { addGlobalErrorMessage } from '../../store/globalMessages';
+import getStore from './getStore';
export default function throwGlobalError(error: { response: Response }): Promise<Response> {
const store = getStore();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
+import { keyBy } from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
-import { keyBy } from 'lodash';
import { Link } from 'react-router';
-import { Location } from 'history';
-import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import AboutProjects from './AboutProjects';
-import AboutLanguages from './AboutLanguages';
-import AboutCleanCode from './AboutCleanCode';
-import AboutQualityModel from './AboutQualityModel';
-import AboutQualityGates from './AboutQualityGates';
-import AboutLeakPeriod from './AboutLeakPeriod';
-import AboutStandards from './AboutStandards';
-import AboutScanners from './AboutScanners';
-import EntryIssueTypes from './EntryIssueTypes';
-import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import GlobalContainer from '../../../app/components/GlobalContainer';
+import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { searchProjects } from '../../../api/components';
import { getFacet } from '../../../api/issues';
-import { fetchAboutPageSettings } from '../actions';
+import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
+import GlobalContainer from '../../../app/components/GlobalContainer';
import {
getAppState,
getCurrentUser,
getGlobalSettingValue,
Store
} from '../../../store/rootReducer';
+import { fetchAboutPageSettings } from '../actions';
import '../styles.css';
+import AboutCleanCode from './AboutCleanCode';
+import AboutLanguages from './AboutLanguages';
+import AboutLeakPeriod from './AboutLeakPeriod';
+import AboutProjects from './AboutProjects';
+import AboutQualityGates from './AboutQualityGates';
+import AboutQualityModel from './AboutQualityModel';
+import AboutScanners from './AboutScanners';
+import AboutStandards from './AboutStandards';
+import EntryIssueTypes from './EntryIssueTypes';
interface Props {
appState: Pick<T.AppState, 'defaultOrganization' | 'organizationsEnabled'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
import { Link } from 'react-router';
+import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ReadMore from './ReadMore';
import { getRulesUrl } from '../../../helpers/urls';
+import ReadMore from './ReadMore';
const link = 'https://redirect.sonarsource.com/doc/rules.html';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Link } from 'react-router';
import BugIcon from 'sonar-ui-common/components/icons/BugIcon';
import CodeSmellIcon from 'sonar-ui-common/components/icons/CodeSmellIcon';
import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
-import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getIssuesUrl } from '../../../helpers/urls';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { AboutApp } from '../AboutApp';
import { searchProjects } from '../../../../api/components';
import { getFacet } from '../../../../api/issues';
-import { mockLocation, mockAppState, mockCurrentUser } from '../../../../helpers/testMocks';
+import { mockAppState, mockCurrentUser, mockLocation } from '../../../../helpers/testMocks';
+import { AboutApp } from '../AboutApp';
jest.mock('sonar-ui-common/helpers/pages', () => ({
addWhitePageClass: jest.fn(),
import * as React from 'react';
import Helmet from 'react-helmet';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { isLoggedIn } from '../../../helpers/users';
import SQPageContainer from './components/SQPageContainer';
import SQStartUsing from './components/SQStartUsing';
import SQTopNav from './components/SQTopNav';
-import { isLoggedIn } from '../../../helpers/users';
import './style.css';
export default function AsAService() {
import Helmet from 'react-helmet';
import { Link } from 'react-router';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import SQPageContainer from './components/SQPageContainer';
import { isLoggedIn } from '../../../helpers/users';
+import SQPageContainer from './components/SQPageContainer';
import './style.css';
const LANGUAGES = [
import * as React from 'react';
import Helmet from 'react-helmet';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { isLoggedIn } from '../../../helpers/users';
import SQPageContainer from './components/SQPageContainer';
import SQStartUsing from './components/SQStartUsing';
import SQTopNav from './components/SQTopNav';
-import { isLoggedIn } from '../../../helpers/users';
import './style.css';
export default function BranchAnalysis() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
import * as React from 'react';
import { Helmet } from 'react-helmet';
import { Link } from 'react-router';
-import { Location } from 'history';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Select from 'sonar-ui-common/components/controls/Select';
-import SQPageContainer from './components/SQPageContainer';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { isLoggedIn } from '../../../helpers/users';
+import SQPageContainer from './components/SQPageContainer';
import './style.css';
const CATEGORIES = [
import { connect } from 'react-redux';
import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { FixedNavBar, TopNavBar } from './components/NavBars';
+import { getGlobalSettingValue, Store } from '../../../store/rootReducer';
import FeaturedProjects from './components/FeaturedProjects';
import Footer from './components/Footer';
import { Languages } from './components/Languages';
import LoginButtons from './components/LoginButtons';
+import { FixedNavBar, TopNavBar } from './components/NavBars';
import Statistics from './components/Statistics';
-import { requestHomepageData, HomepageData, FeaturedProject } from './utils';
-import { getGlobalSettingValue, Store } from '../../../store/rootReducer';
import './new_style.css';
+import { FeaturedProject, HomepageData, requestHomepageData } from './utils';
interface Props {
homePageDataUrl?: string;
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import Footer from './components/Footer';
-import { TopNavBar, FixedNavBar } from './components/NavBars';
+import { FixedNavBar, TopNavBar } from './components/NavBars';
import './new_style.css';
export default class Pricing extends React.PureComponent {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router';
import Helmet from 'react-helmet';
+import { Link } from 'react-router';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { isLoggedIn } from '../../../helpers/users';
import LoginButtons from './components/LoginButtons';
import Pricing from './components/Pricing';
import SQPageContainer from './components/SQPageContainer';
import StartUsing from './components/StartUsing';
-import { LANGUAGES } from './utils';
-import { isLoggedIn } from '../../../helpers/users';
import './style.css';
+import { LANGUAGES } from './utils';
const NB_LANGUAGE_PER_ROW = 8;
import * as React from 'react';
import Helmet from 'react-helmet';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { isLoggedIn } from '../../../helpers/users';
import SQPageContainer from './components/SQPageContainer';
import SQStartUsing from './components/SQStartUsing';
import SQTopNav from './components/SQTopNav';
-import { isLoggedIn } from '../../../helpers/users';
import './style.css';
export default function SonarLintIntegration() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import BranchAnalysis from '../BranchAnalysis';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import Home from '../Home';
import { mockStore } from '../../../../helpers/testMocks';
+import Home from '../Home';
import { requestHomepageData } from '../utils';
jest.mock('../utils', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import CountUp from 'react-countup';
import { throttle } from 'lodash';
+import * as React from 'react';
+import CountUp from 'react-countup';
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
import Rating from 'sonar-ui-common/components/ui/Rating';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getBaseUrl, getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
-import { FeaturedProject } from '../utils';
-import CoverageRating from '../../../../components/ui/CoverageRating';
import OrganizationAvatar from '../../../../components/common/OrganizationAvatar';
-import ProjectCardLanguagesContainer from '../../../projects/components/ProjectCardLanguagesContainer';
-import { getMetricName } from '../../../overview/utils';
+import CoverageRating from '../../../../components/ui/CoverageRating';
import { getProjectUrl } from '../../../../helpers/urls';
+import { getMetricName } from '../../../overview/utils';
+import ProjectCardLanguagesContainer from '../../../projects/components/ProjectCardLanguagesContainer';
+import { FeaturedProject } from '../utils';
import './FeaturedProjects.css';
interface Props {
*/
import * as React from 'react';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import SCChevronDownIcon from './SCChevronDownIcon';
import { LANGUAGES } from '../utils';
+import SCChevronDownIcon from './SCChevronDownIcon';
interface State {
height?: number;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { throttle } from 'lodash';
+import * as React from 'react';
import NavBar from 'sonar-ui-common/components/ui/NavBar';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import './NavBars.css';
import { connect } from 'react-redux';
import { withRouter, WithRouterProps } from 'react-router';
import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
-import Footer from './Footer';
import GlobalContainer from '../../../../app/components/GlobalContainer';
import { getCurrentUser, getMyOrganizations, Store } from '../../../../store/rootReducer';
+import Footer from './Footer';
interface StateProps {
currentUser: T.CurrentUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
import { Link } from 'react-router';
+import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
export default function StartUsing() {
return (
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { throttle } from 'lodash';
+import * as React from 'react';
import CountUp from 'react-countup';
-import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import './Statistics.css';
interface Statistic {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import FeaturedProjects, { ProjectCard, ProjectIssues } from '../FeaturedProjects';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Footer from '../Footer';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LoginButtons from '../LoginButtons';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import Statistics, { StatisticCard } from '../Statistics';
const STATISTICS = { icon: 'stat-icon', text: 'my stat', value: 26666 };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { connect } from 'react-redux';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { connect } from 'react-redux';
import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import Nav from './Nav';
-import UserCard from './UserCard';
-import { getCurrentUser, areThereCustomOrganizations, Store } from '../../../store/rootReducer';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { areThereCustomOrganizations, getCurrentUser, Store } from '../../../store/rootReducer';
import '../account.css';
+import Nav from './Nav';
+import UserCard from './UserCard';
interface Props {
currentUser: T.CurrentUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link, IndexLink } from 'react-router';
+import { IndexLink, Link } from 'react-router';
import NavBarTabs from 'sonar-ui-common/components/ui/NavBarTabs';
import { translate } from 'sonar-ui-common/helpers/l10n';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { changePassword } from '../../../api/users';
interface Props {
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getCurrentUser, Store } from '../../../store/rootReducer';
import Password from './Password';
import Tokens from './Tokens';
-import { getCurrentUser, Store } from '../../../store/rootReducer';
interface Props {
user: T.LoggedInUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import { Account } from '../Account';
import { mockCurrentUser } from '../../../../helpers/testMocks';
+import { Account } from '../Account';
jest.mock('sonar-ui-common/helpers/handleRequiredAuthentication', () => ({
default: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Password from '../Password';
+import * as React from 'react';
import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import Password from '../Password';
it('renders correctly', () => {
expect(shallow(<Password user={mockLoggedInUser()} />)).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Tokens from '../Tokens';
it('renders', () => {
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isSonarCloud } from '../../../helpers/system';
import NotificationsList from './NotificationsList';
import SonarCloudNotifications from './SonarCloudNotifications';
-import { isSonarCloud } from '../../../helpers/system';
interface Props {
addNotification: (n: T.Notification) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { groupBy, partition, uniq, uniqBy, uniqWith } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { groupBy, partition, uniq, uniqBy, uniqWith } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as api from '../../../api/notifications';
+import { withAppState } from '../../../components/hoc/withAppState';
import GlobalNotifications from './GlobalNotifications';
import Projects from './Projects';
import { NotificationProject } from './types';
-import * as api from '../../../api/notifications';
-import { withAppState } from '../../../components/hoc/withAppState';
export interface Props {
appState: Pick<T.AppState, 'organizationsEnabled'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import Notifications, { Props } from './Notifications';
import { fetchOrganizations } from '../../../store/rootActions';
+import Notifications, { Props } from './Notifications';
const mapDispatchToProps = { fetchOrganizations } as Pick<Props, 'fetchOrganizations'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, hasMessage } from 'sonar-ui-common/helpers/l10n';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onAdd: (n: T.Notification) => void;
import * as React from 'react';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import NotificationsList from './NotificationsList';
-import { NotificationProject } from './types';
import Organization from '../../../components/shared/Organization';
import { getProjectUrl } from '../../../helpers/urls';
+import NotificationsList from './NotificationsList';
+import { NotificationProject } from './types';
interface Props {
addNotification: (n: T.Notification) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { differenceWith } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { AsyncSelect } from 'sonar-ui-common/components/controls/Select';
-import ProjectNotifications from './ProjectNotifications';
-import { NotificationProject } from './types';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getSuggestions } from '../../../api/components';
import Organization from '../../../components/shared/Organization';
+import ProjectNotifications from './ProjectNotifications';
+import { NotificationProject } from './types';
export interface Props {
addNotification: (n: T.Notification) => void;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getCurrentUserSetting, Store } from '../../../store/rootReducer';
import { setCurrentUserSetting } from '../../../store/users';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import GlobalNotifications from '../GlobalNotifications';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import GlobalNotifications from '../GlobalNotifications';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Notifications } from '../Notifications';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { Notifications } from '../Notifications';
jest.mock('../../../../api/notifications', () => ({
addNotification: jest.fn(() => Promise.resolve()),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { hasMessage } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import { hasMessage } from 'sonar-ui-common/helpers/l10n';
import NotificationsList from '../NotificationsList';
jest.mock('sonar-ui-common/helpers/l10n', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectNotifications from '../ProjectNotifications';
const channels = ['channel1', 'channel2'];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Projects, { Props } from '../Projects';
jest.mock('../../../../api/components', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { SonarCloudNotifications } from '../SonarCloudNotifications';
it('should match snapshot', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import OrganizationCard from './OrganizationCard';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import OrganizationsList from './OrganizationsList';
-import { fetchIfAnyoneCanCreateOrganizations } from './actions';
import {
getAppState,
- getMyOrganizations,
getGlobalSettingValue,
+ getMyOrganizations,
Store
} from '../../../store/rootReducer';
+import { fetchIfAnyoneCanCreateOrganizations } from './actions';
+import OrganizationsList from './OrganizationsList';
interface StateProps {
anyoneCanCreate: boolean;
*/
import { Dispatch } from 'redux';
import { getOrganizations } from '../../../api/organizations';
-import { receiveMyOrganizations } from '../../../store/organizations';
import { getValues } from '../../../api/settings';
+import { receiveMyOrganizations } from '../../../store/organizations';
import { receiveValues } from '../../settings/store/values';
export const fetchMyOrganizations = () => (dispatch: Dispatch) => {
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import UserExternalIdentity from './UserExternalIdentity';
+import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
+import { isSonarCloud } from '../../../helpers/system';
import UserDeleteAccount from './UserDeleteAccount';
+import UserExternalIdentity from './UserExternalIdentity';
import UserGroups from './UserGroups';
import UserScmAccounts from './UserScmAccounts';
-import { isSonarCloud } from '../../../helpers/system';
-import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
export interface Props {
currentUser: T.LoggedInUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import UserDeleteAccountModal from './UserDeleteAccountModal';
-import UserDeleteAccountContent from './UserDeleteAccountContent';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getOrganizationsThatPreventDeletion } from '../../../api/organizations';
import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { withUserOrganizations } from '../../../components/hoc/withUserOrganizations';
-import { getOrganizationsThatPreventDeletion } from '../../../api/organizations';
+import UserDeleteAccountContent from './UserDeleteAccountContent';
+import UserDeleteAccountModal from './UserDeleteAccountModal';
interface Props {
user: T.LoggedInUser;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import InputValidationField from 'sonar-ui-common/components/controls/InputValidationField';
import ValidationModal from 'sonar-ui-common/components/controls/ValidationModal';
-import UserDeleteAccountContent from './UserDeleteAccountContent';
-import RecentHistory from '../../../app/components/RecentHistory';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { deactivateUser } from '../../../api/users';
+import RecentHistory from '../../../app/components/RecentHistory';
import { Router, withRouter } from '../../../components/hoc/withRouter';
import { doLogout } from '../../../store/rootActions';
+import UserDeleteAccountContent from './UserDeleteAccountContent';
interface Values {
login: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Profile, Props } from '../Profile';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import { Profile, Props } from '../Profile';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: jest.fn().mockReturnValue(false) }));
import { shallow } from 'enzyme';
import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { getOrganizationsThatPreventDeletion } from '../../../../api/organizations';
import { mockLoggedInUser, mockOrganization } from '../../../../helpers/testMocks';
import { UserDeleteAccount } from '../UserDeleteAccount';
-import { getOrganizationsThatPreventDeletion } from '../../../../api/organizations';
jest.mock('../../../../api/organizations', () => ({
getOrganizationsThatPreventDeletion: jest.fn().mockResolvedValue({ organizations: [] })
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import UserDeleteAccountContent, {
ShowOrganizations,
ShowOrganizationsToTransferOrDelete
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { deactivateUser } from '../../../../api/users';
import { mockLoggedInUser, mockRouter } from '../../../../helpers/testMocks';
import { UserDeleteAccountModal } from '../UserDeleteAccountModal';
-import { deactivateUser } from '../../../../api/users';
jest.mock('../../../../api/users', () => ({
deactivateUser: jest.fn()
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import Level from 'sonar-ui-common/components/ui/Level';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DateFromNow from '../../../components/intl/DateFromNow';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import MetaLink from '../../overview/meta/MetaLink';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import ProjectCard from './ProjectCard';
interface Props {
import * as React from 'react';
import Helmet from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Projects from './Projects';
import { getMyProjects } from '../../../api/components';
+import Projects from './Projects';
interface State {
loading: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectCard from '../ProjectCard';
it('should render key and name', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import Projects from '../Projects';
import ProjectCard from '../ProjectCard';
+import Projects from '../Projects';
const PROJECTS = [
{ key: 'key1', links: [], name: 'name1' },
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Search from '../components/Search';
-import { STATUSES, CURRENTS, DEBOUNCE_DELAY, DEFAULT_FILTERS } from '../constants';
+import { CURRENTS, DEBOUNCE_DELAY, DEFAULT_FILTERS, STATUSES } from '../constants';
import { formatDuration } from '../utils';
describe('Constants', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { debounce, uniq } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { debounce, uniq } from 'lodash';
import { connect } from 'react-redux';
-import { parseAsDate } from 'sonar-ui-common/helpers/query';
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Header from './Header';
-import Footer from './Footer';
-import Stats from './Stats';
-import Search from './Search';
-import Tasks from './Tasks';
-import { DEFAULT_FILTERS, DEBOUNCE_DELAY, STATUSES, CURRENTS } from '../constants';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { Location, Router } from '../../../components/hoc/withRouter';
+import { parseAsDate } from 'sonar-ui-common/helpers/query';
import {
- getTypes,
+ cancelAllTasks,
+ cancelTask as cancelTaskAPI,
getActivity,
getStatus,
- cancelAllTasks,
- cancelTask as cancelTaskAPI
+ getTypes
} from '../../../api/ce';
-import { updateTask, mapFiltersToParameters, Query } from '../utils';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { Location, Router } from '../../../components/hoc/withRouter';
import { fetchOrganizations } from '../../../store/rootActions';
import '../background-tasks.css';
+import { CURRENTS, DEBOUNCE_DELAY, DEFAULT_FILTERS, STATUSES } from '../constants';
+import { mapFiltersToParameters, Query, updateTask } from '../utils';
+import Footer from './Footer';
+import Header from './Header';
+import Search from './Search';
+import Stats from './Stats';
+import Tasks from './Tasks';
interface Props {
component?: Pick<T.Component, 'key'> & { id: string }; // id should be removed when api/ce/activity accept a component key instead of an id
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { CURRENTS } from '../constants';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getTask } from '../../../api/ce';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import StatusFilter from './StatusFilter';
-import TypesFilter from './TypesFilter';
-import CurrentsFilter from './CurrentsFilter';
-import DateFilter from './DateFilter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { DEFAULT_FILTERS } from '../constants';
import { Query } from '../utils';
+import CurrentsFilter from './CurrentsFilter';
+import DateFilter from './DateFilter';
+import StatusFilter from './StatusFilter';
+import TypesFilter from './TypesFilter';
interface Props {
component?: unknown;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getTask } from '../../../api/ce';
interface Props {
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { colors } from '../../../app/theme';
import { getAppState, Store } from '../../../store/rootReducer';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
export interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { STATUSES } from '../constants';
interface Props {
import * as React from 'react';
import TaskActions from './TaskActions';
import TaskComponent from './TaskComponent';
-import TaskExecutionTime from './TaskExecutionTime';
-import TaskDay from './TaskDay';
import TaskDate from './TaskDate';
+import TaskDay from './TaskDay';
+import TaskExecutionTime from './TaskExecutionTime';
import TaskId from './TaskId';
import TaskStatus from './TaskStatus';
import TaskSubmitter from './TaskSubmitter';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { STATUSES } from '../constants';
import ScannerContext from './ScannerContext';
import Stacktrace from './Stacktrace';
-import { STATUSES } from '../constants';
const AnalysisWarningsModal = lazyLoad(
() => import('../../../components/common/AnalysisWarningsModal'),
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Link } from 'react-router';
import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
import PullRequestIcon from 'sonar-ui-common/components/icons/PullRequestIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import ShortLivingBranchIcon from 'sonar-ui-common/components/icons/ShortLivingBranchIcon';
-import { Link } from 'react-router';
-import TaskType from './TaskType';
import Organization from '../../../components/shared/Organization';
import {
- getProjectUrl,
- getShortLivingBranchUrl,
getLongLivingBranchUrl,
- getPullRequestUrl
+ getProjectUrl,
+ getPullRequestUrl,
+ getShortLivingBranchUrl
} from '../../../helpers/urls';
+import TaskType from './TaskType';
interface Props {
task: T.Task;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
+import * as React from 'react';
import { isValidDate, parseDate } from 'sonar-ui-common/helpers/dates';
import TimeFormatter from '../../../components/intl/TimeFormatter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as isSameDay from 'date-fns/is_same_day';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import DateFormatter from '../../../components/intl/DateFormatter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import Task from './Task';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { ALL_TYPES } from '../constants';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { EditButton } from 'sonar-ui-common/components/controls/buttons';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import WorkersForm from './WorkersForm';
-import NoWorkersSupportPopup from './NoWorkersSupportPopup';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getWorkers } from '../../../api/ce';
+import NoWorkersSupportPopup from './NoWorkersSupportPopup';
+import WorkersForm from './WorkersForm';
interface State {
canSetWorkerCount: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Select from 'sonar-ui-common/components/controls/Select';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { setWorkerCount } from '../../../api/ce';
const MAX_WORKERS = 10;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { BackgroundTasksApp } from '../BackgroundTasksApp';
import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import { BackgroundTasksApp } from '../BackgroundTasksApp';
jest.mock('../../../../api/ce', () => ({
getTypes: jest.fn().mockResolvedValue({
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ScannerContext from '../ScannerContext';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import ScannerContext from '../ScannerContext';
jest.mock('../../../../api/ce', () => ({
getTask: jest.fn(() => Promise.resolve({ scannerContext: 'context' }))
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Stacktrace from '../Stacktrace';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import Stacktrace from '../Stacktrace';
jest.mock('../../../../api/ce', () => ({
getTask: jest.fn(() => Promise.resolve({ errorStacktrace: 'stacktrace' }))
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { StatPendingCount, Props } from '../StatPendingCount';
+import * as React from 'react';
+import { Props, StatPendingCount } from '../StatPendingCount';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import StatPendingTime, { Props } from '../StatPendingTime';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import StatStillFailing, { Props } from '../StatStillFailing';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Stats, { Props } from '../Stats';
+import * as React from 'react';
import { mockComponent } from '../../../../helpers/testMocks';
+import Stats, { Props } from '../Stats';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Task from '../Task';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import TaskActions from '../TaskActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskComponent from '../TaskComponent';
const TASK = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskDate from '../TaskDate';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskDay from '../TaskDay';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskExecutionTime from '../TaskExecutionTime';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskId from '../TaskId';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskStatus from '../TaskStatus';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TaskType from '../TaskType';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Workers from '../Workers';
setWorkerCount: () => Promise.resolve()
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
-import WorkersForm from '../WorkersForm';
+import * as React from 'react';
import { submit } from 'sonar-ui-common/helpers/testUtils';
+import WorkersForm from '../WorkersForm';
it('changes select', () => {
const wrapper = shallow(<WorkersForm onClose={jest.fn()} workerCount={1} />);
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
-import { STATUSES, CURRENTS, ALL_TYPES } from './constants';
+import { ALL_TYPES, CURRENTS, STATUSES } from './constants';
export interface Query {
currents: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { addComponent, getComponent, addComponentChildren, getComponentChildren } from '../bucket';
+import { addComponent, addComponentChildren, getComponent, getComponentChildren } from '../bucket';
const component: T.ComponentMeasure = { key: 'frodo', name: 'frodo', qualifier: 'frodo' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { connect } from 'react-redux';
+import { Location } from 'history';
+import * as React from 'react';
import Helmet from 'react-helmet';
+import { connect } from 'react-redux';
import { InjectedRouter } from 'react-router';
-import { Location } from 'history';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import Components from './Components';
-import Breadcrumbs from './Breadcrumbs';
-import Search from './Search';
-import SourceViewerWrapper from './SourceViewerWrapper';
-import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket';
-import { retrieveComponentChildren, retrieveComponent, loadMoreChildren } from '../utils';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { fetchMetrics, fetchBranchStatus } from '../../../store/rootActions';
+import { isPullRequest, isSameBranchLike, isShortLivingBranch } from '../../../helpers/branches';
+import { getCodeUrl, getProjectUrl } from '../../../helpers/urls';
+import { fetchBranchStatus, fetchMetrics } from '../../../store/rootActions';
import { getMetrics } from '../../../store/rootReducer';
-import { isSameBranchLike, isPullRequest, isShortLivingBranch } from '../../../helpers/branches';
-import { getProjectUrl, getCodeUrl } from '../../../helpers/urls';
+import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket';
import '../code.css';
+import { loadMoreChildren, retrieveComponent, retrieveComponentChildren } from '../utils';
+import Breadcrumbs from './Breadcrumbs';
+import Components from './Components';
+import Search from './Search';
+import SourceViewerWrapper from './SourceViewerWrapper';
interface StateToProps {
metrics: T.Dict<T.Metric>;
*/
import * as classNames from 'classnames';
import * as React from 'react';
-import ComponentName from './ComponentName';
+import { withScrollTo } from '../../../components/hoc/withScrollTo';
+import { WorkspaceContext } from '../../../components/workspace/context';
import ComponentMeasure from './ComponentMeasure';
+import ComponentName from './ComponentName';
import ComponentPin from './ComponentPin';
-import { WorkspaceContext } from '../../../components/workspace/context';
-import { withScrollTo } from '../../../components/hoc/withScrollTo';
interface Props {
branchLike?: T.BranchLike;
*/
import * as React from 'react';
import Measure from '../../../components/measure/Measure';
-import { isDiffMetric } from '../../../helpers/measures';
import { getLeakValue } from '../../../components/measure/utils';
+import { isDiffMetric } from '../../../helpers/measures';
interface Props {
component: T.ComponentMeasure;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { intersection } from 'lodash';
+import * as React from 'react';
+import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation';
+import { getCodeMetrics } from '../utils';
import Component from './Component';
import ComponentsEmpty from './ComponentsEmpty';
import ComponentsHeader from './ComponentsHeader';
-import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation';
-import { getCodeMetrics } from '../utils';
interface Props {
baseComponent?: T.ComponentMeasure;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getTree } from '../../../api/components';
+import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
import { getBranchLikeQuery } from '../../../helpers/branches';
-import { withRouter, Router, Location } from '../../../components/hoc/withRouter';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { Location } from 'history';
+import * as React from 'react';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import SourceViewer from '../../../components/SourceViewer/SourceViewer';
import withKeyboardNavigation from '../../../components/hoc/withKeyboardNavigation';
+import SourceViewer from '../../../components/SourceViewer/SourceViewer';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { App } from '../App';
+import { mockIssue, mockPullRequest, mockRouter } from '../../../../helpers/testMocks';
import { retrieveComponent } from '../../utils';
-import { mockRouter, mockPullRequest, mockIssue } from '../../../../helpers/testMocks';
+import { App } from '../App';
jest.mock('../../utils', () => ({
retrieveComponent: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Component } from '../Component';
+import * as React from 'react';
import { mockComponentMeasure, mockMetric } from '../../../../helpers/testMocks';
+import { Component } from '../Component';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponentMeasure, mockMeasure, mockMetric } from '../../../../helpers/testMocks';
import ComponentMeasure from '../ComponentMeasure';
-import { mockMetric, mockMeasure, mockComponentMeasure } from '../../../../helpers/testMocks';
it('renders correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponentMeasure, mockMainBranch } from '../../../../helpers/testMocks';
import ComponentName, { getTooltip, mostCommonPrefix, Props } from '../ComponentName';
-import { mockMainBranch, mockComponentMeasure } from '../../../../helpers/testMocks';
describe('#getTooltip', () => {
it('should correctly format component information', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { Components } from '../Components';
const COMPONENT = { key: 'foo', name: 'Foo', qualifier: 'TRK' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ComponentsHeader from '../ComponentsHeader';
+import * as React from 'react';
import { mockComponent } from '../../../../helpers/testMocks';
+import ComponentsHeader from '../ComponentsHeader';
it('renders correctly for projects', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { getBreadcrumbs, getChildren, getComponent } from '../../api/components';
+import { getBranchLikeQuery, isPullRequest, isShortLivingBranch } from '../../helpers/branches';
import {
addComponent,
- getComponent as getComponentFromBucket,
- addComponentChildren,
- getComponentChildren,
addComponentBreadcrumbs,
- getComponentBreadcrumbs
+ addComponentChildren,
+ getComponent as getComponentFromBucket,
+ getComponentBreadcrumbs,
+ getComponentChildren
} from './bucket';
-import { getChildren, getComponent, getBreadcrumbs } from '../../api/components';
-import { getBranchLikeQuery, isShortLivingBranch, isPullRequest } from '../../helpers/branches';
const METRICS = [
'ncloc',
*/
import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import ActivationFormModal from './ActivationFormModal';
import { Profile as BaseProfile } from '../../../api/quality-profiles';
+import ActivationFormModal from './ActivationFormModal';
interface Props {
activation?: T.RuleActivation;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Select from 'sonar-ui-common/components/controls/Select';
-import SeverityHelper from '../../../components/shared/SeverityHelper';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { activateRule, Profile } from '../../../api/quality-profiles';
+import SeverityHelper from '../../../components/shared/SeverityHelper';
import { SEVERITIES } from '../../../helpers/constants';
import { sortProfiles } from '../../quality-profiles/utils';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Facet, { BasicProps } from './Facet';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import { SEVERITIES } from '../../../helpers/constants';
+import Facet, { BasicProps } from './Facet';
interface Props extends BasicProps {
disabled: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
import { keyBy } from 'lodash';
+import * as React from 'react';
import { Helmet } from 'react-helmet';
import { connect } from 'react-redux';
import { withRouter, WithRouterProps } from 'react-router';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
addSideBarClass,
addWhitePageClass,
removeWhitePageClass
} from 'sonar-ui-common/helpers/pages';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import BulkChange from './BulkChange';
-import FacetsList from './FacetsList';
-import PageActions from './PageActions';
-import RuleDetails from './RuleDetails';
-import RuleListItem from './RuleListItem';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import {
- Facets,
- Query,
- parseQuery,
- serializeQuery,
- areQueriesEqual,
- shouldRequestFacet,
- FacetKey,
- OpenFacets,
- getServerFacet,
- getAppFacet,
- Actives,
- Activation,
- getOpen
-} from '../query';
+import { Profile, searchQualityProfiles } from '../../../api/quality-profiles';
+import { getRulesApp, searchRules } from '../../../api/rules';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import FiltersHeader from '../../../components/common/FiltersHeader';
-import { searchRules, getRulesApp } from '../../../api/rules';
-import { searchQualityProfiles, Profile } from '../../../api/quality-profiles';
+import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import '../../../components/search-navigator.css';
+import { hasPrivateAccess } from '../../../helpers/organizations';
import {
+ getAppState,
getCurrentUser,
getLanguages,
getMyOrganizations,
- Store,
- getAppState
+ Store
} from '../../../store/rootReducer';
import {
- shouldOpenStandardsFacet,
shouldOpenSonarSourceSecurityFacet,
shouldOpenStandardsChildFacet,
+ shouldOpenStandardsFacet,
STANDARDS
} from '../../issues/utils';
-import { hasPrivateAccess } from '../../../helpers/organizations';
-import '../../../components/search-navigator.css';
+import {
+ Activation,
+ Actives,
+ areQueriesEqual,
+ FacetKey,
+ Facets,
+ getAppFacet,
+ getOpen,
+ getServerFacet,
+ OpenFacets,
+ parseQuery,
+ Query,
+ serializeQuery,
+ shouldRequestFacet
+} from '../query';
import '../styles.css';
+import BulkChange from './BulkChange';
+import FacetsList from './FacetsList';
+import PageActions from './PageActions';
+import RuleDetails from './RuleDetails';
+import RuleListItem from './RuleListItem';
const PAGE_SIZE = 100;
const LIMIT_BEFORE_LOAD_MORE = 5;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { injectIntl, InjectedIntlProps } from 'react-intl';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query } from '../query';
import DateInput from '../../../components/controls/DateInput';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import { longFormatterOption } from '../../../components/intl/DateFormatter';
+import { Query } from '../query';
interface Props {
onChange: (changes: Partial<Query>) => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import BulkChangeModal from './BulkChangeModal';
-import { Query } from '../query';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Profile } from '../../../api/quality-profiles';
+import { Query } from '../query';
+import BulkChangeModal from './BulkChangeModal';
interface Props {
languages: T.Languages;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import Select from 'sonar-ui-common/components/controls/Select';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import Select from 'sonar-ui-common/components/controls/Select';
+import { bulkActivateRules, bulkDeactivateRules, Profile } from '../../../api/quality-profiles';
import { Query, serializeQuery } from '../query';
-import { Profile, bulkActivateRules, bulkDeactivateRules } from '../../../api/quality-profiles';
interface Props {
action: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { csvEscape } from 'sonar-ui-common/helpers/csv';
-import { latinize } from 'sonar-ui-common/helpers/strings';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Select from 'sonar-ui-common/components/controls/Select';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { csvEscape } from 'sonar-ui-common/helpers/csv';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { latinize } from 'sonar-ui-common/helpers/strings';
+import { createRule, updateRule } from '../../../api/rules';
import MarkdownTips from '../../../components/common/MarkdownTips';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import TypeHelper from '../../../components/shared/TypeHelper';
-import { createRule, updateRule } from '../../../api/rules';
-import { SEVERITIES, RULE_TYPES, RULE_STATUSES } from '../../../helpers/constants';
+import { RULE_STATUSES, RULE_TYPES, SEVERITIES } from '../../../helpers/constants';
interface Props {
customRule?: T.RuleDetails;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Facet, { BasicProps } from './Facet';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import { SEVERITIES } from '../../../helpers/constants';
+import Facet, { BasicProps } from './Facet';
export default class DefaultSeverityFacet extends React.PureComponent<BasicProps> {
renderName = (severity: string) => <SeverityHelper severity={severity} />;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { orderBy, without, sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { orderBy, sortBy, without } from 'lodash';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { FacetKey } from '../query';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
+import { FacetKey } from '../query';
export interface BasicProps {
onChange: (changes: T.Dict<string | string[] | undefined>) => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Profile } from '../../../api/quality-profiles';
+import StandardFacet from '../../issues/sidebar/StandardFacet';
+import { Facets, OpenFacets, Query } from '../query';
import ActivationSeverityFacet from './ActivationSeverityFacet';
import AvailableSinceFacet from './AvailableSinceFacet';
import DefaultSeverityFacet from './DefaultSeverityFacet';
import TagFacet from './TagFacet';
import TemplateFacet from './TemplateFacet';
import TypeFacet from './TypeFacet';
-import StandardFacet from '../../issues/sidebar/StandardFacet';
-import { Facets, Query, OpenFacets } from '../query';
-import { Profile } from '../../../api/quality-profiles';
interface Props {
facets?: Facets;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { uniqBy } from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
-import { uniqBy } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { BasicProps } from './Facet';
-import { getLanguages, Store } from '../../../store/rootReducer';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { getLanguages, Store } from '../../../store/rootReducer';
+import { BasicProps } from './Facet';
interface InstalledLanguage {
key: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ReloadButton from 'sonar-ui-common/components/controls/ReloadButton';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import PageCounter from '../../../components/common/PageCounter';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { sortBy } from 'lodash';
import * as classNames from 'classnames';
+import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query, FacetKey } from '../query';
import { Profile } from '../../../api/quality-profiles';
import DocTooltip from '../../../components/docs/DocTooltip';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
+import { FacetKey, Query } from '../query';
interface Props {
activation: boolean | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onCancel: () => void;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import Facet, { BasicProps } from './Facet';
import { getLanguages, Store } from '../../../store/rootReducer';
+import Facet, { BasicProps } from './Facet';
interface StateProps {
referencedLanguages: T.Dict<{ key: string; name: string }>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { Profile } from '../../../api/quality-profiles';
+import { deleteRule, getRuleDetails, updateRule } from '../../../api/rules';
+import DocTooltip from '../../../components/docs/DocTooltip';
+import { Activation, Query } from '../query';
import CustomRuleButton from './CustomRuleButton';
import RuleDetailsCustomRules from './RuleDetailsCustomRules';
import RuleDetailsDescription from './RuleDetailsDescription';
import RuleDetailsMeta from './RuleDetailsMeta';
import RuleDetailsParameters from './RuleDetailsParameters';
import RuleDetailsProfiles from './RuleDetailsProfiles';
-import { Query, Activation } from '../query';
-import { Profile } from '../../../api/quality-profiles';
-import { getRuleDetails, deleteRule, updateRule } from '../../../api/rules';
-import DocTooltip from '../../../components/docs/DocTooltip';
interface Props {
allowCustomRules?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { sortBy } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
-import CustomRuleButton from './CustomRuleButton';
-import { searchRules, deleteRule } from '../../../api/rules';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { deleteRule, searchRules } from '../../../api/rules';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import { getRuleUrl } from '../../../helpers/urls';
+import CustomRuleButton from './CustomRuleButton';
interface Props {
canChange?: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import RemoveExtendedDescriptionModal from './RemoveExtendedDescriptionModal';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { updateRule } from '../../../api/rules';
import MarkdownTips from '../../../components/common/MarkdownTips';
+import RemoveExtendedDescriptionModal from './RemoveExtendedDescriptionModal';
interface Props {
canWrite: boolean | undefined;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getFacet } from '../../../api/issues';
-import { getIssuesUrl } from '../../../helpers/urls';
import { withAppState } from '../../../components/hoc/withAppState';
+import { getIssuesUrl } from '../../../helpers/urls';
interface Props {
appState: Pick<T.AppState, 'branchesEnabled'>;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import LinkIcon from 'sonar-ui-common/components/icons/LinkIcon';
import RuleScopeIcon from 'sonar-ui-common/components/icons/RuleScopeIcon';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import RuleDetailsTagsPopup from './RuleDetailsTagsPopup';
-import SimilarRulesFilter from './SimilarRulesFilter';
-import DateFormatter from '../../../components/intl/DateFormatter';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
+import DateFormatter from '../../../components/intl/DateFormatter';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import TagsList from '../../../components/tags/TagsList';
-import { Query } from '../query';
import { getRuleUrl } from '../../../helpers/urls';
+import { Query } from '../query';
+import RuleDetailsTagsPopup from './RuleDetailsTagsPopup';
+import SimilarRulesFilter from './SimilarRulesFilter';
interface Props {
canWrite: boolean | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { filter } from 'lodash';
+import * as React from 'react';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
-import ActivationButton from './ActivationButton';
-import RuleInheritanceIcon from './RuleInheritanceIcon';
-import { Profile, deactivateRule, activateRule } from '../../../api/quality-profiles';
-import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { activateRule, deactivateRule, Profile } from '../../../api/quality-profiles';
import InstanceMessage from '../../../components/common/InstanceMessage';
import SeverityHelper from '../../../components/shared/SeverityHelper';
import { getQualityProfileUrl } from '../../../helpers/urls';
+import BuiltInQualityProfileBadge from '../../quality-profiles/components/BuiltInQualityProfileBadge';
+import ActivationButton from './ActivationButton';
+import RuleInheritanceIcon from './RuleInheritanceIcon';
interface Props {
activations: T.RuleActivation[] | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { difference, uniq, without } from 'lodash';
import * as React from 'react';
-import { without, uniq, difference } from 'lodash';
-import TagsSelector from '../../../components/tags/TagsSelector';
import { getRuleTags } from '../../../api/rules';
+import TagsSelector from '../../../components/tags/TagsSelector';
export interface Props {
organization: string | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
-import SeverityIcon from 'sonar-ui-common/components/icons/SeverityIcon';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
+import SeverityIcon from 'sonar-ui-common/components/icons/SeverityIcon';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { deactivateRule, Profile } from '../../../api/quality-profiles';
+import TagsList from '../../../components/tags/TagsList';
+import { getRuleUrl } from '../../../helpers/urls';
+import { Activation, Query } from '../query';
import ActivationButton from './ActivationButton';
import RuleInheritanceIcon from './RuleInheritanceIcon';
import SimilarRulesFilter from './SimilarRulesFilter';
-import { Activation, Query } from '../query';
-import { Profile, deactivateRule } from '../../../api/quality-profiles';
-import TagsList from '../../../components/tags/TagsList';
-import { getRuleUrl } from '../../../helpers/urls';
interface Props {
activation?: Activation;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import FilterIcon from 'sonar-ui-common/components/icons/FilterIcon';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import { Query } from '../query';
import SeverityHelper from '../../../components/shared/SeverityHelper';
+import { Query } from '../query';
interface Props {
onFilterChange: (changes: Partial<Query>) => void;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Facet, { BasicProps } from './Facet';
import { RULE_STATUSES } from '../../../helpers/constants';
+import Facet, { BasicProps } from './Facet';
export default class StatusFacet extends React.PureComponent<BasicProps> {
renderName = (status: string) => translate('rules.status', status.toLowerCase());
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { uniq } from 'lodash';
import * as React from 'react';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
-import { uniq } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { BasicProps } from './Facet';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { getRuleTags } from '../../../api/rules';
import { colors } from '../../../app/theme';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { BasicProps } from './Facet';
interface Props extends BasicProps {
organization: string | undefined;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Facet, { BasicProps } from './Facet';
import DocTooltip from '../../../components/docs/DocTooltip';
+import Facet, { BasicProps } from './Facet';
interface Props extends T.Omit<BasicProps, 'onChange' | 'values'> {
onChange: (changes: { template: boolean | undefined }) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ActivationFormModal from '../ActivationFormModal';
+import * as React from 'react';
import { mockQualityProfile, mockRule } from '../../../../helpers/testMocks';
+import ActivationFormModal from '../ActivationFormModal';
it('render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import BulkChange from '../BulkChange';
+import * as React from 'react';
import { mockEvent, mockQualityProfile } from '../../../../helpers/testMocks';
+import BulkChange from '../BulkChange';
const profile = mockQualityProfile({
actions: {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import BulkChangeModal from '../BulkChangeModal';
+import * as React from 'react';
import { mockQualityProfile } from '../../../../helpers/testMocks';
import { Query } from '../../query';
+import BulkChangeModal from '../BulkChangeModal';
it('render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import CustomRuleFormModal from '../CustomRuleFormModal';
import { createRule } from '../../../../api/rules';
import { mockRule } from '../../../../helpers/testMocks';
+import CustomRuleFormModal from '../CustomRuleFormModal';
jest.mock('../../../../api/rules', () => ({ createRule: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import FacetsList from '../FacetsList';
+import * as React from 'react';
import { Query } from '../../query';
+import FacetsList from '../FacetsList';
it('should render correctly', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import RuleDetails from '../RuleDetails';
import { updateRule } from '../../../../api/rules';
+import RuleDetails from '../RuleDetails';
jest.mock('../../../../api/rules', () => ({
deleteRule: jest.fn(),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { click, change, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { change, click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import RuleDetailsDescription from '../RuleDetailsDescription';
jest.mock('../../../../api/rules', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { RuleDetailsIssues } from '../RuleDetailsIssues';
import { getFacet } from '../../../../api/issues';
+import { RuleDetailsIssues } from '../RuleDetailsIssues';
jest.mock('../../../../api/issues', () => ({
getFacet: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import RuleDetailsMeta from '../RuleDetailsMeta';
import RuleDetailsTagsPopup from '../RuleDetailsTagsPopup';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import RuleDetailsParameters from '../RuleDetailsParameters';
+import * as React from 'react';
import { mockRuleDetailsParameter } from '../../../../helpers/testMocks';
+import RuleDetailsParameters from '../RuleDetailsParameters';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import RuleDetailsTagsPopup, { Props } from '../RuleDetailsTagsPopup';
jest.mock('../../../../api/rules', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import RuleListItem from '../RuleListItem';
+import * as React from 'react';
import { mockEvent, mockRule } from '../../../../helpers/testMocks';
+import RuleListItem from '../RuleListItem';
it('should render', () => {
expect(shallowRender()).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import {
- parseAsString,
- parseAsArray,
- serializeString,
- serializeStringArray,
cleanQuery,
- queriesEqual,
+ parseAsArray,
parseAsDate,
- serializeDateShort,
parseAsOptionalBoolean,
+ parseAsOptionalString,
+ parseAsString,
+ queriesEqual,
+ serializeDateShort,
serializeOptionalBoolean,
- parseAsOptionalString
+ serializeString,
+ serializeStringArray
} from 'sonar-ui-common/helpers/query';
export interface Query {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { RouterState, RedirectFunction } from 'react-router';
+import { RedirectFunction, RouterState } from 'react-router';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { parseQuery, serializeQuery } from './query';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
import { keyBy } from 'lodash';
+import * as React from 'react';
+import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { withRouter, WithRouterProps } from 'react-router';
-import Helmet from 'react-helmet';
+import {
+ getLocalizedMetricDomain,
+ translate,
+ translateWithParameters
+} from 'sonar-ui-common/helpers/l10n';
import {
addSideBarClass,
addWhitePageClass,
removeSideBarClass,
removeWhitePageClass
} from 'sonar-ui-common/helpers/pages';
+import { getMeasuresAndMeta } from '../../../api/measures';
+import { getAllMetrics } from '../../../api/metrics';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import { enhanceMeasure } from '../../../components/measure/utils';
+import '../../../components/search-navigator.css';
import {
- getLocalizedMetricDomain,
- translateWithParameters,
- translate
-} from 'sonar-ui-common/helpers/l10n';
-import MeasureContent from './MeasureContent';
-import MeasuresEmpty from './MeasuresEmpty';
-import MeasureOverviewContainer from './MeasureOverviewContainer';
+ getBranchLikeQuery,
+ isPullRequest,
+ isSameBranchLike,
+ isShortLivingBranch
+} from '../../../helpers/branches';
+import { getLeakPeriod } from '../../../helpers/periods';
+import { fetchBranchStatus } from '../../../store/rootActions';
import Sidebar from '../sidebar/Sidebar';
-import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import '../style.css';
import {
- isProjectOverview,
- hasBubbleChart,
- parseQuery,
- serializeQuery,
- Query,
- hasFullMeasures,
getMeasuresPageMetricKeys,
groupByDomains,
- sortMeasures,
+ hasBubbleChart,
+ hasFullMeasures,
+ hasTree,
hasTreemap,
- hasTree
+ isProjectOverview,
+ parseQuery,
+ Query,
+ serializeQuery,
+ sortMeasures
} from '../utils';
-import {
- isSameBranchLike,
- getBranchLikeQuery,
- isShortLivingBranch,
- isPullRequest
-} from '../../../helpers/branches';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import '../../../components/search-navigator.css';
-import '../style.css';
-import { getAllMetrics } from '../../../api/metrics';
-import { getMeasuresAndMeta } from '../../../api/measures';
-import { enhanceMeasure } from '../../../components/measure/utils';
-import { getLeakPeriod } from '../../../helpers/periods';
-import { fetchBranchStatus } from '../../../store/rootActions';
+import MeasureContent from './MeasureContent';
+import MeasureOverviewContainer from './MeasureOverviewContainer';
+import MeasuresEmpty from './MeasuresEmpty';
interface Props extends WithRouterProps {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { collapsePath, limitComponentName } from 'sonar-ui-common/helpers/path';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { collapsePath, limitComponentName } from 'sonar-ui-common/helpers/path';
interface Props {
canBrowse: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
-import Breadcrumb from './Breadcrumb';
+import * as React from 'react';
import { getBreadcrumbs } from '../../../api/components';
import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
+import Breadcrumb from './Breadcrumb';
interface Props {
backToFirst: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import * as differenceInDays from 'date-fns/difference_in_days';
-import { injectIntl, InjectedIntlProps } from 'react-intl';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import DateFromNow from '../../../components/intl/DateFromNow';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DateFormatter, { longFormatterOption } from '../../../components/intl/DateFormatter';
+import DateFromNow from '../../../components/intl/DateFromNow';
import DateTimeFormatter, { formatterOption } from '../../../components/intl/DateTimeFormatter';
-import { getPeriodLabel, getPeriodDate } from '../../../helpers/periods';
+import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods';
interface Props {
className?: string;
import PageActions from 'sonar-ui-common/components/ui/PageActions';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { RequestData } from 'sonar-ui-common/helpers/request';
-import Breadcrumbs from './Breadcrumbs';
-import MeasureContentHeader from './MeasureContentHeader';
-import MeasureHeader from './MeasureHeader';
-import MeasureViewSelect from './MeasureViewSelect';
-import { complementary } from '../config/complementary';
+import { getComponentTree } from '../../../api/components';
+import { getMeasures } from '../../../api/measures';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
+import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
+import { getPeriodValue, isDiffMetric } from '../../../helpers/measures';
+import { getProjectUrl } from '../../../helpers/urls';
+import { complementary } from '../config/complementary';
import FilesView from '../drilldown/FilesView';
import TreeMapView from '../drilldown/TreeMapView';
-import { Query, View, isFileType, enhanceComponent, isViewType } from '../utils';
-import { getComponentTree } from '../../../api/components';
-import { isSameBranchLike, getBranchLikeQuery } from '../../../helpers/branches';
-import { isDiffMetric, getPeriodValue } from '../../../helpers/measures';
-import { getProjectUrl } from '../../../helpers/urls';
-import { getMeasures } from '../../../api/measures';
+import { enhanceComponent, isFileType, isViewType, Query, View } from '../utils';
+import Breadcrumbs from './Breadcrumbs';
+import MeasureContentHeader from './MeasureContentHeader';
+import MeasureHeader from './MeasureHeader';
+import MeasureViewSelect from './MeasureViewSelect';
interface Props {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Link } from 'react-router';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import HistoryIcon from 'sonar-ui-common/components/icons/HistoryIcon';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
-import { Link } from 'react-router';
import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import LeakPeriodLegend from './LeakPeriodLegend';
import LanguageDistributionContainer from '../../../components/charts/LanguageDistributionContainer';
import Measure from '../../../components/measure/Measure';
-import { getMeasureHistoryUrl } from '../../../helpers/urls';
import { isDiffMetric } from '../../../helpers/measures';
+import { getMeasureHistoryUrl } from '../../../helpers/urls';
import { hasFullMeasures } from '../utils';
+import LeakPeriodLegend from './LeakPeriodLegend';
interface Props {
branchLike?: T.BranchLike;
import * as React from 'react';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import PageActions from 'sonar-ui-common/components/ui/PageActions';
-import Breadcrumbs from './Breadcrumbs';
-import LeakPeriodLegend from './LeakPeriodLegend';
-import MeasureContentHeader from './MeasureContentHeader';
+import { getComponentLeaves } from '../../../api/components';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import BubbleChart from '../drilldown/BubbleChart';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
-import { getComponentLeaves } from '../../../api/components';
-import { enhanceComponent, getBubbleMetrics, isFileType, hasFullMeasures } from '../utils';
import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
+import BubbleChart from '../drilldown/BubbleChart';
+import { enhanceComponent, getBubbleMetrics, hasFullMeasures, isFileType } from '../utils';
+import Breadcrumbs from './Breadcrumbs';
+import LeakPeriodLegend from './LeakPeriodLegend';
+import MeasureContentHeader from './MeasureContentHeader';
interface Props {
branchLike?: T.BranchLike;
*/
import * as React from 'react';
import { InjectedRouter } from 'react-router';
-import MeasureOverview from './MeasureOverview';
import { getComponentShow } from '../../../api/components';
+import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
import { getProjectUrl } from '../../../helpers/urls';
import { isViewType, Query } from '../utils';
-import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
+import MeasureOverview from './MeasureOverview';
interface Props {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import TreemapIcon from 'sonar-ui-common/components/icons/TreemapIcon';
+import Select from 'sonar-ui-common/components/controls/Select';
import ListIcon from 'sonar-ui-common/components/icons/ListIcon';
import TreeIcon from 'sonar-ui-common/components/icons/TreeIcon';
+import TreemapIcon from 'sonar-ui-common/components/icons/TreemapIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Select from 'sonar-ui-common/components/controls/Select';
import { hasList, hasTree, hasTreemap, View } from '../utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { App } from '../App';
import { getMeasuresAndMeta } from '../../../../api/measures';
import {
- mockPullRequest,
- mockMainBranch,
- mockRouter,
- mockLocation,
mockComponent,
- mockIssue
+ mockIssue,
+ mockLocation,
+ mockMainBranch,
+ mockPullRequest,
+ mockRouter
} from '../../../../helpers/testMocks';
+import { App } from '../App';
jest.mock('../../../../api/metrics', () => ({
getAllMetrics: jest.fn().mockResolvedValue([
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Breadcrumb from '../Breadcrumb';
it('should show the last element without clickable link', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import Breadcrumbs from '../Breadcrumbs';
import { getBreadcrumbs } from '../../../../api/components';
+import Breadcrumbs from '../Breadcrumbs';
jest.mock('../../../../api/components', () => ({
getBreadcrumbs: jest
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { InjectedIntlProps } from 'react-intl';
import { LeakPeriodLegend } from '../LeakPeriodLegend';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import MeasureContent from '../MeasureContent';
import { getComponentTree } from '../../../../api/components';
import { mockComponentMeasure, mockRouter } from '../../../../helpers/testMocks';
+import MeasureContent from '../MeasureContent';
jest.mock('../../../../api/components', () => {
const { mockComponentMeasure } = require.requireActual('../../../../helpers/testMocks');
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MeasureHeader from '../MeasureHeader';
const METRIC = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MeasureViewSelect from '../MeasureViewSelect';
it('should display correctly with treemap option', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { isDefined } from 'sonar-ui-common/helpers/types';
+import OriginalBubbleChart from 'sonar-ui-common/components/charts/BubbleChart';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import {
getLocalizedMetricDomain,
getLocalizedMetricName,
translateWithParameters
} from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import OriginalBubbleChart from 'sonar-ui-common/components/charts/BubbleChart';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import EmptyResult from './EmptyResult';
+import { isDefined } from 'sonar-ui-common/helpers/types';
import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend';
+import { RATING_COLORS } from '../../../helpers/constants';
import { isDiffMetric } from '../../../helpers/measures';
import { getBubbleMetrics, getBubbleYDomain, isProjectOverview } from '../utils';
-import { RATING_COLORS } from '../../../helpers/constants';
+import EmptyResult from './EmptyResult';
const HEIGHT = 500;
import LinkIcon from 'sonar-ui-common/components/icons/LinkIcon';
import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
-import { splitPath } from 'sonar-ui-common/helpers/path';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { splitPath } from 'sonar-ui-common/helpers/path';
import { getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
import {
getBranchLikeUrl,
*/
import * as React from 'react';
import { getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n';
-import ComponentsListRow from './ComponentsListRow';
-import EmptyResult from './EmptyResult';
import { complementary } from '../config/complementary';
import { View } from '../utils';
+import ComponentsListRow from './ComponentsListRow';
+import EmptyResult from './EmptyResult';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
+import { View } from '../utils';
import ComponentCell from './ComponentCell';
import MeasureCell from './MeasureCell';
-import { View } from '../utils';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
import { throttle } from 'lodash';
-import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import ComponentsList from './ComponentsList';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
+import { isDiffMetric, isPeriodBestValue } from '../../../helpers/measures';
import { View } from '../utils';
-import { isPeriodBestValue, isDiffMetric } from '../../../helpers/measures';
+import ComponentsList from './ComponentsList';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { scaleLinear, scaleOrdinal } from 'd3-scale';
import * as React from 'react';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { isDefined } from 'sonar-ui-common/helpers/types';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
-import { scaleLinear, scaleOrdinal } from 'd3-scale';
import ColorGradientLegend from 'sonar-ui-common/components/charts/ColorGradientLegend';
import TreeMap, { TreeMapItem } from 'sonar-ui-common/components/charts/TreeMap';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import {
+ getLocalizedMetricName,
translate,
- translateWithParameters,
- getLocalizedMetricName
+ translateWithParameters
} from 'sonar-ui-common/helpers/l10n';
-import EmptyResult from './EmptyResult';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { isDefined } from 'sonar-ui-common/helpers/types';
import { colors } from '../../../app/theme';
import ColorBoxLegend from '../../../components/charts/ColorBoxLegend';
import { isDiffMetric } from '../../../helpers/measures';
+import EmptyResult from './EmptyResult';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentsList from '../ComponentsList';
const COMPONENTS = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FilesView from '../FilesView';
const COMPONENTS = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MeasureCell from '../MeasureCell';
describe('should correctly take the value', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { RouterState, RedirectFunction } from 'react-router';
+import { RedirectFunction, RouterState } from 'react-router';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
const routes = [
getLocalizedCategoryMetricName,
getLocalizedMetricDomain,
getLocalizedMetricName,
- translate,
- hasMessage
+ hasMessage,
+ translate
} from 'sonar-ui-common/helpers/l10n';
-import FacetMeasureValue from './FacetMeasureValue';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
hasFacetStat,
sortMeasures
} from '../utils';
+import FacetMeasureValue from './FacetMeasureValue';
interface Props {
domain: { name: string; measures: T.MeasureEnhanced[] };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import Measure from '../../../components/measure/Measure';
import { isDiffMetric } from '../../../helpers/measures';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProjectOverviewFacet from './ProjectOverviewFacet';
-import DomainFacet from './DomainFacet';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import { groupByDomains, KNOWN_DOMAINS, PROJECT_OVERVEW, Query } from '../utils';
+import DomainFacet from './DomainFacet';
+import ProjectOverviewFacet from './ProjectOverviewFacet';
interface Props {
measures: T.MeasureEnhanced[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DomainFacet from '../DomainFacet';
it('should display facet item list', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FacetMeasureValue from '../FacetMeasureValue';
const MEASURE = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Sidebar from '../Sidebar';
it('should display two facets', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { groupBy, memoize, sortBy, toPairs } from 'lodash';
-import { cleanQuery, parseAsString, serializeString } from 'sonar-ui-common/helpers/query';
import { getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n';
-import { domains } from './config/domains';
-import { bubbles } from './config/bubbles';
+import { cleanQuery, parseAsString, serializeString } from 'sonar-ui-common/helpers/query';
import { enhanceMeasure } from '../../components/measure/utils';
import {
isLongLivingBranch,
isShortLivingBranch
} from '../../helpers/branches';
import { getDisplayMetrics, isDiffMetric } from '../../helpers/measures';
+import { bubbles } from './config/bubbles';
+import { domains } from './config/domains';
export type View = 'list' | 'tree' | 'treemap';
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import RadioCard, { RadioCardProps } from 'sonar-ui-common/components/controls/RadioCard';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatPrice } from '../organization/utils';
interface Props extends RadioCardProps {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { isWebUri } from 'valid-url';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import ValidationInput from 'sonar-ui-common/components/controls/ValidationInput';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isWebUri } from 'valid-url';
import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { debounce } from 'lodash';
+import * as React from 'react';
import ValidationInput from 'sonar-ui-common/components/controls/ValidationInput';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getHostUrl } from 'sonar-ui-common/helpers/urls';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
+import Select from 'sonar-ui-common/components/controls/Select';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import Select from 'sonar-ui-common/components/controls/Select';
import { sanitizeAlmId } from '../../../helpers/almIntegrations';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { isWebUri } from 'valid-url';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import ValidationInput from 'sonar-ui-common/components/controls/ValidationInput';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isWebUri } from 'valid-url';
interface Props {
initialValue?: string;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import RadioCard, { RadioCardProps } from 'sonar-ui-common/components/controls/RadioCard';
-import UpgradeOrganizationAdvantages from './UpgradeOrganizationAdvantages';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatPrice } from '../organization/utils';
+import UpgradeOrganizationAdvantages from './UpgradeOrganizationAdvantages';
interface Props extends RadioCardProps {
isRecommended: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { debounce } from 'lodash';
+import * as React from 'react';
import ValidationInput from 'sonar-ui-common/components/controls/ValidationInput';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { doesComponentExists } from '../../../api/components';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate, hasMessage } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import RadioCard from 'sonar-ui-common/components/controls/RadioCard';
+import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
+import { getSubscriptionPlans } from '../../../api/billing';
+import { formatPrice } from '../organization/utils';
import UpgradeOrganizationAdvantages from './UpgradeOrganizationAdvantages';
import UpgradeOrganizationModal from './UpgradeOrganizationModal';
-import { formatPrice } from '../organization/utils';
-import { getSubscriptionPlans } from '../../../api/billing';
interface Props {
className?: string;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import BillingFormShim from './BillingFormShim';
-import UpgradeOrganizationAdvantages from './UpgradeOrganizationAdvantages';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
import { getExtensionStart } from '../../../helpers/extensions';
+import BillingFormShim from './BillingFormShim';
+import UpgradeOrganizationAdvantages from './UpgradeOrganizationAdvantages';
const BillingForm = withCurrentUser(BillingFormShim);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import BillingFormShim from '../BillingFormShim';
beforeAll(() => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FreeCardPlan from '../FreeCardPlan';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationAvatarInput from '../OrganizationAvatarInput';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import OrganizationKeyInput from '../OrganizationKeyInput';
import { getOrganization } from '../../../../api/organizations';
+import OrganizationKeyInput from '../OrganizationKeyInput';
jest.mock('../../../../api/organizations', () => ({
getOrganization: jest.fn().mockResolvedValue(undefined)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import OrganizationSelect, { getOptionRenderer } from '../OrganizationSelect';
+import * as React from 'react';
import { mockOrganization, mockOrganizationWithAlm } from '../../../../helpers/testMocks';
+import OrganizationSelect, { getOptionRenderer } from '../OrganizationSelect';
const organizations = [mockOrganization(), mockOrganizationWithAlm({ key: 'bar', name: 'Bar' })];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationUrlInput from '../OrganizationUrlInput';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PaidCardPlan from '../PaidCardPlan';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import ProjectKeyInput from '../ProjectKeyInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import UpgradeOrganizationAdvantages from '../UpgradeOrganizationAdvantages';
it('should render correctly ', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { hasMessage } from 'sonar-ui-common/helpers/l10n';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
-import UpgradeOrganizationBox from '../UpgradeOrganizationBox';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { getSubscriptionPlans } from '../../../../api/billing';
+import UpgradeOrganizationBox from '../UpgradeOrganizationBox';
jest.mock('sonar-ui-common/helpers/l10n', () => ({
...jest.requireActual('sonar-ui-common/helpers/l10n'),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import UpgradeOrganizationModal from '../UpgradeOrganizationModal';
import { getExtensionStart } from '../../../../helpers/extensions';
+import UpgradeOrganizationModal from '../UpgradeOrganizationModal';
jest.mock('../../../../helpers/extensions', () => ({
getExtensionStart: jest.fn().mockResolvedValue(undefined)
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { sanitizeAlmId } from '../../../helpers/almIntegrations';
export default function AlmApplicationInstalling({ almKey }: { almKey?: string }) {
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import OrganizationSelect from '../components/OrganizationSelect';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { isGithub } from '../../../helpers/almIntegrations';
+import OrganizationSelect from '../components/OrganizationSelect';
interface Props {
almKey: string;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
+import { bindAlmOrganization } from '../../../api/alm-integration';
+import { getAlmMembersUrl, isGithub, sanitizeAlmId } from '../../../helpers/almIntegrations';
import AutoOrganizationBind from './AutoOrganizationBind';
import OrganizationDetailsForm from './OrganizationDetailsForm';
import OrganizationDetailsStep from './OrganizationDetailsStep';
import PlanStep from './PlanStep';
import { Step } from './utils';
-import { bindAlmOrganization } from '../../../api/alm-integration';
-import { sanitizeAlmId, getAlmMembersUrl, isGithub } from '../../../helpers/almIntegrations';
enum Filters {
Bind = 'bind',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import * as differenceInMinutes from 'date-fns/difference_in_minutes';
import { times } from 'lodash';
-import { connect } from 'react-redux';
+import * as React from 'react';
import { Helmet } from 'react-helmet';
+import { connect } from 'react-redux';
import { withRouter, WithRouterProps } from 'react-router';
+import Tabs from 'sonar-ui-common/components/controls/Tabs';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { get, remove } from 'sonar-ui-common/helpers/storage';
import { slugify } from 'sonar-ui-common/helpers/strings';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import Tabs from 'sonar-ui-common/components/controls/Tabs';
-import { createOrganization } from './actions';
-import {
- ORGANIZATION_IMPORT_REDIRECT_TO_PROJECT_TIMESTAMP,
- parseQuery,
- serializeQuery,
- Query,
- ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP,
- Step,
- BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP,
- BIND_ORGANIZATION_KEY
-} from './utils';
-import AlmApplicationInstalling from './AlmApplicationInstalling';
-import AutoOrganizationCreate from './AutoOrganizationCreate';
-import ManualOrganizationCreate from './ManualOrganizationCreate';
-import RemoteOrganizationChoose from './RemoteOrganizationChoose';
-import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
-import { withUserOrganizations } from '../../../components/hoc/withUserOrganizations';
-import { deleteOrganization } from '../../organizations/actions';
import {
+ bindAlmOrganization,
getAlmAppInfo,
getAlmOrganization,
GetAlmOrganizationResponse,
- listUnboundApplications,
- bindAlmOrganization
+ listUnboundApplications
} from '../../../api/alm-integration';
import { getSubscriptionPlans } from '../../../api/billing';
import * as api from '../../../api/organizations';
+import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
+import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
+import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
+import { withUserOrganizations } from '../../../components/hoc/withUserOrganizations';
import { hasAdvancedALMIntegration, sanitizeAlmId } from '../../../helpers/almIntegrations';
import { getOrganizationUrl } from '../../../helpers/urls';
import { skipOnboarding } from '../../../store/users';
-import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
+import { deleteOrganization } from '../../organizations/actions';
import '../../tutorials/styles.css'; // TODO remove me
+import { createOrganization } from './actions';
+import AlmApplicationInstalling from './AlmApplicationInstalling';
+import AutoOrganizationCreate from './AutoOrganizationCreate';
+import ManualOrganizationCreate from './ManualOrganizationCreate';
+import RemoteOrganizationChoose from './RemoteOrganizationChoose';
+import {
+ BIND_ORGANIZATION_KEY,
+ BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP,
+ ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP,
+ ORGANIZATION_IMPORT_REDIRECT_TO_PROJECT_TIMESTAMP,
+ parseQuery,
+ Query,
+ serializeQuery,
+ Step
+} from './utils';
interface Props {
createOrganization: (
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import OrganizationAvatarInput from '../components/OrganizationAvatarInput';
import OrganizationKeyInput from '../components/OrganizationKeyInput';
import OrganizationUrlInput from '../components/OrganizationUrlInput';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import PlanSelect, { Plan } from './PlanSelect';
-import BillingFormShim from '../components/BillingFormShim';
-import Step from '../../tutorials/components/Step';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
import { getExtensionStart } from '../../../helpers/extensions';
+import Step from '../../tutorials/components/Step';
+import BillingFormShim from '../components/BillingFormShim';
+import PlanSelect, { Plan } from './PlanSelect';
const BillingForm = withCurrentUser(BillingFormShim);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { WithRouterProps, withRouter } from 'react-router';
-import { FormattedMessage } from 'react-intl';
import { sortBy } from 'lodash';
+import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import { withRouter, WithRouterProps } from 'react-router';
+import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import IdentityProviderLink from 'sonar-ui-common/components/controls/IdentityProviderLink';
-import { save } from 'sonar-ui-common/helpers/storage';
+import Select from 'sonar-ui-common/components/controls/Select';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { save } from 'sonar-ui-common/helpers/storage';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import Select from 'sonar-ui-common/components/controls/Select';
-import { serializeQuery, ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP } from './utils';
import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
import { sanitizeAlmId } from '../../../helpers/almIntegrations';
+import { ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP, serializeQuery } from './utils';
interface Props {
almApplication: T.AlmApplication;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AlmApplicationInstalling from '../AlmApplicationInstalling';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { submit } from 'sonar-ui-common/helpers/testUtils';
-import AutoOrganizationBind from '../AutoOrganizationBind';
import { mockOrganization } from '../../../../helpers/testMocks';
+import AutoOrganizationBind from '../AutoOrganizationBind';
it('should render correctly', () => {
const onBindOrganization = jest.fn().mockResolvedValue({});
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { bindAlmOrganization } from '../../../../api/alm-integration';
+import { mockAlmApplication, mockAlmOrganization } from '../../../../helpers/testMocks';
import AutoOrganizationCreate from '../AutoOrganizationCreate';
import { Step } from '../utils';
-import { bindAlmOrganization } from '../../../../api/alm-integration';
-import { mockAlmOrganization, mockAlmApplication } from '../../../../helpers/testMocks';
jest.mock('../../../../api/alm-integration', () => ({
bindAlmOrganization: jest.fn().mockResolvedValue({})
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { times } from 'lodash';
+import { mount, shallow } from 'enzyme';
import { Location } from 'history';
-import { shallow, mount } from 'enzyme';
+import { times } from 'lodash';
+import * as React from 'react';
import { get, remove } from 'sonar-ui-common/helpers/storage';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { CreateOrganization } from '../CreateOrganization';
import {
bindAlmOrganization,
getAlmAppInfo,
import { getSubscriptionPlans } from '../../../../api/billing';
import { getOrganizations } from '../../../../api/organizations';
import {
- mockRouter,
- mockOrganizationWithAdminActions,
- mockOrganizationWithAlm,
mockAlmOrganization,
+ mockLocation,
mockLoggedInUser,
- mockLocation
+ mockOrganizationWithAdminActions,
+ mockOrganizationWithAlm,
+ mockRouter
} from '../../../../helpers/testMocks';
+import { CreateOrganization } from '../CreateOrganization';
jest.mock('../../../../api/billing', () => ({
getSubscriptionPlans: jest
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { mockOrganization } from '../../../../helpers/testMocks';
import ManualOrganizationCreate from '../ManualOrganizationCreate';
import { Step } from '../utils';
-import { mockOrganization } from '../../../../helpers/testMocks';
it('should render and create organization', async () => {
const createOrganization = jest.fn().mockResolvedValue({ key: 'foo' });
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, submit } from 'sonar-ui-common/helpers/testUtils';
import OrganizationDetailsForm from '../OrganizationDetailsForm';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationDetailsStep from '../OrganizationDetailsStep';
it('should render form', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import PlanSelect, { Plan } from '../PlanSelect';
import { mockAlmOrganization } from '../../../../helpers/testMocks';
+import PlanSelect, { Plan } from '../PlanSelect';
it('should render and select', () => {
const onChange = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, submit } from 'sonar-ui-common/helpers/testUtils';
-import PlanStep from '../PlanStep';
-import { Plan } from '../PlanSelect';
+import * as React from 'react';
+import { submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { mockAlmOrganization } from '../../../../helpers/testMocks';
+import { Plan } from '../PlanSelect';
+import PlanStep from '../PlanStep';
jest.mock('../../../../helpers/extensions', () => ({
getExtensionStart: jest.fn().mockResolvedValue(undefined)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { submit } from 'sonar-ui-common/helpers/testUtils';
+import { mockAlmOrganization, mockRouter } from '../../../../helpers/testMocks';
import { RemoteOrganizationChoose } from '../RemoteOrganizationChoose';
-import { mockRouter, mockAlmOrganization } from '../../../../helpers/testMocks';
it('should render', () => {
expect(shallowRender()).toMatchSnapshot();
*/
import { Dispatch } from 'redux';
import * as api from '../../../api/organizations';
-import * as actions from '../../../store/organizations';
import { isGithub } from '../../../helpers/almIntegrations';
+import * as actions from '../../../store/organizations';
export function createOrganization({
alm,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { memoize } from 'lodash';
-import { parseAsOptionalString, cleanQuery, serializeString } from 'sonar-ui-common/helpers/query';
-import { decodeJwt } from 'sonar-ui-common/helpers/strings';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { cleanQuery, parseAsOptionalString, serializeString } from 'sonar-ui-common/helpers/query';
+import { decodeJwt } from 'sonar-ui-common/helpers/strings';
import { isBitbucket, isGithub } from '../../../helpers/almIntegrations';
export const ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP =
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { identity } from 'lodash';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
+import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon';
import LockIcon from 'sonar-ui-common/components/icons/LockIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import { colors } from '../../../app/theme';
import { getProjectUrl } from '../../../helpers/urls';
*/
import * as React from 'react';
import IdentityProviderLink from 'sonar-ui-common/components/controls/IdentityProviderLink';
-import { save } from 'sonar-ui-common/helpers/storage';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import RemoteRepositories from './RemoteRepositories';
-import OrganizationInput from './OrganizationInput';
+import { save } from 'sonar-ui-common/helpers/storage';
import {
ORGANIZATION_IMPORT_BINDING_IN_PROGRESS_TIMESTAMP,
ORGANIZATION_IMPORT_REDIRECT_TO_PROJECT_TIMESTAMP
} from '../organization/utils';
+import OrganizationInput from './OrganizationInput';
+import RemoteRepositories from './RemoteRepositories';
interface Props {
almApplication: T.AlmApplication;
*/
import * as React from 'react';
import { WithRouterProps } from 'react-router';
-import CreateProjectPageSonarCloud from './CreateProjectPageSonarCloud';
-import CreateProjectPageSonarQube from './CreateProjectPageSonarQube';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import { isSonarCloud } from '../../../helpers/system';
+import CreateProjectPageSonarCloud from './CreateProjectPageSonarCloud';
+import CreateProjectPageSonarQube from './CreateProjectPageSonarQube';
export default function CreateProjectPage(props: WithRouterProps) {
return (
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { WithRouterProps } from 'react-router';
-import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import Tabs from 'sonar-ui-common/components/controls/Tabs';
-import AutoProjectCreate from './AutoProjectCreate';
-import ManualProjectCreate from './ManualProjectCreate';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
+import { getAlmAppInfo } from '../../../api/alm-integration';
import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { withUserOrganizations } from '../../../components/hoc/withUserOrganizations';
-import { getAlmAppInfo } from '../../../api/alm-integration';
import { hasAdvancedALMIntegration } from '../../../helpers/almIntegrations';
-import { getProjectUrl, getOrganizationUrl } from '../../../helpers/urls';
+import { getOrganizationUrl, getProjectUrl } from '../../../helpers/urls';
import { skipOnboarding } from '../../../store/users';
+import AutoProjectCreate from './AutoProjectCreate';
+import ManualProjectCreate from './ManualProjectCreate';
import './style.css';
interface Props {
import * as React from 'react';
import Helmet from 'react-helmet';
import { WithRouterProps } from 'react-router';
-import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ManualProjectCreate from './ManualProjectCreate';
+import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages';
import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { getProjectUrl } from '../../../helpers/urls';
+import ManualProjectCreate from './ManualProjectCreate';
import './style.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import OrganizationInput from './OrganizationInput';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createProject } from '../../../api/components';
-import ProjectKeyInput from '../components/ProjectKeyInput';
import VisibilitySelector from '../../../components/common/VisibilitySelector';
-import UpgradeOrganizationBox from '../components/UpgradeOrganizationBox';
import { isSonarCloud } from '../../../helpers/system';
+import ProjectKeyInput from '../components/ProjectKeyInput';
+import UpgradeOrganizationBox from '../components/UpgradeOrganizationBox';
import './ManualProjectCreate.css';
+import OrganizationInput from './OrganizationInput';
interface Props {
currentUser: T.LoggedInUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { WithRouterProps, withRouter } from 'react-router';
-import { save } from 'sonar-ui-common/helpers/storage';
+import { withRouter, WithRouterProps } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { save } from 'sonar-ui-common/helpers/storage';
import OrganizationSelect from '../components/OrganizationSelect';
import { ORGANIZATION_IMPORT_REDIRECT_TO_PROJECT_TIMESTAMP } from '../organization/utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { keyBy } from 'lodash';
-import { isDefined } from 'sonar-ui-common/helpers/types';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import * as React from 'react';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import AlmRepositoryItem from './AlmRepositoryItem';
-import SetupProjectBox from './SetupProjectBox';
-import UpgradeOrganizationBox from '../components/UpgradeOrganizationBox';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { isDefined } from 'sonar-ui-common/helpers/types';
import { getRepositories } from '../../../api/alm-integration';
import { isPaidOrganization } from '../../../helpers/organizations';
+import UpgradeOrganizationBox from '../components/UpgradeOrganizationBox';
+import AlmRepositoryItem from './AlmRepositoryItem';
+import SetupProjectBox from './SetupProjectBox';
interface Props {
almApplication: T.AlmApplication;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { partition } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { provisionProject } from '../../../api/alm-integration';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AlmRepositoryItem from '../AlmRepositoryItem';
const identityProviders = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import AutoProjectCreate from '../AutoProjectCreate';
+import * as React from 'react';
import {
mockOrganizationWithAdminActions,
mockOrganizationWithAlm
} from '../../../../helpers/testMocks';
+import AutoProjectCreate from '../AutoProjectCreate';
const almApplication = {
backgroundColor: 'blue',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CreateProjectPage from '../CreateProjectPage';
-import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import CreateProjectPage from '../CreateProjectPage';
jest.mock('../../../../helpers/system', () => ({
isSonarCloud: jest.fn().mockReturnValue(false)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { CreateProjectPageSonarCloud } from '../CreateProjectPageSonarCloud';
import { getAlmAppInfo } from '../../../../api/alm-integration';
import {
- mockRouter,
mockOrganizationWithAdminActions,
- mockOrganizationWithAlm
+ mockOrganizationWithAlm,
+ mockRouter
} from '../../../../helpers/testMocks';
+import { CreateProjectPageSonarCloud } from '../CreateProjectPageSonarCloud';
jest.mock('../../../../api/alm-integration', () => ({
getAlmAppInfo: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ManualProjectCreate from '../ManualProjectCreate';
import { createProject } from '../../../../api/components';
+import ManualProjectCreate from '../ManualProjectCreate';
jest.mock('../../../../api/components', () => ({
createProject: jest.fn().mockResolvedValue({ project: { key: 'bar', name: 'Bar' } })
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { OrganizationInput } from '../OrganizationInput';
+import * as React from 'react';
import {
- mockRouter,
mockOrganization,
- mockOrganizationWithAlm
+ mockOrganizationWithAlm,
+ mockRouter
} from '../../../../helpers/testMocks';
+import { OrganizationInput } from '../OrganizationInput';
const organizations = [mockOrganization(), mockOrganizationWithAlm({ key: 'bar', name: 'Bar' })];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { times } from 'lodash';
import { shallow } from 'enzyme';
+import { times } from 'lodash';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import RemoteRepositories from '../RemoteRepositories';
import { getRepositories } from '../../../../api/alm-integration';
import {
- mockOrganizationWithAlm,
- mockOrganizationWithAdminActions
+ mockOrganizationWithAdminActions,
+ mockOrganizationWithAlm
} from '../../../../helpers/testMocks';
+import RemoteRepositories from '../RemoteRepositories';
jest.mock('../../../../api/alm-integration', () => ({
getRepositories: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, submit } from 'sonar-ui-common/helpers/testUtils';
-import SetupProjectBox from '../SetupProjectBox';
+import * as React from 'react';
+import { submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { provisionProject } from '../../../../api/alm-integration';
import { mockOrganizationWithAlm } from '../../../../helpers/testMocks';
+import SetupProjectBox from '../SetupProjectBox';
jest.mock('../../../../api/alm-integration', () => ({
provisionProject: jest
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import Header from './Header';
-import List from './List';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- getCustomMeasures,
createCustomMeasure,
- updateCustomMeasure,
- deleteCustomMeasure
+ deleteCustomMeasure,
+ getCustomMeasures,
+ updateCustomMeasure
} from '../../../api/measures';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import Header from './Header';
+import List from './List';
interface Props {
component: { key: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import Form from './Form';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
measure: T.CustomMeasure;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
+import Select from 'sonar-ui-common/components/controls/Select';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import Select from 'sonar-ui-common/components/controls/Select';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getAllMetrics } from '../../../api/metrics';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CreateButton from './CreateButton';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import ActionsDropdown, {
ActionsDropdownDivider,
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { isUserActive } from '../../../helpers/users';
import DeleteForm from './DeleteForm';
import Form from './Form';
import MeasureDate from './MeasureDate';
-import { isUserActive } from '../../../helpers/users';
interface Props {
measure: T.CustomMeasure;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import Item from './Item';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import App from '../App';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import CreateButton from '../CreateButton';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DeleteForm from '../DeleteForm';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { change, submit, click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { change, click, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import Form from '../Form';
jest.mock('../../../../api/metrics', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
it('should create new custom measure', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Item from '../Item';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import List from '../List';
it('should render', () => {
*/
import * as React from 'react';
import { Helmet } from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import { MetricProps } from './Form';
-import Header from './Header';
-import List from './List';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
+ createMetric,
+ deleteMetric,
getMetricDomains,
- getMetricTypes,
getMetrics,
- deleteMetric,
- updateMetric,
- createMetric,
- MetricsResponse
+ getMetricTypes,
+ MetricsResponse,
+ updateMetric
} from '../../../api/metrics';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { MetricProps } from './Form';
+import Header from './Header';
+import List from './List';
interface Props {}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import Form, { MetricProps } from './Form';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
metric: T.Metric;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Select, { Creatable } from 'sonar-ui-common/components/controls/Select';
+import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
export interface MetricProps {
description: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CreateButton from './CreateButton';
import { MetricProps } from './Form';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
ActionsDropdownDivider,
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DeleteForm from './DeleteForm';
import Form, { MetricProps } from './Form';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { MetricProps } from './Form';
import Item from './Item';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import App from '../App';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import CreateButton from '../CreateButton';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DeleteForm from '../DeleteForm';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { change, submit, click } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { change, click, submit } from 'sonar-ui-common/helpers/testUtils';
import Form from '../Form';
it('should render form', async () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
it('should create new metric', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Item from '../Item';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import List from '../List';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as navigationTreeSonarCloud from 'Docs/../static/SonarCloudNavigationTree.json';
+import * as navigationTreeSonarQube from 'Docs/../static/SonarQubeNavigationTree.json';
+import { DocNavigationItem } from 'Docs/@types/types';
import * as React from 'react';
import Helmet from 'react-helmet';
import { Link } from 'react-router';
-import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
-import { DocNavigationItem } from 'Docs/@types/types';
-import * as navigationTreeSonarQube from 'Docs/../static/SonarQubeNavigationTree.json';
-import * as navigationTreeSonarCloud from 'Docs/../static/SonarCloudNavigationTree.json';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Sidebar from './Sidebar';
-import getPages from '../pages';
+import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import NotFound from '../../../app/components/NotFound';
import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
import DocMarkdownBlock from '../../../components/docs/DocMarkdownBlock';
import { isSonarCloud } from '../../../helpers/system';
+import getPages from '../pages';
import '../styles.css';
+import Sidebar from './Sidebar';
interface Props {
params: { splat?: string };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { DocNavigationItem } from 'Docs/@types/types';
-import MenuBlock from './MenuBlock';
-import { MenuItem } from './MenuItem';
-import { MenuExternalLink } from './MenuExternalLink';
+import * as React from 'react';
import {
+ getOpenChainFromPath,
isDocsNavigationBlock,
- isDocsNavigationExternalLink,
- getOpenChainFromPath
+ isDocsNavigationExternalLink
} from '../navTreeUtils';
import { DocumentationEntry, getNodeFromUrl } from '../utils';
+import MenuBlock from './MenuBlock';
+import { MenuExternalLink } from './MenuExternalLink';
+import { MenuItem } from './MenuItem';
interface Props {
navigation: DocNavigationItem[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import OpenCloseIcon from 'sonar-ui-common/components/icons/OpenCloseIcon';
import * as classNames from 'classnames';
-import { DocsNavigationBlock, DocNavigationItem } from 'Docs/@types/types';
+import { DocNavigationItem, DocsNavigationBlock } from 'Docs/@types/types';
+import * as React from 'react';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import { MenuItem } from './MenuItem';
+import OpenCloseIcon from 'sonar-ui-common/components/icons/OpenCloseIcon';
import { isDocsNavigationBlock } from '../navTreeUtils';
import { DocumentationEntry, getNodeFromUrl } from '../utils';
+import { MenuItem } from './MenuItem';
interface Props {
block: DocsNavigationBlock;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
import { testPathAgainstUrl } from '../navTreeUtils';
import { DocumentationEntry } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
-import { highlightMarks, cutWords, DocumentationEntry } from '../utils';
+import { cutWords, DocumentationEntry, highlightMarks } from '../utils';
export interface SearchResult {
exactMatch?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import lunr, { LunrBuilder, LunrIndex, LunrToken } from 'lunr';
-import { sortBy } from 'lodash';
import { DocNavigationItem } from 'Docs/@types/types';
+import { sortBy } from 'lodash';
+import lunr, { LunrBuilder, LunrIndex, LunrToken } from 'lunr';
+import * as React from 'react';
import { isDefined } from 'sonar-ui-common/helpers/types';
-import SearchResultEntry from './SearchResultEntry';
import { getUrlsList } from '../navTreeUtils';
import { DocumentationEntry } from '../utils';
+import SearchResultEntry from './SearchResultEntry';
interface Props {
navigation: DocNavigationItem[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { DocNavigationItem } from 'Docs/@types/types';
+import * as React from 'react';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { DocumentationEntry } from '../utils';
import Menu from './Menu';
import SearchResults from './SearchResults';
-import { DocumentationEntry } from '../utils';
interface Props {
navigation: DocNavigationItem[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
-import App from '../App';
import { isSonarCloud } from '../../../../helpers/system';
+import App from '../App';
jest.mock('../../../../components/common/ScreenPositionHelper', () => ({
default: class ScreenPositionHelper extends React.Component<{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Menu from '../Menu';
function createPage(title: string, relativeName: string, text = '') {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import MenuBlock from '../MenuBlock';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { MenuItem } from '../MenuItem';
+import * as React from 'react';
import { DocumentationEntry } from '../../utils';
+import { MenuItem } from '../MenuItem';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchResultEntry, {
SearchResult,
SearchResultText,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
import lunr from 'lunr';
+import * as React from 'react';
import SearchResults from '../SearchResults';
jest.mock('lunr', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Sidebar from '../Sidebar';
function createPage(title: string, relativeName: string, text = '') {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { flatten } from 'lodash';
+import NavigationTree from 'Docs/../static/SonarQubeNavigationTree.json';
import {
DocNavigationItem,
DocsNavigationBlock,
DocsNavigationExternalLink
} from 'Docs/@types/types';
-import NavigationTree from 'Docs/../static/SonarQubeNavigationTree.json';
+import { flatten } from 'lodash';
export function getNavTree() {
return NavigationTree as DocNavigationItem[];
*/
import remark from 'remark';
import visit from 'unist-util-visit';
-import { DocumentationEntry, DocumentationEntryScope } from './utils';
+import { filterContent, separateFrontMatter } from '../../helpers/markdown';
import * as Docs from './documentation.directory-loader';
-import { separateFrontMatter, filterContent } from '../../helpers/markdown';
+import { DocumentationEntry, DocumentationEntryScope } from './utils';
export default function getPages(): DocumentationEntry[] {
return ((Docs as unknown) as Array<{ content: string; path: string }>).map(file => {
*/
import * as React from 'react';
import { WithRouterProps } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Radio from 'sonar-ui-common/components/controls/Radio';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { giveDowngradeFeedback } from '../../../api/billing';
import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
import './DowngradeFeedback.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import DowngradeFeedback, { LocationState } from '../DowngradeFeedback';
+import * as React from 'react';
import { giveDowngradeFeedback } from '../../../../api/billing';
import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import DowngradeFeedback, { LocationState } from '../DowngradeFeedback';
jest.mock('../../../../api/billing', () => ({
giveDowngradeFeedback: jest.fn()
*/
import * as React from 'react';
import { Helmet } from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { createGroup, deleteGroup, searchUsersGroups, updateGroup } from '../../../api/user_groups';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import Header from './Header';
import List from './List';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { searchUsersGroups, deleteGroup, updateGroup, createGroup } from '../../../api/user_groups';
interface Props {
organization?: Pick<T.Organization, 'key'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
group: T.Group;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import BulletListIcon from 'sonar-ui-common/components/icons/BulletListIcon';
import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
+import BulletListIcon from 'sonar-ui-common/components/icons/BulletListIcon';
import EditMembersModal from './EditMembersModal';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { find, without } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import SelectList, {
SelectListFilter,
SelectListSearchParams
} from 'sonar-ui-common/components/controls/SelectList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { addUserToGroup, getUsersInGroup, removeUserFromGroup } from '../../../api/user_groups';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
confirmButtonText: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import Form from './Form';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import ListItem from './ListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { omitNil } from 'sonar-ui-common/helpers/request';
import ActionsDropdown, {
- ActionsDropdownItem,
- ActionsDropdownDivider
+ ActionsDropdownDivider,
+ ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { omitNil } from 'sonar-ui-common/helpers/request';
import DeleteForm from './DeleteForm';
import EditMembers from './EditMembers';
import Form from './Form';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import App from '../App';
-import { mockOrganization } from '../../../../helpers/testMocks';
import {
createGroup,
deleteGroup,
searchUsersGroups,
updateGroup
} from '../../../../api/user_groups';
+import { mockOrganization } from '../../../../helpers/testMocks';
+import App from '../App';
jest.mock('../../../../api/user_groups', () => ({
createGroup: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DeleteForm from '../DeleteForm';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import EditMembers from '../EditMembers';
import * as React from 'react';
import SelectList, { SelectListFilter } from 'sonar-ui-common/components/controls/SelectList';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { addUserToGroup, getUsersInGroup, removeUserFromGroup } from '../../../../api/user_groups';
import EditMembersModal from '../EditMembersModal';
-import { getUsersInGroup, addUserToGroup, removeUserFromGroup } from '../../../../api/user_groups';
const organization = 'orga';
const group = { id: 1, name: 'foo', membersCount: 1 };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { change, submit, click } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { change, click, submit } from 'sonar-ui-common/helpers/testUtils';
import Form from '../Form';
it('should render form', async () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Header from '../Header';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import List from '../List';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import ListItem from '../ListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import AppContainer from './components/AppContainer';
-import { isSonarCloud } from '../../helpers/system';
-import { isLoggedIn } from '../../helpers/users';
import { withCurrentUser } from '../../components/hoc/withCurrentUser';
import { Location } from '../../components/hoc/withRouter';
+import { isSonarCloud } from '../../helpers/system';
+import { isLoggedIn } from '../../helpers/users';
+import AppContainer from './components/AppContainer';
export interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { IssuesPage, Props } from '../IssuesPageSelector';
-import { mockLocation, mockCurrentUser, mockLoggedInUser } from '../../../helpers/testMocks';
+import * as React from 'react';
import { isSonarCloud } from '../../../helpers/system';
+import { mockCurrentUser, mockLocation, mockLoggedInUser } from '../../../helpers/testMocks';
+import { IssuesPage, Props } from '../IssuesPageSelector';
jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn().mockReturnValue(false) }));
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { selectFlow, selectLocation } from '../actions';
import { mockIssue } from '../../../helpers/testMocks';
+import { selectFlow, selectLocation } from '../actions';
describe('selectFlow', () => {
it('should select flow and enable locations navigator', () => {
*/
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
import {
- shouldOpenSeverityFacet,
- shouldOpenStandardsFacet,
scrollToIssue,
+ shouldOpenSeverityFacet,
+ shouldOpenSonarSourceSecurityFacet,
shouldOpenStandardsChildFacet,
- shouldOpenSonarSourceSecurityFacet
+ shouldOpenStandardsFacet
} from '../utils';
jest.mock('sonar-ui-common/helpers/scrolling', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
-import Helmet from 'react-helmet';
import { keyBy, omit, without } from 'lodash';
+import * as React from 'react';
+import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
+import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import {
addSideBarClass,
addWhitePageClass,
removeSideBarClass,
removeWhitePageClass
} from 'sonar-ui-common/helpers/pages';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import { Button } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import BulkChangeModal, { MAX_PAGE_SIZE } from './BulkChangeModal';
-import IssuesList from './IssuesList';
-import IssuesSourceViewer from './IssuesSourceViewer';
-import MyIssuesFilter from './MyIssuesFilter';
-import NoIssues from './NoIssues';
-import NoMyIssues from './NoMyIssues';
-import PageActions from './PageActions';
-import ConciseIssuesList from '../conciseIssuesList/ConciseIssuesList';
-import ConciseIssuesListHeader from '../conciseIssuesList/ConciseIssuesListHeader';
-import Sidebar from '../sidebar/Sidebar';
+import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import EmptySearch from '../../../components/common/EmptySearch';
import FiltersHeader from '../../../components/common/FiltersHeader';
import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import { withRouter, Location, Router } from '../../../components/hoc/withRouter';
+import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
+import '../../../components/search-navigator.css';
+import {
+ fillBranchLike,
+ getBranchLikeQuery,
+ isPullRequest,
+ isSameBranchLike,
+ isShortLivingBranch
+} from '../../../helpers/branches';
+import { isSonarCloud } from '../../../helpers/system';
+import { fetchBranchStatus } from '../../../store/rootActions';
import * as actions from '../actions';
+import ConciseIssuesList from '../conciseIssuesList/ConciseIssuesList';
+import ConciseIssuesListHeader from '../conciseIssuesList/ConciseIssuesListHeader';
+import Sidebar from '../sidebar/Sidebar';
+import '../styles.css';
import {
areMyIssuesSelected,
areQueriesEqual,
ReferencedLanguage,
ReferencedRule,
saveMyIssues,
- serializeQuery,
- STANDARDS,
scrollToIssue,
+ serializeQuery,
shouldOpenSeverityFacet,
shouldOpenSonarSourceSecurityFacet,
+ shouldOpenStandardsChildFacet,
shouldOpenStandardsFacet,
- shouldOpenStandardsChildFacet
+ STANDARDS
} from '../utils';
-import {
- isShortLivingBranch,
- isSameBranchLike,
- getBranchLikeQuery,
- isPullRequest,
- fillBranchLike
-} from '../../../helpers/branches';
-import { isSonarCloud } from '../../../helpers/system';
-import { fetchBranchStatus } from '../../../store/rootActions';
-import '../../../components/search-navigator.css';
-import '../styles.css';
+import BulkChangeModal, { MAX_PAGE_SIZE } from './BulkChangeModal';
+import IssuesList from './IssuesList';
+import IssuesSourceViewer from './IssuesSourceViewer';
+import MyIssuesFilter from './MyIssuesFilter';
+import NoIssues from './NoIssues';
+import NoMyIssues from './NoMyIssues';
+import PageActions from './PageActions';
interface FetchIssuesPromise {
components: ReferencedComponent[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { uniq } from 'lodash';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
-import { uniq } from 'lodash';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { searchIssues } from '../../../api/issues';
import { getOrganizations } from '../../../api/organizations';
import throwGlobalError from '../../../app/utils/throwGlobalError';
+import { parseIssueFromResponse } from '../../../helpers/issues';
+import { receiveOrganizations } from '../../../store/organizations';
import {
- getCurrentUser,
areThereCustomOrganizations,
+ getCurrentUser,
getMyOrganizations,
Store
} from '../../../store/rootReducer';
-import { parseIssueFromResponse } from '../../../helpers/issues';
-import { receiveOrganizations } from '../../../store/organizations';
interface StateProps {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { pickBy, sortBy } from 'lodash';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { pickBy, sortBy } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import Modal from 'sonar-ui-common/components/controls/Modal';
-import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import Modal from 'sonar-ui-common/components/controls/Modal';
import Radio from 'sonar-ui-common/components/controls/Radio';
-import Select from 'sonar-ui-common/components/controls/Select';
import SearchSelect from 'sonar-ui-common/components/controls/SearchSelect';
-import { searchAssignees } from '../utils';
-import Avatar from '../../../components/ui/Avatar';
+import Select from 'sonar-ui-common/components/controls/Select';
+import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { bulkChangeIssues, searchIssueTags } from '../../../api/issues';
+import throwGlobalError from '../../../app/utils/throwGlobalError';
import MarkdownTips from '../../../components/common/MarkdownTips';
import SeverityHelper from '../../../components/shared/SeverityHelper';
-import throwGlobalError from '../../../app/utils/throwGlobalError';
-import { searchIssueTags, bulkChangeIssues } from '../../../api/issues';
+import Avatar from '../../../components/ui/Avatar';
import { isLoggedIn, isUserActive } from '../../../helpers/users';
+import { searchAssignees } from '../utils';
interface AssigneeOption {
avatar?: string;
*/
import * as React from 'react';
import { collapsePath, limitComponentName } from 'sonar-ui-common/helpers/path';
-import { getSelectedLocation } from '../utils';
import Organization from '../../../components/shared/Organization';
+import { getSelectedLocation } from '../utils';
interface Props {
component?: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ListItem from './ListItem';
import { Query, scrollToIssue } from '../utils';
+import ListItem from './ListItem';
interface Props {
branchLike: T.BranchLike | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { uniq } from 'lodash';
+import * as React from 'react';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { getLocations, getSelectedLocation } from '../utils';
-import CrossComponentSourceViewer from '../crossComponentSourceViewer/CrossComponentSourceViewer';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
+import CrossComponentSourceViewer from '../crossComponentSourceViewer/CrossComponentSourceViewer';
+import { getLocations, getSelectedLocation } from '../utils';
interface Props {
branchLike: T.BranchLike | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ComponentBreadcrumbs from './ComponentBreadcrumbs';
-import { Query } from '../utils';
import Issue from '../../../components/issue/Issue';
+import { Query } from '../utils';
+import ComponentBreadcrumbs from './ComponentBreadcrumbs';
interface Props {
branchLike: T.BranchLike | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
myIssues: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ReloadButton from 'sonar-ui-common/components/controls/ReloadButton';
-import IssuesCounter from './IssuesCounter';
-import TotalEffort from './TotalEffort';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import HomePageSelect from '../../../components/controls/HomePageSelect';
import { isSonarCloud } from '../../../helpers/system';
+import IssuesCounter from './IssuesCounter';
+import TotalEffort from './TotalEffort';
interface Props {
canSetHome: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import { waitAndUpdate, KEYCODE_MAP, keydown } from 'sonar-ui-common/helpers/testUtils';
-import { App } from '../App';
+import { KEYCODE_MAP, keydown, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import {
- mockLoggedInUser,
- mockRouter,
+ mockComponent,
+ mockCurrentUser,
+ mockEvent,
mockIssue,
mockLocation,
- mockEvent,
- mockCurrentUser,
+ mockLoggedInUser,
mockPullRequest,
- mockComponent
+ mockRouter
} from '../../../../helpers/testMocks';
import {
enableLocationsNavigator,
- selectNextLocation,
- selectPreviousLocation,
selectNextFlow,
- selectPreviousFlow
+ selectNextLocation,
+ selectPreviousFlow,
+ selectPreviousLocation
} from '../../actions';
+import { App } from '../App';
jest.mock('sonar-ui-common/helpers/handleRequiredAuthentication', () => ({
default: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import BulkChangeModal, { MAX_PAGE_SIZE } from '../BulkChangeModal';
import { mockIssue } from '../../../../helpers/testMocks';
+import BulkChangeModal, { MAX_PAGE_SIZE } from '../BulkChangeModal';
jest.mock('../../../../api/issues', () => ({
searchIssueTags: () => Promise.resolve([undefined, []])
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ComponentBreadcrumbs from '../ComponentBreadcrumbs';
const baseIssue = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import IssuesCounter from '../IssuesCounter';
it('formats numbers', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import IssuesList from '../IssuesList';
import { mockIssue } from '../../../../helpers/testMocks';
+import IssuesList from '../IssuesList';
it('should render correctly', async () => {
jest.useFakeTimers();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockIssue, mockMainBranch } from '../../../../helpers/testMocks';
import IssuesSourceViewer from '../IssuesSourceViewer';
-import { mockMainBranch, mockIssue } from '../../../../helpers/testMocks';
it('should render SourceViewer correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import LocationNavigationKeyboardShortcuts, { Props } from '../LocationNavigationKeyboardShortcuts';
+import * as React from 'react';
import { mockFlowLocation } from '../../../../helpers/testMocks';
+import LocationNavigationKeyboardShortcuts, { Props } from '../LocationNavigationKeyboardShortcuts';
it('should render correctly', () => {
expect(shallowRender().type()).toBeNull();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PageActions from '../PageActions';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TotalEffort from '../TotalEffort';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
+import TypeHelper from '../../../components/shared/TypeHelper';
+import LocationNavigationKeyboardShortcuts from '../components/LocationNavigationKeyboardShortcuts';
import ConciseIssueLocations from './ConciseIssueLocations';
import ConciseIssueLocationsNavigator from './ConciseIssueLocationsNavigator';
-import LocationNavigationKeyboardShortcuts from '../components/LocationNavigationKeyboardShortcuts';
-import TypeHelper from '../../../components/shared/TypeHelper';
interface Props {
issue: T.Issue;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import LocationIndex from '../../../components/common/LocationIndex';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { uniq } from 'lodash';
+import * as React from 'react';
+import { getLocations } from '../utils';
import ConciseIssueLocationsNavigatorLocation from './ConciseIssueLocationsNavigatorLocation';
import CrossFileLocationsNavigator from './CrossFileLocationsNavigator';
-import { getLocations } from '../utils';
interface Props {
issue: Pick<T.Issue, 'component' | 'key' | 'flows' | 'secondaryLocations' | 'type'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { collapsePath } from 'sonar-ui-common/helpers/path';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { collapsePath } from 'sonar-ui-common/helpers/path';
import ConciseIssueLocationsNavigatorLocation from './ConciseIssueLocationsNavigatorLocation';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssue from '../ConciseIssue';
const issue: T.Issue = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
-import ConciseIssueBox from '../ConciseIssueBox';
+import * as React from 'react';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { mockIssue } from '../../../../helpers/testMocks';
+import ConciseIssueBox from '../ConciseIssueBox';
it('should render correctly', async () => {
const onClick = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssueComponent from '../ConciseIssueComponent';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssueLocationBadge from '../ConciseIssueLocationBadge';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssueLocations from '../ConciseIssueLocations';
const textRange = { startLine: 1, startOffset: 1, endLine: 1, endOffset: 1 };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConciseIssueLocationsNavigator from '../ConciseIssueLocationsNavigator';
+import * as React from 'react';
import { mockIssue } from '../../../../helpers/testMocks';
+import ConciseIssueLocationsNavigator from '../ConciseIssueLocationsNavigator';
const location1: T.FlowLocation = {
component: 'foo',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssueLocationsNavigatorLocation from '../ConciseIssueLocationsNavigatorLocation';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConciseIssuesList from '../ConciseIssuesList';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import CrossFileLocationsNavigator from '../CrossFileLocationsNavigator';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
+import { getSources } from '../../../api/components';
+import getCoverageStatus from '../../../components/SourceViewer/helpers/getCoverageStatus';
+import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing';
+import SourceViewerHeaderSlim from '../../../components/SourceViewer/SourceViewerHeaderSlim';
+import { getBranchLikeQuery } from '../../../helpers/branches';
+import SnippetViewer from './SnippetViewer';
import {
createSnippets,
expandSnippet,
EXPAND_BY_LINES,
- MERGE_DISTANCE,
- linesForSnippets
+ linesForSnippets,
+ MERGE_DISTANCE
} from './utils';
-import SnippetViewer from './SnippetViewer';
-import SourceViewerHeaderSlim from '../../../components/SourceViewer/SourceViewerHeaderSlim';
-import getCoverageStatus from '../../../components/SourceViewer/helpers/getCoverageStatus';
-import { getSources } from '../../../api/components';
-import { locationsByLine } from '../../../components/SourceViewer/helpers/indexing';
-import { getBranchLikeQuery } from '../../../helpers/branches';
interface Props {
branchLike: T.BranchLike | undefined;
*/
import * as React from 'react';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import ComponentSourceSnippetViewer from './ComponentSourceSnippetViewer';
-import { groupLocationsByComponent } from './utils';
-import DuplicationPopup from '../../../components/SourceViewer/components/DuplicationPopup';
-import { SourceViewerContext } from '../../../components/SourceViewer/SourceViewerContext';
-import { WorkspaceContext } from '../../../components/workspace/context';
+import { getDuplications } from '../../../api/components';
import { getIssueFlowSnippets } from '../../../api/issues';
+import DuplicationPopup from '../../../components/SourceViewer/components/DuplicationPopup';
import {
filterDuplicationBlocksByLine,
- isDuplicationBlockInRemovedComponent,
- getDuplicationBlocksForIndex
+ getDuplicationBlocksForIndex,
+ isDuplicationBlockInRemovedComponent
} from '../../../components/SourceViewer/helpers/duplications';
import {
duplicationsByLine,
issuesByComponentAndLine
} from '../../../components/SourceViewer/helpers/indexing';
-import { getDuplications } from '../../../api/components';
+import { SourceViewerContext } from '../../../components/SourceViewer/SourceViewerContext';
+import { WorkspaceContext } from '../../../components/workspace/context';
import { getBranchLikeQuery } from '../../../helpers/branches';
+import ComponentSourceSnippetViewer from './ComponentSourceSnippetViewer';
+import { groupLocationsByComponent } from './utils';
interface Props {
branchLike: T.Branch | T.PullRequest | undefined;
import * as React from 'react';
import classNames from 'classnames';
import ExpandSnippetIcon from 'sonar-ui-common/components/icons/ExpandSnippetIcon';
-import { scrollHorizontally } from 'sonar-ui-common/helpers/scrolling';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { inSnippet, LINES_BELOW_LAST } from './utils';
+import { scrollHorizontally } from 'sonar-ui-common/helpers/scrolling';
import Line from '../../../components/SourceViewer/components/Line';
import { symbolsByLine } from '../../../components/SourceViewer/helpers/indexing';
import { getSecondaryIssueLocationsForLine } from '../../../components/SourceViewer/helpers/issueLocations';
import {
- optimizeLocationMessage,
optimizeHighlightedSymbols,
+ optimizeLocationMessage,
optimizeSelectedIssue
} from '../../../components/SourceViewer/helpers/lines';
+import { inSnippet, LINES_BELOW_LAST } from './utils';
interface Props {
branchLike: T.BranchLike | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { shallow, mount, ReactWrapper } from 'enzyme';
+import { mount, ReactWrapper, shallow } from 'enzyme';
import { times } from 'lodash';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ComponentSourceSnippetViewer from '../ComponentSourceSnippetViewer';
+import { getSources } from '../../../../api/components';
import {
- mockMainBranch,
- mockIssue,
- mockSourceViewerFile,
mockFlowLocation,
+ mockIssue,
+ mockMainBranch,
+ mockShortLivingBranch,
mockSnippetsByComponent,
mockSourceLine,
- mockShortLivingBranch
+ mockSourceViewerFile
} from '../../../../helpers/testMocks';
-import { getSources } from '../../../../api/components';
+import ComponentSourceSnippetViewer from '../ComponentSourceSnippetViewer';
jest.mock('../../../../api/components', () => ({
getSources: jest.fn().mockResolvedValue([])
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import CrossComponentSourceViewerWrapper from '../CrossComponentSourceViewerWrapper';
+import { getDuplications } from '../../../../api/components';
+import { getIssueFlowSnippets } from '../../../../api/issues';
import {
mockFlowLocation,
mockIssue,
mockSourceLine,
mockSourceViewerFile
} from '../../../../helpers/testMocks';
-import { getIssueFlowSnippets } from '../../../../api/issues';
-import { getDuplications } from '../../../../api/components';
+import CrossComponentSourceViewerWrapper from '../CrossComponentSourceViewerWrapper';
jest.mock('../../../../api/issues', () => {
const { mockSnippetsByComponent } = require.requireActual('../../../../helpers/testMocks');
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { range } from 'lodash';
import { shallow } from 'enzyme';
-import SnippetViewer from '../SnippetViewer';
+import { range } from 'lodash';
+import * as React from 'react';
import {
- mockSourceViewerFile,
- mockMainBranch,
mockIssue,
- mockSourceLine
+ mockMainBranch,
+ mockSourceLine,
+ mockSourceViewerFile
} from '../../../../helpers/testMocks';
+import SnippetViewer from '../SnippetViewer';
it('should render correctly', () => {
const snippet = range(5, 8).map(line => mockSourceLine({ line }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { groupLocationsByComponent, createSnippets, expandSnippet } from '../utils';
import { mockFlowLocation, mockSnippetsByComponent } from '../../../../helpers/testMocks';
+import { createSnippets, expandSnippet, groupLocationsByComponent } from '../utils';
describe('groupLocationsByComponent', () => {
it('should handle empty args', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { Location } from 'sonar-ui-common/helpers/urls';
-import { parseQuery, areMyIssuesSelected, serializeQuery } from './utils';
+import { areMyIssuesSelected, parseQuery, serializeQuery } from './utils';
function parseHash(hash: string) {
const query: T.RawQuery = {};
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit, sortBy, without } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
+import * as React from 'react';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { searchAssignees, Query, Facet } from '../utils';
-import Avatar from '../../../components/ui/Avatar';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import Avatar from '../../../components/ui/Avatar';
import { isUserActive } from '../../../helpers/users';
+import { Facet, Query, searchAssignees } from '../utils';
interface Props {
assigned: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query, Facet } from '../utils';
-import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { searchIssueAuthors } from '../../../api/issues';
+import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { Facet, Query } from '../utils';
interface Props {
component: T.Component | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as isSameDay from 'date-fns/is_same_day';
import { max } from 'lodash';
-import { injectIntl, InjectedIntlProps } from 'react-intl';
+import * as React from 'react';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import BarChart from 'sonar-ui-common/components/charts/BarChart';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { Query } from '../utils';
+import DateRangeInput from '../../../components/controls/DateRangeInput';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import { longFormatterOption } from '../../../components/intl/DateFormatter';
import DateFromNow from '../../../components/intl/DateFromNow';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
-import DateRangeInput from '../../../components/controls/DateRangeInput';
+import { Query } from '../utils';
interface Props {
component: T.Component | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit } from 'lodash';
+import * as React from 'react';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { collapsePath } from 'sonar-ui-common/helpers/path';
import { highlightTerm } from 'sonar-ui-common/helpers/search';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query, Facet } from '../utils';
-import ListStyleFacet from '../../../components/facet/ListStyleFacet';
import { getTree, TreeComponent } from '../../../api/components';
+import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { Facet, Query } from '../utils';
interface Props {
componentKey: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit } from 'lodash';
+import * as React from 'react';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { collapsePath } from 'sonar-ui-common/helpers/path';
import { highlightTerm } from 'sonar-ui-common/helpers/search';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query, ReferencedComponent, Facet } from '../utils';
-import { TreeComponent, getTree } from '../../../api/components';
+import { getTree, TreeComponent } from '../../../api/components';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { Facet, Query, ReferencedComponent } from '../utils';
interface Props {
componentKey: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { omit, uniqBy } from 'lodash';
import * as React from 'react';
-import { uniqBy, omit } from 'lodash';
import { connect } from 'react-redux';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
-import { Query, ReferencedLanguage, Facet } from '../utils';
import { getLanguages, Store } from '../../../store/rootReducer';
+import { Facet, Query, ReferencedLanguage } from '../utils';
interface InstalledLanguage {
key: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { omit } from 'lodash';
import * as React from 'react';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
-import { omit } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
+import { getTree, searchProjects } from '../../../api/components';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
-import { Query, ReferencedComponent, Facet } from '../utils';
-import { searchProjects, getTree } from '../../../api/components';
import Organization from '../../../components/shared/Organization';
+import { Facet, Query, ReferencedComponent } from '../utils';
interface Props {
component: T.Component | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { orderBy, without } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { formatFacetStat, Query } from '../utils';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
+import { formatFacetStat, Query } from '../utils';
interface Props {
fetching: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ListStyleFacet from '../../../components/facet/ListStyleFacet';
-import { Query, ReferencedRule, Facet } from '../utils';
import { searchRules } from '../../../api/rules';
+import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { Facet, Query, ReferencedRule } from '../utils';
interface Props {
fetching: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { orderBy, without } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { formatFacetStat, Query } from '../utils';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
-import SeverityHelper from '../../../components/shared/SeverityHelper';
import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
+import SeverityHelper from '../../../components/shared/SeverityHelper';
+import { formatFacetStat, Query } from '../utils';
interface Props {
fetching: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Facet, Query, ReferencedComponent, ReferencedLanguage, ReferencedRule } from '../utils';
import AssigneeFacet from './AssigneeFacet';
import AuthorFacet from './AuthorFacet';
import CreationDateFacet from './CreationDateFacet';
import StatusFacet from './StatusFacet';
import TagFacet from './TagFacet';
import TypeFacet from './TypeFacet';
-import { Query, Facet, ReferencedComponent, ReferencedLanguage, ReferencedRule } from '../utils';
export interface Props {
component: T.Component | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { omit, sortBy, without } from 'lodash';
import * as React from 'react';
-import { sortBy, without, omit } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
renderSansTop25Category,
renderSonarSourceSecurityCategory
} from '../../../helpers/security-standard';
-import { Query, STANDARDS, formatFacetStat, Facet } from '../utils';
+import { Facet, formatFacetStat, Query, STANDARDS } from '../utils';
interface Props {
cwe: string[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { orderBy, without } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { formatFacetStat, Query } from '../utils';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
-import StatusHelper from '../../../components/shared/StatusHelper';
import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
+import StatusHelper from '../../../components/shared/StatusHelper';
+import { formatFacetStat, Query } from '../utils';
interface Props {
fetching: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { omit } from 'lodash';
import * as React from 'react';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
-import { omit } from 'lodash';
-import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query, Facet } from '../utils';
+import { highlightTerm } from 'sonar-ui-common/helpers/search';
import { searchIssueTags } from '../../../api/issues';
import { colors } from '../../../app/theme';
import ListStyleFacet from '../../../components/facet/ListStyleFacet';
+import { Facet, Query } from '../utils';
interface Props {
component: T.Component | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { orderBy, without } from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
-import { orderBy, without } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import NewsBox from 'sonar-ui-common/components/ui/NewsBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import FacetBox from '../../../components/facet/FacetBox';
import FacetHeader from '../../../components/facet/FacetHeader';
import FacetItem from '../../../components/facet/FacetItem';
import FacetItemsList from '../../../components/facet/FacetItemsList';
import MultipleSelectionHint from '../../../components/facet/MultipleSelectionHint';
-import { formatFacetStat, Query } from '../utils';
+import { ISSUE_TYPES } from '../../../helpers/constants';
import { getCurrentUser, getCurrentUserSetting, Store } from '../../../store/rootReducer';
import { setCurrentUserSetting } from '../../../store/users';
-import { ISSUE_TYPES } from '../../../helpers/constants';
+import { formatFacetStat, Query } from '../utils';
interface Props {
fetching: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import AssigneeFacet from '../AssigneeFacet';
+import * as React from 'react';
import { Query } from '../../utils';
+import AssigneeFacet from '../AssigneeFacet';
jest.mock('../../../../store/rootReducer', () => ({}));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
import { flatten } from 'lodash';
-import Sidebar, { Props } from '../Sidebar';
+import * as React from 'react';
import { Query } from '../../utils';
+import Sidebar, { Props } from '../Sidebar';
jest.mock('../../../../store/rootReducer', () => ({}));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import StandardFacet from '../StandardFacet';
-import { Query } from '../../utils';
import { getStandards } from '../../../../helpers/security-standard';
+import { Query } from '../../utils';
+import StandardFacet from '../StandardFacet';
jest.mock('../../../../helpers/security-standard', () => ({
...require.requireActual('../../../../helpers/security-standard'),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import StatusFacet from '../StatusFacet';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import { TypeFacet } from '../TypeFacet';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import {
- queriesEqual,
cleanQuery,
- parseAsBoolean,
parseAsArray,
+ parseAsBoolean,
+ parseAsDate,
parseAsString,
+ queriesEqual,
+ serializeDateShort,
serializeString,
- serializeStringArray,
- parseAsDate,
- serializeDateShort
+ serializeStringArray
} from 'sonar-ui-common/helpers/query';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
import { get, save } from 'sonar-ui-common/helpers/storage';
import { searchMembers } from '../../api/organizations';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl, getReturnUrl } from 'sonar-ui-common/helpers/urls';
-import { Button } from 'sonar-ui-common/components/controls/buttons';
import { getMigrationStatus, getSystemStatus, migrateDatabase } from '../../../api/system';
+import InstanceMessage from '../../../components/common/InstanceMessage';
import DateFromNow from '../../../components/intl/DateFromNow';
import TimeFormatter from '../../../components/intl/TimeFormatter';
-import InstanceMessage from '../../../components/common/InstanceMessage';
import { isSonarCloud } from '../../../helpers/system';
import '../styles.css';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import App from '../App';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import App from '../App';
jest.mock('../../../../api/system', () => ({
getMigrationStatus: jest.fn(),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy, uniqBy } from 'lodash';
+import * as React from 'react';
import Helmet from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Header from './Header';
-import EditionBoxes from './EditionBoxes';
-import Footer from './Footer';
-import PluginsList from './PluginsList';
-import Search from './Search';
-import { filterPlugins, parseQuery, Query, serializeQuery } from './utils';
-import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
import {
getAvailablePlugins,
+ getInstalledPlugins,
getInstalledPluginsWithUpdates,
getPluginUpdates,
Plugin,
- PluginPendingResult,
- getInstalledPlugins
+ PluginPendingResult
} from '../../api/plugins';
-import { withRouter, Location, Router } from '../../components/hoc/withRouter';
+import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
+import { Location, Router, withRouter } from '../../components/hoc/withRouter';
+import EditionBoxes from './EditionBoxes';
+import Footer from './Footer';
+import Header from './Header';
+import PluginsList from './PluginsList';
+import Search from './Search';
import './style.css';
+import { filterPlugins, parseQuery, Query, serializeQuery } from './utils';
export interface Props {
currentEdition?: T.EditionKey;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import App from './App';
-import { getAppState, getGlobalSettingValue, Store } from '../../store/rootReducer';
import AdminContext from '../../app/components/AdminContext';
+import { getAppState, getGlobalSettingValue, Store } from '../../store/rootReducer';
+import App from './App';
interface OwnProps {
location: { pathname: string; query: T.RawQuery };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { getMarketplaceNavigation } from '../../api/nav';
import EditionBox from './components/EditionBox';
import { EDITIONS } from './utils';
-import { getMarketplaceNavigation } from '../../api/nav';
export interface Props {
currentEdition?: T.EditionKey;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Plugin, PluginPending } from '../../api/plugins';
import PluginAvailable from './components/PluginAvailable';
import PluginInstalled from './components/PluginInstalled';
import { isPluginAvailable, isPluginInstalled } from './utils';
-import { Plugin, PluginPending } from '../../api/plugins';
interface Props {
plugins: Plugin[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Query } from './utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import EditionBoxes from '../EditionBoxes';
import { EditionKey } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Footer from '../Footer';
it('should display the number of plugins', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
import { EditionKey } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import tooltipDCE from 'Docs/tooltips/editions/datacenter.md';
import tooltipDE from 'Docs/tooltips/editions/developer.md';
import tooltipEE from 'Docs/tooltips/editions/enterprise.md';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Edition, getEditionUrl } from '../utils';
const DocMarkdownBlock = lazyLoad(() => import('../../../components/docs/DocMarkdownBlock'));
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
-import PluginUpdateButton from './PluginUpdateButton';
+import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { installPlugin, Plugin, uninstallPlugin, updatePlugin } from '../../../api/plugins';
import { isPluginAvailable, isPluginInstalled } from '../utils';
-import { Plugin, installPlugin, updatePlugin, uninstallPlugin } from '../../../api/plugins';
+import PluginUpdateButton from './PluginUpdateButton';
interface Props {
plugin: Plugin;
*/
import * as React from 'react';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { PluginAvailable as IPluginAvailable } from '../../../api/plugins';
import PluginChangeLogButton from './PluginChangeLogButton';
import PluginDescription from './PluginDescription';
import PluginLicense from './PluginLicense';
import PluginOrganization from './PluginOrganization';
import PluginStatus from './PluginStatus';
import PluginUrls from './PluginUrls';
-import { PluginAvailable as IPluginAvailable } from '../../../api/plugins';
interface Props {
plugin: IPluginAvailable;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import PluginChangeLogItem from './PluginChangeLogItem';
import { Release, Update } from '../../../api/plugins';
+import PluginChangeLogItem from './PluginChangeLogItem';
export interface Props {
release: Release;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import EllipsisIcon from 'sonar-ui-common/components/icons/EllipsisIcon';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import PluginChangeLog from './PluginChangeLog';
+import EllipsisIcon from 'sonar-ui-common/components/icons/EllipsisIcon';
import { Release, Update } from '../../../api/plugins';
+import PluginChangeLog from './PluginChangeLog';
interface Props {
release: Release;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import DateFormatter from '../../../components/intl/DateFormatter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Release, Update } from '../../../api/plugins';
+import DateFormatter from '../../../components/intl/DateFormatter';
interface Props {
release: Release;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { PluginInstalled as IPluginInstalled } from '../../../api/plugins';
import PluginDescription from './PluginDescription';
import PluginLicense from './PluginLicense';
import PluginOrganization from './PluginOrganization';
import PluginStatus from './PluginStatus';
import PluginUpdates from './PluginUpdates';
import PluginUrls from './PluginUrls';
-import { PluginInstalled as IPluginInstalled } from '../../../api/plugins';
interface Props {
plugin: IPluginInstalled;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
license?: string;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import PluginActions from './PluginActions';
import { Plugin } from '../../../api/plugins';
+import PluginActions from './PluginActions';
interface Props {
plugin: Plugin;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Update } from '../../../api/plugins';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import PluginChangeLogButton from './PluginChangeLogButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Release, Update } from '../../../api/plugins';
+import PluginChangeLogButton from './PluginChangeLogButton';
interface Props {
update: Update;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import PluginUpdateItem from './PluginUpdateItem';
import { Update } from '../../../api/plugins';
+import PluginUpdateItem from './PluginUpdateItem';
interface Props {
updates?: Update[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import EditionBox from '../EditionBox';
+import * as React from 'react';
import { EditionKey } from '../../utils';
+import EditionBox from '../EditionBox';
const DEFAULT_EDITION = {
key: EditionKey.developer,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { PluginAvailable, PluginInstalled } from '../../../../api/plugins';
import PluginActions from '../PluginActions';
-import { PluginInstalled, PluginAvailable } from '../../../../api/plugins';
const installedPlugin: PluginInstalled = {
key: 'foo',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PluginChangeLog, { Props } from '../PluginChangeLog';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PluginDescription from '../PluginDescription';
it('should display the description and category', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PluginLicense from '../PluginLicense';
it('should display the license field', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PluginUrls from '../PluginUrls';
it('should display the urls', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { stringify } from 'querystring';
import { memoize } from 'lodash';
+import { stringify } from 'querystring';
import { cleanQuery, parseAsString, serializeString } from 'sonar-ui-common/helpers/query';
import { omitNil } from 'sonar-ui-common/helpers/request';
import { Plugin, PluginAvailable, PluginInstalled, PluginPending } from '../../api/plugins';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink, Button } from 'sonar-ui-common/components/controls/buttons';
+import { Button, ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import UsersSelectSearch from '../users/components/UsersSelectSearch';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { searchMembers } from '../../api/organizations';
+import UsersSelectSearch from '../users/components/UsersSelectSearch';
interface Props {
addMember: (member: T.OrganizationMember) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { keyBy, pickBy, some } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import * as React from 'react';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import OrganizationGroupCheckbox from '../organizations/components/OrganizationGroupCheckbox';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getUserGroups, UserGroup } from '../../api/users';
+import OrganizationGroupCheckbox from '../organizations/components/OrganizationGroupCheckbox';
interface Props {
onClose: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import MembersListItem from './MembersListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getAlmMembersUrl, sanitizeAlmId } from '../../helpers/almIntegrations';
export interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import ActionsDropdown, {
ActionsDropdownDivider,
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import RemoveMemberForm from './RemoveMemberForm';
-import ManageMemberGroupsForm from './ManageMemberGroupsForm';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import Avatar from '../../components/ui/Avatar';
+import ManageMemberGroupsForm from './ManageMemberGroupsForm';
+import RemoveMemberForm from './RemoveMemberForm';
interface Props {
member: T.OrganizationMember;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import DocTooltip from '../../components/docs/DocTooltip';
+import { isGithub, sanitizeAlmId } from '../../helpers/almIntegrations';
import AddMemberForm from './AddMemberForm';
import SyncMemberForm from './SyncMemberForm';
-import DocTooltip from '../../components/docs/DocTooltip';
-import { sanitizeAlmId, isGithub } from '../../helpers/almIntegrations';
export interface Props {
handleAddMember: (member: T.OrganizationMember) => void;
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import MembersPageHeader from './MembersPageHeader';
-import MembersListHeader from './MembersListHeader';
-import MembersList from './MembersList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { addMember, removeMember, searchMembers } from '../../api/organizations';
+import { addUserToGroup, removeUserFromGroup, searchUsersGroups } from '../../api/user_groups';
import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
-import { searchMembers, addMember, removeMember } from '../../api/organizations';
-import { searchUsersGroups, addUserToGroup, removeUserFromGroup } from '../../api/user_groups';
+import MembersList from './MembersList';
+import MembersListHeader from './MembersListHeader';
+import MembersPageHeader from './MembersPageHeader';
interface Props {
currentUser: T.LoggedInUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import OrganizationMembers from './OrganizationMembers';
-import { getOrganizationByKey, Store } from '../../store/rootReducer';
import { withCurrentUser } from '../../components/hoc/withCurrentUser';
+import { getOrganizationByKey, Store } from '../../store/rootReducer';
+import OrganizationMembers from './OrganizationMembers';
interface OwnProps {
params: { organizationKey: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClose: () => void;
import * as React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import RadioCard from 'sonar-ui-common/components/controls/RadioCard';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { setOrganizationMemberSync, syncMembers } from '../../api/organizations';
import { sanitizeAlmId } from '../../helpers/almIntegrations';
import { fetchOrganization } from '../../store/rootActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, submit } from 'sonar-ui-common/helpers/testUtils';
-import AddMemberForm from '../AddMemberForm';
import { searchMembers } from '../../../api/organizations';
+import AddMemberForm from '../AddMemberForm';
jest.mock('../../../api/organizations', () => ({
searchMembers: jest.fn().mockResolvedValue({ paging: {}, users: [] })
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ManageMemberGroupsForm from '../ManageMemberGroupsForm';
const member = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import MembersList from '../MembersList';
+import * as React from 'react';
import { mockLoggedInUser, mockOrganization } from '../../../helpers/testMocks';
+import MembersList from '../MembersList';
const members = [
{ login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 },
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import MembersListHeader, { Props } from '../MembersListHeader';
+import * as React from 'react';
import { mockOrganization, mockOrganizationWithAlm } from '../../../helpers/testMocks';
+import MembersListHeader, { Props } from '../MembersListHeader';
it('should render without the total', () => {
expect(shallowRender({ total: undefined })).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import { mockOrganization, mockOrganizationWithAdminActions } from '../../../helpers/testMocks';
import MembersListItem from '../MembersListItem';
-import { mockOrganizationWithAdminActions, mockOrganization } from '../../../helpers/testMocks';
it('should not render actions and groups for non admin', () => {
expect(shallowRender({ organization: mockOrganization() })).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import MembersPageHeader, { Props } from '../MembersPageHeader';
+import * as React from 'react';
import {
mockOrganization,
- mockOrganizationWithAlm,
- mockOrganizationWithAdminActions
+ mockOrganizationWithAdminActions,
+ mockOrganizationWithAlm
} from '../../../helpers/testMocks';
+import MembersPageHeader, { Props } from '../MembersPageHeader';
it('should render correctly', () => {
expect(shallowRender({ loading: true })).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import OrganizationMembers from '../OrganizationMembers';
-import { searchMembers, addMember, removeMember } from '../../../api/organizations';
-import { searchUsersGroups, addUserToGroup, removeUserFromGroup } from '../../../api/user_groups';
+import { addMember, removeMember, searchMembers } from '../../../api/organizations';
+import { addUserToGroup, removeUserFromGroup, searchUsersGroups } from '../../../api/user_groups';
import {
mockLoggedInUser,
mockOrganization,
mockOrganizationWithAdminActions,
mockOrganizationWithAlm
} from '../../../helpers/testMocks';
+import OrganizationMembers from '../OrganizationMembers';
jest.mock('../../../api/organizations', () => ({
addMember: jest.fn().mockResolvedValue({ login: 'bar', name: 'Bar', groupCount: 1 }),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import RemoveMemberForm from '../RemoveMemberForm';
+import * as React from 'react';
import { mockEvent } from '../../../helpers/testMocks';
+import RemoveMemberForm from '../RemoveMemberForm';
const member = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 };
const organization = { key: 'myorg', name: 'MyOrg' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { SyncMemberForm } from '../SyncMemberForm';
import { setOrganizationMemberSync, syncMembers } from '../../../api/organizations';
import { mockOrganizationWithAlm } from '../../../helpers/testMocks';
+import { SyncMemberForm } from '../SyncMemberForm';
jest.mock('../../../api/organizations', () => ({
setOrganizationMemberSync: jest.fn().mockResolvedValue(undefined),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as actions from '../actions';
-import { mockOrganization } from '../../../helpers/testMocks';
import { deleteOrganization, updateOrganization } from '../../../api/organizations';
+import { mockOrganization } from '../../../helpers/testMocks';
+import * as actions from '../actions';
jest.mock('../../../api/organizations', () => ({
deleteOrganization: jest.fn().mockResolvedValue({}),
import { Dispatch } from 'redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
import * as api from '../../api/organizations';
-import * as actions from '../../store/organizations';
import { addGlobalSuccessMessage } from '../../store/globalMessages';
+import * as actions from '../../store/organizations';
export function updateOrganization(key: string, changes: T.OrganizationBase) {
return (dispatch: Dispatch<any>) => {
import * as React from 'react';
import { connect } from 'react-redux';
import { RouterState } from 'react-router';
-import { getCurrentUser, getOrganizationByKey, Store } from '../../../store/rootReducer';
import handleRequiredAuthorization from '../../../app/utils/handleRequiredAuthorization';
import { isLoggedIn } from '../../../helpers/users';
+import { getCurrentUser, getOrganizationByKey, Store } from '../../../store/rootReducer';
interface StateToProps {
currentUser: T.CurrentUser;
*/
import * as React from 'react';
import IdentityProviderLink from 'sonar-ui-common/components/controls/IdentityProviderLink';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { save } from 'sonar-ui-common/helpers/storage';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import {
- BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP,
- BIND_ORGANIZATION_KEY
-} from '../../create/organization/utils';
import { getAlmAppInfo } from '../../../api/alm-integration';
import { sanitizeAlmId } from '../../../helpers/almIntegrations';
+import {
+ BIND_ORGANIZATION_KEY,
+ BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP
+} from '../../create/organization/utils';
interface Props {
currentUser: T.LoggedInUser;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import InstanceMessage from '../../../components/common/InstanceMessage';
-import { deleteOrganization } from '../actions';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getOrganizationBilling } from '../../../api/organizations';
-import { isSonarCloud } from '../../../helpers/system';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
+import InstanceMessage from '../../../components/common/InstanceMessage';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import { isSonarCloud } from '../../../helpers/system';
+import { deleteOrganization } from '../actions';
interface DispatchToProps {
deleteOrganization: (key: string) => Promise<void>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { debounce } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
-import { debounce } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import OrganizationBind from './OrganizationBind';
-import OrganizationDelete from './OrganizationDelete';
-import { updateOrganization } from '../actions';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { hasAdvancedALMIntegration } from '../../../helpers/almIntegrations';
+import { updateOrganization } from '../actions';
+import OrganizationBind from './OrganizationBind';
+import OrganizationDelete from './OrganizationDelete';
interface DispatchProps {
updateOrganization: (organization: string, changes: T.OrganizationBase) => Promise<any>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
import OnboardingAddMembersIcon from 'sonar-ui-common/components/icons/OnboardingAddMembersIcon';
import OnboardingProjectIcon from 'sonar-ui-common/components/icons/OnboardingProjectIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Button } from 'sonar-ui-common/components/controls/buttons';
import { OnboardingContextShape } from '../../../app/components/OnboardingContext';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import '../../tutorials/styles.css';
import './OrganizationEmpty.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
import * as React from 'react';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
-import { Location } from 'history';
-import OrganizationNavigation from '../navigation/OrganizationNavigation';
-import NotFound from '../../../app/components/NotFound';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import NotFound from '../../../app/components/NotFound';
+import { fetchOrganization } from '../../../store/rootActions';
import {
- getOrganizationByKey,
getCurrentUser,
getMyOrganizations,
+ getOrganizationByKey,
Store
} from '../../../store/rootReducer';
-import { fetchOrganization } from '../../../store/rootActions';
+import OrganizationNavigation from '../navigation/OrganizationNavigation';
interface OwnProps {
children?: React.ReactNode;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import AllProjectsContainer from '../../projects/components/AllProjectsContainer';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import AllProjectsContainer from '../../projects/components/AllProjectsContainer';
interface Props {
location: { pathname: string; query: T.Dict<string> };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
import { Location } from 'history';
+import * as React from 'react';
import { hasAdminAccess, OrganizationAccess } from '../OrganizationAccessContainer';
jest.mock('../../../../app/utils/handleRequiredAuthorization', () => ({ default: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { save } from 'sonar-ui-common/helpers/storage';
-import OrganizationBind from '../OrganizationBind';
-import {
- BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP,
- BIND_ORGANIZATION_KEY
-} from '../../../create/organization/utils';
import { getAlmAppInfo } from '../../../../api/alm-integration';
import {
mockAlmApplication,
mockLoggedInUser,
mockOrganization
} from '../../../../helpers/testMocks';
+import {
+ BIND_ORGANIZATION_KEY,
+ BIND_ORGANIZATION_REDIRECT_TO_ORG_TIMESTAMP
+} from '../../../create/organization/utils';
+import OrganizationBind from '../OrganizationBind';
jest.mock('../../../../api/alm-integration', () => ({
getAlmAppInfo: jest.fn(() => Promise.resolve({ application: mockAlmApplication() }))
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { OrganizationDelete } from '../OrganizationDelete';
import { getOrganizationBilling } from '../../../../api/organizations';
import { isSonarCloud } from '../../../../helpers/system';
+import { OrganizationDelete } from '../OrganizationDelete';
jest.mock('../../../../api/organizations', () => ({
getOrganizationBilling: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { OrganizationEdit } from '../OrganizationEdit';
+import * as React from 'react';
import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import { OrganizationEdit } from '../OrganizationEdit';
it('smoke test', () => {
const organization = { key: 'foo', name: 'Foo' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { OrganizationEmpty } from '../OrganizationEmpty';
import {
- mockRouter,
mockOrganization,
- mockOrganizationWithAlm
+ mockOrganizationWithAlm,
+ mockRouter
} from '../../../../helpers/testMocks';
+import { OrganizationEmpty } from '../OrganizationEmpty';
const organization: T.Organization = mockOrganization();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationGroupCheckbox from '../OrganizationGroupCheckbox';
const group = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
import { Location } from 'history';
+import * as React from 'react';
import { OrganizationPage } from '../OrganizationPage';
const fetchOrganization = jest.fn().mockResolvedValue(undefined);
*/
import * as React from 'react';
import ContextNavBar from 'sonar-ui-common/components/ui/ContextNavBar';
+import { rawSizes } from '../../../app/theme';
import OrganizationNavigationHeader from './OrganizationNavigationHeader';
-import OrganizationNavigationMeta from './OrganizationNavigationMeta';
import OrganizationNavigationMenuContainer from './OrganizationNavigationMenuContainer';
-import { rawSizes } from '../../../app/theme';
+import OrganizationNavigationMeta from './OrganizationNavigationMeta';
interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
location: { pathname: string };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
location: { pathname: string };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { Link } from 'react-router';
-import { sortBy } from 'lodash';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
import OrganizationListItem from '../../../components/ui/OrganizationListItem';
import {
- sanitizeAlmId,
+ getUserAlmKey,
hasAdvancedALMIntegration,
- getUserAlmKey
+ sanitizeAlmId
} from '../../../helpers/almIntegrations';
export interface Props {
import { Link } from 'react-router';
import NavBarTabs from 'sonar-ui-common/components/ui/NavBarTabs';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import OrganizationNavigationExtensions from './OrganizationNavigationExtensions';
-import OrganizationNavigationAdministration from './OrganizationNavigationAdministration';
-import { getQualityGatesUrl } from '../../../helpers/urls';
import { hasPrivateAccess, isCurrentUserMemberOf } from '../../../helpers/organizations';
+import { getQualityGatesUrl } from '../../../helpers/urls';
import { getCurrentUser, getMyOrganizations, Store } from '../../../store/rootReducer';
+import OrganizationNavigationAdministration from './OrganizationNavigationAdministration';
+import OrganizationNavigationExtensions from './OrganizationNavigationExtensions';
interface StateToProps {
currentUser: T.CurrentUser;
import { translate } from 'sonar-ui-common/helpers/l10n';
import HomePageSelect from '../../../components/controls/HomePageSelect';
import DocTooltip from '../../../components/docs/DocTooltip';
-import { isSonarCloud } from '../../../helpers/system';
import { hasPrivateAccess, isPaidOrganization } from '../../../helpers/organizations';
+import { isSonarCloud } from '../../../helpers/system';
interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationNavigation from '../OrganizationNavigation';
it('render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationNavigationAdministration from '../OrganizationNavigationAdministration';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import OrganizationNavigationHeader, { Props } from '../OrganizationNavigationHeader';
+import * as React from 'react';
import {
- mockOrganizationWithAlm,
mockCurrentUser,
- mockLoggedInUser
+ mockLoggedInUser,
+ mockOrganizationWithAlm
} from '../../../../helpers/testMocks';
+import OrganizationNavigationHeader, { Props } from '../OrganizationNavigationHeader';
it('renders', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { hasPrivateAccess, isCurrentUserMemberOf } from '../../../../helpers/organizations';
import { OrganizationNavigationMenu } from '../OrganizationNavigationMenuContainer';
-import { isCurrentUserMemberOf, hasPrivateAccess } from '../../../../helpers/organizations';
jest.mock('../../../../helpers/organizations', () => ({
isCurrentUserMemberOf: jest.fn().mockReturnValue(true),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationNavigationMeta from '../OrganizationNavigationMeta';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: () => true }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { RouterState, RedirectFunction } from 'react-router';
+import { RedirectFunction, RouterState } from 'react-router';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import codingRulesRoutes from '../coding-rules/routes';
import qualityGatesRoutes from '../quality-gates/routes';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { BadgeType } from './utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Select from 'sonar-ui-common/components/controls/Select';
-import { BadgeColors, BadgeType, BadgeOptions, BadgeFormats } from './utils';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
import { fetchWebApi } from '../../../api/web-api';
+import { BadgeColors, BadgeFormats, BadgeOptions, BadgeType } from './utils';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import BadgeButton from './BadgeButton';
-import BadgeParams from './BadgeParams';
-import { BadgeType, BadgeOptions, getBadgeUrl, getBadgeSnippet } from './utils';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../components/common/CodeSnippet';
import { getBranchLikeQuery } from '../../../helpers/branches';
import { isSonarCloud } from '../../../helpers/system';
+import BadgeButton from './BadgeButton';
+import BadgeParams from './BadgeParams';
import './styles.css';
+import { BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from './utils';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import BadgeButton from '../BadgeButton';
import { BadgeType } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import BadgeParams from '../BadgeParams';
import { BadgeType } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Location } from 'sonar-ui-common/helpers/urls';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import BadgesModal from '../BadgesModal';
+import { Location } from 'sonar-ui-common/helpers/urls';
import { isSonarCloud } from '../../../../helpers/system';
+import BadgesModal from '../BadgesModal';
jest.mock('sonar-ui-common/helpers/urls', () => ({
getHostUrl: () => 'host',
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { Location } from 'sonar-ui-common/helpers/urls';
-import { getBadgeUrl, BadgeOptions, BadgeType, getBadgeSnippet } from '../utils';
+import { BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from '../utils';
jest.mock('sonar-ui-common/helpers/urls', () => ({
...require.requireActual('sonar-ui-common/helpers/urls'),
*/
import * as React from 'react';
import { Helmet } from 'react-helmet';
-import { getBaseUrl, getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import OverviewApp from './OverviewApp';
+import { getBaseUrl, getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
-import { getProjectUrl } from '../../../helpers/urls';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import { isPullRequest, isShortLivingBranch } from '../../../helpers/branches';
import { isSonarCloud } from '../../../helpers/system';
-import { isShortLivingBranch, isPullRequest } from '../../../helpers/branches';
+import { getProjectUrl } from '../../../helpers/urls';
+import OverviewApp from './OverviewApp';
const EmptyOverview = lazyLoad(() => import('./EmptyOverview'));
const ReviewApp = lazyLoad(() => import('../pullRequests/ReviewApp'));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { sortBy } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import DateTooltipFormatter from '../../../components/intl/DateTooltipFormatter';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getApplicationLeak } from '../../../api/application';
import DateFromNow from '../../../components/intl/DateFromNow';
+import DateTooltipFormatter from '../../../components/intl/DateTooltipFormatter';
interface Props {
branch?: T.LongLivingBranch;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { connect } from 'react-redux';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isBranch, isLongLivingBranch, isMainBranch } from '../../../helpers/branches';
+import { isSonarCloud } from '../../../helpers/system';
+import { isLoggedIn } from '../../../helpers/users';
+import { getCurrentUser, Store } from '../../../store/rootReducer';
import AnalyzeTutorial from '../../tutorials/analyzeProject/AnalyzeTutorial';
import AnalyzeTutorialSonarCloud from '../../tutorials/analyzeProject/AnalyzeTutorialSonarCloud';
import MetaContainer from '../meta/MetaContainer';
-import { isLongLivingBranch, isBranch, isMainBranch } from '../../../helpers/branches';
-import { isLoggedIn } from '../../../helpers/users';
-import { getCurrentUser, Store } from '../../../store/rootReducer';
-import { isSonarCloud } from '../../../helpers/system';
interface OwnProps {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
-import { injectIntl, InjectedIntlProps } from 'react-intl';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import DateFromNow from '../../../components/intl/DateFromNow';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DateFormatter, { longFormatterOption } from '../../../components/intl/DateFormatter';
+import DateFromNow from '../../../components/intl/DateFromNow';
import DateTimeFormatter, { formatterOption } from '../../../components/intl/DateTimeFormatter';
import { getPeriodDate, getPeriodLabel } from '../../../helpers/periods';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { uniq } from 'lodash';
+import * as React from 'react';
import { connect } from 'react-redux';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import ApplicationQualityGate from '../qualityGate/ApplicationQualityGate';
-import Bugs from '../main/Bugs';
-import CodeSmells from '../main/CodeSmells';
-import Coverage from '../main/Coverage';
-import Duplications from '../main/Duplications';
-import VulnerabilitiesAndHotspots from '../main/VulnerabilitiesAndHotspots';
-import MetaContainer from '../meta/MetaContainer';
-import QualityGate from '../qualityGate/QualityGate';
-import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import { getMeasuresAndMeta } from '../../../api/measures';
import { getAllTimeMachineData } from '../../../api/time-machine';
-import { enhanceMeasuresWithMetrics } from '../../../helpers/measures';
-import { getLeakPeriod } from '../../../helpers/periods';
-import { METRICS, HISTORY_METRICS_LIST } from '../utils';
-import {
- DEFAULT_GRAPH,
- getDisplayedHistoryMetrics,
- getProjectActivityGraph
-} from '../../projectActivity/utils';
+import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import {
- isSameBranchLike,
+ getBranchLikeDisplayName,
getBranchLikeQuery,
isLongLivingBranch,
isMainBranch,
- getBranchLikeDisplayName
+ isSameBranchLike
} from '../../../helpers/branches';
+import { enhanceMeasuresWithMetrics } from '../../../helpers/measures';
+import { getLeakPeriod } from '../../../helpers/periods';
import { fetchMetrics } from '../../../store/rootActions';
import { getMetrics, Store } from '../../../store/rootReducer';
+import {
+ DEFAULT_GRAPH,
+ getDisplayedHistoryMetrics,
+ getProjectActivityGraph
+} from '../../projectActivity/utils';
+import Bugs from '../main/Bugs';
+import CodeSmells from '../main/CodeSmells';
+import Coverage from '../main/Coverage';
+import Duplications from '../main/Duplications';
+import VulnerabilitiesAndHotspots from '../main/VulnerabilitiesAndHotspots';
+import MetaContainer from '../meta/MetaContainer';
+import ApplicationQualityGate from '../qualityGate/ApplicationQualityGate';
+import QualityGate from '../qualityGate/QualityGate';
import '../styles.css';
+import { HISTORY_METRICS_LIST, METRICS } from '../utils';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { max } from 'd3-array';
+import * as React from 'react';
import LineChart from 'sonar-ui-common/components/charts/LineChart';
const HEIGHT = 80;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { App } from '../App';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import { App } from '../App';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import ApplicationLeakPeriodLegend from '../ApplicationLeakPeriodLegend';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { EmptyOverview, WarningMessage } from '../EmptyOverview';
+import * as React from 'react';
import {
- mockPullRequest,
+ mockComponent,
mockLoggedInUser,
mockMainBranch,
- mockComponent
+ mockPullRequest
} from '../../../../helpers/testMocks';
+import { EmptyOverview, WarningMessage } from '../EmptyOverview';
const branch = mockMainBranch();
const component = mockComponent({ version: '0.0.1' });
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInDays from 'date-fns/difference_in_days';
-import { InjectedIntlProps } from 'react-intl';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { InjectedIntlProps } from 'react-intl';
import { LeakPeriodLegend } from '../LeakPeriodLegend';
jest.mock('date-fns/difference_in_days', () => jest.fn().mockReturnValue(10));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { OverviewApp } from '../OverviewApp';
import { getMeasuresAndMeta } from '../../../../api/measures';
import { getAllTimeMachineData } from '../../../../api/time-machine';
import {
- mockMainBranch,
mockComponent,
- mockMetric,
+ mockLongLivingBranch,
+ mockMainBranch,
mockMeasure,
- mockLongLivingBranch
+ mockMetric
} from '../../../../helpers/testMocks';
+import { OverviewApp } from '../OverviewApp';
jest.mock('../../../../api/measures', () => {
const { mockMeasure, mockMetric } = getMockHelpers();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import Timeline from '../Timeline';
import * as React from 'react';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Analysis from './Analysis';
import { getProjectActivity } from '../../../api/projectActivity';
import PreviewGraph from '../../../components/preview-graph/PreviewGraph';
import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
import { getActivityUrl } from '../../../helpers/urls';
+import Analysis from './Analysis';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Event from './Event';
import DateTooltipFormatter from '../../../components/intl/DateTooltipFormatter';
+import Event from './Event';
interface Props {
analysis: T.Analysis;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Level from 'sonar-ui-common/components/ui/Level';
-import { isRichQualityGateEvent } from '../../projectActivity/components/RichQualityGateEventInner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { isDefinitionChangeEvent } from '../../projectActivity/components/DefinitionChangeEventInner';
+import { isRichQualityGateEvent } from '../../projectActivity/components/RichQualityGateEventInner';
interface Props {
event: T.AnalysisEvent;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalysesList from '../AnalysesList';
it('should render show more link', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Analysis from '../Analysis';
const ANALYSIS = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Event from '../Event';
+import * as React from 'react';
import { RichQualityGateEvent } from '../../../projectActivity/components/RichQualityGateEventInner';
+import Event from '../Event';
const EVENT = { key: '1', category: 'OTHER', name: 'test' };
const VERSION = { key: '2', category: 'VERSION', name: '6.5-SNAPSHOT' };
import * as React from 'react';
import BugIcon from 'sonar-ui-common/components/icons/BugIcon';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import enhance, { ComposedProps } from './enhance';
-import ApplicationLeakPeriodLegend from '../components/ApplicationLeakPeriodLegend';
import DocTooltip from '../../../components/docs/DocTooltip';
import DateFromNow from '../../../components/intl/DateFromNow';
+import { isLongLivingBranch } from '../../../helpers/branches';
+import ApplicationLeakPeriodLegend from '../components/ApplicationLeakPeriodLegend';
import LeakPeriodLegend from '../components/LeakPeriodLegend';
import { getMetricName } from '../utils';
-import { isLongLivingBranch } from '../../../helpers/branches';
+import enhance, { ComposedProps } from './enhance';
export class Bugs extends React.PureComponent<ComposedProps> {
renderHeader() {
import * as React from 'react';
import CodeSmellIcon from 'sonar-ui-common/components/icons/CodeSmellIcon';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import enhance, { ComposedProps } from './enhance';
import DocTooltip from '../../../components/docs/DocTooltip';
-import { getMetricName } from '../utils';
import DrilldownLink from '../../../components/shared/DrilldownLink';
+import { getMetricName } from '../utils';
+import enhance, { ComposedProps } from './enhance';
export class CodeSmells extends React.PureComponent<ComposedProps> {
renderHeader() {
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import enhance, { ComposedProps } from './enhance';
import DocTooltip from '../../../components/docs/DocTooltip';
import DrilldownLink from '../../../components/shared/DrilldownLink';
-import { getMetricName } from '../utils';
-import { getPeriodValue } from '../../../helpers/measures';
import CoverageRating from '../../../components/ui/CoverageRating';
+import { getPeriodValue } from '../../../helpers/measures';
+import { getMetricName } from '../utils';
+import enhance, { ComposedProps } from './enhance';
export class Coverage extends React.PureComponent<ComposedProps> {
getCoverage() {
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import enhance, { ComposedProps } from './enhance';
import DocTooltip from '../../../components/docs/DocTooltip';
import DrilldownLink from '../../../components/shared/DrilldownLink';
-import { getMetricName } from '../utils';
import { getPeriodValue } from '../../../helpers/measures';
+import { getMetricName } from '../utils';
+import enhance, { ComposedProps } from './enhance';
export class Duplications extends React.PureComponent<ComposedProps> {
renderHeader() {
import * as React from 'react';
import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
-import enhance, { ComposedProps } from './enhance';
import DocTooltip from '../../../components/docs/DocTooltip';
import { getMetricName } from '../utils';
+import enhance, { ComposedProps } from './enhance';
export class VulnerabiltiesAndHotspots extends React.PureComponent<ComposedProps> {
renderHeader() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Bugs from '../Bugs';
-import { ComposedProps } from '../enhance';
+import * as React from 'react';
import {
mockComponent,
mockMainBranch,
mockMeasureEnhanced,
mockMetric
} from '../../../../helpers/testMocks';
+import Bugs from '../Bugs';
+import { ComposedProps } from '../enhance';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CodeSmells from '../CodeSmells';
-import { ComposedProps } from '../enhance';
+import * as React from 'react';
import {
mockComponent,
mockMainBranch,
mockMeasureEnhanced,
mockMetric
} from '../../../../helpers/testMocks';
+import CodeSmells from '../CodeSmells';
+import { ComposedProps } from '../enhance';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Coverage from '../Coverage';
-import { ComposedProps } from '../enhance';
+import * as React from 'react';
import {
mockComponent,
mockMainBranch,
mockMeasureEnhanced,
mockMetric
} from '../../../../helpers/testMocks';
+import Coverage from '../Coverage';
+import { ComposedProps } from '../enhance';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Duplications from '../Duplications';
-import { ComposedProps } from '../enhance';
+import * as React from 'react';
import {
mockComponent,
mockMainBranch,
mockMeasureEnhanced,
mockMetric
} from '../../../../helpers/testMocks';
+import Duplications from '../Duplications';
+import { ComposedProps } from '../enhance';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import VulnerabilitiesAndHotspots from '../VulnerabilitiesAndHotspots';
-import { ComposedProps } from '../enhance';
+import * as React from 'react';
import {
mockComponent,
mockMainBranch,
mockMeasureEnhanced,
mockMetric
} from '../../../../helpers/testMocks';
+import { ComposedProps } from '../enhance';
+import VulnerabilitiesAndHotspots from '../VulnerabilitiesAndHotspots';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import HistoryIcon from 'sonar-ui-common/components/icons/HistoryIcon';
import { Link } from 'react-router';
-import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import HistoryIcon from 'sonar-ui-common/components/icons/HistoryIcon';
import Rating from 'sonar-ui-common/components/ui/Rating';
-import DrilldownLink from '../../../components/shared/DrilldownLink';
-import Timeline from '../components/Timeline';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getWrappedDisplayName } from '../../../components/hoc/utils';
+import DrilldownLink from '../../../components/shared/DrilldownLink';
+import { getBranchLikeQuery } from '../../../helpers/branches';
import {
- isDiffMetric,
getPeriodValue,
+ getRatingTooltip,
getShortType,
- getRatingTooltip
+ isDiffMetric
} from '../../../helpers/measures';
import { getPeriodDate } from '../../../helpers/periods';
import {
getComponentIssuesUrl,
getMeasureHistoryUrl
} from '../../../helpers/urls';
-import { getBranchLikeQuery } from '../../../helpers/branches';
+import Timeline from '../components/Timeline';
export interface EnhanceProps {
branchLike?: T.BranchLike;
import { connect } from 'react-redux';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import MetaKey from './MetaKey';
-import MetaOrganizationKey from './MetaOrganizationKey';
-import MetaLinks from './MetaLinks';
-import MetaQualityGate from './MetaQualityGate';
-import MetaQualityProfiles from './MetaQualityProfiles';
-import MetaSize from './MetaSize';
-import MetaTags from './MetaTags';
-import AnalysesList from '../events/AnalysesList';
+import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
import { hasPrivateAccess } from '../../../helpers/organizations';
import {
+ getAppState,
getCurrentUser,
getMyOrganizations,
getOrganizationByKey,
- Store,
- getAppState
+ Store
} from '../../../store/rootReducer';
-import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
+import AnalysesList from '../events/AnalysesList';
+import MetaKey from './MetaKey';
+import MetaLinks from './MetaLinks';
+import MetaOrganizationKey from './MetaOrganizationKey';
+import MetaQualityGate from './MetaQualityGate';
+import MetaQualityProfiles from './MetaQualityProfiles';
+import MetaSize from './MetaSize';
+import MetaTags from './MetaTags';
const BadgesModal = lazyLoad(() => import('../badges/BadgesModal'), 'BadgesModal');
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
componentKey: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ProjectLinkIcon from 'sonar-ui-common/components/icons/ProjectLinkIcon';
import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
+import ProjectLinkIcon from 'sonar-ui-common/components/icons/ProjectLinkIcon';
import isValidUri from '../../../app/utils/isValidUri';
import { getLinkName } from '../../projectLinks/utils';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import MetaLink from './MetaLink';
-import { orderLinks } from '../../projectLinks/utils';
import { getProjectLinks } from '../../../api/projectLinks';
+import { orderLinks } from '../../projectLinks/utils';
+import MetaLink from './MetaLink';
interface Props {
component: T.LightComponent;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
organization: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import { getQualityProfileUrl } from '../../../helpers/urls';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { searchRules } from '../../../api/rules';
+import { getQualityProfileUrl } from '../../../helpers/urls';
import { getLanguages, Store } from '../../../store/rootReducer';
interface StateProps {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import SizeRating from 'sonar-ui-common/components/ui/SizeRating';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import DrilldownLink from '../../../components/shared/DrilldownLink';
import LanguageDistributionContainer from '../../../components/charts/LanguageDistributionContainer';
+import DrilldownLink from '../../../components/shared/DrilldownLink';
import { getMetricName } from '../utils';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import MetaTagsSelector from './MetaTagsSelector';
-import TagsList from '../../../components/tags/TagsList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { setProjectTags } from '../../../api/components';
+import TagsList from '../../../components/tags/TagsList';
+import MetaTagsSelector from './MetaTagsSelector';
interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { difference, without } from 'lodash';
import * as React from 'react';
-import { without, difference } from 'lodash';
-import TagsSelector from '../../../components/tags/TagsSelector';
import { searchProjectTags } from '../../../api/components';
+import TagsSelector from '../../../components/tags/TagsSelector';
interface Props {
project: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Meta } from '../MetaContainer';
+import * as React from 'react';
import {
mockAppState,
+ mockComponent,
mockLoggedInUser,
- mockOrganization,
- mockComponent
+ mockOrganization
} from '../../../../helpers/testMocks';
+import { Meta } from '../MetaContainer';
it('should render correctly', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import MetaLink from '../MetaLink';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { MetaQualityProfiles } from '../MetaQualityProfiles';
-import { mockLanguage, mockQualityProfile } from '../../../../helpers/testMocks';
import { searchRules } from '../../../../api/rules';
+import { mockLanguage, mockQualityProfile } from '../../../../helpers/testMocks';
+import { MetaQualityProfiles } from '../MetaQualityProfiles';
jest.mock('../../../../api/rules', () => {
return {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import MetaTags from '../MetaTags';
+import * as React from 'react';
import { mockComponent } from '../../../../helpers/testMocks';
+import MetaTags from '../MetaTags';
const component = mockComponent({
configuration: {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order, import/first */
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
+import * as React from 'react';
+import { searchProjectTags } from '../../../../api/components';
import MetaTagsSelector from '../MetaTagsSelector';
jest.mock('../../../../api/components', () => ({
return lodash;
});
-import { searchProjectTags } from '../../../../api/components';
-
it('searches tags on mount', () => {
(searchProjectTags as jest.Mock).mockImplementation(() =>
Promise.resolve({ tags: ['foo', 'bar'] })
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { findMeasure } from '../../../helpers/measures';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { getMetricName, ISSUETYPE_MAP, IssueType } from '../utils';
+import DocTooltip from '../../../components/docs/DocTooltip';
import { getLeakValue } from '../../../components/measure/utils';
import { getBranchLikeQuery } from '../../../helpers/branches';
-import { getComponentIssuesUrl } from '../../../helpers/urls';
import { findMeasure } from '../../../helpers/measures';
-import DocTooltip from '../../../components/docs/DocTooltip';
+import { getComponentIssuesUrl } from '../../../helpers/urls';
+import { getMetricName, IssueType, ISSUETYPE_MAP } from '../utils';
export interface Props {
branchLike?: T.ShortLivingBranch | T.PullRequest;
import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import Rating from 'sonar-ui-common/components/ui/Rating';
-import DrilldownLink from '../../../components/shared/DrilldownLink';
-import { getRatingName, ISSUETYPE_MAP, IssueType } from '../utils';
import { getLeakValue, getRatingTooltip } from '../../../components/measure/utils';
+import DrilldownLink from '../../../components/shared/DrilldownLink';
import { findMeasure } from '../../../helpers/measures';
+import { getRatingName, IssueType, ISSUETYPE_MAP } from '../utils';
interface Props {
branchLike?: T.ShortLivingBranch | T.PullRequest;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
import * as classNames from 'classnames';
-import { Link } from 'react-router';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Link } from 'react-router';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import { getQualityGateUrl, getQualityGatesUrl } from '../../../helpers/urls';
-import { isSonarCloud } from '../../../helpers/system';
+import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { colors } from '../../../app/theme';
+import { isSonarCloud } from '../../../helpers/system';
+import { getQualityGatesUrl, getQualityGateUrl } from '../../../helpers/urls';
interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { getLeakValue } from '../../../components/measure/utils';
import DrilldownLink from '../../../components/shared/DrilldownLink';
import { findMeasure } from '../../../helpers/measures';
-import { getLeakValue } from '../../../components/measure/utils';
import { MEASUREMENTS_MAP, MeasurementType } from '../utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { connect } from 'react-redux';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import AfterMergeEstimate from './AfterMergeEstimate';
-import LargeQualityGateBadge from './LargeQualityGateBadge';
-import IssueLabel from './IssueLabel';
-import IssueRating from './IssueRating';
-import MeasurementLabel from './MeasurementLabel';
-import DocTooltip from '../../../components/docs/DocTooltip';
-import QualityGateConditions from '../qualityGate/QualityGateConditions';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getMeasures } from '../../../api/measures';
-import { PR_METRICS, IssueType, MeasurementType } from '../utils';
+import DocTooltip from '../../../components/docs/DocTooltip';
import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
import { isSameStatusConditionList } from '../../../helpers/qualityGates';
-import { Store, getBranchStatusByBranchLike } from '../../../store/rootReducer';
import { fetchBranchStatus } from '../../../store/rootActions';
+import { getBranchStatusByBranchLike, Store } from '../../../store/rootReducer';
+import QualityGateConditions from '../qualityGate/QualityGateConditions';
import '../styles.css';
+import { IssueType, MeasurementType, PR_METRICS } from '../utils';
+import AfterMergeEstimate from './AfterMergeEstimate';
+import IssueLabel from './IssueLabel';
+import IssueRating from './IssueRating';
+import LargeQualityGateBadge from './LargeQualityGateBadge';
+import MeasurementLabel from './MeasurementLabel';
interface OwnProps {
branchLike: T.PullRequest | T.ShortLivingBranch;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import AfterMergeEstimate from '../AfterMergeEstimate';
+import * as React from 'react';
import { mockMeasure } from '../../../../helpers/testMocks';
+import AfterMergeEstimate from '../AfterMergeEstimate';
it('should render correctly for coverage', () => {
expect(shallowRender({ measures: [mockMeasure({ metric: 'coverage' })] })).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockMeasure, mockPullRequest } from '../../../../helpers/testMocks';
import IssueLabel, { Props } from '../IssueLabel';
-import { mockComponent, mockPullRequest, mockMeasure } from '../../../../helpers/testMocks';
it('should render correctly for bugs', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockMeasure, mockPullRequest } from '../../../../helpers/testMocks';
import IssueRating from '../IssueRating';
-import { mockPullRequest, mockComponent, mockMeasure } from '../../../../helpers/testMocks';
it('should render correctly for bugs', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import LargeQualityGateBadge from '../LargeQualityGateBadge';
-import { mockComponent } from '../../../../helpers/testMocks';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import { mockComponent } from '../../../../helpers/testMocks';
+import LargeQualityGateBadge from '../LargeQualityGateBadge';
jest.mock('../../../../helpers/system', () => ({
isSonarCloud: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockMeasure, mockShortLivingBranch } from '../../../../helpers/testMocks';
import MeasurementLabel from '../MeasurementLabel';
-import { mockShortLivingBranch, mockComponent, mockMeasure } from '../../../../helpers/testMocks';
it('should render correctly for coverage', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { ReviewApp } from '../ReviewApp';
import { getMeasures } from '../../../../api/measures';
import {
mockComponent,
mockPullRequest,
mockQualityGateStatusCondition
} from '../../../../helpers/testMocks';
+import { ReviewApp } from '../ReviewApp';
jest.mock('../../../../api/measures', () => {
const { mockMeasure } = require.requireActual('../../../../helpers/testMocks');
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { keyBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import Level from 'sonar-ui-common/components/ui/Level';
-import ApplicationQualityGateProject from './ApplicationQualityGateProject';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { ApplicationProject, getApplicationQualityGate } from '../../../api/quality-gates';
import DocTooltip from '../../../components/docs/DocTooltip';
-import { getApplicationQualityGate, ApplicationProject } from '../../../api/quality-gates';
+import ApplicationQualityGateProject from './ApplicationQualityGateProject';
interface Props {
branch?: T.LongLivingBranch;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { ApplicationProject, ConditionAnalysis } from '../../../api/quality-gates';
import { isDiffMetric } from '../../../helpers/measures';
import { getProjectUrl } from '../../../helpers/urls';
import './ApplicationQualityGateProject.css';
-import { ApplicationProject, ConditionAnalysis } from '../../../api/quality-gates';
interface Props {
metrics: T.Dict<T.Metric>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Level from 'sonar-ui-common/components/ui/Level';
-import QualityGateConditions from './QualityGateConditions';
-import EmptyQualityGate from './EmptyQualityGate';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
+import EmptyQualityGate from './EmptyQualityGate';
+import QualityGateConditions from './QualityGateConditions';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
+import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
-import DrilldownLink from '../../../components/shared/DrilldownLink';
import Measure from '../../../components/measure/Measure';
+import DrilldownLink from '../../../components/shared/DrilldownLink';
+import { getBranchLikeQuery, isPullRequest, isShortLivingBranch } from '../../../helpers/branches';
import { getPeriodValue, isDiffMetric } from '../../../helpers/measures';
import { getComponentIssuesUrl } from '../../../helpers/urls';
-import { getBranchLikeQuery, isPullRequest, isShortLivingBranch } from '../../../helpers/branches';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
+import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import ChevronDownIcon from 'sonar-ui-common/components/icons/ChevronDownIcon';
-import { sortBy } from 'lodash';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import QualityGateCondition from './QualityGateCondition';
import { getMeasuresAndMeta } from '../../../api/measures';
+import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
import { enhanceMeasuresWithMetrics } from '../../../helpers/measures';
-import { isSameBranchLike, getBranchLikeQuery } from '../../../helpers/branches';
+import QualityGateCondition from './QualityGateCondition';
const LEVEL_ORDER = ['ERROR', 'WARN'];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ApplicationQualityGate from '../ApplicationQualityGate';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ApplicationQualityGateProject from '../ApplicationQualityGateProject';
const metrics = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import QualityGate from '../QualityGate';
it('renders message about ignored conditions', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import QualityGateCondition from '../QualityGateCondition';
const mockRatingCondition = (metric: string): T.QualityGateStatusConditionEnhanced => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import QualityGateConditions from '../QualityGateConditions';
import { getMeasuresAndMeta } from '../../../../api/measures';
import { mockComponent, mockQualityGateStatusCondition } from '../../../../helpers/testMocks';
+import QualityGateConditions from '../QualityGateConditions';
jest.mock('../../../../api/measures', () => {
return {
*/
import BugIcon from 'sonar-ui-common/components/icons/BugIcon';
import CodeSmellIcon from 'sonar-ui-common/components/icons/CodeSmellIcon';
-import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
+import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
import { translate } from 'sonar-ui-common/helpers/l10n';
import CoverageRating from '../../components/ui/CoverageRating';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { difference } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import ActionsDropdown, {
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import DeleteForm from './DeleteForm';
-import Form from './Form';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- setDefaultPermissionTemplate,
deletePermissionTemplate,
+ setDefaultPermissionTemplate,
updatePermissionTemplate
} from '../../../api/permissions';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import DeleteForm from './DeleteForm';
+import Form from './Form';
interface Props {
fromDetails?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { Location } from 'history';
import * as React from 'react';
import { connect } from 'react-redux';
-import { Location } from 'history';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Home from './Home';
-import Template from './Template';
-import OrganizationHelmet from '../../../components/common/OrganizationHelmet';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { sortPermissions, mergePermissionsToTemplates, mergeDefaultsToTemplates } from '../utils';
import { getPermissionTemplates } from '../../../api/permissions';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import OrganizationHelmet from '../../../components/common/OrganizationHelmet';
import { getAppState, Store } from '../../../store/rootReducer';
import '../../permissions/styles.css';
+import { mergeDefaultsToTemplates, mergePermissionsToTemplates, sortPermissions } from '../utils';
+import Home from './Home';
+import Template from './Template';
interface Props {
location: Location;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
confirmButtonText: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import Form from './Form';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createPermissionTemplate } from '../../../api/permissions';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import Form from './Form';
interface Props {
organization?: { key: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import InstanceMessage from '../../../components/common/InstanceMessage';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import ActionsCell from './ActionsCell';
import NameCell from './NameCell';
import PermissionCell from './PermissionCell';
-import ActionsCell from './ActionsCell';
interface Props {
organization: T.Organization | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { isSonarCloud } from '../../../helpers/system';
interface Props {
import * as React from 'react';
import Helmet from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import TemplateHeader from './TemplateHeader';
-import TemplateDetails from './TemplateDetails';
+import * as api from '../../../api/permissions';
import HoldersList from '../../permissions/shared/components/HoldersList';
import SearchForm from '../../permissions/shared/components/SearchForm';
import {
convertToPermissionDefinitions,
PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE
} from '../../permissions/utils';
-import * as api from '../../../api/permissions';
+import TemplateDetails from './TemplateDetails';
+import TemplateHeader from './TemplateHeader';
interface Props {
organization: T.Organization | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { ActionsCell } from '../ActionsCell';
const SAMPLE = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { App } from '../App';
import { mockLocation, mockOrganization } from '../../../../helpers/testMocks';
+import { App } from '../App';
jest.mock('../../../../api/permissions', () => ({
getPermissionTemplates: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Defaults from '../Defaults';
const SAMPLE: T.PermissionTemplate = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Form from '../Form';
it('render correctly', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { resetBundle } from 'sonar-ui-common/helpers/l10n';
-import { convertToPermissionDefinitions } from '../utils';
import { isSonarCloud } from '../../../helpers/system';
+import { convertToPermissionDefinitions } from '../utils';
jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
import * as React from 'react';
import { connect } from 'react-redux';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import SearchForm from '../../shared/components/SearchForm';
+import { getAppState, Store } from '../../../../store/rootReducer';
import HoldersList from '../../shared/components/HoldersList';
+import SearchForm from '../../shared/components/SearchForm';
import {
- PERMISSIONS_ORDER_GLOBAL,
convertToPermissionDefinitions,
+ PERMISSIONS_ORDER_GLOBAL,
PERMISSIONS_ORDER_GLOBAL_GOV
} from '../../utils';
-import { Store, getAppState } from '../../../../store/rootReducer';
interface StateProps {
appState: Pick<T.AppState, 'qualifiers'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { without } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { without } from 'lodash';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import PageHeader from './PageHeader';
-import AllHoldersList from './AllHoldersList';
import * as api from '../../../../api/permissions';
import Suggestions from '../../../../app/components/embed-docs-modal/Suggestions';
import '../../styles.css';
+import AllHoldersList from './AllHoldersList';
+import PageHeader from './PageHeader';
interface Props {
organization?: T.Organization;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import App from '../App';
import {
grantPermissionToGroup,
grantPermissionToUser,
revokePermissionFromUser
} from '../../../../../api/permissions';
import { mockOrganization } from '../../../../../helpers/testMocks';
+import App from '../App';
jest.mock('../../../../../api/permissions', () => ({
getGlobalPermissionsGroups: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { without } from 'lodash';
+import * as React from 'react';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import SearchForm from '../../shared/components/SearchForm';
import HoldersList from '../../shared/components/HoldersList';
-import { PERMISSIONS_ORDER_BY_QUALIFIER, convertToPermissionDefinitions } from '../../utils';
+import SearchForm from '../../shared/components/SearchForm';
+import { convertToPermissionDefinitions, PERMISSIONS_ORDER_BY_QUALIFIER } from '../../utils';
interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { without } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { without } from 'lodash';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as api from '../../../../api/permissions';
+import VisibilitySelector from '../../../../components/common/VisibilitySelector';
+import UpgradeOrganizationBox from '../../../create/components/UpgradeOrganizationBox';
+import '../../styles.css';
import AllHoldersList from './AllHoldersList';
import PageHeader from './PageHeader';
import PublicProjectDisclaimer from './PublicProjectDisclaimer';
-import UpgradeOrganizationBox from '../../../create/components/UpgradeOrganizationBox';
-import VisibilitySelector from '../../../../components/common/VisibilitySelector';
-import * as api from '../../../../api/permissions';
-import '../../styles.css';
interface Props {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import App from './App';
-import { getCurrentUser, getOrganizationByKey, Store } from '../../../../store/rootReducer';
import { fetchOrganization } from '../../../../store/rootActions';
+import { getCurrentUser, getOrganizationByKey, Store } from '../../../../store/rootReducer';
+import App from './App';
interface OwnProps {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
+import Select from 'sonar-ui-common/components/controls/Select';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import Select from 'sonar-ui-common/components/controls/Select';
-import { getPermissionTemplates, applyTemplateToProject } from '../../../../api/permissions';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { applyTemplateToProject, getPermissionTemplates } from '../../../../api/permissions';
interface Props {
onApply?: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import ApplyTemplate from './ApplyTemplate';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
component: {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import App from '../App';
import {
grantPermissionToGroup,
grantPermissionToUser,
revokePermissionFromUser
} from '../../../../../api/permissions';
import { mockComponent, mockOrganization } from '../../../../../helpers/testMocks';
+import App from '../App';
jest.mock('../../../../../api/permissions', () => ({
getPermissionsGroupsForComponent: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import ApplyTemplate from '../ApplyTemplate';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { without } from 'lodash';
import * as React from 'react';
import GroupIcon from 'sonar-ui-common/components/icons/GroupIcon';
-import { without } from 'lodash';
-import PermissionCell from './PermissionCell';
import { isPermissionDefinitionGroup } from '../../utils';
+import PermissionCell from './PermissionCell';
interface Props {
group: T.PermissionGroup;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { partition, sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import UserHolder from './UserHolder';
+import { isPermissionDefinitionGroup } from '../../utils';
import GroupHolder from './GroupHolder';
import PermissionHeader from './PermissionHeader';
-import { isPermissionDefinitionGroup } from '../../utils';
+import UserHolder from './UserHolder';
interface Props {
filter?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import { isPermissionDefinitionGroup } from '../../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import InstanceMessage from '../../../../components/common/InstanceMessage';
import { isPermissionDefinitionGroup } from '../../utils';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
filter: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { without } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import PermissionCell from './PermissionCell';
import Avatar from '../../../../components/ui/Avatar';
-import { isPermissionDefinitionGroup } from '../../utils';
import { isSonarCloud } from '../../../../helpers/system';
+import { isPermissionDefinitionGroup } from '../../utils';
+import PermissionCell from './PermissionCell';
interface Props {
onToggle: (user: T.PermissionUser, permission: string) => Promise<void>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import GroupHolder from '../GroupHolder';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import HoldersList from '../HoldersList';
const permissions = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PermissionCell from '../PermissionCell';
const permissionItem = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import UserHolder from '../UserHolder';
import { isSonarCloud } from '../../../../../helpers/system';
+import UserHolder from '../UserHolder';
jest.mock('../../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { convertMeasures } from '../utils';
import { mockMeasure } from '../../../helpers/testMocks';
+import { convertMeasures } from '../utils';
describe('convertMeasures', () => {
it('should correctly transform a list of metrics to a dictionary', () => {
import * as React from 'react';
import { connect } from 'react-redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import MeasuresButtonLink from './MeasuresButtonLink';
-import MetricBox from './MetricBox';
-import Report from './Report';
-import WorstProjects from './WorstProjects';
-import { SubComponent } from '../types';
-import { PORTFOLIO_METRICS, SUB_COMPONENTS_METRICS, convertMeasures } from '../utils';
-import Measure from '../../../components/measure/Measure';
import { getChildren } from '../../../api/components';
import { getMeasures } from '../../../api/measures';
+import Measure from '../../../components/measure/Measure';
import { fetchMetrics } from '../../../store/rootActions';
import { getMetrics, Store } from '../../../store/rootReducer';
import '../styles.css';
+import { SubComponent } from '../types';
+import { convertMeasures, PORTFOLIO_METRICS, SUB_COMPONENTS_METRICS } from '../utils';
+import MeasuresButtonLink from './MeasuresButtonLink';
+import MetricBox from './MetricBox';
+import Report from './Report';
+import WorstProjects from './WorstProjects';
interface OwnProps {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Link } from 'react-router';
import Rating from 'sonar-ui-common/components/ui/Rating';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import Measure from '../../../components/measure/Measure';
import { getComponentDrilldownUrl } from '../../../helpers/urls';
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import Level from 'sonar-ui-common/components/ui/Level';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import Measure from '../../../components/measure/Measure';
+import { getComponentDrilldownUrl } from '../../../helpers/urls';
+import { METRICS_PER_TYPE } from '../utils';
import Effort from './Effort';
import HistoryButtonLink from './HistoryButtonLink';
import MainRating from './MainRating';
import MeasuresButtonLink from './MeasuresButtonLink';
import RatingFreshness from './RatingFreshness';
-import { METRICS_PER_TYPE } from '../utils';
-import Measure from '../../../components/measure/Measure';
-import { getComponentDrilldownUrl } from '../../../helpers/urls';
interface Props {
component: string;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Rating from 'sonar-ui-common/components/ui/Rating';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DateFromNow from '../../../components/intl/DateFromNow';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getReportStatus, getReportUrl, ReportStatus } from '../../../api/report';
import Subscription from './Subscription';
-import { getReportStatus, ReportStatus, getReportUrl } from '../../../api/report';
interface Props {
component: { key: string; name: string };
import * as React from 'react';
import { connect } from 'react-redux';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { ReportStatus, subscribe, unsubscribe } from '../../../api/report';
import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
import throwGlobalError from '../../../app/utils/throwGlobalError';
-import { ReportStatus, subscribe, unsubscribe } from '../../../api/report';
import { isLoggedIn } from '../../../helpers/users';
import { getCurrentUser, Store } from '../../../store/rootReducer';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { max } from 'lodash';
import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { Link } from 'react-router';
-import { max } from 'lodash';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { SubComponent } from '../types';
import { colors } from '../../../app/theme';
import Measure from '../../../components/measure/Measure';
import { getProjectUrl } from '../../../helpers/urls';
+import { SubComponent } from '../types';
interface Props {
component: string;
getChildren: jest.fn(() => Promise.resolve({ components: [], paging: { total: 0 } }))
}));
+import { mount, shallow } from 'enzyme';
import * as React from 'react';
-import { shallow, mount } from 'enzyme';
import { App } from '../App';
const getMeasures = require('../../../../api/measures').getMeasures as jest.Mock<any>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Effort from '../Effort';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import HistoryButtonLink from '../HistoryButtonLink';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MainRating from '../MainRating';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MeasuresButtonLink from '../MeasuresButtonLink';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MetricBox from '../MetricBox';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import RatingFreshness from '../RatingFreshness';
it('renders', () => {
return report;
});
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
+import * as React from 'react';
import Report from '../Report';
const getReportStatus = require('../../../../api/report').getReportStatus as jest.Mock<any>;
return report;
});
+import { mount, shallow } from 'enzyme';
import * as React from 'react';
-import { shallow, mount } from 'enzyme';
-import { Subscription } from '../Subscription';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { ReportStatus } from '../../../../api/report';
+import { Subscription } from '../Subscription';
const subscribe = require('../../../../api/report').subscribe as jest.Mock<any>;
const unsubscribe = require('../../../../api/report').unsubscribe as jest.Mock<any>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorstProjects from '../WorstProjects';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { Link } from 'react-router';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
+import { Link } from 'react-router';
+import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
import ProjectEventIcon from 'sonar-ui-common/components/icons/ProjectEventIcon';
-import { limitComponentName } from 'sonar-ui-common/helpers/path';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import { getProjectUrl } from '../../../helpers/urls';
+import { limitComponentName } from 'sonar-ui-common/helpers/path';
import { isMainBranch } from '../../../helpers/branches';
+import { getProjectUrl } from '../../../helpers/urls';
export type DefinitionChangeEvent = T.AnalysisEvent &
Required<Pick<T.AnalysisEvent, 'definitionChange'>>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { DeleteButton, EditButton } from 'sonar-ui-common/components/controls/buttons';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import EventInner from './EventInner';
import ChangeEventForm from './forms/ChangeEventForm';
import RemoveEventForm from './forms/RemoveEventForm';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import ProjectEventIcon from 'sonar-ui-common/components/icons/ProjectEventIcon';
-import * as classNames from 'classnames';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { isRichQualityGateEvent, RichQualityGateEventInner } from './RichQualityGateEventInner';
-import { isDefinitionChangeEvent, DefinitionChangeEventInner } from './DefinitionChangeEventInner';
import { ComponentContext } from '../../../app/components/ComponentContext';
+import { DefinitionChangeEventInner, isDefinitionChangeEvent } from './DefinitionChangeEventInner';
+import { isRichQualityGateEvent, RichQualityGateEventInner } from './RichQualityGateEventInner';
interface Props {
event: T.AnalysisEvent;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import Event from './Event';
interface Props {
*/
import * as React from 'react';
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import AdvancedTimeline from 'sonar-ui-common/components/charts/AdvancedTimeline';
-import GraphsTooltips from './GraphsTooltips';
-import GraphsLegendCustom from './GraphsLegendCustom';
-import GraphsLegendStatic from './GraphsLegendStatic';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getShortType } from '../../../helpers/measures';
import { MeasureHistory, Serie } from '../utils';
+import GraphsLegendCustom from './GraphsLegendCustom';
+import GraphsLegendStatic from './GraphsLegendStatic';
+import GraphsTooltips from './GraphsTooltips';
interface Props {
events: T.AnalysisEvent[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { isEqual } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import GraphHistory from './GraphHistory';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
getSeriesMetricType,
hasHistoryData,
isCustomGraph,
- Serie,
MeasureHistory,
- ParsedAnalysis
+ ParsedAnalysis,
+ Serie
} from '../utils';
+import GraphHistory from './GraphHistory';
interface Props {
analyses: ParsedAnalysis[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import GraphsLegendItem from './GraphsLegendItem';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { hasDataValues, Serie } from '../utils';
+import GraphsLegendItem from './GraphsLegendItem';
interface Props {
removeMetric: (metric: string) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
+import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon';
import ChartLegendIcon from 'sonar-ui-common/components/icons/ChartLegendIcon';
-import { ClearButton } from 'sonar-ui-common/components/controls/buttons';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import GraphsLegendItem from './GraphsLegendItem';
import { Serie } from '../utils';
+import GraphsLegendItem from './GraphsLegendItem';
interface Props {
series: Array<Pick<Serie, 'name' | 'translatedName'>>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { isDefined } from 'sonar-ui-common/helpers/types';
import { Popup, PopupPlacement } from 'sonar-ui-common/components/ui/popups';
+import { isDefined } from 'sonar-ui-common/helpers/types';
+import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
+import { DEFAULT_GRAPH, MeasureHistory, Serie } from '../utils';
import GraphsTooltipsContent from './GraphsTooltipsContent';
-import GraphsTooltipsContentEvents from './GraphsTooltipsContentEvents';
import GraphsTooltipsContentCoverage from './GraphsTooltipsContentCoverage';
import GraphsTooltipsContentDuplication from './GraphsTooltipsContentDuplication';
+import GraphsTooltipsContentEvents from './GraphsTooltipsContentEvents';
import GraphsTooltipsContentIssues from './GraphsTooltipsContentIssues';
-import { DEFAULT_GRAPH, MeasureHistory, Serie } from '../utils';
-import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
interface Props {
events: T.AnalysisEvent[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { throttle } from 'lodash';
+import * as React from 'react';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import ProjectActivityAnalysis from './ProjectActivityAnalysis';
import DateFormatter from '../../../components/intl/DateFormatter';
import {
activityQueryChanged,
getAnalysesByVersionByDay,
- selectedDateQueryChanged,
+ ParsedAnalysis,
Query,
- ParsedAnalysis
+ selectedDateQueryChanged
} from '../utils';
+import ProjectActivityAnalysis from './ProjectActivityAnalysis';
interface Props {
addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { parseDate } from 'sonar-ui-common/helpers/dates';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import * as React from 'react';
import ActionsDropdown, {
ActionsDropdownDivider,
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { parseDate } from 'sonar-ui-common/helpers/dates';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import TimeFormatter from '../../../components/intl/TimeFormatter';
+import { ParsedAnalysis } from '../utils';
import Events from './Events';
import AddEventForm from './forms/AddEventForm';
import RemoveAnalysisForm from './forms/RemoveAnalysisForm';
-import TimeFormatter from '../../../components/intl/TimeFormatter';
-import { ParsedAnalysis } from '../utils';
interface Props {
addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
import Helmet from 'react-helmet';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProjectActivityPageHeader from './ProjectActivityPageHeader';
-import ProjectActivityAnalysesList from './ProjectActivityAnalysesList';
-import ProjectActivityGraphs from './ProjectActivityGraphs';
-import { MeasureHistory, Query, ParsedAnalysis } from '../utils';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { MeasureHistory, ParsedAnalysis, Query } from '../utils';
import './projectActivity.css';
+import ProjectActivityAnalysesList from './ProjectActivityAnalysesList';
+import ProjectActivityGraphs from './ProjectActivityGraphs';
+import ProjectActivityPageHeader from './ProjectActivityPageHeader';
interface Props {
addCustomEvent: (analysis: string, name: string, category?: string) => Promise<void>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { Location } from 'history';
+import * as React from 'react';
import { InjectedRouter } from 'react-router';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import ProjectActivityApp from './ProjectActivityApp';
-import { getAllTimeMachineData } from '../../../api/time-machine';
import { getAllMetrics } from '../../../api/metrics';
import * as api from '../../../api/projectActivity';
-import * as actions from '../actions';
+import { getAllTimeMachineData } from '../../../api/time-machine';
import { getBranchLikeQuery } from '../../../helpers/branches';
+import * as actions from '../actions';
import {
customMetricsChanged,
DEFAULT_GRAPH,
getProjectActivityGraph,
isCustomGraph,
MeasureHistory,
- parseQuery,
ParsedAnalysis,
+ parseQuery,
Query,
serializeQuery,
serializeUrlQuery
} from '../utils';
+import ProjectActivityApp from './ProjectActivityApp';
interface Props {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DateRangeInput from '../../../components/controls/DateRangeInput';
import { Query } from '../utils';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { debounce, findLast, maxBy, minBy, sortBy } from 'lodash';
+import * as React from 'react';
import { save } from 'sonar-ui-common/helpers/storage';
-import ProjectActivityGraphsHeader from './ProjectActivityGraphsHeader';
-import GraphsZoom from './GraphsZoom';
-import GraphsHistory from './GraphsHistory';
import {
datesQueryChanged,
generateSeries,
getDisplayedHistoryMetrics,
+ getProjectActivityGraph,
getSeriesMetricType,
historyQueryChanged,
isCustomGraph,
PROJECT_ACTIVITY_GRAPH_CUSTOM,
Query,
Serie,
- splitSeriesInGraphs,
- getProjectActivityGraph
+ splitSeriesInGraphs
} from '../utils';
+import GraphsHistory from './GraphsHistory';
+import GraphsZoom from './GraphsZoom';
+import ProjectActivityGraphsHeader from './ProjectActivityGraphsHeader';
interface Props {
analyses: ParsedAnalysis[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { GRAPH_TYPES, isCustomGraph } from '../utils';
import AddGraphMetric from './forms/AddGraphMetric';
-import { isCustomGraph, GRAPH_TYPES } from '../utils';
interface Props {
addCustomMetric: (metric: string) => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { APPLICATION_EVENT_TYPES, EVENT_TYPES, Query } from '../utils';
+import ProjectActivityDateInput from './ProjectActivityDateInput';
import ProjectActivityEventSelectOption from './ProjectActivityEventSelectOption';
import ProjectActivityEventSelectValue from './ProjectActivityEventSelectValue';
-import ProjectActivityDateInput from './ProjectActivityDateInput';
-import { EVENT_TYPES, APPLICATION_EVENT_TYPES, Query } from '../utils';
interface Props {
category?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
-import ProjectEventIcon from 'sonar-ui-common/components/icons/ProjectEventIcon';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import ProjectEventIcon from 'sonar-ui-common/components/icons/ProjectEventIcon';
import Level from 'sonar-ui-common/components/ui/Level';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getProjectUrl } from '../../../helpers/urls';
export type RichQualityGateEvent = T.AnalysisEvent & Required<Pick<T.AnalysisEvent, 'qualityGate'>>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { DefinitionChangeEventInner, DefinitionChangeEvent } from '../DefinitionChangeEventInner';
+import { DefinitionChangeEvent, DefinitionChangeEventInner } from '../DefinitionChangeEventInner';
it('should render', () => {
const event: DefinitionChangeEvent = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import GraphHistory from '../GraphHistory';
import { DEFAULT_GRAPH } from '../../utils';
+import GraphHistory from '../GraphHistory';
const SERIES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import GraphsHistory from '../GraphsHistory';
import { DEFAULT_GRAPH } from '../../utils';
+import GraphsHistory from '../GraphsHistory';
const ANALYSES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import GraphsLegendCustom from '../GraphsLegendCustom';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GraphsLegendItem from '../GraphsLegendItem';
it('should render correctly a legend', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GraphsLegendStatic from '../GraphsLegendStatic';
const SERIES = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import GraphsTooltips from '../GraphsTooltips';
import { DEFAULT_GRAPH } from '../../utils';
+import GraphsTooltips from '../GraphsTooltips';
const SERIES_ISSUES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GraphsTooltipsContent from '../GraphsTooltipsContent';
const DEFAULT_PROPS = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import GraphsTooltipsContentCoverage from '../GraphsTooltipsContentCoverage';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import GraphsTooltipsContentDuplication from '../GraphsTooltipsContentDuplication';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import GraphsTooltipsContentEvents from '../GraphsTooltipsContentEvents';
const EVENTS = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import GraphsTooltipsContentIssues from '../GraphsTooltipsContentIssues';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import ProjectActivityAnalysesList from '../ProjectActivityAnalysesList';
import { DEFAULT_GRAPH } from '../../utils';
+import ProjectActivityAnalysesList from '../ProjectActivityAnalysesList';
jest.mock('date-fns/start_of_day', () => (date: Date) => {
const startDay = new Date(date);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { mockAnalysisEvent, mockParsedAnalysis } from '../../../../helpers/testMocks';
import ProjectActivityAnalysis from '../ProjectActivityAnalysis';
-import { mockParsedAnalysis, mockAnalysisEvent } from '../../../../helpers/testMocks';
jest.mock('sonar-ui-common/helpers/dates', () => ({
parseDate: () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import ProjectActivityApp from '../ProjectActivityApp';
import { DEFAULT_GRAPH } from '../../utils';
+import ProjectActivityApp from '../ProjectActivityApp';
const ANALYSES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProjectActivityAppContainer from '../ProjectActivityAppContainer';
+import * as React from 'react';
import { mockComponent, mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import ProjectActivityAppContainer from '../ProjectActivityAppContainer';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import ProjectActivityDateInput from '../ProjectActivityDateInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectActivityEventSelectOption from '../ProjectActivityEventSelectOption';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import ProjectActivityGraphs from '../ProjectActivityGraphs';
import { DEFAULT_GRAPH } from '../../utils';
+import ProjectActivityGraphs from '../ProjectActivityGraphs';
const ANALYSES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import ProjectActivityPageHeader from '../ProjectActivityPageHeader';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { RichQualityGateEventInner, RichQualityGateEvent } from '../RichQualityGateEventInner';
+import { RichQualityGateEvent, RichQualityGateEventInner } from '../RichQualityGateEventInner';
const event: RichQualityGateEvent = {
category: 'QUALITY_GATE',
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { ParsedAnalysis } from '../../utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { find, sortBy } from 'lodash';
-import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import AddGraphMetricPopup from './AddGraphMetricPopup';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
import { isDiffMetric } from '../../../../helpers/measures';
+import AddGraphMetricPopup from './AddGraphMetricPopup';
interface Props {
addMetric: (metric: string) => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import MultiSelect from '../../../../components/common/MultiSelect';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
changeEvent: (event: string, name: string) => Promise<void>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { ParsedAnalysis } from '../../utils';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
analysis: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AddEventForm from '../AddEventForm';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ChangeEventForm from '../ChangeEventForm';
it('should render correctly', () => {
*/
import * as startOfDay from 'date-fns/start_of_day';
import { chunk, flatMap, groupBy, isEqual, sortBy } from 'lodash';
+import { parseDate } from 'sonar-ui-common/helpers/dates';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
import {
cleanQuery,
parseAsArray,
parseAsDate,
parseAsString,
- serializeStringArray,
serializeDate,
- serializeString
+ serializeString,
+ serializeStringArray
} from 'sonar-ui-common/helpers/query';
-import { parseDate } from 'sonar-ui-common/helpers/dates';
import { get } from 'sonar-ui-common/helpers/storage';
-import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
export type ParsedAnalysis = T.Omit<T.Analysis, 'date'> & { date: Date };
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import BranchRow from './BranchRow';
-import LongBranchesPattern from './LongBranchesPattern';
+import { getValues } from '../../../api/settings';
import {
- sortBranchesAsTree,
getBranchLikeKey,
+ isPullRequest,
isShortLivingBranch,
- isPullRequest
+ sortBranchesAsTree
} from '../../../helpers/branches';
-import { getValues } from '../../../api/settings';
+import BranchRow from './BranchRow';
+import LongBranchesPattern from './LongBranchesPattern';
interface Props {
branchLikes: T.BranchLike[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import App from './App';
import { getAppState, Store } from '../../../store/rootReducer';
+import App from './App';
const mapStateToProps = (state: Store) => ({
canAdmin: getAppState(state).canAdmin
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import ActionsDropdown, {
- ActionsDropdownItem,
- ActionsDropdownDivider
+ ActionsDropdownDivider,
+ ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import DeleteBranchModal from './DeleteBranchModal';
-import LeakPeriodForm from './LeakPeriodForm';
-import RenameBranchModal from './RenameBranchModal';
-import BranchIcon from '../../../components/icons-components/BranchIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import BranchStatus from '../../../components/common/BranchStatus';
+import BranchIcon from '../../../components/icons-components/BranchIcon';
+import DateFromNow from '../../../components/intl/DateFromNow';
import {
- isShortLivingBranch,
+ getBranchLikeDisplayName,
isLongLivingBranch,
isMainBranch,
- getBranchLikeDisplayName,
- isPullRequest
+ isPullRequest,
+ isShortLivingBranch
} from '../../../helpers/branches';
-import DateFromNow from '../../../components/intl/DateFromNow';
+import DeleteBranchModal from './DeleteBranchModal';
+import LeakPeriodForm from './LeakPeriodForm';
+import RenameBranchModal from './RenameBranchModal';
interface Props {
branchLike: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { deleteBranch, deletePullRequest } from '../../../api/branches';
-import { isPullRequest, getBranchLikeDisplayName } from '../../../helpers/branches';
+import { getBranchLikeDisplayName, isPullRequest } from '../../../helpers/branches';
interface Props {
branchLike: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import SettingForm from './SettingForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getValues } from '../../../api/settings';
+import SettingForm from './SettingForm';
interface Props {
branch: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { EditButton } from 'sonar-ui-common/components/controls/buttons';
-import LongBranchesPatternForm from './LongBranchesPatternForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getValues } from '../../../api/settings';
+import LongBranchesPatternForm from './LongBranchesPatternForm';
interface Props {
project: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import SettingForm from './SettingForm';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { renameBranch } from '../../../api/branches';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button, ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { Button, SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import { setSimpleSettingValue, resetSettingValue } from '../../../api/settings';
+import { resetSettingValue, setSimpleSettingValue } from '../../../api/settings';
import { sanitizeTranslation } from '../../settings/utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
-import App from '../App';
+import * as React from 'react';
import { getValues } from '../../../../api/settings';
import {
- mockMainBranch,
mockLongLivingBranch,
- mockShortLivingBranch,
- mockPullRequest
+ mockMainBranch,
+ mockPullRequest,
+ mockShortLivingBranch
} from '../../../../helpers/testMocks';
+import App from '../App';
jest.mock('../../../../api/settings', () => ({
getValues: jest.fn(() => Promise.resolve([]))
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import BranchRow from '../BranchRow';
import { mockPullRequest, mockShortLivingBranch } from '../../../../helpers/testMocks';
+import BranchRow from '../BranchRow';
const mainBranch: T.MainBranch = { isMain: true, name: 'master' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
-import { submit, doAsync, click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import DeleteBranchModal from '../DeleteBranchModal';
+import * as React from 'react';
+import { click, doAsync, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { deleteBranch, deletePullRequest } from '../../../../api/branches';
-import { mockShortLivingBranch, mockPullRequest } from '../../../../helpers/testMocks';
+import { mockPullRequest, mockShortLivingBranch } from '../../../../helpers/testMocks';
+import DeleteBranchModal from '../DeleteBranchModal';
jest.mock('../../../../api/branches', () => ({
deleteBranch: jest.fn(),
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import LongBranchesPattern from '../LongBranchesPattern';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import LongBranchesPattern from '../LongBranchesPattern';
jest.mock('../../../../api/settings', () => ({
getValues: jest.fn(() => Promise.resolve([]))
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LongBranchesPatternForm from '../LongBranchesPatternForm';
it('renders', () => {
/* eslint-disable import/first */
jest.mock('../../../../api/branches', () => ({ renameBranch: jest.fn() }));
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
-import { submit, doAsync, click, change, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import RenameBranchModal from '../RenameBranchModal';
+import * as React from 'react';
+import { change, click, doAsync, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { renameBranch } from '../../../../api/branches';
+import RenameBranchModal from '../RenameBranchModal';
beforeEach(() => {
(renameBranch as jest.Mock<any>).mockClear();
resetSettingValue: jest.fn(() => Promise.resolve())
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { change, click, submit } from 'sonar-ui-common/helpers/testUtils';
import SettingForm from '../SettingForm';
-import { change, submit, click } from 'sonar-ui-common/helpers/testUtils';
const setSimpleSettingValue = require('../../../../api/settings')
.setSimpleSettingValue as jest.Mock<any>;
import * as React from 'react';
import Helmet from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Header from './Header';
import Form from './Form';
+import Header from './Header';
interface Props {
component: Pick<T.Component, 'key' | 'name' | 'qualifier'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
-import { withRouter, Router } from '../../components/hoc/withRouter';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { deletePortfolio, deleteProject } from '../../api/components';
import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage';
-import { deleteProject, deletePortfolio } from '../../api/components';
+import { Router, withRouter } from '../../components/hoc/withRouter';
interface Props {
component: Pick<T.Component, 'key' | 'name' | 'qualifier'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import App from '../App';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { Form } from '../Form';
-import { deleteProject, deletePortfolio } from '../../../api/components';
+import * as React from 'react';
+import { deletePortfolio, deleteProject } from '../../../api/components';
import { mockRouter } from '../../../helpers/testMocks';
+import { Form } from '../Form';
jest.mock('../../../api/components', () => ({
deleteProject: jest.fn().mockResolvedValue(undefined),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
it('should render', () => {
import Helmet from 'react-helmet';
import { withRouter, WithRouterProps } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import UpdateForm from './UpdateForm';
import { changeKey } from '../../api/components';
import RecentHistory from '../../app/components/RecentHistory';
+import UpdateForm from './UpdateForm';
interface Props {
component: Pick<T.Component, 'key' | 'name'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
component: Pick<T.Component, 'key' | 'name'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { WithRouterProps } from 'react-router';
-import { Key } from '../Key';
import { changeKey } from '../../../api/components';
+import { Key } from '../Key';
jest.mock('../../../api/components', () => ({
changeKey: jest.fn().mockResolvedValue(undefined)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { change, click } from 'sonar-ui-common/helpers/testUtils';
import UpdateForm from '../UpdateForm';
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { createLink, deleteLink, getProjectLinks } from '../../api/projectLinks';
import Header from './Header';
import Table from './Table';
-import { getProjectLinks, createLink, deleteLink } from '../../api/projectLinks';
interface Props {
component: Pick<T.Component, 'key'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CreationModal from './CreationModal';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ProjectLinkIcon from 'sonar-ui-common/components/icons/ProjectLinkIcon';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
-import { isProvided, getLinkName } from './utils';
+import ProjectLinkIcon from 'sonar-ui-common/components/icons/ProjectLinkIcon';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import isValidUri from '../../app/utils/isValidUri';
+import { getLinkName, isProvided } from './utils';
interface Props {
link: T.ProjectLink;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import App from '../App';
import { createLink, deleteLink, getProjectLinks } from '../../../api/projectLinks';
+import App from '../App';
// import { getProjectLinks, createLink, deleteLink } from '../../api/projectLinks';
jest.mock('../../../api/projectLinks', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, submit } from 'sonar-ui-common/helpers/testUtils';
import CreationModal from '../CreationModal';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Header from '../Header';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LinkRow from '../LinkRow';
it('should render provided link', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Table from '../Table';
it('should render', () => {
import * as React from 'react';
import Helmet from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Header from './Header';
-import Form from './Form';
import {
- fetchQualityGates,
- getGateForProject,
associateGateWithProject,
- dissociateGateWithProject
+ dissociateGateWithProject,
+ fetchQualityGates,
+ getGateForProject
} from '../../api/quality-gates';
import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage';
import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
+import Form from './Form';
+import Header from './Header';
interface Props {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
allGates: T.QualityGate[];
default: jest.fn()
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import App from '../App';
const associateGateWithProject = require('../../../api/quality-gates')
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Form from '../Form';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
it('renders', () => {
import * as React from 'react';
import Helmet from 'react-helmet';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Header from './Header';
-import Table from './Table';
import {
associateProject,
dissociateProject,
- searchQualityProfiles,
- Profile
+ Profile,
+ searchQualityProfiles
} from '../../api/quality-profiles';
import A11ySkipTarget from '../../app/components/a11y/A11ySkipTarget';
import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
import addGlobalSuccessMessage from '../../app/utils/addGlobalSuccessMessage';
import handleRequiredAuthorization from '../../app/utils/handleRequiredAuthorization';
+import Header from './Header';
+import Table from './Table';
interface Props {
component: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Profile } from '../../api/quality-profiles';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { groupBy, orderBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProfileRow from './ProfileRow';
import { Profile } from '../../api/quality-profiles';
+import ProfileRow from './ProfileRow';
interface Props {
allProfiles: Profile[];
default: jest.fn()
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import App from '../App';
const associateProject = require('../../../api/quality-profiles').associateProject as jest.Mock<
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Header from '../Header';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfileRow from '../ProfileRow';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Table from '../Table';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as utils from '../utils';
import { searchProjects } from '../../../api/components';
-import { mockOrganization, mockComponent } from '../../../helpers/testMocks';
+import { mockComponent, mockOrganization } from '../../../helpers/testMocks';
+import * as utils from '../utils';
jest.mock('../../../api/components', () => ({
searchProjects: jest.fn().mockResolvedValue({ components: [], facets: [], paging: { total: 10 } })
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { omitBy } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { omitBy } from 'lodash';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
import { get, save } from 'sonar-ui-common/helpers/storage';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import PageHeader from './PageHeader';
-import ProjectsList from './ProjectsList';
-import PageSidebar from './PageSidebar';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import OrganizationEmpty from '../../organizations/components/OrganizationEmpty';
-import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import Visualizations from '../visualizations/Visualizations';
-import { Project, Facets } from '../types';
-import { fetchProjects, parseSorting, SORTING_SWITCH } from '../utils';
-import { parseUrlQuery, Query, hasFilterParams, hasVisualizationParams } from '../query';
-import { isSonarCloud } from '../../../helpers/system';
-import { isLoggedIn } from '../../../helpers/users';
import { OnboardingContext } from '../../../app/components/OnboardingContext';
-import { withRouter, Location, Router } from '../../../components/hoc/withRouter';
+import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
import '../../../components/search-navigator.css';
+import { isSonarCloud } from '../../../helpers/system';
+import { isLoggedIn } from '../../../helpers/users';
+import OrganizationEmpty from '../../organizations/components/OrganizationEmpty';
+import { hasFilterParams, hasVisualizationParams, parseUrlQuery, Query } from '../query';
import '../styles.css';
+import { Facets, Project } from '../types';
+import { fetchProjects, parseSorting, SORTING_SWITCH } from '../utils';
+import Visualizations from '../visualizations/Visualizations';
+import PageHeader from './PageHeader';
+import PageSidebar from './PageSidebar';
+import ProjectsList from './ProjectsList';
interface Props {
currentUser: T.CurrentUser;
*/
import { connect } from 'react-redux';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import { getCurrentUser, areThereCustomOrganizations, Store } from '../../../store/rootReducer';
+import { areThereCustomOrganizations, getCurrentUser, Store } from '../../../store/rootReducer';
const stateToProps = (state: Store) => ({
currentUser: getCurrentUser(state),
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClearAll: () => void;
*/
import * as React from 'react';
import { get } from 'sonar-ui-common/helpers/storage';
-import AllProjectsContainer from './AllProjectsContainer';
-import { PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE, PROJECTS_ALL } from '../utils';
import { searchProjects } from '../../../api/components';
+import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
import { isSonarCloud } from '../../../helpers/system';
import { isLoggedIn } from '../../../helpers/users';
-import { withRouter, Location, Router } from '../../../components/hoc/withRouter';
+import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils';
+import AllProjectsContainer from './AllProjectsContainer';
interface Props {
currentUser: T.CurrentUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import DefaultPageSelector from './DefaultPageSelector';
import { getCurrentUser, Store } from '../../../store/rootReducer';
+import DefaultPageSelector from './DefaultPageSelector';
const stateToProps = (state: Store) => ({
currentUser: getCurrentUser(state)
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Query } from '../query';
import '../../../components/common/EmptySearch.css';
+import { Query } from '../query';
export default function EmptyFavoriteSearch({ query }: { query: Query }) {
return (
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { OnboardingContextShape } from '../../../app/components/OnboardingContext';
import { isSonarCloud } from '../../../helpers/system';
import { hasGlobalPermission, isLoggedIn } from '../../../helpers/users';
-import { OnboardingContextShape } from '../../../app/components/OnboardingContext';
interface Props {
currentUser: T.CurrentUser;
*/
import * as React from 'react';
import { IndexLink, Link } from 'react-router';
-import { save } from 'sonar-ui-common/helpers/storage';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE, PROJECTS_ALL } from '../utils';
+import { save } from 'sonar-ui-common/helpers/storage';
import { isLoggedIn } from '../../../helpers/users';
+import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER, PROJECTS_FAVORITE } from '../utils';
interface Props {
currentUser: T.CurrentUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import FavoriteFilter from './FavoriteFilter';
import { getCurrentUser, Store } from '../../../store/rootReducer';
+import FavoriteFilter from './FavoriteFilter';
function mapStateToProps(state: Store) {
return { currentUser: getCurrentUser(state) };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { Link } from 'react-router';
import { connect } from 'react-redux';
-import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Link } from 'react-router';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { OnboardingContextShape } from '../../../app/components/OnboardingContext';
import OrganizationListItem from '../../../components/ui/OrganizationListItem';
-import { getMyOrganizations, Store } from '../../../store/rootReducer';
import { isSonarCloud } from '../../../helpers/system';
-import { OnboardingContextShape } from '../../../app/components/OnboardingContext';
+import { getMyOrganizations, Store } from '../../../store/rootReducer';
interface OwnProps {
openProjectOnboarding: OnboardingContextShape;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import PerspectiveSelect from './PerspectiveSelect';
-import ProjectsSortingSelect from './ProjectsSortingSelect';
-import SearchFilterContainer from '../filters/SearchFilterContainer';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import HomePageSelect from '../../../components/controls/HomePageSelect';
-import { Project } from '../types';
import { isSonarCloud } from '../../../helpers/system';
import { isLoggedIn } from '../../../helpers/users';
+import SearchFilterContainer from '../filters/SearchFilterContainer';
+import { Project } from '../types';
+import PerspectiveSelect from './PerspectiveSelect';
+import ProjectsSortingSelect from './ProjectsSortingSelect';
interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { flatMap } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import FavoriteFilterContainer from './FavoriteFilterContainer';
-import ClearAll from './ClearAll';
-import LanguagesFilterContainer from '../filters/LanguagesFilterContainer';
import CoverageFilter from '../filters/CoverageFilter';
import DuplicationsFilter from '../filters/DuplicationsFilter';
+import LanguagesFilterContainer from '../filters/LanguagesFilterContainer';
import MaintainabilityFilter from '../filters/MaintainabilityFilter';
import NewCoverageFilter from '../filters/NewCoverageFilter';
import NewDuplicationsFilter from '../filters/NewDuplicationsFilter';
+import NewLinesFilter from '../filters/NewLinesFilter';
import NewMaintainabilityFilter from '../filters/NewMaintainabilityFilter';
import NewReliabilityFilter from '../filters/NewReliabilityFilter';
import NewSecurityFilter from '../filters/NewSecurityFilter';
-import NewLinesFilter from '../filters/NewLinesFilter';
import QualityGateFilter from '../filters/QualityGateFilter';
import ReliabilityFilter from '../filters/ReliabilityFilter';
import SecurityFilter from '../filters/SecurityFilter';
import SizeFilter from '../filters/SizeFilter';
import TagsFilter from '../filters/TagsFilter';
-import { Facets } from '../types';
import { hasFilterParams } from '../query';
+import { Facets } from '../types';
+import ClearAll from './ClearAll';
+import FavoriteFilterContainer from './FavoriteFilterContainer';
interface Props {
facets?: Facets;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
-import PerspectiveSelectOption, { Option } from './PerspectiveSelectOption';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { VIEWS, VISUALIZATIONS } from '../utils';
+import PerspectiveSelectOption, { Option } from './PerspectiveSelectOption';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ListIcon from 'sonar-ui-common/components/icons/ListIcon';
import BubblesIcon from 'sonar-ui-common/components/icons/BubblesIcon';
+import ListIcon from 'sonar-ui-common/components/icons/ListIcon';
export interface Option {
label: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Project } from '../types';
import ProjectCardLeak from './ProjectCardLeak';
import ProjectCardOverall from './ProjectCardOverall';
-import { Project } from '../types';
interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import ProjectCardLanguages from './ProjectCardLanguages';
import { getLanguages, Store } from '../../../store/rootReducer';
+import ProjectCardLanguages from './ProjectCardLanguages';
const stateToProps = (state: Store) => ({
languages: getLanguages(state)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as difference from 'date-fns/difference_in_milliseconds';
import * as React from 'react';
import { Link } from 'react-router';
-import * as difference from 'date-fns/difference_in_milliseconds';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import ProjectCardQualityGate from './ProjectCardQualityGate';
-import ProjectCardLeakMeasures from './ProjectCardLeakMeasures';
-import ProjectCardOrganizationContainer from './ProjectCardOrganizationContainer';
+import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
import Favorite from '../../../components/controls/Favorite';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import TagsList from '../../../components/tags/TagsList';
-import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
-import { Project } from '../types';
-import { formatDuration } from '../utils';
import { getProjectUrl } from '../../../helpers/urls';
import { isLoggedIn } from '../../../helpers/users';
+import { Project } from '../types';
+import { formatDuration } from '../utils';
+import ProjectCardLeakMeasures from './ProjectCardLeakMeasures';
+import ProjectCardOrganizationContainer from './ProjectCardOrganizationContainer';
+import ProjectCardQualityGate from './ProjectCardQualityGate';
interface Props {
currentUser: T.CurrentUser;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import ProjectCardOrganization from './ProjectCardOrganization';
import { areThereCustomOrganizations, Store } from '../../../store/rootReducer';
+import ProjectCardOrganization from './ProjectCardOrganization';
const stateToProps = (state: Store) => ({
organizationsEnabled: areThereCustomOrganizations(state)
import * as React from 'react';
import { Link } from 'react-router';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import ProjectCardQualityGate from './ProjectCardQualityGate';
-import ProjectCardOverallMeasures from './ProjectCardOverallMeasures';
-import ProjectCardOrganizationContainer from './ProjectCardOrganizationContainer';
+import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
import Favorite from '../../../components/controls/Favorite';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import TagsList from '../../../components/tags/TagsList';
-import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer';
-import { Project } from '../types';
import { getProjectUrl } from '../../../helpers/urls';
import { isLoggedIn } from '../../../helpers/users';
+import { Project } from '../types';
+import ProjectCardOrganizationContainer from './ProjectCardOrganizationContainer';
+import ProjectCardOverallMeasures from './ProjectCardOverallMeasures';
+import ProjectCardQualityGate from './ProjectCardQualityGate';
interface Props {
currentUser: T.CurrentUser;
import Rating from 'sonar-ui-common/components/ui/Rating';
import SizeRating from 'sonar-ui-common/components/ui/SizeRating';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProjectCardLanguagesContainer from './ProjectCardLanguagesContainer';
import Measure from '../../../components/measure/Measure';
import CoverageRating from '../../../components/ui/CoverageRating';
+import ProjectCardLanguagesContainer from './ProjectCardLanguagesContainer';
interface Props {
measures: T.Dict<string | undefined>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import Level from 'sonar-ui-common/components/ui/Level';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
interface Props {
status?: string;
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
import { List, ListRowProps } from 'react-virtualized/dist/commonjs/List';
import { WindowScroller } from 'react-virtualized/dist/commonjs/WindowScroller';
-import ProjectCard from './ProjectCard';
-import NoFavoriteProjects from './NoFavoriteProjects';
-import EmptyInstance from './EmptyInstance';
-import EmptyFavoriteSearch from './EmptyFavoriteSearch';
+import { OnboardingContext } from '../../../app/components/OnboardingContext';
import EmptySearch from '../../../components/common/EmptySearch';
-import { Project } from '../types';
import { Query } from '../query';
-import { OnboardingContext } from '../../../app/components/OnboardingContext';
+import { Project } from '../types';
+import EmptyFavoriteSearch from './EmptyFavoriteSearch';
+import EmptyInstance from './EmptyInstance';
+import NoFavoriteProjects from './NoFavoriteProjects';
+import ProjectCard from './ProjectCard';
interface Props {
cardType?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import SortDescIcon from 'sonar-ui-common/components/icons/SortDescIcon';
import { sortBy } from 'lodash';
-import SortAscIcon from 'sonar-ui-common/components/icons/SortAscIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import * as React from 'react';
import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import Select from 'sonar-ui-common/components/controls/Select';
-import ProjectsSortingSelectOption, { Option } from './ProjectsSortingSelectOption';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import SortAscIcon from 'sonar-ui-common/components/icons/SortAscIcon';
+import SortDescIcon from 'sonar-ui-common/components/icons/SortDescIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { colors } from '../../../app/theme';
-import { SORTING_METRICS, SORTING_LEAK_METRICS, parseSorting } from '../utils';
+import { parseSorting, SORTING_LEAK_METRICS, SORTING_METRICS } from '../utils';
+import ProjectsSortingSelectOption, { Option } from './ProjectsSortingSelectOption';
interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
export interface Option {
label: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { AllProjects } from '../AllProjects';
+import * as React from 'react';
import { get, save } from 'sonar-ui-common/helpers/storage';
-import { isSonarCloud } from '../../../../helpers/system';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import { isSonarCloud } from '../../../../helpers/system';
+import { AllProjects } from '../AllProjects';
jest.mock('../ProjectsList', () => ({
// eslint-disable-next-line
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import ClearAll from '../ClearAll';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount } from 'enzyme';
+import * as React from 'react';
import { get } from 'sonar-ui-common/helpers/storage';
import { doAsync } from 'sonar-ui-common/helpers/testUtils';
-import { DefaultPageSelector } from '../DefaultPageSelector';
import { searchProjects } from '../../../../api/components';
+import { DefaultPageSelector } from '../DefaultPageSelector';
jest.mock('../AllProjectsContainer', () => ({
// eslint-disable-next-line
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import EmptyInstance from '../EmptyInstance';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import EmptyInstance from '../EmptyInstance';
jest.mock('../../../../helpers/system', () => ({
isSonarCloud: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { save } from 'sonar-ui-common/helpers/storage';
import { click } from 'sonar-ui-common/helpers/testUtils';
import FavoriteFilter from '../FavoriteFilter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { NoFavoriteProjects } from '../NoFavoriteProjects';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import { NoFavoriteProjects } from '../NoFavoriteProjects';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PageHeader from '../PageHeader';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PageSidebar from '../PageSidebar';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PerspectiveSelect from '../PerspectiveSelect';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PerspectiveSelectOption from '../PerspectiveSelectOption';
it('should render correctly for a view', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockCurrentUser } from '../../../../helpers/testMocks';
import { Project } from '../../types';
import ProjectCard from '../ProjectCard';
-import { mockCurrentUser } from '../../../../helpers/testMocks';
const ORGANIZATION = { key: 'org', name: 'org' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectCardLanguages from '../ProjectCardLanguages';
const languages = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProjectCardLeak from '../ProjectCardLeak';
-import { Project } from '../../types';
+import * as React from 'react';
import { mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks';
+import { Project } from '../../types';
+import ProjectCardLeak from '../ProjectCardLeak';
jest.mock(
'date-fns/difference_in_milliseconds',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectCardLeakMeasures from '../ProjectCardLeakMeasures';
it('should render correctly with all data', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProjectCardOverall from '../ProjectCardOverall';
-import { Project } from '../../types';
+import * as React from 'react';
import { mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks';
+import { Project } from '../../types';
+import ProjectCardOverall from '../ProjectCardOverall';
const MEASURES = {
alert_status: 'OK',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectCardOverallMeasures from '../ProjectCardOverallMeasures';
it('should render correctly with all data', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectCardQualityGate from '../ProjectCardQualityGate';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectsList from '../ProjectsList';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import ProjectsSortingSelect from '../ProjectsSortingSelect';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectsSortingSelectOption from '../ProjectsSortingSelectOption';
it('renders', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- getCoverageRatingLabel,
- getCoverageRatingAverageValue
+ getCoverageRatingAverageValue,
+ getCoverageRatingLabel
} from 'sonar-ui-common/helpers/ratings';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Filter from './Filter';
-import FilterHeader from './FilterHeader';
import CoverageRating from '../../../components/ui/CoverageRating';
import { Facet } from '../types';
+import Filter from './Filter';
+import FilterHeader from './FilterHeader';
export interface Props {
className?: string;
*/
import * as React from 'react';
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- getDuplicationsRatingLabel,
- getDuplicationsRatingAverageValue
+ getDuplicationsRatingAverageValue,
+ getDuplicationsRatingLabel
} from 'sonar-ui-common/helpers/ratings';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
-import { Facet } from '../types';
export interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { Facet } from '../types';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Rating from 'sonar-ui-common/components/ui/Rating';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
-import { Facet } from '../types';
interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { difference, sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getLanguageByKey } from '../../../store/languages';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
import SearchableFilterFooter from './SearchableFilterFooter';
import SearchableFilterOption from './SearchableFilterOption';
-import { getLanguageByKey } from '../../../store/languages';
-import { Facet } from '../types';
interface Props {
facet?: Facet;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import LanguagesFilter from './LanguagesFilter';
import { getLanguages, Store } from '../../../store/rootReducer';
+import LanguagesFilter from './LanguagesFilter';
const stateToProps = (state: Store) => ({
languages: getLanguages(state)
import * as React from 'react';
import CodeSmellIcon from 'sonar-ui-common/components/icons/CodeSmellIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { getSizeRatingLabel } from 'sonar-ui-common/helpers/ratings';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getSizeRatingLabel } from 'sonar-ui-common/helpers/ratings';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
-import { Facet } from '../types';
export interface Props {
className?: string;
import * as React from 'react';
import CodeSmellIcon from 'sonar-ui-common/components/icons/CodeSmellIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
import * as React from 'react';
import BugIcon from 'sonar-ui-common/components/icons/BugIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
import * as React from 'react';
import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import Level from 'sonar-ui-common/components/ui/Level';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
-import { Facet } from '../types';
export interface Props {
className?: string;
import * as React from 'react';
import BugIcon from 'sonar-ui-common/components/icons/BugIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
isFavorite?: boolean;
import * as React from 'react';
import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import IssuesFilter from './IssuesFilter';
interface Props {
className?: string;
*/
import * as React from 'react';
import SizeRating from 'sonar-ui-common/components/ui/SizeRating';
-import { getSizeRatingLabel, getSizeRatingAverageValue } from 'sonar-ui-common/helpers/ratings';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getSizeRatingAverageValue, getSizeRatingLabel } from 'sonar-ui-common/helpers/ratings';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
-import { Facet } from '../types';
export interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { debounce, difference, size, sortBy } from 'lodash';
import * as React from 'react';
-import { debounce, difference, sortBy, size } from 'lodash';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { searchProjectTags } from '../../../api/components';
+import { Facet } from '../types';
import Filter from './Filter';
import FilterHeader from './FilterHeader';
import SearchableFilterFooter from './SearchableFilterFooter';
import SearchableFilterOption from './SearchableFilterOption';
-import { searchProjectTags } from '../../../api/components';
-import { Facet } from '../types';
interface Props {
facet?: Facet;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import CoverageFilter from '../CoverageFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DuplicationsFilter from '../DuplicationsFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Filter from '../Filter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FilterHeader from '../FilterHeader';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import IssuesFilter from '../IssuesFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LanguagesFilter from '../LanguagesFilter';
const languages = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MaintainabilityFilter from '../MaintainabilityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewCoverageFilter from '../NewCoverageFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewDuplicationsFilter from '../NewDuplicationsFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewLinesFilter from '../NewLinesFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewMaintainabilityFilter from '../NewMaintainabilityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewReliabilityFilter from '../NewReliabilityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import NewSecurityFilter from '../NewSecurityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import QualityGateFilter, { Props } from '../QualityGateFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ReliabilityFilter from '../ReliabilityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchFilterContainer from '../SearchFilterContainer';
it('searches', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchableFilterFooter from '../SearchableFilterFooter';
const options = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SearchableFilterOption from '../SearchableFilterOption';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SecurityFilter from '../SecurityFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SizeFilter from '../SizeFilter';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TagsFilter from '../TagsFilter';
const tags = ['lang', 'sonar', 'csharp', 'dotnet', 'it', 'net'];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { RouterState, RedirectFunction } from 'react-router';
+import { RedirectFunction, RouterState } from 'react-router';
+import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { save } from 'sonar-ui-common/helpers/storage';
import { isDefined } from 'sonar-ui-common/helpers/types';
-import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import DefaultPageSelectorContainer from './components/DefaultPageSelectorContainer';
import FavoriteProjectsContainer from './components/FavoriteProjectsContainer';
-import { PROJECTS_DEFAULT_FILTER, PROJECTS_ALL } from './utils';
+import { PROJECTS_ALL, PROJECTS_DEFAULT_FILTER } from './utils';
const routes = [
{ indexRoute: { component: DefaultPageSelectorContainer } },
import { uniq } from 'lodash';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { RequestData } from 'sonar-ui-common/helpers/request';
-import { Query, convertToFilter } from './query';
-import { getOrganizations } from '../../api/organizations';
-import { searchProjects, Facet } from '../../api/components';
+import { Facet, searchProjects } from '../../api/components';
import { getMeasuresForProjects } from '../../api/measures';
-import { isDiffMetric, getPeriodValue } from '../../helpers/measures';
+import { getOrganizations } from '../../api/organizations';
+import { getPeriodValue, isDiffMetric } from '../../helpers/measures';
+import { convertToFilter, Query } from './query';
interface SortingOption {
class?: string;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SimpleBubbleChart from './SimpleBubbleChart';
import { Project } from '../types';
+import SimpleBubbleChart from './SimpleBubbleChart';
interface Props {
displayOrganizations: boolean;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SimpleBubbleChart from './SimpleBubbleChart';
import { Project } from '../types';
+import SimpleBubbleChart from './SimpleBubbleChart';
interface Props {
displayOrganizations: boolean;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SimpleBubbleChart from './SimpleBubbleChart';
import { Project } from '../types';
+import SimpleBubbleChart from './SimpleBubbleChart';
interface Props {
displayOrganizations: boolean;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SimpleBubbleChart from './SimpleBubbleChart';
import { Project } from '../types';
+import SimpleBubbleChart from './SimpleBubbleChart';
interface Props {
displayOrganizations: boolean;
*/
import * as React from 'react';
import BubbleChart from 'sonar-ui-common/components/charts/BubbleChart';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import { Project } from '../types';
import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend';
import { RATING_COLORS } from '../../../helpers/constants';
import { getProjectUrl } from '../../../helpers/urls';
+import { Project } from '../types';
const X_METRIC = 'sqale_index';
const X_METRIC_TYPE = 'SHORT_WORK_DUR';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SimpleBubbleChart from './SimpleBubbleChart';
import { Project } from '../types';
+import SimpleBubbleChart from './SimpleBubbleChart';
interface Props {
displayOrganizations: boolean;
*/
import * as React from 'react';
import BubbleChart from 'sonar-ui-common/components/charts/BubbleChart';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend';
import { RATING_COLORS } from '../../../helpers/constants';
import { getProjectUrl } from '../../../helpers/urls';
*/
import * as React from 'react';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Risk from './Risk';
-import Reliability from './Reliability';
-import Security from './Security';
-import Maintainability from './Maintainability';
+import { Project } from '../types';
+import { localizeSorting } from '../utils';
import Coverage from './Coverage';
import Duplications from './Duplications';
-import { localizeSorting } from '../utils';
-import { Project } from '../types';
+import Maintainability from './Maintainability';
+import Reliability from './Reliability';
+import Risk from './Risk';
+import Security from './Security';
interface Props {
displayOrganizations?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Coverage from '../Coverage';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Duplications from '../Duplications';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Maintainability from '../Maintainability';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Reliability from '../Reliability';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Risk from '../Risk';
+import * as React from 'react';
import { Project } from '../../types';
+import Risk from '../Risk';
it('renders', () => {
const project1: Project = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Security from '../Security';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import SimpleBubbleChart from '../SimpleBubbleChart';
+import * as React from 'react';
import { Project } from '../../types';
+import SimpleBubbleChart from '../SimpleBubbleChart';
it('renders', () => {
const project1: Project = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Visualizations from '../Visualizations';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { debounce, uniq, without } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { debounce, uniq, without } from 'lodash';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
import { toNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import { getComponents, Project } from '../../api/components';
+import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
+import CreateProjectForm from './CreateProjectForm';
import Header from './Header';
-import Search from './Search';
import Projects from './Projects';
-import CreateProjectForm from './CreateProjectForm';
-import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
-import { getComponents, Project } from '../../api/components';
+import Search from './Search';
export interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import App from './App';
import { changeProjectDefaultVisibility } from '../../api/permissions';
-import { getAppState, getOrganizationByKey, getCurrentUser, Store } from '../../store/rootReducer';
-import { fetchOrganization } from '../../store/rootActions';
import { receiveOrganizations } from '../../store/organizations';
+import { fetchOrganization } from '../../store/rootActions';
+import { getAppState, getCurrentUser, getOrganizationByKey, Store } from '../../store/rootReducer';
+import App from './App';
interface StateProps {
appState: { defaultOrganization: string; qualifiers: string[] };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { toNotSoISOString } from 'sonar-ui-common/helpers/dates';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import Select from 'sonar-ui-common/components/controls/Select';
-import { getPermissionTemplates, bulkApplyTemplate } from '../../api/permissions';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { toNotSoISOString } from 'sonar-ui-common/helpers/dates';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { bulkApplyTemplate, getPermissionTemplates } from '../../api/permissions';
export interface Props {
analyzedBefore: Date | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
export interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { Link } from 'react-router';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createProject } from '../../api/components';
-import UpgradeOrganizationBox from '../create/components/UpgradeOrganizationBox';
import VisibilitySelector from '../../components/common/VisibilitySelector';
import { getProjectUrl } from '../../helpers/urls';
+import UpgradeOrganizationBox from '../create/components/UpgradeOrganizationBox';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { toNotSoISOString } from 'sonar-ui-common/helpers/dates';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { toNotSoISOString } from 'sonar-ui-common/helpers/dates';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { bulkDeleteProjects } from '../../api/components';
export interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { EditButton, Button } from 'sonar-ui-common/components/controls/buttons';
-import ChangeDefaultVisibilityForm from './ChangeDefaultVisibilityForm';
import { isSonarCloud } from '../../helpers/system';
+import ChangeDefaultVisibilityForm from './ChangeDefaultVisibilityForm';
export interface Props {
hasProvisionPermission?: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { Link } from 'react-router';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
-import ProjectRowActions from './ProjectRowActions';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { Project } from '../../api/components';
import PrivacyBadgeContainer from '../../components/common/PrivacyBadgeContainer';
import DateTooltipFormatter from '../../components/intl/DateTooltipFormatter';
-import { Project } from '../../api/components';
+import ProjectRowActions from './ProjectRowActions';
interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import RestoreAccessModal from './RestoreAccessModal';
-import ApplyTemplate from '../permissions/project/components/ApplyTemplate';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Project } from '../../api/components';
import { getComponentNavigation } from '../../api/nav';
import { getComponentPermissionsUrl } from '../../helpers/urls';
+import ApplyTemplate from '../permissions/project/components/ApplyTemplate';
+import RestoreAccessModal from './RestoreAccessModal';
export interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProjectRow from './ProjectRow';
import { Project } from '../../api/components';
+import ProjectRow from './ProjectRow';
interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { grantPermissionToUser } from '../../api/permissions';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Project } from '../../api/components';
+import { grantPermissionToUser } from '../../api/permissions';
interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
import Select from 'sonar-ui-common/components/controls/Select';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Project } from '../../api/components';
+import DateInput from '../../components/controls/DateInput';
import BulkApplyTemplateModal from './BulkApplyTemplateModal';
import DeleteModal from './DeleteModal';
-import DateInput from '../../components/controls/DateInput';
-import { Project } from '../../api/components';
export interface Props {
analyzedBefore: Date | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import App, { Props } from '../App';
jest.mock('lodash', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
-import BulkApplyTemplateModal, { Props } from '../BulkApplyTemplateModal';
-import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import BulkApplyTemplateModal, { Props } from '../BulkApplyTemplateModal';
jest.mock('../../../api/permissions', () => ({
bulkApplyTemplate: jest.fn(() => Promise.resolve()),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import ChangeDefaultVisibilityForm from '../ChangeDefaultVisibilityForm';
)
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CreateProjectForm from '../CreateProjectForm';
+import * as React from 'react';
import { change, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import CreateProjectForm from '../CreateProjectForm';
const createProject = require('../../../api/components').createProject as jest.Mock<any>;
bulkDeleteProjects: jest.fn(() => Promise.resolve())
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
-import DeleteModal, { Props } from '../DeleteModal';
-import { click } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
+import { click } from 'sonar-ui-common/helpers/testUtils';
+import DeleteModal, { Props } from '../DeleteModal';
const bulkDeleteProjects = require('../../../api/components').bulkDeleteProjects as jest.Mock<any>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Header, { Props } from '../Header';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProjectRow from '../ProjectRow';
const project = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ProjectRowActions, { Props } from '../ProjectRowActions';
-import { mockLoggedInUser } from '../../../helpers/testMocks';
import { getComponentNavigation } from '../../../api/nav';
+import { mockLoggedInUser } from '../../../helpers/testMocks';
+import ProjectRowActions, { Props } from '../ProjectRowActions';
jest.mock('../../../api/nav', () => ({
getComponentNavigation: jest.fn().mockResolvedValue({})
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Projects from '../Projects';
const organization = { key: 'org', name: 'org', projectVisibility: 'public' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Search, { Props } from '../Search';
import * as React from 'react';
import Helmet from 'react-helmet';
import { WithRouterProps } from 'react-router';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
addSideBarClass,
addWhitePageClass,
removeSideBarClass,
removeWhitePageClass
} from 'sonar-ui-common/helpers/pages';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import Details from './Details';
-import List from './List';
-import ListHeader from './ListHeader';
-import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import { fetchQualityGates } from '../../../api/quality-gates';
-import { getQualityGateUrl } from '../../../helpers/urls';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
import '../../../components/search-navigator.css';
+import { getQualityGateUrl } from '../../../helpers/urls';
import '../styles.css';
+import Details from './Details';
+import List from './List';
+import ListHeader from './ListHeader';
interface Props extends WithRouterProps {
organization?: Pick<T.Organization, 'key'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import ActionsDropdown, {
+ ActionsDropdownItem
+} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
import {
- translate,
getLocalizedMetricName,
+ translate,
translateWithParameters
} from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
-import ActionsDropdown, {
- ActionsDropdownItem
-} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import ConditionModal from './ConditionModal';
import { deleteCondition } from '../../../api/quality-gates';
+import ConditionModal from './ConditionModal';
interface Props {
condition: T.Condition;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import MetricSelect from './MetricSelect';
-import ConditionOperator from './ConditionOperator';
-import ThresholdInput from './ThresholdInput';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
import { createCondition, updateCondition } from '../../../api/quality-gates';
import { getPossibleOperators } from '../utils';
+import ConditionOperator from './ConditionOperator';
+import MetricSelect from './MetricSelect';
+import ThresholdInput from './ThresholdInput';
interface Props {
condition?: T.Condition;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getPossibleOperators } from '../utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { differenceWith, map, sortBy, uniqBy } from 'lodash';
-import { translate, getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ModalButton from 'sonar-ui-common/components/controls/ModalButton';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
+import DocTooltip from '../../../components/docs/DocTooltip';
import Condition from './Condition';
import ConditionModal from './ConditionModal';
-import DocTooltip from '../../../components/docs/DocTooltip';
interface Props {
canEdit: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { copyQualityGate } from '../../../api/quality-gates';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import { getQualityGateUrl } from '../../../helpers/urls';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createQualityGate } from '../../../api/quality-gates';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import { getQualityGateUrl } from '../../../helpers/urls';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { deleteQualityGate } from '../../../api/quality-gates';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import { getQualityGatesUrl } from '../../../helpers/urls';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
interface Props {
onDelete: () => Promise<void>;
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import DetailsHeader from './DetailsHeader';
-import DetailsContent from './DetailsContent';
-import { getMetrics, Store } from '../../../store/rootReducer';
-import { fetchMetrics } from '../../../store/rootActions';
import { fetchQualityGate } from '../../../api/quality-gates';
-import { checkIfDefault, addCondition, replaceCondition, deleteCondition } from '../utils';
+import { fetchMetrics } from '../../../store/rootActions';
+import { getMetrics, Store } from '../../../store/rootReducer';
+import { addCondition, checkIfDefault, deleteCondition, replaceCondition } from '../utils';
+import DetailsContent from './DetailsContent';
+import DetailsHeader from './DetailsHeader';
interface OwnProps {
id: string;
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import DocTooltip from '../../../components/docs/DocTooltip';
import Conditions from './Conditions';
import Projects from './Projects';
-import DocTooltip from '../../../components/docs/DocTooltip';
interface Props {
isDefault?: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ModalButton from 'sonar-ui-common/components/controls/ModalButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { setQualityGateAsDefault } from '../../../api/quality-gates';
import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
-import RenameQualityGateForm from './RenameQualityGateForm';
import CopyQualityGateForm from './CopyQualityGateForm';
import DeleteQualityGateForm from './DeleteQualityGateForm';
-import { setQualityGateAsDefault } from '../../../api/quality-gates';
+import RenameQualityGateForm from './RenameQualityGateForm';
interface Props {
onSetDefault: () => void;
import * as React from 'react';
import { Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
import { getQualityGateUrl } from '../../../helpers/urls';
+import BuiltInQualityGateBadge from './BuiltInQualityGateBadge';
interface Props {
organization?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ModalButton from 'sonar-ui-common/components/controls/ModalButton';
-import CreateQualityGateForm from './CreateQualityGateForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
+import CreateQualityGateForm from './CreateQualityGateForm';
interface Props {
canCreate: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
+import Select from 'sonar-ui-common/components/controls/Select';
import {
- translate,
+ getLocalizedMetricDomain,
getLocalizedMetricName,
- getLocalizedMetricDomain
+ translate
} from 'sonar-ui-common/helpers/l10n';
-import Select from 'sonar-ui-common/components/controls/Select';
interface Props {
metrics: T.Metric[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { find, without } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import SelectList, {
SelectListFilter,
SelectListSearchParams
} from 'sonar-ui-common/components/controls/SelectList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
associateGateWithProject,
dissociateGateWithProject,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { renameQualityGate } from '../../../api/quality-gates';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConditionModal from '../ConditionModal';
+import * as React from 'react';
import { mockQualityGate } from '../../../../helpers/testMocks';
+import ConditionModal from '../ConditionModal';
it('should render correctly', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ConditionOperator from '../ConditionOperator';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CopyQualityGateForm from '../CopyQualityGateForm';
+import * as React from 'react';
import { mockQualityGate } from '../../../../helpers/testMocks';
+import CopyQualityGateForm from '../CopyQualityGateForm';
it('should render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import CreateQualityGateForm from '../CreateQualityGateForm';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MetricSelect from '../MetricSelect';
it('should render correctly', () => {
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import SelectList, { SelectListFilter } from 'sonar-ui-common/components/controls/SelectList';
-import Projects from '../Projects';
-import { mockQualityGate } from '../../../../helpers/testMocks';
+import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import {
- searchProjects,
associateGateWithProject,
- dissociateGateWithProject
+ dissociateGateWithProject,
+ searchProjects
} from '../../../../api/quality-gates';
+import { mockQualityGate } from '../../../../helpers/testMocks';
+import Projects from '../Projects';
const qualityGate = mockQualityGate();
const organization = 'TEST';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import RenameQualityGateForm from '../RenameQualityGateForm';
+import * as React from 'react';
import { mockQualityGate } from '../../../../helpers/testMocks';
+import RenameQualityGateForm from '../RenameQualityGateForm';
it('should render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change } from 'sonar-ui-common/helpers/testUtils';
import ThresholdInput from '../ThresholdInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { sortProfiles } from '../utils';
import { Profile } from '../types';
+import { sortProfiles } from '../utils';
function createProfile(key: string, parentKey?: string) {
return { name: key, key, parentKey } as Profile;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as isSameMinute from 'date-fns/is_same_minute';
+import { sortBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { sortBy } from 'lodash';
-import * as isSameMinute from 'date-fns/is_same_minute';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ChangesList from './ChangesList';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import { getRulesUrl } from '../../../helpers/urls';
import { ProfileChangelogEvent } from '../types';
+import ChangesList from './ChangesList';
interface Props {
events: ProfileChangelogEvent[];
import { withRouter, WithRouterProps } from 'react-router';
import { parseDate, toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Changelog from './Changelog';
-import ChangelogSearch from './ChangelogSearch';
-import ChangelogEmpty from './ChangelogEmpty';
import { getProfileChangelog } from '../../../api/quality-profiles';
-import { getProfileChangelogPath } from '../utils';
import { Profile, ProfileChangelogEvent } from '../types';
+import { getProfileChangelogPath } from '../utils';
+import Changelog from './Changelog';
+import ChangelogEmpty from './ChangelogEmpty';
+import ChangelogSearch from './ChangelogSearch';
interface Props extends WithRouterProps {
organization: string | null;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DateRangeInput from '../../../components/controls/DateRangeInput';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import SeverityChange from './SeverityChange';
import ParameterChange from './ParameterChange';
+import SeverityChange from './SeverityChange';
interface Props {
changes: T.Dict<string | null>;
*/
import { shallow } from 'enzyme';
import * as React from 'react';
+import { ProfileChangelogEvent } from '../../types';
import Changelog from '../Changelog';
import ChangesList from '../ChangesList';
-import { ProfileChangelogEvent } from '../../types';
function createEvent(overrides?: Partial<ProfileChangelogEvent>): ProfileChangelogEvent {
return {
import { shallow } from 'enzyme';
import * as React from 'react';
import ChangesList from '../ChangesList';
-import SeverityChange from '../SeverityChange';
import ParameterChange from '../ParameterChange';
+import SeverityChange from '../SeverityChange';
it('should render changes', () => {
const changes = { severity: 'BLOCKER', foo: 'bar' };
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import SeverityChange from '../SeverityChange';
import SeverityHelper from '../../../../components/shared/SeverityHelper';
+import SeverityChange from '../SeverityChange';
it('should render SeverityHelper', () => {
const output = shallow(<SeverityChange severity="BLOCKER" />).find(SeverityHelper);
*/
import * as React from 'react';
import { withRouter, WithRouterProps } from 'react-router';
-import ComparisonForm from './ComparisonForm';
-import ComparisonResults from './ComparisonResults';
import { compareProfiles, CompareResponse } from '../../../api/quality-profiles';
-import { getProfileComparePath } from '../utils';
import { Profile } from '../types';
+import { getProfileComparePath } from '../utils';
+import ComparisonForm from './ComparisonForm';
+import ComparisonResults from './ComparisonResults';
interface Props extends WithRouterProps {
organization?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Profile } from '../types';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Profile } from '../../../api/quality-profiles';
import { getRuleDetails } from '../../../api/rules';
import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
import SeverityIcon from 'sonar-ui-common/components/icons/SeverityIcon';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { CompareResponse, Profile } from '../../../api/quality-profiles';
+import { getRulesUrl } from '../../../helpers/urls';
import ComparisonEmpty from './ComparisonEmpty';
import ComparisonResultActivation from './ComparisonResultActivation';
-import { getRulesUrl } from '../../../helpers/urls';
-import { CompareResponse, Profile } from '../../../api/quality-profiles';
type Params = T.Dict<string>;
*/
import { shallow } from 'enzyme';
import * as React from 'react';
-import ComparisonForm from '../ComparisonForm';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import ComparisonForm from '../ComparisonForm';
it('should render Select with right options', () => {
const profile = mockQualityProfile();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ComparisonResultActivation from '../ComparisonResultActivation';
import { Profile } from '../../../../api/quality-profiles';
+import ComparisonResultActivation from '../ComparisonResultActivation';
jest.mock('../../../../api/rules', () => ({
getRuleDetails: jest.fn().mockResolvedValue({ key: 'foo' })
import { shallow } from 'enzyme';
import * as React from 'react';
import { Link } from 'react-router';
-import ComparisonResults from '../ComparisonResults';
-import ComparisonEmpty from '../ComparisonEmpty';
import { Profile } from '../../../../api/quality-profiles';
+import ComparisonEmpty from '../ComparisonEmpty';
+import ComparisonResults from '../ComparisonResults';
it('should render ComparisonEmpty', () => {
const output = shallow(
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { searchQualityProfiles, getExporters, Actions } from '../../../api/quality-profiles';
+import { Actions, getExporters, searchQualityProfiles } from '../../../api/quality-profiles';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { sortProfiles } from '../utils';
-import { Exporter, Profile } from '../types';
import OrganizationHelmet from '../../../components/common/OrganizationHelmet';
import '../styles.css';
+import { Exporter, Profile } from '../types';
+import { sortProfiles } from '../utils';
interface Props {
children: React.ReactElement<any>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import App from './App';
import { getLanguages, getOrganizationByKey, Store } from '../../../store/rootReducer';
+import App from './App';
const mapStateToProps = (state: Store, ownProps: any) => ({
languages: getLanguages(state),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Profile } from '../types';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { copyProfile } from '../../../api/quality-profiles';
+import { Profile } from '../types';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import { Profile } from '../types';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { deleteProfile } from '../../../api/quality-profiles';
+import { Profile } from '../types';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { changeProfileParent, createQualityProfile } from '../../../api/quality-profiles';
import { Profile } from '../types';
-import { createQualityProfile, changeProfileParent } from '../../../api/quality-profiles';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
- ActionsDropdownItem,
- ActionsDropdownDivider
+ ActionsDropdownDivider,
+ ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
-import RenameProfileForm from './RenameProfileForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { setDefaultProfile } from '../../../api/quality-profiles';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import { getRulesUrl } from '../../../helpers/urls';
+import { Profile } from '../types';
+import { getProfileComparePath, getProfilePath, getProfilesPath } from '../utils';
import CopyProfileForm from './CopyProfileForm';
import DeleteProfileForm from './DeleteProfileForm';
import ExtendProfileForm from './ExtendProfileForm';
-import { getRulesUrl } from '../../../helpers/urls';
-import { setDefaultProfile } from '../../../api/quality-profiles';
-import { getProfilePath, getProfileComparePath, getProfilesPath } from '../utils';
-import { Profile } from '../types';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import RenameProfileForm from './RenameProfileForm';
interface Props {
className?: string;
import * as React from 'react';
import Helmet from 'react-helmet';
import { WithRouterProps } from 'react-router';
-import ProfileNotFound from './ProfileNotFound';
import ProfileHeader from '../details/ProfileHeader';
import { Profile } from '../types';
+import ProfileNotFound from './ProfileNotFound';
interface Props {
children: React.ReactElement<any>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DateFromNow from '../../../components/intl/DateFromNow';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { Profile } from '../types';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { renameProfile } from '../../../api/quality-profiles';
+import { Profile } from '../types';
interface Props {
onClose: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import ExtendProfileForm from '../ExtendProfileForm';
-import { createQualityProfile, changeProfileParent } from '../../../../api/quality-profiles';
+import { changeProfileParent, createQualityProfile } from '../../../../api/quality-profiles';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import ExtendProfileForm from '../ExtendProfileForm';
jest.mock('../../../../api/quality-profiles', () => ({
createQualityProfile: jest.fn().mockResolvedValue({ profile: { key: 'new-profile' } }),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { ProfileActions } from '../ProfileActions';
import { mockQualityProfile, mockRouter } from '../../../../helpers/testMocks';
+import { ProfileActions } from '../ProfileActions';
const PROFILE = mockQualityProfile({
activeRuleCount: 68,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Helmet from 'react-helmet';
import { WithRouterProps } from 'react-router';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
+import ProfileHeader from '../../details/ProfileHeader';
import ProfileContainer from '../ProfileContainer';
import ProfileNotFound from '../ProfileNotFound';
-import ProfileHeader from '../../details/ProfileHeader';
-import { mockQualityProfile } from '../../../../helpers/testMocks';
const routerProps = { router: {} } as WithRouterProps;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import * as React from 'react';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import Select from 'sonar-ui-common/components/controls/Select';
-import { Profile } from '../types';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { changeProfileParent } from '../../../api/quality-profiles';
+import { Profile } from '../types';
interface Props {
onChange: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { find, without } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Modal from 'sonar-ui-common/components/controls/Modal';
import SelectList, {
SelectListFilter,
SelectListSearchParams
} from 'sonar-ui-common/components/controls/SelectList';
-import { Profile } from '../types';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
associateProject,
dissociateProject,
getProfileProjects,
ProfileProject
} from '../../../api/quality-profiles';
+import { Profile } from '../types';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import ProfileRules from './ProfileRules';
-import ProfileProjects from './ProfileProjects';
-import ProfileInheritance from './ProfileInheritance';
+import { Exporter, Profile } from '../types';
import ProfileExporters from './ProfileExporters';
+import ProfileInheritance from './ProfileInheritance';
import ProfilePermissions from './ProfilePermissions';
-import { Exporter, Profile } from '../types';
+import ProfileProjects from './ProfileProjects';
+import ProfileRules from './ProfileRules';
interface Props {
exporters: Exporter[];
import { stringify } from 'querystring';
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Profile, Exporter } from '../types';
+import { Exporter, Profile } from '../types';
interface Props {
exporters: Exporter[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { Link, IndexLink } from 'react-router';
+import { IndexLink, Link } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ProfileLink from '../components/ProfileLink';
+import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
import ProfileActions from '../components/ProfileActions';
import ProfileDate from '../components/ProfileDate';
-import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
+import ProfileLink from '../components/ProfileLink';
+import { Profile } from '../types';
import {
- isStagnant,
- getProfilesPath,
+ getProfileChangelogPath,
getProfilesForLanguagePath,
- getProfileChangelogPath
+ getProfilesPath,
+ isStagnant
} from '../utils';
-import { Profile } from '../types';
interface Props {
profile: Profile;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import ProfileInheritanceBox from './ProfileInheritanceBox';
-import ChangeParentForm from './ChangeParentForm';
-import { Profile } from '../types';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getProfileInheritance } from '../../../api/quality-profiles';
+import { Profile } from '../types';
+import ChangeParentForm from './ChangeParentForm';
+import ProfileInheritanceBox from './ProfileInheritanceBox';
interface Props {
organization: string | null;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
-import ProfileLink from '../components/ProfileLink';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
+import ProfileLink from '../components/ProfileLink';
interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy, uniqBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import ProfilePermissionsUser from './ProfilePermissionsUser';
-import ProfilePermissionsGroup from './ProfilePermissionsGroup';
-import ProfilePermissionsForm from './ProfilePermissionsForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- searchUsers,
searchGroups,
+ searchUsers,
SearchUsersGroupsParameters
} from '../../../api/quality-profiles';
import { Profile } from '../types';
+import ProfilePermissionsForm from './ProfilePermissionsForm';
+import ProfilePermissionsGroup from './ProfilePermissionsGroup';
+import ProfilePermissionsUser from './ProfilePermissionsUser';
export interface Group {
name: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import ProfilePermissionsFormSelect from './ProfilePermissionsFormSelect';
-import { Group } from './ProfilePermissions';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
- searchUsers,
- searchGroups,
- addUser,
addGroup,
+ addUser,
+ searchGroups,
+ searchUsers,
SearchUsersGroupsParameters
} from '../../../api/quality-profiles';
+import { Group } from './ProfilePermissions';
+import ProfilePermissionsFormSelect from './ProfilePermissionsFormSelect';
interface Props {
onClose: () => void;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { debounce, identity } from 'lodash';
import * as React from 'react';
+import Select from 'sonar-ui-common/components/controls/Select';
import GroupIcon from 'sonar-ui-common/components/icons/GroupIcon';
-import { debounce, identity } from 'lodash';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Select from 'sonar-ui-common/components/controls/Select';
-import { Group } from './ProfilePermissions';
import Avatar from '../../../components/ui/Avatar';
+import { Group } from './ProfilePermissions';
type Option = T.UserSelected | Group;
type OptionWithValue = Option & { value: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import GroupIcon from 'sonar-ui-common/components/icons/GroupIcon';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { DeleteButton, Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { Button, DeleteButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal, { ChildrenProps } from 'sonar-ui-common/components/controls/SimpleModal';
-import { Group } from './ProfilePermissions';
+import GroupIcon from 'sonar-ui-common/components/icons/GroupIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { removeGroup } from '../../../api/quality-profiles';
+import { Group } from './ProfilePermissions';
interface Props {
group: Group;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import {
DeleteButton,
- SubmitButton,
- ResetButtonLink
+ ResetButtonLink,
+ SubmitButton
} from 'sonar-ui-common/components/controls/buttons';
import SimpleModal, { ChildrenProps } from 'sonar-ui-common/components/controls/SimpleModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { removeUser } from '../../../api/quality-profiles';
import Avatar from '../../../components/ui/Avatar';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import ChangeProjectsForm from './ChangeProjectsForm';
-import { Profile } from '../types';
+import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getProfileProjects } from '../../../api/quality-profiles';
+import { Profile } from '../types';
+import ChangeProjectsForm from './ChangeProjectsForm';
interface Props {
organization: string | null;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { keyBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { keyBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import ProfileRulesRowOfType from './ProfileRulesRowOfType';
-import ProfileRulesRowTotal from './ProfileRulesRowTotal';
-import ProfileRulesDeprecatedWarning from './ProfileRulesDeprecatedWarning';
-import ProfileRulesSonarWayComparison from './ProfileRulesSonarWayComparison';
-import { searchRules, takeFacet } from '../../../api/rules';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getQualityProfile } from '../../../api/quality-profiles';
+import { searchRules, takeFacet } from '../../../api/rules';
+import DocTooltip from '../../../components/docs/DocTooltip';
import { getRulesUrl } from '../../../helpers/urls';
import { Profile } from '../types';
-import DocTooltip from '../../../components/docs/DocTooltip';
+import ProfileRulesDeprecatedWarning from './ProfileRulesDeprecatedWarning';
+import ProfileRulesRowOfType from './ProfileRulesRowOfType';
+import ProfileRulesRowTotal from './ProfileRulesRowTotal';
+import ProfileRulesSonarWayComparison from './ProfileRulesSonarWayComparison';
const TYPES = ['BUG', 'VULNERABILITY', 'CODE_SMELL', 'SECURITY_HOTSPOT'];
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls';
interface Props {
*/
import * as React from 'react';
import { Link } from 'react-router';
+import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import { getRulesUrl } from '../../../helpers/urls';
interface Props {
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getRulesUrl } from '../../../helpers/urls';
interface Props {
import { shallow } from 'enzyme';
import * as React from 'react';
import SelectList, { SelectListFilter } from 'sonar-ui-common/components/controls/SelectList';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
-import ChangeProjectsForm from '../ChangeProjectsForm';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import {
- getProfileProjects,
associateProject,
- dissociateProject
+ dissociateProject,
+ getProfileProjects
} from '../../../../api/quality-profiles';
+import ChangeProjectsForm from '../ChangeProjectsForm';
const profile: any = { key: 'profFile_key' };
const organization = 'TEST';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProfileDetails from '../ProfileDetails';
+import * as React from 'react';
import { Profile } from '../../types';
+import ProfileDetails from '../ProfileDetails';
it('renders without permissions', () => {
expect(
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
-import ProfilePermissions from '../ProfilePermissions';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
+import ProfilePermissions from '../ProfilePermissions';
jest.mock('../../../../api/quality-profiles', () => ({
searchUsers: jest.fn(() => Promise.resolve([])),
addGroup: jest.fn(() => Promise.resolve())
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProfilePermissionsForm from '../ProfilePermissionsForm';
+import * as React from 'react';
import { submit } from 'sonar-ui-common/helpers/testUtils';
+import ProfilePermissionsForm from '../ProfilePermissionsForm';
const addUser = require('../../../../api/quality-profiles').addUser as jest.Mock<any>;
const addGroup = require('../../../../api/quality-profiles').addGroup as jest.Mock<any>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfilePermissionsFormSelect from '../ProfilePermissionsFormSelect';
jest.mock('lodash', () => {
removeGroup: jest.fn(() => Promise.resolve())
}));
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProfilePermissionsGroup from '../ProfilePermissionsGroup';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import ProfilePermissionsGroup from '../ProfilePermissionsGroup';
const removeGroup = require('../../../../api/quality-profiles').removeGroup as jest.Mock<any>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import ProfilePermissionsUser from '../ProfilePermissionsUser';
import { removeUser } from '../../../../api/quality-profiles';
+import ProfilePermissionsUser from '../ProfilePermissionsUser';
jest.mock('../../../../api/quality-profiles', () => ({
removeUser: jest.fn(() => Promise.resolve())
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ProfileProjects from '../ProfileProjects';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import ProfileProjects from '../ProfileProjects';
jest.mock('../../../../api/quality-profiles', () => ({
getProfileProjects: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ProfileRules from '../ProfileRules';
-import * as apiRules from '../../../../api/rules';
import * as apiQP from '../../../../api/quality-profiles';
+import * as apiRules from '../../../../api/rules';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import ProfileRules from '../ProfileRules';
const PROFILE = mockQualityProfile({
activeRuleCount: 68,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfileRulesDeprecatedWarning from '../ProfileRulesDeprecatedWarning';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfileRulesRowOfType from '../ProfileRulesRowOfType';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfileRulesRowTotal from '../ProfileRulesRowTotal';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ProfileRulesSonarWayComparison from '../ProfileRulesSonarWayComparison';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import * as React from 'react';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import {
changeProfileParent,
createQualityProfile,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Profile } from '../types';
import EvolutionDeprecated from './EvolutionDeprecated';
-import EvolutionStagnant from './EvolutionStagnant';
import EvolutionRules from './EvolutionRules';
-import { Profile } from '../types';
+import EvolutionStagnant from './EvolutionStagnant';
interface Props {
organization: string | null;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { sortBy } from 'lodash';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import ProfileLink from '../components/ProfileLink';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getDeprecatedActiveRulesUrl } from '../../../helpers/urls';
+import ProfileLink from '../components/ProfileLink';
import { Profile } from '../types';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { sortBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { sortBy } from 'lodash';
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
import { searchRules } from '../../../api/rules';
import { getRulesUrl } from '../../../helpers/urls';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DateFormatter from '../../../components/intl/DateFormatter';
import ProfileLink from '../components/ProfileLink';
-import { isStagnant } from '../utils';
import { Profile } from '../types';
+import { isStagnant } from '../utils';
interface Props {
organization: string | null;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import PageHeader from './PageHeader';
+import { Actions } from '../../../api/quality-profiles';
+import { Profile } from '../types';
import Evolution from './Evolution';
+import PageHeader from './PageHeader';
import ProfilesList from './ProfilesList';
-import { Profile } from '../types';
-import { Actions } from '../../../api/quality-profiles';
interface Props {
actions: Actions;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import CreateProfileForm from './CreateProfileForm';
-import RestoreProfileForm from './RestoreProfileForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Actions } from '../../../api/quality-profiles';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import { Profile } from '../types';
import { getProfilePath } from '../utils';
-import { Actions } from '../../../api/quality-profiles';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import CreateProfileForm from './CreateProfileForm';
+import RestoreProfileForm from './RestoreProfileForm';
interface Props {
actions: Actions;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { groupBy, pick, sortBy } from 'lodash';
import { Location } from 'history';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { groupBy, pick, sortBy } from 'lodash';
+import * as React from 'react';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import ProfilesListRow from './ProfilesListRow';
-import ProfilesListHeader from './ProfilesListHeader';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../components/docs/DocTooltip';
import { Profile } from '../types';
+import ProfilesListHeader from './ProfilesListHeader';
+import ProfilesListRow from './ProfilesListRow';
interface Props {
languages: T.Language[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Select from 'sonar-ui-common/components/controls/Select';
-import { getProfilesPath, getProfilesForLanguagePath } from '../utils';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
+import { getProfilesForLanguagePath, getProfilesPath } from '../utils';
interface Props {
currentFilter?: string;
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import ProfileLink from '../components/ProfileLink';
-import ProfileDate from '../components/ProfileDate';
-import ProfileActions from '../components/ProfileActions';
-import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import DocTooltip from '../../../components/docs/DocTooltip';
import { getRulesUrl } from '../../../helpers/urls';
-import { isStagnant } from '../utils';
+import BuiltInQualityProfileBadge from '../components/BuiltInQualityProfileBadge';
+import ProfileActions from '../components/ProfileActions';
+import ProfileDate from '../components/ProfileDate';
+import ProfileLink from '../components/ProfileLink';
import { Profile } from '../types';
-import DocTooltip from '../../../components/docs/DocTooltip';
+import { isStagnant } from '../utils';
interface Props {
organization: string | null;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { restoreQualityProfile } from '../../../api/quality-profiles';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CreateProfileForm from '../CreateProfileForm';
+import * as React from 'react';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import CreateProfileForm from '../CreateProfileForm';
jest.mock('../../../../api/quality-profiles', () => ({
changeProfileParent: jest.fn(),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import EvolutionDeprecated from '../EvolutionDeprecated';
+import * as React from 'react';
import { mockQualityProfile } from '../../../../helpers/testMocks';
+import EvolutionDeprecated from '../EvolutionDeprecated';
it('should render correctly', () => {
const wrapper = shallow(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { PageHeader } from '../PageHeader';
import { mockLanguage, mockQualityProfile, mockRouter } from '../../../../helpers/testMocks';
+import { PageHeader } from '../PageHeader';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ProfilesList from '../ProfilesList';
+import * as React from 'react';
import { mockLanguage, mockLocation, mockQualityProfile } from '../../../../helpers/testMocks';
+import ProfilesList from '../ProfilesList';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { ProfilesListHeader } from '../ProfilesListHeader';
+import * as React from 'react';
import { mockRouter } from '../../../../helpers/testMocks';
+import { ProfilesListHeader } from '../ProfilesListHeader';
it('should render correctly', () => {
const wrapper = shallowRender();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import RestoreProfileForm from '../RestoreProfileForm';
it('should render correctly', () => {
import * as differenceInYears from 'date-fns/difference_in_years';
import { sortBy } from 'lodash';
import { isValidDate, parseDate } from 'sonar-ui-common/helpers/dates';
-import { Profile } from './types';
import { Profile as BaseProfile } from '../../api/quality-profiles';
+import { Profile } from './types';
export function sortProfiles(profiles: BaseProfile[]): Profile[] {
const result: Profile[] = [];
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { getTextColor } from 'sonar-ui-common/helpers/colors';
import { getCookie } from 'sonar-ui-common/helpers/cookies';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import { colors } from '../../../app/theme';
import { getIdentityProviders } from '../../../api/users';
+import { colors } from '../../../app/theme';
interface State {
identityProviders: T.IdentityProvider[];
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import LoginForm from './LoginForm';
-import OAuthProviders from './OAuthProviders';
import GlobalMessagesContainer from '../../../app/components/GlobalMessagesContainer';
import './Login.css';
+import LoginForm from './LoginForm';
+import OAuthProviders from './OAuthProviders';
interface Props {
identityProviders: T.IdentityProvider[];
import * as React from 'react';
import { connect } from 'react-redux';
import { getReturnUrl } from 'sonar-ui-common/helpers/urls';
-import Login from './Login';
-import LoginSonarCloud from './LoginSonarCloud';
-import { doLogin } from '../../../store/rootActions';
import { getIdentityProviders } from '../../../api/users';
import { isSonarCloud } from '../../../helpers/system';
+import { doLogin } from '../../../store/rootActions';
+import Login from './Login';
+import LoginSonarCloud from './LoginSonarCloud';
interface OwnProps {
location: {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
import './LoginForm.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { connect } from 'react-redux';
-import * as classNames from 'classnames';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { Store } from '../../../store/rootReducer';
import LoginForm from './LoginForm';
-import OAuthProviders from './OAuthProviders';
import './LoginSonarCloud.css';
-import { Store } from '../../../store/rootReducer';
+import OAuthProviders from './OAuthProviders';
interface Props {
identityProviders: T.IdentityProvider[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
+import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import IdentityProviderLink from 'sonar-ui-common/components/controls/IdentityProviderLink';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import './OAuthProviders.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import EmailAlreadyExists from '../EmailAlreadyExists';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Login from '../Login';
const identityProvider = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, click, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import LoginForm from '../LoginForm';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { LoginSonarCloud } from '../LoginSonarCloud';
const identityProvider = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { Logout } from '../Logout';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OAuthProviders from '../OAuthProviders';
const identityProviders = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Unauthorized from '../Unauthorized';
jest.mock('sonar-ui-common/helpers/cookies', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getEmptyValue, getDefaultValue, sanitizeTranslation } from '../utils';
+import { getDefaultValue, getEmptyValue, sanitizeTranslation } from '../utils';
const fields = [
{ key: 'foo', type: 'STRING' } as T.SettingFieldDefinition,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { connect } from 'react-redux';
import { sortBy } from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
import { IndexLink } from 'react-router';
-import { getCategoryName } from '../utils';
import { getSettingsAppAllCategories, Store } from '../../../store/rootReducer';
+import { getCategoryName } from '../utils';
interface Category {
key: string;
import { connect } from 'react-redux';
import { WithRouterProps } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import { getSettingsAppDefaultCategory, Store } from '../../../store/rootReducer';
+import '../side-tabs.css';
+import { fetchSettings } from '../store/actions';
+import '../styles.css';
import AllCategoriesList from './AllCategoriesList';
import CategoryDefinitionsList from './CategoryDefinitionsList';
import PageHeader from './PageHeader';
import WildcardsHelp from './WildcardsHelp';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { fetchSettings } from '../store/actions';
-import { getSettingsAppDefaultCategory, Store } from '../../../store/rootReducer';
-import '../styles.css';
-import '../side-tabs.css';
interface Props {
component?: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import SubCategoryDefinitionsList from './SubCategoryDefinitionsList';
-import { fetchValues } from '../store/actions';
import { getSettingsAppSettingsForCategory, Store } from '../../../store/rootReducer';
+import { fetchValues } from '../store/actions';
+import SubCategoryDefinitionsList from './SubCategoryDefinitionsList';
interface Props {
category: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import classNames from 'classnames';
import * as React from 'react';
import { connect } from 'react-redux';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
-import classNames from 'classnames';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import Input from './inputs/Input';
-import DefinitionActions from './DefinitionActions';
-import {
- getPropertyName,
- getPropertyDescription,
- getSettingValue,
- isDefaultOrInherited,
- sanitizeTranslation
-} from '../utils';
-import { resetValue, saveValue, checkValue } from '../store/actions';
-import { cancelChange, changeValue, passValidation } from '../store/settingsPage';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import {
getSettingsAppChangedValue,
getSettingsAppValidationMessage,
isSettingsAppLoading,
Store
} from '../../../store/rootReducer';
+import { checkValue, resetValue, saveValue } from '../store/actions';
+import { cancelChange, changeValue, passValidation } from '../store/settingsPage';
+import {
+ getPropertyDescription,
+ getPropertyName,
+ getSettingValue,
+ isDefaultOrInherited,
+ sanitizeTranslation
+} from '../utils';
+import DefinitionActions from './DefinitionActions';
+import Input from './inputs/Input';
interface Props {
cancelChange: (key: string) => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import { isEmptyValue, getDefaultValue, getSettingValue } from '../utils';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getDefaultValue, getSettingValue, isEmptyValue } from '../utils';
type Props = {
changedValue: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { parseError } from 'sonar-ui-common/helpers/request';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { parseError } from 'sonar-ui-common/helpers/request';
import { sendTestEmail } from '../../../api/settings';
+import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
interface Props {
currentUser: T.LoggedInUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { groupBy, isEqual, sortBy } from 'lodash';
+import * as React from 'react';
+import { getSubCategoryDescription, getSubCategoryName, sanitizeTranslation } from '../utils';
import DefinitionsList from './DefinitionsList';
import EmailForm from './EmailForm';
-import { getSubCategoryName, getSubCategoryDescription, sanitizeTranslation } from '../utils';
interface Props {
category: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { Definition } from '../Definition';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DefinitionActions from '../DefinitionActions';
const definition: T.SettingCategoryDefinition = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { EmailForm } from '../EmailForm';
+import * as React from 'react';
import { mockLoggedInUser } from '../../../../helpers/testMocks';
+import { EmailForm } from '../EmailForm';
it('should render correctly', () => {
expect(shallow(<EmailForm currentUser={mockLoggedInUser()} />)).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import PropertySetInput from './PropertySetInput';
+import { DefaultInputProps, isCategoryDefinition } from '../../utils';
import MultiValueInput from './MultiValueInput';
import PrimitiveInput from './PrimitiveInput';
-import { DefaultInputProps, isCategoryDefinition } from '../../utils';
+import PropertySetInput from './PropertySetInput';
export default function Input(props: DefaultInputProps) {
const { definition } = props.setting;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Toggle from 'sonar-ui-common/components/controls/Toggle';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { DefaultSpecializedInputProps } from '../../utils';
interface Props extends DefaultSpecializedInputProps {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import SimpleInput from './SimpleInput';
import { DefaultSpecializedInputProps } from '../../utils';
+import SimpleInput from './SimpleInput';
export default function InputForNumber(props: DefaultSpecializedInputProps) {
return <SimpleInput {...props} className="input-small" type="text" />;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button } from 'sonar-ui-common/components/controls/buttons';
import LockIcon from 'sonar-ui-common/components/icons/LockIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Button } from 'sonar-ui-common/components/controls/buttons';
import { colors } from '../../../../app/theme';
import { DefaultSpecializedInputProps } from '../../utils';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import SimpleInput from './SimpleInput';
import { DefaultSpecializedInputProps } from '../../utils';
+import SimpleInput from './SimpleInput';
export default function InputForString(props: DefaultSpecializedInputProps) {
return <SimpleInput {...props} className="settings-large-input" type="text" />;
*/
import * as React from 'react';
import { DeleteButton } from 'sonar-ui-common/components/controls/buttons';
+import { DefaultInputProps, getEmptyValue } from '../../utils';
import PrimitiveInput from './PrimitiveInput';
-import { getEmptyValue, DefaultInputProps } from '../../utils';
export default class MultiValueInput extends React.PureComponent<DefaultInputProps> {
ensureValue = () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import InputForString from './InputForString';
-import InputForText from './InputForText';
-import InputForPassword from './InputForPassword';
-import InputForBoolean from './InputForBoolean';
-import InputForNumber from './InputForNumber';
-import InputForSingleSelectList from './InputForSingleSelectList';
import {
- getUniqueName,
- isDefaultOrInherited,
DefaultInputProps,
- DefaultSpecializedInputProps
+ DefaultSpecializedInputProps,
+ getUniqueName,
+ isDefaultOrInherited
} from '../../utils';
+import InputForBoolean from './InputForBoolean';
+import InputForNumber from './InputForNumber';
+import InputForPassword from './InputForPassword';
+import InputForSingleSelectList from './InputForSingleSelectList';
+import InputForString from './InputForString';
+import InputForText from './InputForText';
const typeMapping: {
[type in T.SettingType]?: React.ComponentType<DefaultSpecializedInputProps>
*/
import * as React from 'react';
import { DeleteButton } from 'sonar-ui-common/components/controls/buttons';
+import { DefaultInputProps, getEmptyValue, getUniqueName, isCategoryDefinition } from '../../utils';
import PrimitiveInput from './PrimitiveInput';
-import { getEmptyValue, getUniqueName, DefaultInputProps, isCategoryDefinition } from '../../utils';
export default class PropertySetInput extends React.PureComponent<DefaultInputProps> {
ensureValue() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { DefaultSpecializedInputProps } from '../../utils';
interface Props extends DefaultSpecializedInputProps {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import Input from '../Input';
+import * as React from 'react';
import { DefaultInputProps } from '../../../utils';
+import Input from '../Input';
const settingValue = {
key: 'example'
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import InputForBoolean from '../InputForBoolean';
+import * as React from 'react';
import { DefaultSpecializedInputProps } from '../../../utils';
+import InputForBoolean from '../InputForBoolean';
it('should render Toggle', () => {
const onChange = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import InputForNumber from '../InputForNumber';
import SimpleInput from '../SimpleInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { click, change, submit } from 'sonar-ui-common/helpers/testUtils';
-import InputForPassword from '../InputForPassword';
+import * as React from 'react';
+import { change, click, submit } from 'sonar-ui-common/helpers/testUtils';
import { DefaultSpecializedInputProps } from '../../../utils';
+import InputForPassword from '../InputForPassword';
it('should render lock icon, but no form', () => {
const onChange = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import InputForSingleSelectList from '../InputForSingleSelectList';
+import * as React from 'react';
import { DefaultSpecializedInputProps } from '../../../utils';
+import InputForSingleSelectList from '../InputForSingleSelectList';
it('should render Select', () => {
const onChange = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import InputForString from '../InputForString';
import SimpleInput from '../SimpleInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change } from 'sonar-ui-common/helpers/testUtils';
-import InputForText from '../InputForText';
import { DefaultSpecializedInputProps } from '../../../utils';
+import InputForText from '../InputForText';
it('should render textarea', () => {
const onChange = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import { DefaultInputProps } from '../../../utils';
import MultiValueInput from '../MultiValueInput';
import PrimitiveInput from '../PrimitiveInput';
-import { DefaultInputProps } from '../../../utils';
const settingValue = {
key: 'example'
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change } from 'sonar-ui-common/helpers/testUtils';
import SimpleInput from '../SimpleInput';
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { checkSecretKey, generateSecretKey } from '../../../api/settings';
import EncryptionForm from './EncryptionForm';
import GenerateSecretKeyForm from './GenerateSecretKeyForm';
-import { checkSecretKey, generateSecretKey } from '../../../api/settings';
interface State {
loading: boolean;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { encryptValue } from '../../../api/settings';
interface Props {
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
generateSecretKey: () => Promise<void>;
import { Dispatch } from 'redux';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { parseError } from 'sonar-ui-common/helpers/request';
-import { receiveValues } from './values';
-import { receiveDefinitions } from './definitions';
-import {
- cancelChange,
- failValidation,
- passValidation,
- startLoading,
- stopLoading
-} from './settingsPage';
import {
getDefinitions,
getValues,
- setSettingValue,
- resetSettingValue
+ resetSettingValue,
+ setSettingValue
} from '../../../api/settings';
import { closeAllGlobalMessages } from '../../../store/globalMessages';
-import { isEmptyValue } from '../utils';
import {
- getSettingsAppDefinition,
getSettingsAppChangedValue,
+ getSettingsAppDefinition,
Store
} from '../../../store/rootReducer';
+import { isEmptyValue } from '../utils';
+import { receiveDefinitions } from './definitions';
+import {
+ cancelChange,
+ failValidation,
+ passValidation,
+ startLoading,
+ stopLoading
+} from './settingsPage';
+import { receiveValues } from './values';
export function fetchSettings(component?: string) {
return (dispatch: Dispatch) => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { combineReducers } from 'redux';
+import globalMessages, * as fromGlobalMessages from '../../../store/globalMessages';
import definitions, * as fromDefinitions from './definitions';
-import values, * as fromValues from './values';
import settingsPage, * as fromSettingsPage from './settingsPage';
-import globalMessages, * as fromGlobalMessages from '../../../store/globalMessages';
+import values, * as fromValues from './values';
interface State {
definitions: fromDefinitions.State;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { combineReducers } from 'redux';
import { keyBy } from 'lodash';
-import { ActionType } from '../../../store/utils/actions';
+import { combineReducers } from 'redux';
import { Action as AppStateAction, Actions as AppStateActions } from '../../../store/appState';
+import { ActionType } from '../../../store/utils/actions';
enum Actions {
receiveValues = 'RECEIVE_VALUES'
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { sanitize } from 'dompurify';
-import { translate, hasMessage } from 'sonar-ui-common/helpers/l10n';
+import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
export const DEFAULT_CATEGORY = 'general';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable sonarjs/no-duplicate-string */
-import * as u from '../utils';
import { mockClusterSysInfo, mockStandaloneSysInfo } from '../../../helpers/testMocks';
+import * as u from '../utils';
describe('parseQuery', () => {
it('should correctly parse the expand array', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { withRouter, WithRouterProps } from 'react-router';
import Helmet from 'react-helmet';
+import { withRouter, WithRouterProps } from 'react-router';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ClusterSysInfos from './ClusterSysInfos';
-import PageHeader from './PageHeader';
-import StandaloneSysInfos from './StandaloneSysInfos';
-import SystemUpgradeNotif from './system-upgrade/SystemUpgradeNotif';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import { getSystemInfo } from '../../../api/system';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
+import '../styles.css';
import {
+ getClusterVersion,
getServerId,
getSystemLogsLevel,
+ getVersion,
isCluster,
parseQuery,
Query,
- serializeQuery,
- getVersion,
- getClusterVersion
+ serializeQuery
} from '../utils';
-import '../styles.css';
+import ClusterSysInfos from './ClusterSysInfos';
+import PageHeader from './PageHeader';
+import StandaloneSysInfos from './StandaloneSysInfos';
+import SystemUpgradeNotif from './system-upgrade/SystemUpgradeNotif';
type Props = WithRouterProps;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import { LOGS_LEVELS } from '../utils';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { setLogLevel } from '../../../api/system';
+import { LOGS_LEVELS } from '../utils';
interface Props {
infoMsg: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import HealthCard from './info-items/HealthCard';
import {
getAppNodes,
+ getClusterMainCardSection,
getHealth,
getHealthCauses,
- getClusterMainCardSection,
getNodeName,
getSearchNodes,
ignoreInfoFields
} from '../utils';
+import HealthCard from './info-items/HealthCard';
interface Props {
expandedCards: string[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { EditButton, Button } from 'sonar-ui-common/components/controls/buttons';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import ChangeLogLevelForm from './ChangeLogLevelForm';
import AdminContext from '../../../app/components/AdminContext';
import RestartButton from '../../../components/common/RestartButton';
import { getFileNameSuffix } from '../utils';
+import ChangeLogLevelForm from './ChangeLogLevelForm';
interface Props {
canDownloadLogs: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
import PageActions from './PageActions';
export interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { map } from 'lodash';
-import HealthCard from './info-items/HealthCard';
+import * as React from 'react';
import {
getHealth,
getHealthCauses,
getStandaloneSecondarySections,
ignoreInfoFields
} from '../utils';
+import HealthCard from './info-items/HealthCard';
interface Props {
expandedCards: string[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ChangeLogLevelForm from '../ChangeLogLevelForm';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ClusterSysInfos from '../ClusterSysInfos';
+import * as React from 'react';
import { mockClusterSysInfo } from '../../../../helpers/testMocks';
+import ClusterSysInfos from '../ClusterSysInfos';
it('should render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import PageActions from '../PageActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PageHeader, { Props } from '../PageHeader';
jest.mock('sonar-ui-common/helpers/dates', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import StandaloneSysInfos from '../StandaloneSysInfos';
+import * as React from 'react';
import { mockStandaloneSysInfo } from '../../../../helpers/testMocks';
+import StandaloneSysInfos from '../StandaloneSysInfos';
it('should render correctly', () => {
expect(getWrapper()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { map } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import * as React from 'react';
import BoxedGroupAccordion from 'sonar-ui-common/components/controls/BoxedGroupAccordion';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getLogsLevel, groupSections, LOGS_LEVELS } from '../../utils';
import HealthItem from './HealthItem';
import Section from './Section';
-import { LOGS_LEVELS, groupSections, getLogsLevel } from '../../utils';
interface Props {
biggerHealth?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import HealthCauseItem from './HealthCauseItem';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import StatusIndicator from '../../../../components/common/StatusIndicator';
+import HealthCauseItem from './HealthCauseItem';
interface Props {
biggerHealth?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { map } from 'lodash';
+import * as React from 'react';
import SysInfoItem from './SysInfoItem';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { map } from 'lodash';
import * as React from 'react';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
-import { map } from 'lodash';
-import HealthItem from './HealthItem';
import { HEALTH_FIELD, STATE_FIELD } from '../../utils';
+import HealthItem from './HealthItem';
export interface Props {
name: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import HealthCard from '../HealthCard';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import HealthCauseItem from '../HealthCauseItem';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import HealthItem from '../HealthItem';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Section from '../Section';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SysInfoItem, { Props } from '../SysInfoItem';
it('should render string', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import SystemUpgradeItem from './SystemUpgradeItem';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import DateFormatter from '../../../../components/intl/DateFormatter';
interface Props {
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import SystemUpgradeIntermediate from './SystemUpgradeIntermediate';
import DateFormatter from '../../../../components/intl/DateFormatter';
+import SystemUpgradeIntermediate from './SystemUpgradeIntermediate';
interface Props {
type?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import SystemUpgradeForm from './SystemUpgradeForm';
-import { sortUpgrades, groupUpgrades } from '../../utils';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getSystemUpgrades } from '../../../../api/system';
+import { groupUpgrades, sortUpgrades } from '../../utils';
+import SystemUpgradeForm from './SystemUpgradeForm';
interface State {
systemUpgrades: T.SystemUpgrade[][];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SystemUpgradeForm from '../SystemUpgradeForm';
const UPGRADES = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import SystemUpgradeIntermediate from '../SystemUpgradeIntermediate';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SystemUpgradeItem from '../SystemUpgradeItem';
const UPGRADES = [
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import SystemUpgradeNotif from '../SystemUpgradeNotif';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { each, groupBy, memoize, omit, omitBy, pickBy, sortBy } from 'lodash';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import {
cleanQuery,
parseAsArray,
parseAsString,
serializeStringArray
} from 'sonar-ui-common/helpers/query';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
export interface Query {
expandedCards: string[];
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import AnalyzeTutorialSuggestion from './AnalyzeTutorialSuggestion';
-import ProjectAnalysisStep from '../components/ProjectAnalysisStep';
-import TokenStep from '../components/TokenStep';
-import { isVSTS } from '../../../helpers/almIntegrations';
import InstanceMessage from '../../../components/common/InstanceMessage';
+import { isVSTS } from '../../../helpers/almIntegrations';
import { isSonarCloud } from '../../../helpers/system';
+import ProjectAnalysisStep from '../components/ProjectAnalysisStep';
+import TokenStep from '../components/TokenStep';
import '../styles.css';
+import AnalyzeTutorialSuggestion from './AnalyzeTutorialSuggestion';
export enum Steps {
ANALYSIS,
*/
import * as classnames from 'classnames';
import * as React from 'react';
+import BackButton from 'sonar-ui-common/components/controls/BackButton';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { get, remove, save } from 'sonar-ui-common/helpers/storage';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import BackButton from 'sonar-ui-common/components/controls/BackButton';
+import { getGithubLanguages } from '../../../api/alm-integration';
+import { generateToken, getTokens } from '../../../api/user-tokens';
+import InstanceMessage from '../../../components/common/InstanceMessage';
+import { isBitbucket, isGithub, isVSTS } from '../../../helpers/almIntegrations';
+import { isSonarCloud } from '../../../helpers/system';
+import AnalyzeTutorialDone from '../components/AnalyzeTutorialDone';
+import ProjectAnalysisStep from '../components/ProjectAnalysisStep';
+import TokenStep from '../components/TokenStep';
+import '../styles.css';
+import { getUniqueTokenName } from '../utils';
+import './AnalyzeTutorialSonarCloud.css';
+import { TutorialSuggestionBitbucket, TutorialSuggestionVSTS } from './AnalyzeTutorialSuggestion';
import ConfigureWithAutoScan from './configurations/ConfigureWithAutoScan';
-import ConfigureWithTravis from './configurations/ConfigureWithTravis';
import ConfigureWithLocalScanner from './configurations/ConfigureWithLocalScanner';
import ConfigureOtherCI from './configurations/ConfigureWithOtherCI';
-import { TutorialSuggestionBitbucket, TutorialSuggestionVSTS } from './AnalyzeTutorialSuggestion';
+import ConfigureWithTravis from './configurations/ConfigureWithTravis';
import {
Alm,
- ALM_KEYS,
AlmLanguagesStats,
alms,
+ ALM_KEYS,
AnalysisMode,
autoScanMode,
isAutoScannable,
PROJECT_STEP_PROGRESS,
TutorialProps
} from './utils';
-import { getUniqueTokenName } from '../utils';
-import AnalyzeTutorialDone from '../components/AnalyzeTutorialDone';
-import InstanceMessage from '../../../components/common/InstanceMessage';
-import TokenStep from '../components/TokenStep';
-import ProjectAnalysisStep from '../components/ProjectAnalysisStep';
-import { generateToken, getTokens } from '../../../api/user-tokens';
-import { getGithubLanguages } from '../../../api/alm-integration';
-import { isBitbucket, isGithub, isVSTS } from '../../../helpers/almIntegrations';
-import { isSonarCloud } from '../../../helpers/system';
-import '../styles.css';
-import './AnalyzeTutorialSonarCloud.css';
interface Props {
component: T.Component;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { isBitbucket, isGithub, isVSTS } from '../../../helpers/almIntegrations';
export function TutorialSuggestionBitbucket() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalyzeTutorial from '../AnalyzeTutorial';
jest.mock('../../../../helpers/system', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { get } from 'sonar-ui-common/helpers/storage';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import AnalyzeTutorialSonarCloud from '../AnalyzeTutorialSonarCloud';
-import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
import { generateToken, getTokens } from '../../../../api/user-tokens';
+import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
import { getUniqueTokenName } from '../../utils';
+import AnalyzeTutorialSonarCloud from '../AnalyzeTutorialSonarCloud';
jest.mock('sonar-ui-common/helpers/storage', () => ({
get: jest.fn(),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalyzeTutorialSuggestion, {
TutorialSuggestionBitbucket,
TutorialSuggestionGithub,
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DocTooltip from '../../../../components/docs/DocTooltip';
export function AutoScanAlert() {
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import { AutoScanAlert } from './AutoScanAlert';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import Step from '../../components/Step';
import { TutorialProps } from '../utils';
+import { AutoScanAlert } from './AutoScanAlert';
export default function ConfigureWithAutoScan({ onDone }: TutorialProps) {
const [showCustomizationOptions, setCustomizationOptions] = React.useState<boolean>(false);
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { get, save } from 'sonar-ui-common/helpers/storage';
-import EncryptYourTokenStep from '../steps/EncryptYourTokenStep';
+import { isSonarCloud } from '../../../../helpers/system';
import CreateSonarPropertiesStep from '../steps/CreateSonarPropertiesStep';
import EditTravisYmlStep from '../steps/EditTravisYmlStep';
-import { isSonarCloud } from '../../../../helpers/system';
+import EncryptYourTokenStep from '../steps/EncryptYourTokenStep';
import { PROJECT_STEP_PROGRESS, TutorialProps } from '../utils';
enum Steps {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { AutoScanAlert } from '../AutoScanAlert';
it('should renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConfigureWithOtherCI from '../ConfigureWithOtherCI';
-import { TutorialProps } from '../../utils';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { TutorialProps } from '../../utils';
+import ConfigureWithOtherCI from '../ConfigureWithOtherCI';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConfigureWithAutoScan from '../ConfigureWithAutoScan';
-import { TutorialProps } from '../../utils';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { TutorialProps } from '../../utils';
+import ConfigureWithAutoScan from '../ConfigureWithAutoScan';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConfigureWithLocalScanner from '../ConfigureWithLocalScanner';
-import { TutorialProps } from '../../utils';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { TutorialProps } from '../../utils';
+import ConfigureWithLocalScanner from '../ConfigureWithLocalScanner';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ConfigureWithTravis from '../ConfigureWithTravis';
-import { TutorialProps } from '../../utils';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { TutorialProps } from '../../utils';
+import ConfigureWithTravis from '../ConfigureWithTravis';
jest.mock('sonar-ui-common/helpers/storage', () => ({
get: jest.fn().mockReturnValue(
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import Step from '../../components/Step';
import { StepProps } from '../../utils';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button, DeleteButton } from 'sonar-ui-common/components/controls/buttons';
import ConfirmModal from 'sonar-ui-common/components/controls/ConfirmModal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { generateToken, getTokens, revokeToken } from '../../../../api/user-tokens';
-import { getUniqueTokenName } from '../../utils';
import { RenderOptions } from '../../components/RenderOptions';
+import { getUniqueTokenName } from '../../utils';
export enum TokenMode {
use_existing_token = 'use_existing_token',
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import BuildSystemForm from '../../components/BuildSystemForm';
import AnalysisCommandTravis from '../../components/commands/AnalysisCommandTravis';
import Step from '../../components/Step';
-import BuildSystemForm from '../../components/BuildSystemForm';
import { StepProps } from '../../utils';
interface BuildProps {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
-import EditTokenModal from './EditTokenModal';
-import Step from '../../components/Step';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../components/common/CodeSnippet';
+import Step from '../../components/Step';
+import EditTokenModal from './EditTokenModal';
export interface YourTokenProps {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import CreateSonarPropertiesStep from '../CreateSonarPropertiesStep';
+import * as React from 'react';
import { StepProps } from '../../../utils';
+import CreateSonarPropertiesStep from '../CreateSonarPropertiesStep';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import EditTokenModal, { TokenMode } from '../EditTokenModal';
-import { mockComponent, mockEvent, mockLoggedInUser } from '../../../../../helpers/testMocks';
import { generateToken, getTokens, revokeToken } from '../../../../../api/user-tokens';
+import { mockComponent, mockEvent, mockLoggedInUser } from '../../../../../helpers/testMocks';
import { getUniqueTokenName } from '../../../utils';
+import EditTokenModal, { TokenMode } from '../EditTokenModal';
jest.mock('../../../../../api/user-tokens', () => ({
generateToken: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import EditTravisYmlStep from '../EditTravisYmlStep';
+import * as React from 'react';
import { StepProps } from '../../../utils';
+import EditTravisYmlStep from '../EditTravisYmlStep';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import EncryptYourTokenStep from '../EncryptYourTokenStep';
-import { StepProps } from '../../../utils';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { StepProps } from '../../../utils';
+import EncryptYourTokenStep from '../EncryptYourTokenStep';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import BackButton from 'sonar-ui-common/components/controls/BackButton';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getBaseUrl } from 'sonar-ui-common/helpers/urls';
-import BackButton from 'sonar-ui-common/components/controls/BackButton';
interface Props {
setTutorialDone: (done: boolean) => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
-import { RenderOptions } from './RenderOptions';
-import NewProjectForm from './NewProjectForm';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { isSonarCloud } from '../../../helpers/system';
import { isLanguageConfigured, LanguageConfig } from '../utils';
+import NewProjectForm from './NewProjectForm';
+import { RenderOptions } from './RenderOptions';
interface Props {
component?: T.Component;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { DeleteButton, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { createProject, deleteProject } from '../../../api/components';
interface Props {
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Step from './Step';
-import LanguageForm from './LanguageForm';
-import AnalysisCommand from './commands/AnalysisCommand';
import { LanguageConfig } from '../utils';
+import AnalysisCommand from './commands/AnalysisCommand';
+import LanguageForm from './LanguageForm';
+import Step from './Step';
interface Props {
component?: T.Component;
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { get, save } from 'sonar-ui-common/helpers/storage';
-import Step from './Step';
+import { PROJECT_STEP_PROGRESS } from '../analyzeProject/utils';
import BuildSystemForm from './BuildSystemForm';
import AnalysisCommandCustom from './commands/AnalysisCommandCustom';
import AnalysisCommandOtherCI from './commands/AnalysisCommandOtherCI';
-import { PROJECT_STEP_PROGRESS } from '../analyzeProject/utils';
+import Step from './Step';
export enum ProjectAnalysisModes {
CI = 'CI',
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface RenderOptionsProps {
checked: string | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/no-noninteractive-tabindex */
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
interface Props {
finished?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
+import { Button, DeleteButton, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { DeleteButton, SubmitButton, Button } from 'sonar-ui-common/components/controls/buttons';
-import Step from './Step';
-import { getTokens, generateToken, revokeToken } from '../../../api/user-tokens';
+import { generateToken, getTokens, revokeToken } from '../../../api/user-tokens';
import { getUniqueTokenName } from '../utils';
+import Step from './Step';
interface Props {
currentUser: Pick<T.LoggedInUser, 'login'>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalyzeTutorialDone from '../AnalyzeTutorialDone';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import BuildSystemForm from '../BuildSystemForm';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import LanguageForm from '../LanguageForm';
+import * as React from 'react';
import { isSonarCloud } from '../../../../helpers/system';
+import LanguageForm from '../LanguageForm';
jest.mock('../../../../helpers/system', () => ({ isSonarCloud: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import NewProjectForm from '../NewProjectForm';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { mockComponent } from '../../../../helpers/testMocks';
import ProjectAnalysisStep from '../ProjectAnalysisStep';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
import ProjectAnalysisStepFromBuildTool, {
ProjectAnalysisModes,
Props
} from '../ProjectAnalysisStepFromBuildTool';
-import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
jest.mock('sonar-ui-common/helpers/storage', () => ({
get: jest.fn().mockReturnValue(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Step from '../Step';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, click, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import TokenStep from '../TokenStep';
*/
import * as React from 'react';
import { getHostUrl } from 'sonar-ui-common/helpers/urls';
-import JavaMaven from './JavaMaven';
-import JavaGradle from './JavaGradle';
+import { LanguageConfig } from '../../utils';
+import { getProjectKey } from '../ProjectAnalysisStep';
+import ClangGCC from './ClangGCC';
import DotNet from './DotNet';
+import JavaGradle from './JavaGradle';
+import JavaMaven from './JavaMaven';
import Msvc from './Msvc';
-import ClangGCC from './ClangGCC';
import Other from './Other';
-import { LanguageConfig } from '../../utils';
-import { getProjectKey } from '../ProjectAnalysisStep';
interface Props {
component?: T.Component;
*/
import * as React from 'react';
import { getHostUrl } from 'sonar-ui-common/helpers/urls';
-import JavaMavenCustom from './Custom/JavaMavenCustom';
-import JavaGradleCustom from './Custom/JavaGradleCustom';
+import { RenderOS, RenderOSProps } from '../LanguageForm';
+import { getProjectKey } from '../ProjectAnalysisStep';
+import { ProjectAnalysisModes } from '../ProjectAnalysisStepFromBuildTool';
+import { AnalysisCommandCommon } from './AnalysisCommandOtherCI';
import ClangGCCCustom from './Custom/ClangGCCCustom';
+import JavaGradleCustom from './Custom/JavaGradleCustom';
+import JavaMavenCustom from './Custom/JavaMavenCustom';
import OtherCustom from './Custom/OtherCustom';
import { AnalysisCommandProps, AnalysisCommandRenderProps } from './utils';
-import { AnalysisCommandCommon } from './AnalysisCommandOtherCI';
-import { getProjectKey } from '../ProjectAnalysisStep';
-import { ProjectAnalysisModes } from '../ProjectAnalysisStepFromBuildTool';
-import { RenderOS, RenderOSProps } from '../LanguageForm';
export function RenderCommandForMaven({
component,
*/
import * as React from 'react';
import { getHostUrl } from 'sonar-ui-common/helpers/urls';
-import OtherOtherCI from './OtherCI/OtherOtherCI';
-import ClangGCCOtherCI from './OtherCI/ClangGCCOtherCI';
-import { AnalysisCommandProps, AnalysisCommandRenderProps } from './utils';
-import { RenderCommandForGradle, RenderCommandForMaven } from './AnalysisCommandCustom';
-import { getProjectKey } from '../ProjectAnalysisStep';
+import EditTokenModal from '../../analyzeProject/steps/EditTokenModal';
import { RenderOS, RenderOSProps } from '../LanguageForm';
+import { getProjectKey } from '../ProjectAnalysisStep';
import { ProjectAnalysisModes } from '../ProjectAnalysisStepFromBuildTool';
-import EditTokenModal from '../../analyzeProject/steps/EditTokenModal';
+import { RenderCommandForGradle, RenderCommandForMaven } from './AnalysisCommandCustom';
+import ClangGCCOtherCI from './OtherCI/ClangGCCOtherCI';
+import OtherOtherCI from './OtherCI/OtherOtherCI';
+import { AnalysisCommandProps, AnalysisCommandRenderProps } from './utils';
export function RenderCommandForClangOrGCC({
component,
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getHostUrl } from 'sonar-ui-common/helpers/urls';
-import { JavaMavenTravisSonarCloud } from './TravisSonarCloud/JavaMavenTravisSonarCloud';
+import CodeSnippet from '../../../../components/common/CodeSnippet';
+import { getProjectKey } from '../ProjectAnalysisStep';
+import { ClangGCCTravisSonarCloud } from './TravisSonarCloud/ClangGCCTravisSonarCloud';
import { JavaGradleTravisSonarCloud } from './TravisSonarCloud/JavaGradleTravisSonarCloud';
+import { JavaMavenTravisSonarCloud } from './TravisSonarCloud/JavaMavenTravisSonarCloud';
import { OtherTravisSonarCloud } from './TravisSonarCloud/OtherTravisSonarCloud';
-import { ClangGCCTravisSonarCloud } from './TravisSonarCloud/ClangGCCTravisSonarCloud';
-import { getProjectKey } from '../ProjectAnalysisStep';
-import CodeSnippet from '../../../../components/common/CodeSnippet';
interface Props {
buildType: string | undefined;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SQScanner from './SQScanner';
-import BuildWrapper from './BuildWrapper';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../components/common/InstanceMessage';
import { quote } from '../../utils';
+import BuildWrapper from './BuildWrapper';
+import SQScanner from './SQScanner';
export interface Props {
host: string;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
-import { quote } from '../../../utils';
-import SQScanner from '../SQScanner';
-import BuildWrapper from '../BuildWrapper';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
+import { quote } from '../../../utils';
import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
+import BuildWrapper from '../BuildWrapper';
+import SQScanner from '../SQScanner';
export interface Props {
host: string;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { JavaCustomProps, RenderCustomContent } from './JavaMavenCustom';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
+import { JavaCustomProps, RenderCustomContent } from './JavaMavenCustom';
export default function JavaGradleCustom(props: JavaCustomProps) {
const suffix = props.mode === ProjectAnalysisModes.CI ? '.ci' : '';
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
-import InstanceMessage from '../../../../../components/common/InstanceMessage';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
+import InstanceMessage from '../../../../../components/common/InstanceMessage';
import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
export interface JavaCustomProps {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
-import SQScanner from '../SQScanner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../../components/common/InstanceMessage';
import { quote } from '../../../utils';
import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
+import SQScanner from '../SQScanner';
export interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import ClangGCCCustom, { ClangGCCCommon } from '../ClangGCCCustom';
+import * as React from 'react';
import { ProjectAnalysisModes } from '../../../ProjectAnalysisStepFromBuildTool';
+import ClangGCCCustom, { ClangGCCCommon } from '../ClangGCCCustom';
it('should render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { ProjectAnalysisModes } from '../../../ProjectAnalysisStepFromBuildTool';
import JavaGradleCustom from '../JavaGradleCustom';
import { RenderCustomContent } from '../JavaMavenCustom';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { ProjectAnalysisModes } from '../../../ProjectAnalysisStepFromBuildTool';
import JavaMavenCustom, { RenderCustomContent } from '../JavaMavenCustom';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockLoggedInUser } from '../../../../../../helpers/testMocks';
import { ProjectAnalysisModes } from '../../../ProjectAnalysisStepFromBuildTool';
import OtherCustom from '../OtherCustom';
-import { mockComponent, mockLoggedInUser } from '../../../../../../helpers/testMocks';
it('should render correctly', () => {
expect(
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import MSBuildScanner from './MSBuildScanner';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../components/common/InstanceMessage';
+import MSBuildScanner from './MSBuildScanner';
export interface Props {
host: string;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import MSBuildScanner from './MSBuildScanner';
-import BuildWrapper from './BuildWrapper';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../components/common/InstanceMessage';
+import BuildWrapper from './BuildWrapper';
+import MSBuildScanner from './MSBuildScanner';
interface Props {
host: string;
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import SQScanner from './SQScanner';
import CodeSnippet from '../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../components/common/InstanceMessage';
import { quote } from '../../utils';
+import SQScanner from './SQScanner';
export interface Props {
host: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { EditButton } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import CodeSnippet from '../../../../../components/common/CodeSnippet';
import { quote } from '../../../utils';
-import SQScanner from '../SQScanner';
import BuildWrapper from '../BuildWrapper';
-import CodeSnippet from '../../../../../components/common/CodeSnippet';
import { ClangGCCCommon } from '../Custom/ClangGCCCustom';
+import SQScanner from '../SQScanner';
export interface Props {
host: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, EditButton } from 'sonar-ui-common/components/controls/buttons';
-import SQScanner from '../SQScanner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
import InstanceMessage from '../../../../../components/common/InstanceMessage';
import { quote } from '../../../utils';
+import SQScanner from '../SQScanner';
export interface Props {
component: T.Component;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ClangGCCOtherCI from '../ClangGCCOtherCI';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import OtherOtherCI from '../OtherOtherCI';
+import * as React from 'react';
import { mockComponent, mockLoggedInUser } from '../../../../../../helpers/testMocks';
+import OtherOtherCI from '../OtherOtherCI';
it('should render correctly', () => {
expect(
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { CommonTravisSonarCloud } from './utils';
import { getSonarcloudAddonYml, getSonarcloudAddonYmlRender } from '../AnalysisCommandTravis';
import { Props } from '../ClangGCC';
+import { CommonTravisSonarCloud } from './utils';
export function ClangGCCTravisSonarCloud(props: Props) {
const command = `${getSonarcloudAddonYml(props.organization)}
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import CodeSnippet from '../../../../../components/common/CodeSnippet';
import {
getSonarcloudAddonYml,
- RequirementJavaBuild,
- getSonarcloudAddonYmlRender
+ getSonarcloudAddonYmlRender,
+ RequirementJavaBuild
} from '../AnalysisCommandTravis';
import { Props } from '../JavaGradle';
-import CodeSnippet from '../../../../../components/common/CodeSnippet';
export function JavaGradleTravisSonarCloud(props: Props) {
const config = `plugins {
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Props } from '../JavaMaven';
+import CodeSnippet from '../../../../../components/common/CodeSnippet';
import {
getSonarcloudAddonYml,
- RequirementJavaBuild,
- getSonarcloudAddonYmlRender
+ getSonarcloudAddonYmlRender,
+ RequirementJavaBuild
} from '../AnalysisCommandTravis';
-import CodeSnippet from '../../../../../components/common/CodeSnippet';
+import { Props } from '../JavaMaven';
export function JavaMavenTravisSonarCloud(props: Props) {
const command = `${getSonarcloudAddonYml(props.organization)}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { CommonTravisSonarCloud } from './utils';
import { getSonarcloudAddonYml, getSonarcloudAddonYmlRender } from '../AnalysisCommandTravis';
import { Props } from '../Other';
+import { CommonTravisSonarCloud } from './utils';
export function OtherTravisSonarCloud(props: Props) {
const command = `${getSonarcloudAddonYml(props.organization)}
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { ClangGCCTravisSonarCloud } from '../ClangGCCTravisSonarCloud';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { JavaGradleTravisSonarCloud } from '../JavaGradleTravisSonarCloud';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { JavaMavenTravisSonarCloud } from '../JavaMavenTravisSonarCloud';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { OtherTravisSonarCloud } from '../OtherTravisSonarCloud';
it('should render correctly', () => {
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { RequirementOtherBuild } from '../AnalysisCommandTravis';
import CodeSnippet from '../../../../../components/common/CodeSnippet';
+import { RequirementOtherBuild } from '../AnalysisCommandTravis';
interface CommonTravisSonarCloudProps {
command: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalysisCommand from '../AnalysisCommand';
jest.mock('../../../../../helpers/system', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
import AnalysisCommandTravis, {
RenderCommandForClangOrGCC,
RenderCommandForGradle,
RenderCommandForMaven,
RenderCommandForOther
} from '../AnalysisCommandCustom';
-import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
-import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
const organization = 'org';
const token = '123';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
+import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
import AnalysisCommandOtherCI, {
AnalysisCommandCommon,
RenderCommandForClangOrGCC,
RenderCommandForOther
} from '../AnalysisCommandOtherCI';
-import { ProjectAnalysisModes } from '../../ProjectAnalysisStepFromBuildTool';
-import { mockComponent, mockLoggedInUser } from '../../../../../helpers/testMocks';
const organization = 'org';
const token = '123';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import AnalysisCommandTravis, {
getSonarcloudAddonYml,
getSonarcloudAddonYmlRender,
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import BuildWrapper from '../BuildWrapper';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ClangGCC from '../ClangGCC';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DotNet, { Props } from '../DotNet';
it('DotNet renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import JavaGradle from '../JavaGradle';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import JavaMaven from '../JavaMaven';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MSBuildScanner from '../MSBuildScanner';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Msvc from '../Msvc';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Other from '../Other';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SQScanner from '../SQScanner';
it('renders correctly', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import Modal from 'sonar-ui-common/components/controls/Modal';
import OnboardingProjectIcon from 'sonar-ui-common/components/icons/OnboardingProjectIcon';
import OnboardingTeamIcon from 'sonar-ui-common/components/icons/OnboardingTeamIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import Modal from 'sonar-ui-common/components/controls/Modal';
-import OrganizationsShortList from './OrganizationsShortList';
import { whenLoggedIn } from '../../../components/hoc/whenLoggedIn';
import { withUserOrganizations } from '../../../components/hoc/withUserOrganizations';
import '../styles.css';
+import OrganizationsShortList from './OrganizationsShortList';
export interface Props {
onClose: VoidFunction;
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import OnboardingModal from './OnboardingModal';
-import { skipOnboarding } from '../../../store/users';
import { OnboardingContext } from '../../../app/components/OnboardingContext';
import { Router } from '../../../components/hoc/withRouter';
+import { skipOnboarding } from '../../../store/users';
+import OnboardingModal from './OnboardingModal';
interface Props {
router: Router;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { Link } from 'react-router';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import OrganizationsShortListItem from './OrganizationsShortListItem';
import * as React from 'react';
import { ListButton } from 'sonar-ui-common/components/controls/buttons';
import OrganizationAvatar from '../../../components/common/OrganizationAvatar';
-import { withRouter, Router } from '../../../components/hoc/withRouter';
+import { Router, withRouter } from '../../../components/hoc/withRouter';
import { getOrganizationUrl } from '../../../helpers/urls';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import { OnboardingModal, Props } from '../OnboardingModal';
import { mockOrganization } from '../../../../helpers/testMocks';
+import { OnboardingModal, Props } from '../OnboardingModal';
it('renders correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import OrganizationsShortList, { Props } from '../OrganizationsShortList';
+import * as React from 'react';
import { mockOrganization } from '../../../../helpers/testMocks';
+import OrganizationsShortList, { Props } from '../OrganizationsShortList';
it('should render null with no orgs', () => {
expect(shallowRender().getElement()).toBe(null);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
+import { mockOrganization, mockRouter } from '../../../../helpers/testMocks';
import { OrganizationsShortListItem } from '../OrganizationsShortListItem';
-import { mockRouter, mockOrganization } from '../../../../helpers/testMocks';
it('renders correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import UserForm from './components/UserForm';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Query } from './utils';
interface Props {
*/
import * as React from 'react';
import Helmet from 'react-helmet';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { getIdentityProviders, searchUsers } from '../../api/users';
+import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
+import { Location, Router, withRouter } from '../../components/hoc/withRouter';
import Header from './Header';
import Search from './Search';
import UsersList from './UsersList';
import { parseQuery, Query, serializeQuery } from './utils';
-import Suggestions from '../../app/components/embed-docs-modal/Suggestions';
-import { getIdentityProviders, searchUsers } from '../../api/users';
-import { withRouter, Location, Router } from '../../components/hoc/withRouter';
interface Props {
currentUser: { isLoggedIn: boolean; login?: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import UsersApp from './UsersApp';
import { areThereCustomOrganizations, getCurrentUser, Store } from '../../store/rootReducer';
+import UsersApp from './UsersApp';
const mapStateToProps = (state: Store) => ({
currentUser: getCurrentUser(state),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import Header from '../Header';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable import/order */
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { UsersApp } from '../UsersApp';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { Location } from '../../../components/hoc/withRouter';
+import { UsersApp } from '../UsersApp';
jest.mock('../../../api/users', () => ({
getIdentityProviders: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import UsersList from '../UsersList';
const users = [
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { deactivateUser } from '../../../api/users';
export interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { find, without } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Modal from 'sonar-ui-common/components/controls/Modal';
import SelectList, {
SelectListFilter,
SelectListSearchParams
} from 'sonar-ui-common/components/controls/SelectList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getUserGroups, UserGroup } from '../../../api/users';
import { addUserToGroup, removeUserFromGroup } from '../../../api/user_groups';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { parseError } from 'sonar-ui-common/helpers/request';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { parseError } from 'sonar-ui-common/helpers/request';
import { changePassword } from '../../../api/users';
import addGlobalSuccessMessage from '../../../app/utils/addGlobalSuccessMessage';
import throwGlobalError from '../../../app/utils/throwGlobalError';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { generateToken, getTokens } from '../../../api/user-tokens';
import TokensFormItem, { TokenDeleteConfirmation } from './TokensFormItem';
import TokensFormNewToken from './TokensFormNewToken';
-import { getTokens, generateToken } from '../../../api/user-tokens';
interface Props {
deleteConfirmation: TokenDeleteConfirmation;
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { limitComponentName } from 'sonar-ui-common/helpers/path';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { limitComponentName } from 'sonar-ui-common/helpers/path';
+import { revokeToken } from '../../../api/user-tokens';
import DateFormatter from '../../../components/intl/DateFormatter';
import DateFromNowHourPrecision from '../../../components/intl/DateFromNowHourPrecision';
-import { revokeToken } from '../../../api/user-tokens';
export type TokenDeleteConfirmation = 'inline' | 'modal';
*/
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import TokensForm from './TokensForm';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
token: { name: string; token: string };
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
- ActionsDropdownItem,
- ActionsDropdownDivider
+ ActionsDropdownDivider,
+ ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isUserActive } from '../../../helpers/users';
import DeactivateForm from './DeactivateForm';
import PasswordForm from './PasswordForm';
import UserForm from './UserForm';
-import { isUserActive } from '../../../helpers/users';
interface Props {
isCurrentUser: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { uniq } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { parseError } from 'sonar-ui-common/helpers/request';
+import * as React from 'react';
import { Button, ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
-import { Alert } from 'sonar-ui-common/components/ui/Alert';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
-import UserScmAccountInput from './UserScmAccountInput';
-import throwGlobalError from '../../../app/utils/throwGlobalError';
+import { Alert } from 'sonar-ui-common/components/ui/Alert';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { parseError } from 'sonar-ui-common/helpers/request';
import { createUser, updateUser } from '../../../api/users';
+import throwGlobalError from '../../../app/utils/throwGlobalError';
+import UserScmAccountInput from './UserScmAccountInput';
export interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import BulletListIcon from 'sonar-ui-common/components/icons/BulletListIcon';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import GroupsForm from './GroupsForm';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import BulletListIcon from 'sonar-ui-common/components/icons/BulletListIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
+import DateFromNowHourPrecision from '../../../components/intl/DateFromNowHourPrecision';
+import Avatar from '../../../components/ui/Avatar';
import TokensFormModal from './TokensFormModal';
import UserActions from './UserActions';
import UserGroups from './UserGroups';
import UserListItemIdentity from './UserListItemIdentity';
import UserScmAccounts from './UserScmAccounts';
-import Avatar from '../../../components/ui/Avatar';
-import DateFromNowHourPrecision from '../../../components/intl/DateFromNowHourPrecision';
interface Props {
identityProvider?: T.IdentityProvider;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { debounce } from 'lodash';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Select from 'sonar-ui-common/components/controls/Select';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Avatar from '../../../components/ui/Avatar';
interface Option {
import { shallow } from 'enzyme';
import * as React from 'react';
import SelectList, { SelectListFilter } from 'sonar-ui-common/components/controls/SelectList';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
-import GroupsForm from '../GroupsForm';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { getUserGroups } from '../../../../api/users';
import { addUserToGroup, removeUserFromGroup } from '../../../../api/user_groups';
import { mockUser } from '../../../../helpers/testMocks';
+import GroupsForm from '../GroupsForm';
const user = mockUser();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import PasswordForm from '../PasswordForm';
+import * as React from 'react';
import { mockUser } from '../../../../helpers/testMocks';
+import PasswordForm from '../PasswordForm';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { change, submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import TokensForm from '../TokensForm';
import { generateToken, getTokens } from '../../../../api/user-tokens';
+import TokensForm from '../TokensForm';
jest.mock('../../../../api/user-tokens', () => ({
generateToken: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import TokensFormItem from '../TokensFormItem';
import { revokeToken } from '../../../../api/user-tokens';
+import TokensFormItem from '../TokensFormItem';
jest.mock('../../../../components/intl/DateFormatter');
jest.mock('../../../../components/intl/DateFromNow');
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import TokensFormModal from '../TokensFormModal';
+import * as React from 'react';
import { mockUser } from '../../../../helpers/testMocks';
+import TokensFormModal from '../TokensFormModal';
it('should render correctly', () => {
expect(
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import UserActions from '../UserActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, submit } from 'sonar-ui-common/helpers/testUtils';
-import UserForm from '../UserForm';
-import { mockUser } from '../../../../helpers/testMocks';
+import * as React from 'react';
+import { submit, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { createUser, updateUser } from '../../../../api/users';
+import { mockUser } from '../../../../helpers/testMocks';
+import UserForm from '../UserForm';
jest.mock('../../../../api/users', () => ({
createUser: jest.fn().mockResolvedValue({}),
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import UserGroups from '../UserGroups';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import UserListItem from '../UserListItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import UserListItemIdentity, { Props, ExternalProvider } from '../UserListItemIdentity';
+import * as React from 'react';
+import UserListItemIdentity, { ExternalProvider, Props } from '../UserListItemIdentity';
describe('#UserListItemIdentity', () => {
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import UsersSelectSearch, {
UsersSelectSearchOption,
UsersSelectSearchValue
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
-import LinkIcon from 'sonar-ui-common/components/icons/LinkIcon';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
+import LinkIcon from 'sonar-ui-common/components/icons/LinkIcon';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Params from './Params';
-import ResponseExample from './ResponseExample';
+import { getActionKey, serializeQuery } from '../utils';
import ActionChangelog from './ActionChangelog';
import DeprecatedBadge from './DeprecatedBadge';
import InternalBadge from './InternalBadge';
-import { getActionKey, serializeQuery } from '../utils';
+import Params from './Params';
+import ResponseExample from './ResponseExample';
interface Props {
action: T.WebApi.Action;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { parseVersion } from '../utils';
export default function DeprecatedBadge({ since }: { since?: string }) {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { actionsFilter, getActionKey, Query } from '../utils';
import Action from './Action';
import DeprecatedBadge from './DeprecatedBadge';
import InternalBadge from './InternalBadge';
-import { getActionKey, actionsFilter, Query } from '../utils';
interface Props {
domain: T.WebApi.Domain;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
export default function InternalBadge() {
return (
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { Link } from 'react-router';
-import * as classNames from 'classnames';
+import { actionsFilter, isDomainPathActive, Query, serializeQuery } from '../utils';
import DeprecatedBadge from './DeprecatedBadge';
import InternalBadge from './InternalBadge';
-import { isDomainPathActive, actionsFilter, Query, serializeQuery } from '../utils';
interface Props {
domains: T.WebApi.Domain[];
*/
import * as React from 'react';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import InternalBadge from './InternalBadge';
import DeprecatedBadge from './DeprecatedBadge';
+import InternalBadge from './InternalBadge';
interface Props {
params: T.WebApi.Param[];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { Query } from '../utils';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { maxBy } from 'lodash';
import * as React from 'react';
import Helmet from 'react-helmet';
-import { maxBy } from 'lodash';
import { Link, withRouter, WithRouterProps } from 'react-router';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Domain from './Domain';
-import Menu from './Menu';
-import Search from './Search';
+import { fetchWebApi } from '../../../api/web-api';
import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
-import { fetchWebApi } from '../../../api/web-api';
+import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
+import '../styles/web-api.css';
import {
getActionKey,
isDomainPathActive,
- Query,
- serializeQuery,
parseQuery,
- parseVersion
+ parseVersion,
+ Query,
+ serializeQuery
} from '../utils';
-import '../styles/web-api.css';
+import Domain from './Domain';
+import Menu from './Menu';
+import Search from './Search';
type Props = WithRouterProps;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Action from '../Action';
const ACTION = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ActionChangelog from '../ActionChangelog';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DeprecatedBadge from '../DeprecatedBadge';
it('should render with version', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Domain from '../Domain';
const ACTION = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Menu from '../Menu';
const ACTION: T.WebApi.Action = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Params from '../Params';
const DEFAULT_PARAM: T.WebApi.Param = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import ResponseExample from '../ResponseExample';
const ACTION = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Search from '../Search';
const PROPS = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { WebApiApp } from '../WebApiApp';
import { fetchWebApi } from '../../../../api/web-api';
import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
+import { WebApiApp } from '../WebApiApp';
jest.mock('../../../../api/web-api', () => ({
fetchWebApi: jest.fn().mockResolvedValue([
import { memoize } from 'lodash';
import {
cleanQuery,
- serializeString,
parseAsOptionalBoolean,
- parseAsString
+ parseAsString,
+ serializeString
} from 'sonar-ui-common/helpers/query';
export interface Query {
import * as React from 'react';
import { Helmet } from 'react-helmet';
import { translate } from 'sonar-ui-common/helpers/l10n';
+import { createWebhook, deleteWebhook, searchWebhooks, updateWebhook } from '../../../api/webhooks';
+import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import PageActions from './PageActions';
import PageHeader from './PageHeader';
import WebhooksList from './WebhooksList';
-import { createWebhook, deleteWebhook, searchWebhooks, updateWebhook } from '../../../api/webhooks';
-import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
interface Props {
component?: T.LightComponent;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { isWebUri } from 'valid-url';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import InputValidationField from 'sonar-ui-common/components/controls/InputValidationField';
import ValidationModal from 'sonar-ui-common/components/controls/ValidationModal';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { isWebUri } from 'valid-url';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { SubmitButton, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/controls/buttons';
import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import Modal from 'sonar-ui-common/components/controls/Modal';
import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
-import DeliveryAccordion from './DeliveryAccordion';
+import Modal from 'sonar-ui-common/components/controls/Modal';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { searchDeliveries } from '../../../api/webhooks';
+import DeliveryAccordion from './DeliveryAccordion';
interface Props {
onClose: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import BoxedGroupAccordion from 'sonar-ui-common/components/controls/BoxedGroupAccordion';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
-import BoxedGroupAccordion from 'sonar-ui-common/components/controls/BoxedGroupAccordion';
-import DeliveryItem from './DeliveryItem';
-import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
import { getDelivery } from '../../../api/webhooks';
+import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
+import DeliveryItem from './DeliveryItem';
interface Props {
delivery: T.WebhookDelivery;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import CodeSnippet from '../../../components/common/CodeSnippet';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translateWithParameters, translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
-import DeliveryItem from './DeliveryItem';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getDelivery } from '../../../api/webhooks';
+import DeliveryItem from './DeliveryItem';
interface Props {
delivery: T.WebhookDelivery;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import CreateWebhookForm from './CreateWebhookForm';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import ActionsDropdown, {
- ActionsDropdownItem,
- ActionsDropdownDivider
+ ActionsDropdownDivider,
+ ActionsDropdownItem
} from 'sonar-ui-common/components/controls/ActionsDropdown';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import CreateWebhookForm from './CreateWebhookForm';
import DeleteWebhookForm from './DeleteWebhookForm';
import DeliveriesForm from './DeliveriesForm';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import WebhookItemLatestDelivery from './WebhookItemLatestDelivery';
import WebhookActions from './WebhookActions';
+import WebhookItemLatestDelivery from './WebhookItemLatestDelivery';
interface Props {
onDelete: (webhook: string) => Promise<void>;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
import BulletListIcon from 'sonar-ui-common/components/icons/BulletListIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
-import LatestDeliveryForm from './LatestDeliveryForm';
import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
+import LatestDeliveryForm from './LatestDeliveryForm';
interface Props {
webhook: T.Webhook;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import WebhookItem from './WebhookItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import App from '../App';
+import * as React from 'react';
import {
createWebhook,
deleteWebhook,
searchWebhooks,
updateWebhook
} from '../../../../api/webhooks';
+import App from '../App';
jest.mock('../../../../api/webhooks', () => ({
createWebhook: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import CreateWebhookForm from '../CreateWebhookForm';
const webhookWithoutSecret = { key: '1', name: 'foo', url: 'http://foo.bar' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import DeliveriesForm from '../DeliveriesForm';
+import * as React from 'react';
import { searchDeliveries } from '../../../../api/webhooks';
+import DeliveriesForm from '../DeliveriesForm';
jest.mock('../../../../api/webhooks', () => ({
searchDeliveries: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import DeliveryAccordion from '../DeliveryAccordion';
+import * as React from 'react';
import { getDelivery } from '../../../../api/webhooks';
+import DeliveryAccordion from '../DeliveryAccordion';
jest.mock('../../../../api/webhooks', () => ({
getDelivery: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DeliveryItem from '../DeliveryItem';
const delivery = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import LatestDeliveryForm from '../LatestDeliveryForm';
+import * as React from 'react';
import { getDelivery } from '../../../../api/webhooks';
+import LatestDeliveryForm from '../LatestDeliveryForm';
jest.mock('../../../../api/webhooks', () => ({
getDelivery: jest.fn(() =>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import PageActions from '../PageActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PageHeader from '../PageHeader';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import WebhookActions from '../WebhookActions';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WebhookItem from '../WebhookItem';
const webhook = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import WebhookItemLatestDelivery from '../WebhookItemLatestDelivery';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WebhooksList from '../WebhooksList';
const webhooks = [
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { intersection, uniqBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import SourceViewerCode from './SourceViewerCode';
-import SourceViewerHeader from './SourceViewerHeader';
-import SourceViewerHeaderSlim from './SourceViewerHeaderSlim';
-import { SourceViewerContext } from './SourceViewerContext';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import {
+ getComponentData,
+ getComponentForSourceViewer,
+ getDuplications,
+ getSources
+} from '../../api/components';
+import { getBranchLikeQuery, isSameBranchLike } from '../../helpers/branches';
+import { WorkspaceContext } from '../workspace/context';
import DuplicationPopup from './components/DuplicationPopup';
-import defaultLoadIssues from './helpers/loadIssues';
-import getCoverageStatus from './helpers/getCoverageStatus';
import {
filterDuplicationBlocksByLine,
getDuplicationBlocksForIndex,
isDuplicationBlockInRemovedComponent
} from './helpers/duplications';
+import getCoverageStatus from './helpers/getCoverageStatus';
import {
duplicationsByLine,
issuesByLine,
locationsByLine,
symbolsByLine
} from './helpers/indexing';
-import {
- getComponentData,
- getComponentForSourceViewer,
- getDuplications,
- getSources
-} from '../../api/components';
-import { isSameBranchLike, getBranchLikeQuery } from '../../helpers/branches';
-import { WorkspaceContext } from '../workspace/context';
+import defaultLoadIssues from './helpers/loadIssues';
+import SourceViewerCode from './SourceViewerCode';
+import { SourceViewerContext } from './SourceViewerContext';
+import SourceViewerHeader from './SourceViewerHeader';
+import SourceViewerHeaderSlim from './SourceViewerHeaderSlim';
import './styles.css';
// TODO react-virtualized
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import Line from './components/Line';
import { getSecondaryIssueLocationsForLine } from './helpers/issueLocations';
import {
- optimizeSelectedIssue,
+ optimizeHighlightedSymbols,
optimizeLocationMessage,
- optimizeHighlightedSymbols
+ optimizeSelectedIssue
} from './helpers/lines';
const EMPTY_ARRAY: any[] = [];
import { stringify } from 'querystring';
import * as React from 'react';
import { Link } from 'react-router';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
+import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
import ListIcon from 'sonar-ui-common/components/icons/ListIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
-import { collapsedDirFromPath, fileFromPath } from 'sonar-ui-common/helpers/path';
+import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { collapsedDirFromPath, fileFromPath } from 'sonar-ui-common/helpers/path';
import { omitNil } from 'sonar-ui-common/helpers/request';
import { getBaseUrl, getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
-import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
-import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import MeasuresOverlay from './components/MeasuresOverlay';
-import Favorite from '../controls/Favorite';
-import { WorkspaceContextShape } from '../workspace/context';
import { getBranchLikeQuery, isMainBranch } from '../../helpers/branches';
import { getBranchLikeUrl, getCodeUrl, getComponentIssuesUrl } from '../../helpers/urls';
+import Favorite from '../controls/Favorite';
+import { WorkspaceContextShape } from '../workspace/context';
+import MeasuresOverlay from './components/MeasuresOverlay';
interface Props {
branchLike: T.BranchLike | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { Link } from 'react-router';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import ExpandSnippetIcon from 'sonar-ui-common/components/icons/ExpandSnippetIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { collapsedDirFromPath, fileFromPath } from 'sonar-ui-common/helpers/path';
import { getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import Favorite from '../controls/Favorite';
-import { isMainBranch, getBranchLikeQuery } from '../../helpers/branches';
+import { getBranchLikeQuery, isMainBranch } from '../../helpers/branches';
import { getBranchLikeUrl, getComponentIssuesUrl } from '../../helpers/urls';
+import Favorite from '../controls/Favorite';
import './SourceViewerHeaderSlim.css';
export interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockIssue, mockMainBranch, mockSourceViewerFile } from '../../../helpers/testMocks';
import SourceViewerHeader from '../SourceViewerHeader';
-import { mockMainBranch, mockSourceViewerFile, mockIssue } from '../../../helpers/testMocks';
it('should render correctly for a regular file', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import SourceViewerHeaderSlim, { Props } from '../SourceViewerHeaderSlim';
+import * as React from 'react';
import { mockMainBranch, mockSourceViewerFile } from '../../../helpers/testMocks';
+import SourceViewerHeaderSlim, { Props } from '../SourceViewerHeaderSlim';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { groupBy, sortBy } from 'lodash';
+import * as React from 'react';
import { Link } from 'react-router';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
-import { collapsedDirFromPath, fileFromPath } from 'sonar-ui-common/helpers/path';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import { WorkspaceContextShape } from '../../workspace/context';
-import { isShortLivingBranch, isPullRequest } from '../../../helpers/branches';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { collapsedDirFromPath, fileFromPath } from 'sonar-ui-common/helpers/path';
+import { isPullRequest, isShortLivingBranch } from '../../../helpers/branches';
import { getProjectUrl } from '../../../helpers/urls';
+import { WorkspaceContextShape } from '../../workspace/context';
interface Props {
blocks: T.DuplicationBlock[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { times } from 'lodash';
-import LineNumber from './LineNumber';
-import LineSCM from './LineSCM';
+import * as React from 'react';
+import './Line.css';
+import LineCode from './LineCode';
import LineCoverage from './LineCoverage';
-import LineDuplications from './LineDuplications';
import LineDuplicationBlock from './LineDuplicationBlock';
+import LineDuplications from './LineDuplications';
import LineIssuesIndicator from './LineIssuesIndicator';
-import LineCode from './LineCode';
-import './Line.css';
+import LineNumber from './LineNumber';
+import LineSCM from './LineSCM';
interface Props {
branchLike: T.BranchLike | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import LineIssuesList from './LineIssuesList';
+import * as React from 'react';
import LocationIndex from '../../common/LocationIndex';
import LocationMessage from '../../common/LocationMessage';
import {
splitByTokens,
Token
} from '../helpers/highlight';
+import LineIssuesList from './LineIssuesList';
interface Props {
branchLike: T.BranchLike | undefined;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
line: T.SourceLine;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import * as React from 'react';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
duplicated: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
line: T.SourceLine;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import IssueIcon from 'sonar-ui-common/components/icons/IssueIcon';
import { sortByType } from '../../../helpers/issues';
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getCodeUrl } from '../../../helpers/urls';
import { SourceViewerContext } from '../SourceViewerContext';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { groupBy, keyBy, sortBy } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { keyBy, sortBy, groupBy } from 'lodash';
+import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import Modal from 'sonar-ui-common/components/controls/Modal';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
-import { translate, getLocalizedMetricName } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import Modal from 'sonar-ui-common/components/controls/Modal';
import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
-import MeasuresOverlayMeasure from './MeasuresOverlayMeasure';
+import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { getFacets } from '../../../api/issues';
import { getMeasures } from '../../../api/measures';
import { getAllMetrics } from '../../../api/metrics';
+import { getBranchLikeQuery } from '../../../helpers/branches';
+import { ISSUE_TYPES, SEVERITIES } from '../../../helpers/constants';
+import { enhanceMeasuresWithMetrics, getDisplayMetrics } from '../../../helpers/measures';
+import { getBranchLikeUrl } from '../../../helpers/urls';
import Measure from '../../measure/Measure';
import SeverityHelper from '../../shared/SeverityHelper';
import CoverageRating from '../../ui/CoverageRating';
-import { SEVERITIES, ISSUE_TYPES } from '../../../helpers/constants';
-import { getDisplayMetrics, enhanceMeasuresWithMetrics } from '../../../helpers/measures';
-import { getBranchLikeUrl } from '../../../helpers/urls';
-import { getBranchLikeQuery } from '../../../helpers/branches';
+import MeasuresOverlayMeasure from './MeasuresOverlayMeasure';
interface Props {
branchLike: T.BranchLike | undefined;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
import DateFormatter from '../../intl/DateFormatter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockIssue, mockPullRequest, mockSourceLine } from '../../../../helpers/testMocks';
import Line from '../Line';
-import { mockPullRequest, mockSourceLine, mockIssue } from '../../../../helpers/testMocks';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
+import { mockIssue, mockShortLivingBranch, mockSourceLine } from '../../../../helpers/testMocks';
import LineCode from '../LineCode';
-import { mockShortLivingBranch, mockIssue, mockSourceLine } from '../../../../helpers/testMocks';
it('render code', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LineCoverage from '../LineCoverage';
it('render covered line', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import LineDuplicationBlock from '../LineDuplicationBlock';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import LineDuplications from '../LineDuplications';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import LineIssuesIndicator from '../LineIssuesIndicator';
import { mockIssue } from '../../../../helpers/testMocks';
+import LineIssuesIndicator from '../LineIssuesIndicator';
it('should render correctly', () => {
const onClick = jest.fn();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LineIssuesList from '../LineIssuesList';
const issueBase: T.Issue = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import LineNumber from '../LineNumber';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LineOptionsPopup from '../LineOptionsPopup';
jest.mock('../../SourceViewerContext', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import LineSCM from '../LineSCM';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { waitAndUpdate, click } from 'sonar-ui-common/helpers/testUtils';
+import * as React from 'react';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import MeasuresOverlay from '../MeasuresOverlay';
jest.mock('../../../../api/issues', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MeasuresOverlayMeasure from '../MeasuresOverlayMeasure';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SCMPopup from '../SCMPopup';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { issuesByComponentAndLine, symbolsByLine } from '../indexing';
import { mockIssue } from '../../../../helpers/testMocks';
+import { issuesByComponentAndLine, symbolsByLine } from '../indexing';
describe('issuesByComponentAndLine', () => {
it('should map issues by lines and components', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getSecondaryIssueLocationsForLine, getLinearLocations } from '../issueLocations';
-import { mockSourceLine, mockFlowLocation } from '../../../../helpers/testMocks';
+import { mockFlowLocation, mockSourceLine } from '../../../../helpers/testMocks';
+import { getLinearLocations, getSecondaryIssueLocationsForLine } from '../issueLocations';
describe('getSecondaryIssueLocationsForLine', () => {
it('should return secondary locations for a line', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import loadIssues from '../loadIssues';
import { mockMainBranch } from '../../../../helpers/testMocks';
+import loadIssues from '../loadIssues';
jest.mock('../../../../api/issues', () => ({
searchIssues: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { ScaleLinear, ScaleOrdinal } from 'd3-scale';
+import * as React from 'react';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import './ColorBoxLegend.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
import { RATING_COLORS } from '../../helpers/constants';
import './ColorBoxLegend.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sortBy } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import Histogram from 'sonar-ui-common/components/charts/Histogram';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import LanguageDistribution from './LanguageDistribution';
import { getLanguages, Store } from '../../store/rootReducer';
+import LanguageDistribution from './LanguageDistribution';
const mapStateToProps = (state: Store) => ({
languages: getLanguages(state)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import LanguageDistribution from '../LanguageDistribution';
it('renders', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import WarningIcon from 'sonar-ui-common/components/icons/WarningIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Modal from 'sonar-ui-common/components/controls/Modal';
+import WarningIcon from 'sonar-ui-common/components/icons/WarningIcon';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { getTask } from '../../api/ce';
interface Props {
import * as React from 'react';
import { connect } from 'react-redux';
import Level from 'sonar-ui-common/components/ui/Level';
-import { Store, getBranchStatusByBranchLike } from '../../store/rootReducer';
+import { getBranchStatusByBranchLike, Store } from '../../store/rootReducer';
interface Props {
branchLike: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import ClipboardButton from 'sonar-ui-common/components/controls/ClipboardButton';
import './CodeSnippet.css';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
displayReset: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import './LocationIndex.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import './LocationMessage.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { getMarkdownHelpUrl } from '../../helpers/urls';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { difference } from 'lodash';
-import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import MultiSelectOption from './MultiSelectOption';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
interface Props {
active?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import GenericAvatar from 'sonar-ui-common/components/ui/GenericAvatar';
import './OrganizationAvatar.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import VisibleIcon from 'sonar-ui-common/components/icons/VisibleIcon';
+import * as React from 'react';
import { connect } from 'react-redux';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import VisibleIcon from 'sonar-ui-common/components/icons/VisibleIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { colors } from '../../app/theme';
-import { isSonarCloud } from '../../helpers/system';
import { isCurrentUserMemberOf, isPaidOrganization } from '../../helpers/organizations';
+import { isSonarCloud } from '../../helpers/system';
import {
getCurrentUser,
- getOrganizationByKey,
getMyOrganizations,
+ getOrganizationByKey,
Store
} from '../../store/rootReducer';
import DocTooltip from '../docs/DocTooltip';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import { translate } from 'sonar-ui-common/helpers/l10n';
+import * as React from 'react';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { restart } from '../../api/system';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { debounce } from 'lodash';
+import * as React from 'react';
interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
+import classNames from 'classnames';
import * as key from 'keymaster';
import { uniqueId } from 'lodash';
-import classNames from 'classnames';
+import * as React from 'react';
import SelectListItem from './SelectListItem';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import classNames from 'classnames';
+import * as React from 'react';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import './StatusIndicator.css';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import AnalysisWarningsModal from '../AnalysisWarningsModal';
import { getTask } from '../../../api/ce';
+import AnalysisWarningsModal from '../AnalysisWarningsModal';
jest.mock('../../../api/ce', () => ({
getTask: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { BranchStatus } from '../BranchStatus';
+import * as React from 'react';
import { mockLongLivingBranch } from '../../../helpers/testMocks';
+import { BranchStatus } from '../BranchStatus';
it('should render correctly', () => {
expect(shallowRender().type()).toBeNull();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount } from 'enzyme';
+import * as React from 'react';
import CodeSnippet from '../CodeSnippet';
it('renders correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import EmptySearch from '../EmptySearch';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import InstanceMessage from '../InstanceMessage';
+import * as React from 'react';
import { getInstance } from '../../../helpers/system';
+import InstanceMessage from '../InstanceMessage';
jest.mock('../../../helpers/system', () => ({ getInstance: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MarkdownTips from '../MarkdownTips';
it('should render the tips', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { mount, shallow } from 'enzyme';
import * as React from 'react';
-import { shallow, mount } from 'enzyme';
import MultiSelect from '../MultiSelect';
const props = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MultiSelectOption from '../MultiSelectOption';
const props = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { PrivacyBadge } from '../PrivacyBadgeContainer';
+import * as React from 'react';
import { isSonarCloud } from '../../../helpers/system';
+import { PrivacyBadge } from '../PrivacyBadgeContainer';
jest.mock('../../../helpers/system', () => ({ isSonarCloud: jest.fn().mockReturnValue(false) }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import RestartButton from '../RestartButton';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { mount, shallow } from 'enzyme';
import * as React from 'react';
-import { shallow, mount } from 'enzyme';
import { click, keydown } from 'sonar-ui-common/helpers/testUtils';
import SelectList from '../SelectList';
import SelectListItem from '../SelectListItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SelectListItem from '../SelectListItem';
it('should render correctly without children', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import VisibilitySelector from '../VisibilitySelector';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
-import CalendarIcon from 'sonar-ui-common/components/icons/CalendarIcon';
-import ChevronLeftIcon from 'sonar-ui-common/components/icons/ChevronLeftIcon';
-import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
-import { DayModifiers, Modifier, Modifiers } from 'react-day-picker';
-import { InjectedIntlProps, injectIntl } from 'react-intl';
-import { range } from 'lodash';
import * as addMonths from 'date-fns/add_months';
import * as setMonth from 'date-fns/set_month';
import * as setYear from 'date-fns/set_year';
import * as subMonths from 'date-fns/sub_months';
-import {
- getShortMonthName,
- getWeekDayName,
- getShortWeekDayName
-} from 'sonar-ui-common/helpers/l10n';
+import { range } from 'lodash';
+import * as React from 'react';
+import { DayModifiers, Modifier, Modifiers } from 'react-day-picker';
+import { InjectedIntlProps, injectIntl } from 'react-intl';
import { ButtonIcon, ClearButton } from 'sonar-ui-common/components/controls/buttons';
import OutsideClickHandler from 'sonar-ui-common/components/controls/OutsideClickHandler';
-import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import Select from 'sonar-ui-common/components/controls/Select';
+import CalendarIcon from 'sonar-ui-common/components/icons/CalendarIcon';
+import ChevronLeftIcon from 'sonar-ui-common/components/icons/ChevronLeftIcon';
+import ChevronRightIcon from 'sonar-ui-common/components/icons/ChevronRightIcon';
+import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
+import {
+ getShortMonthName,
+ getShortWeekDayName,
+ getWeekDayName
+} from 'sonar-ui-common/helpers/l10n';
import './DayPicker.css';
import './styles.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
import DateInput from './DateInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import { connect } from 'react-redux';
+import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import HomeIcon from 'sonar-ui-common/components/icons/HomeIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
-import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import { isLoggedIn } from '../../helpers/users';
import { getCurrentUser, Store } from '../../store/rootReducer';
import { setHomePage } from '../../store/users';
-import { isLoggedIn } from '../../helpers/users';
interface StateProps {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
-import { shallow } from 'enzyme';
import * as addDays from 'date-fns/add_days';
import * as setMonth from 'date-fns/set_month';
import * as setYear from 'date-fns/set_year';
import * as subDays from 'date-fns/sub_days';
import * as subMonths from 'date-fns/sub_months';
+import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import DateInput from '../DateInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
import DateRangeInput from '../DateRangeInput';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Favorite from '../Favorite';
jest.mock('../../../api/favorites', () => ({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
-import HomePageSelect from '../HomePageSelect';
import { setHomePage } from '../../../api/users';
import rootReducer, { getCurrentUser, Store } from '../../../store/rootReducer';
import configureStore from '../../../store/utils/configureStore';
+import HomePageSelect from '../HomePageSelect';
jest.mock('../../../api/users', () => ({
setHomePage: jest.fn(() => Promise.resolve())
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import remark from 'remark';
+import remarkCustomBlocks from 'remark-custom-blocks';
import reactRenderer from 'remark-react';
import slug from 'remark-slug';
-import remarkCustomBlocks from 'remark-custom-blocks';
+import 'sonar-ui-common/components/ui/Alert.css'; // eslint-disable-line import/extension
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import DocLink from './DocLink';
+import { filterContent, separateFrontMatter } from '../../helpers/markdown';
+import DocCollapsibleBlock from './DocCollapsibleBlock';
import DocImg from './DocImg';
+import DocLink from './DocLink';
import DocToc from './DocToc';
import DocTooltipLink from './DocTooltipLink';
-import DocCollapsibleBlock from './DocCollapsibleBlock';
-import { separateFrontMatter, filterContent } from '../../helpers/markdown';
-import 'sonar-ui-common/components/ui/Alert.css'; // eslint-disable-line import/extension
interface Props {
childProps?: T.Dict<string>;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
+import { debounce, memoize } from 'lodash';
import * as React from 'react';
+import { findDOMNode } from 'react-dom';
import remark from 'remark';
import reactRenderer from 'remark-react';
-import { findDOMNode } from 'react-dom';
-import * as classNames from 'classnames';
-import { debounce, memoize } from 'lodash';
import { translate } from 'sonar-ui-common/helpers/l10n';
import onlyToc from './plugins/remark-only-toc';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { forEach } from 'lodash';
import * as React from 'react';
import { Link } from 'react-router';
-import { forEach } from 'lodash';
import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
interface OwnProps {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import DocCollapsibleBlock from '../DocCollapsibleBlock';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { DocLink } from '../DocLink';
+import * as React from 'react';
import { isSonarCloud } from '../../../helpers/system';
+import { DocLink } from '../DocLink';
jest.mock('../../../helpers/system', () => ({
isSonarCloud: jest.fn(() => false)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DocMarkdownBlock from '../DocMarkdownBlock';
const CONTENT = `
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount } from 'enzyme';
+import * as React from 'react';
import { click, scrollTo } from 'sonar-ui-common/helpers/testUtils';
import DocToc from '../DocToc';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import DocTooltip from '../DocTooltip';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DocTooltipLink from '../DocTooltipLink';
it('should render simple link', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import slug from 'remark-slug';
import util from 'mdast-util-toc';
+import slug from 'remark-slug';
/**
* This is a simplified version of the remark-toc plugin: https://github.com/remarkjs/remark-toc
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
interface Props {
className?: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import OpenCloseIcon from 'sonar-ui-common/components/icons/OpenCloseIcon';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
-import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
+import OpenCloseIcon from 'sonar-ui-common/components/icons/OpenCloseIcon';
+import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
interface Props {
children?: React.ReactNode;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
export interface Props {
active?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
import { sortBy, without } from 'lodash';
-import { queriesEqual } from 'sonar-ui-common/helpers/query';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import * as React from 'react';
+import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { Alert } from 'sonar-ui-common/components/ui/Alert';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
-import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { formatMeasure } from 'sonar-ui-common/helpers/measures';
+import { queriesEqual } from 'sonar-ui-common/helpers/query';
import FacetBox from './FacetBox';
import FacetHeader from './FacetHeader';
import FacetItem from './FacetItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FacetBox from '../FacetBox';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import FacetHeader from '../FacetHeader';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import FacetItem, { Props } from '../FacetItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import FacetItemsList from '../FacetItemsList';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import ListStyleFacet, { Props } from '../ListStyleFacet';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import ListStyleFacetFooter from '../ListStyleFacetFooter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import MultipleSelectionHint from '../MultipleSelectionHint';
it('should render for mac', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';
+import * as React from 'react';
import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
-import { whenLoggedIn } from '../whenLoggedIn';
import { mockStore } from '../../../helpers/testMocks';
+import { whenLoggedIn } from '../whenLoggedIn';
jest.mock('sonar-ui-common/helpers/handleRequiredAuthentication', () => ({
default: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { withCurrentUser } from '../withCurrentUser';
+import * as React from 'react';
import { mockStore } from '../../../helpers/testMocks';
+import { withCurrentUser } from '../withCurrentUser';
class X extends React.Component<{ currentUser: T.CurrentUser }> {
render() {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { mount, shallow } from 'enzyme';
-import { keydown, KEYCODE_MAP } from 'sonar-ui-common/helpers/testUtils';
-import withKeyboardNavigation, { WithKeyboardNavigationProps } from '../withKeyboardNavigation';
+import * as React from 'react';
+import { KEYCODE_MAP, keydown } from 'sonar-ui-common/helpers/testUtils';
import { mockComponent } from '../../../helpers/testMocks';
+import withKeyboardNavigation, { WithKeyboardNavigationProps } from '../withKeyboardNavigation';
class X extends React.Component<{
components?: T.ComponentMeasure[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import { withUserOrganizations } from '../withUserOrganizations';
+import * as React from 'react';
import { mockStore } from '../../../helpers/testMocks';
+import { withUserOrganizations } from '../withUserOrganizations';
jest.mock('../../../api/organizations', () => ({ getOrganizations: jest.fn() }));
*/
import * as React from 'react';
import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication';
+import { isLoggedIn } from '../../helpers/users';
import { getWrappedDisplayName } from './utils';
import { withCurrentUser } from './withCurrentUser';
-import { isLoggedIn } from '../../helpers/users';
export function whenLoggedIn<P>(WrappedComponent: React.ComponentType<P>) {
class Wrapper extends React.Component<P & { currentUser: T.CurrentUser }> {
*/
import * as React from 'react';
import { connect } from 'react-redux';
+import { getAppState, Store } from '../../store/rootReducer';
import { getWrappedDisplayName } from './utils';
-import { Store, getAppState } from '../../store/rootReducer';
export function withAppState<P>(
WrappedComponent: React.ComponentClass<P & { appState: Partial<T.AppState> }>
*/
import * as React from 'react';
import { connect } from 'react-redux';
+import { getCurrentUser, Store } from '../../store/rootReducer';
import { getWrappedDisplayName } from './utils';
-import { Store, getCurrentUser } from '../../store/rootReducer';
export function withCurrentUser<P>(
WrappedComponent: React.ComponentType<P & { currentUser: T.CurrentUser }>
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
+import * as React from 'react';
import PageActions from 'sonar-ui-common/components/ui/PageActions';
import { getWrappedDisplayName } from './utils';
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { getWrappedDisplayName } from './utils';
-import { Store, getMyOrganizations } from '../../store/rootReducer';
import { fetchMyOrganizations } from '../../apps/account/organizations/actions';
+import { getMyOrganizations, Store } from '../../store/rootReducer';
+import { getWrappedDisplayName } from './utils';
interface OwnProps {
fetchMyOrganizations: () => Promise<void>;
*/
import * as React from 'react';
import { IconProps } from 'sonar-ui-common/components/icons/Icon';
-import ShortLivingBranchIcon from 'sonar-ui-common/components/icons/ShortLivingBranchIcon';
import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
import PullRequestIcon from 'sonar-ui-common/components/icons/PullRequestIcon';
-import { isShortLivingBranch, isPullRequest } from '../../helpers/branches';
+import ShortLivingBranchIcon from 'sonar-ui-common/components/icons/ShortLivingBranchIcon';
+import { isPullRequest, isShortLivingBranch } from '../../helpers/branches';
interface Props extends IconProps {
branchLike: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as differenceInHours from 'date-fns/difference_in_hours';
+import * as React from 'react';
import { DateSource } from 'react-intl';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import DateFromNow from './DateFromNow';
import DateTimeFormatter from './DateTimeFormatter';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { parseDate } from 'sonar-ui-common/helpers/dates';
import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { parseDate } from 'sonar-ui-common/helpers/dates';
import DateFormatter from './DateFormatter';
import DateTimeFormatter from './DateTimeFormatter';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as key from 'keymaster';
-import IssueView from './IssueView';
-import { updateIssue } from './actions';
+import * as React from 'react';
import { setIssueAssignee } from '../../api/issues';
+import { updateIssue } from './actions';
import './Issue.css';
+import IssueView from './IssueView';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import classNames from 'classnames';
+import * as React from 'react';
import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
+import { deleteIssueComment, editIssueComment } from '../../api/issues';
import { updateIssue } from './actions';
-import IssueTitleBar from './components/IssueTitleBar';
import IssueActionsBar from './components/IssueActionsBar';
import IssueCommentLine from './components/IssueCommentLine';
-import { deleteIssueComment, editIssueComment } from '../../api/issues';
+import IssueTitleBar from './components/IssueTitleBar';
interface Props {
branchLike?: T.BranchLike;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import IssueView from '../IssueView';
+import * as React from 'react';
import { mockIssue } from '../../../helpers/testMocks';
+import IssueView from '../IssueView';
it('should render issues correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { parseIssueFromResponse } from '../../helpers/issues';
import { IssueResponse } from '../../api/issues';
+import { parseIssueFromResponse } from '../../helpers/issues';
export const updateIssue = (
onChange: (issue: T.Issue) => void,
*/
import * as React from 'react';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { IssueResponse } from '../../../api/issues';
+import { updateIssue } from '../actions';
import IssueAssign from './IssueAssign';
import IssueCommentAction from './IssueCommentAction';
import IssueSeverity from './IssueSeverity';
import IssueTags from './IssueTags';
import IssueTransition from './IssueTransition';
import IssueType from './IssueType';
-import { updateIssue } from '../actions';
-import { IssueResponse } from '../../../api/issues';
interface Props {
issue: T.Issue;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import Avatar from '../../ui/Avatar';
import SetAssigneePopup from '../popups/SetAssigneePopup';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
-import ChangelogPopup from '../popups/ChangelogPopup';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import DateFromNow from '../../intl/DateFromNow';
import DateTimeFormatter from '../../intl/DateTimeFormatter';
+import ChangelogPopup from '../popups/ChangelogPopup';
interface Props {
isOpen: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
-import CommentPopup from '../popups/CommentPopup';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { addIssueComment } from '../../../api/issues';
import { updateIssue } from '../actions';
+import CommentPopup from '../popups/CommentPopup';
interface Props {
commentAutoTriggered?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { sanitize } from 'dompurify';
-import { EditButton, DeleteButton } from 'sonar-ui-common/components/controls/buttons';
+import * as React from 'react';
+import { DeleteButton, EditButton } from 'sonar-ui-common/components/controls/buttons';
+import Toggler from 'sonar-ui-common/components/controls/Toggler';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
import { translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import DateFromNow from '../../intl/DateFromNow';
import Avatar from '../../ui/Avatar';
import CommentDeletePopup from '../popups/CommentDeletePopup';
import CommentPopup from '../popups/CommentPopup';
-import DateFromNow from '../../intl/DateFromNow';
interface Props {
comment: T.IssueComment;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
import { Button } from 'sonar-ui-common/components/controls/buttons';
+import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { WorkspaceContextShape } from '../../workspace/context';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
-import SetSeverityPopup from '../popups/SetSeverityPopup';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
+import { IssueResponse, setIssueSeverity } from '../../../api/issues';
import SeverityHelper from '../../shared/SeverityHelper';
-import { setIssueSeverity, IssueResponse } from '../../../api/issues';
+import SetSeverityPopup from '../popups/SetSeverityPopup';
interface Props {
canSetSeverity: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
-import SetIssueTagsPopup from '../popups/SetIssueTagsPopup';
-import TagsList from '../../tags/TagsList';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { setIssueTags } from '../../../api/issues';
+import TagsList from '../../tags/TagsList';
import { updateIssue } from '../actions';
+import SetIssueTagsPopup from '../popups/SetIssueTagsPopup';
interface Props {
canSetTags: boolean;
import { Link } from 'react-router';
import LinkIcon from 'sonar-ui-common/components/icons/LinkIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import IssueChangelog from './IssueChangelog';
-import IssueMessage from './IssueMessage';
-import SimilarIssuesFilter from './SimilarIssuesFilter';
import { getBranchLikeQuery } from '../../../helpers/branches';
import { getComponentIssuesUrl } from '../../../helpers/urls';
import { WorkspaceContext } from '../../workspace/context';
+import IssueChangelog from './IssueChangelog';
+import IssueMessage from './IssueMessage';
+import SimilarIssuesFilter from './SimilarIssuesFilter';
interface Props {
branchLike?: T.BranchLike;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
-import SetTransitionPopup from '../popups/SetTransitionPopup';
-import StatusHelper from '../../shared/StatusHelper';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { setIssueTransition } from '../../../api/issues';
+import StatusHelper from '../../shared/StatusHelper';
import { updateIssue } from '../actions';
+import SetTransitionPopup from '../popups/SetTransitionPopup';
interface Props {
hasTransitions: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
import Toggler from 'sonar-ui-common/components/controls/Toggler';
+import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+import { IssueResponse, setIssueType } from '../../../api/issues';
import SetTypePopup from '../popups/SetTypePopup';
-import { setIssueType, IssueResponse } from '../../../api/issues';
interface Props {
canSetType: boolean;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
+import Toggler from 'sonar-ui-common/components/controls/Toggler';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import FilterIcon from 'sonar-ui-common/components/icons/FilterIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ButtonLink } from 'sonar-ui-common/components/controls/buttons';
-import Toggler from 'sonar-ui-common/components/controls/Toggler';
import SimilarIssuesPopup from '../popups/SimilarIssuesPopup';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import IssueActionsBar from '../IssueActionsBar';
+import * as React from 'react';
import { mockIssue } from '../../../../helpers/testMocks';
+import IssueActionsBar from '../IssueActionsBar';
jest.mock('../../actions', () => ({ updateIssue: jest.fn() }));
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueAssign from '../IssueAssign';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueChangelog from '../IssueChangelog';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueCommentAction from '../IssueCommentAction';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueCommentLine from '../IssueCommentLine';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import IssueMessage from '../IssueMessage';
it('should render with the message and a link to open the rule', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueSeverity from '../IssueSeverity';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueTags from '../IssueTags';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import IssueTitleBar from '../IssueTitleBar';
+import * as React from 'react';
import { mockIssue } from '../../../../helpers/testMocks';
+import IssueTitleBar from '../IssueTitleBar';
const issue: T.Issue = mockIssue();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueTransition from '../IssueTransition';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import IssueType from '../IssueType';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
+import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getIssueChangelog } from '../../../api/issues';
-import Avatar from '../../ui/Avatar';
import DateTimeFormatter from '../../intl/DateTimeFormatter';
+import Avatar from '../../ui/Avatar';
import IssueChangelogDiff from '../components/IssueChangelogDiff';
interface Props {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button } from 'sonar-ui-common/components/controls/buttons';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
onDelete: () => void;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { Button, ResetButtonLink } from 'sonar-ui-common/components/controls/buttons';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import MarkdownTips from '../../common/MarkdownTips';
interface Props {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { map } from 'lodash';
-import { translate } from 'sonar-ui-common/helpers/l10n';
-import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import * as React from 'react';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
-import Avatar from '../../ui/Avatar';
-import SelectList from '../../common/SelectList';
-import SelectListItem from '../../common/SelectListItem';
-import { withCurrentUser } from '../../hoc/withCurrentUser';
+import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import { searchMembers } from '../../../api/organizations';
import { searchUsers } from '../../../api/users';
-import { isLoggedIn, isUserActive } from '../../../helpers/users';
import { isSonarCloud } from '../../../helpers/system';
+import { isLoggedIn, isUserActive } from '../../../helpers/users';
+import SelectList from '../../common/SelectList';
+import SelectListItem from '../../common/SelectListItem';
+import { withCurrentUser } from '../../hoc/withCurrentUser';
+import Avatar from '../../ui/Avatar';
interface Props {
currentUser: T.CurrentUser;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { difference, without } from 'lodash';
+import * as React from 'react';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import TagsSelector from '../../tags/TagsSelector';
import { searchIssueTags } from '../../../api/issues';
+import TagsSelector from '../../tags/TagsSelector';
interface Props {
organization: string;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import SeverityIcon from 'sonar-ui-common/components/icons/SeverityIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import SelectList from '../../common/SelectList';
import SelectListItem from '../../common/SelectListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate, hasMessage } from 'sonar-ui-common/helpers/l10n';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
+import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
import SelectList from '../../common/SelectList';
import SelectListItem from '../../common/SelectListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
import SelectList from '../../common/SelectList';
import SelectListItem from '../../common/SelectListItem';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
-import { fileFromPath, limitComponentName } from 'sonar-ui-common/helpers/path';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
-import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
-import Avatar from '../../ui/Avatar';
+import { fileFromPath, limitComponentName } from 'sonar-ui-common/helpers/path';
import SelectList from '../../common/SelectList';
import SelectListItem from '../../common/SelectListItem';
import SeverityHelper from '../../shared/SeverityHelper';
import StatusHelper from '../../shared/StatusHelper';
+import Avatar from '../../ui/Avatar';
interface Props {
issue: T.Issue;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import ChangelogPopup from '../ChangelogPopup';
import { getIssueChangelog } from '../../../../api/issues';
+import ChangelogPopup from '../ChangelogPopup';
jest.mock('../../../../api/issues', () => ({
getIssueChangelog: jest.fn().mockResolvedValue({
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import CommentDeletePopup from '../CommentDeletePopup';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import CommentPopup from '../CommentPopup';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { SetAssigneePopup } from '../SetAssigneePopup';
-import { mockLoggedInUser, mockUser } from '../../../../helpers/testMocks';
import { searchMembers } from '../../../../api/organizations';
import { searchUsers } from '../../../../api/users';
import { isSonarCloud } from '../../../../helpers/system';
+import { mockLoggedInUser, mockUser } from '../../../../helpers/testMocks';
+import { SetAssigneePopup } from '../SetAssigneePopup';
jest.mock('../../../../helpers/system', () => ({
isSonarCloud: jest.fn().mockReturnValue(false)
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SetIssueTagsPopup from '../SetIssueTagsPopup';
it('should render tags popup correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SetSeverityPopup from '../SetSeverityPopup';
it('should render tags popup correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { hasMessage } from 'sonar-ui-common/helpers/l10n';
import SetTransitionPopup, { Props } from '../SetTransitionPopup';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import SetTypePopup from '../SetTypePopup';
it('should render tags popup correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
-import SimilarIssuesPopup from '../SimilarIssuesPopup';
+import * as React from 'react';
import { mockIssue } from '../../../../helpers/testMocks';
+import SimilarIssuesPopup from '../SimilarIssuesPopup';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import Measure from '../Measure';
jest.mock('../../../helpers/measures', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { minBy } from 'lodash';
+import * as React from 'react';
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
import AdvancedTimeline from 'sonar-ui-common/components/charts/AdvancedTimeline';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { formatMeasure } from 'sonar-ui-common/helpers/measures';
-import PreviewGraphTooltips from './PreviewGraphTooltips';
import {
DEFAULT_GRAPH,
generateSeries,
Serie,
splitSeriesInGraphs
} from '../../apps/projectActivity/utils';
-import { getShortType } from '../../helpers/measures';
import { getBranchLikeQuery } from '../../helpers/branches';
-import { withRouter, Router } from '../hoc/withRouter';
+import { getShortType } from '../../helpers/measures';
+import { Router, withRouter } from '../hoc/withRouter';
+import PreviewGraphTooltips from './PreviewGraphTooltips';
interface History {
[x: string]: Array<{ date: Date; value?: string }>;
*/
import * as React from 'react';
import { Popup, PopupPlacement } from 'sonar-ui-common/components/ui/popups';
-import PreviewGraphTooltipsContent from './PreviewGraphTooltipsContent';
-import DateFormatter from '../intl/DateFormatter';
import { Serie } from '../../apps/projectActivity/utils';
+import DateFormatter from '../intl/DateFormatter';
+import PreviewGraphTooltipsContent from './PreviewGraphTooltipsContent';
interface Props {
formatValue: (value: number | string) => string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { parseDate } from 'sonar-ui-common/helpers/dates';
-import PreviewGraphTooltips from '../PreviewGraphTooltips';
import { DEFAULT_GRAPH } from '../../../apps/projectActivity/utils';
+import PreviewGraphTooltips from '../PreviewGraphTooltips';
const SERIES_ISSUES = [
{
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import PreviewGraphTooltipsContent from '../PreviewGraphTooltipsContent';
const DEFAULT_PROPS = {
*/
import * as React from 'react';
import { Link } from 'react-router';
-import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls';
import { getBranchLikeQuery } from '../../helpers/branches';
+import { getComponentDrilldownUrl, getComponentIssuesUrl } from '../../helpers/urls';
const ISSUE_MEASURES = [
'violations',
*/
import * as React from 'react';
import { connect } from 'react-redux';
-import { getOrganizationByKey, areThereCustomOrganizations, Store } from '../../store/rootReducer';
+import { areThereCustomOrganizations, getOrganizationByKey, Store } from '../../store/rootReducer';
import OrganizationLink from '../ui/OrganizationLink';
interface OwnProps {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { translate } from 'sonar-ui-common/helpers/l10n';
import IssueTypeIcon from 'sonar-ui-common/components/icons/IssueTypeIcon';
+import { translate } from 'sonar-ui-common/helpers/l10n';
interface Props {
className?: string;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import DrilldownLink from '../DrilldownLink';
it('should render correctly', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { UnconnectedOrganization } from '../Organization';
const organization = { key: 'foo', name: 'foo' };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import * as classNames from 'classnames';
+import * as React from 'react';
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import TagsIcon from 'sonar-ui-common/components/icons/TagsIcon';
import './TagsList.css';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TagsList from '../TagsList';
const tags = ['foo', 'bar'];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import TagsSelector, { validateTag } from '../TagsSelector';
const props = {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import * as classNames from 'classnames';
import * as React from 'react';
import { connect } from 'react-redux';
-import * as classNames from 'classnames';
import GenericAvatar from 'sonar-ui-common/components/ui/GenericAvatar';
import { getGlobalSettingValue, Store } from '../../store/rootReducer';
*/
import * as React from 'react';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import OrganizationLink from './OrganizationLink';
import OrganizationAvatar from '../common/OrganizationAvatar';
+import OrganizationLink from './OrganizationLink';
interface Props {
organization: T.Organization;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { unconnectedAvatar as Avatar } from '../Avatar';
const gravatarServerUrl = 'http://example.com/{EMAIL_MD5}.jpg?s={SIZE}';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationLink from '../OrganizationLink';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import OrganizationListItem from '../OrganizationListItem';
it('renders', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { omit, uniqBy } from 'lodash';
+import * as React from 'react';
import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
import { get, save } from 'sonar-ui-common/helpers/storage';
-import { WorkspaceContext, ComponentDescriptor, RuleDescriptor } from './context';
-import WorkspacePortal from './WorkspacePortal';
+import { ComponentDescriptor, RuleDescriptor, WorkspaceContext } from './context';
import './styles.css';
+import WorkspacePortal from './WorkspacePortal';
const WORKSPACE = 'sonarqube-workspace';
const WorkspaceNav = lazyLoad(() => import('./WorkspaceNav'));
import * as React from 'react';
import { connect } from 'react-redux';
import { scrollToElement } from 'sonar-ui-common/helpers/scrolling';
-import { ComponentDescriptor } from './context';
-import WorkspaceHeader, { Props as WorkspaceHeaderProps } from './WorkspaceHeader';
-import WorkspaceComponentTitle from './WorkspaceComponentTitle';
-import SourceViewer from '../SourceViewer/SourceViewer';
+import { getParents } from '../../api/components';
import { isPullRequest, isShortLivingBranch } from '../../helpers/branches';
import { fetchBranchStatus } from '../../store/rootActions';
-import { getParents } from '../../api/components';
+import SourceViewer from '../SourceViewer/SourceViewer';
+import { ComponentDescriptor } from './context';
+import WorkspaceComponentTitle from './WorkspaceComponentTitle';
+import WorkspaceHeader, { Props as WorkspaceHeaderProps } from './WorkspaceHeader';
export interface Props extends T.Omit<WorkspaceHeaderProps, 'children' | 'onClose'> {
component: ComponentDescriptor;
*/
import * as React from 'react';
import { DraggableCore, DraggableData } from 'react-draggable';
-import { IconProps } from 'sonar-ui-common/components/icons/Icon';
+import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
import ClearIcon from 'sonar-ui-common/components/icons/ClearIcon';
import CollapseIcon from 'sonar-ui-common/components/icons/CollapseIcon';
import ExpandIcon from 'sonar-ui-common/components/icons/ExpandIcon';
+import { IconProps } from 'sonar-ui-common/components/icons/Icon';
import MinimizeIcon from 'sonar-ui-common/components/icons/MinimizeIcon';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { ButtonIcon } from 'sonar-ui-common/components/controls/buttons';
export interface Props {
children: React.ReactNode;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { keyBy } from 'lodash';
+import * as React from 'react';
import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
-import { withAppState } from '../hoc/withAppState';
-import RuleDetailsMeta from '../../apps/coding-rules/components/RuleDetailsMeta';
-import RuleDetailsDescription from '../../apps/coding-rules/components/RuleDetailsDescription';
import { getRuleDetails, getRulesApp } from '../../api/rules';
+import RuleDetailsDescription from '../../apps/coding-rules/components/RuleDetailsDescription';
+import RuleDetailsMeta from '../../apps/coding-rules/components/RuleDetailsMeta';
import '../../apps/coding-rules/styles.css';
+import { withAppState } from '../hoc/withAppState';
interface Props {
appState: Pick<T.AppState, 'organizationsEnabled'>;
*/
import * as React from 'react';
import LightBulbIcon from 'sonar-ui-common/components/icons/LightBulbIcon';
-import { RuleDescriptor } from './context';
import { colors } from '../../app/theme';
+import { RuleDescriptor } from './context';
interface Props {
limited?: boolean;
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceComponentTitle from '../WorkspaceComponentTitle';
it('should render component', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
-import { WorkspaceComponentViewer, Props } from '../WorkspaceComponentViewer';
-import { mockPullRequest, mockIssue } from '../../../helpers/testMocks';
import { getParents } from '../../../api/components';
+import { mockIssue, mockPullRequest } from '../../../helpers/testMocks';
+import { Props, WorkspaceComponentViewer } from '../WorkspaceComponentViewer';
jest.mock('../../../api/components', () => ({
getParents: jest.fn().mockResolvedValue([{ key: 'bar' }])
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceHeader, { Props } from '../WorkspaceHeader';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceNav, { Props } from '../WorkspaceNav';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceNavComponent, { Props } from '../WorkspaceNavComponent';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { click } from 'sonar-ui-common/helpers/testUtils';
import WorkspaceNavItem, { Props } from '../WorkspaceNavItem';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceNavRule, { Props } from '../WorkspaceNavRule';
it('should render', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspacePortal from '../WorkspacePortal';
it('should create portal element', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
import { WorkspaceRuleDetails } from '../WorkspaceRuleDetails';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceRuleTitle from '../WorkspaceRuleTitle';
it('should render rule', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import * as React from 'react';
import { shallow } from 'enzyme';
+import * as React from 'react';
import WorkspaceRuleViewer, { Props } from '../WorkspaceRuleViewer';
jest.useFakeTimers();
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import {
+ getAlmMembersUrl,
+ getUserAlmKey,
isBitbucket,
isGithub,
isVSTS,
- sanitizeAlmId,
- getAlmMembersUrl,
- getUserAlmKey
+ sanitizeAlmId
} from '../almIntegrations';
import { mockCurrentUser, mockLoggedInUser } from '../testMocks';
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { sortBranchesAsTree, isSameBranchLike } from '../branches';
+import { isSameBranchLike, sortBranchesAsTree } from '../branches';
import {
- mockShortLivingBranch,
mockLongLivingBranch,
+ mockMainBranch,
mockPullRequest,
- mockMainBranch
+ mockShortLivingBranch
} from '../testMocks';
describe('#sortBranchesAsTree', () => {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import exposeLibraries from '../../app/components/extensions/exposeLibraries';
import { getExtensionStart, installScript } from '../extensions';
import { installExtensionsHandler } from '../extensionsHandler';
-import exposeLibraries from '../../app/components/extensions/exposeLibraries';
jest.mock('../../app/components/extensions/exposeLibraries', () => ({
default: jest.fn()
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getFrontMatter, separateFrontMatter, filterContent } from '../markdown';
+import { filterContent, getFrontMatter, separateFrontMatter } from '../markdown';
import { isSonarCloud } from '../system';
jest.mock('../system', () => ({
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import {
- isSameStatusConditionList,
- extractStatusConditionsFromProjectStatus
+ extractStatusConditionsFromProjectStatus,
+ isSameStatusConditionList
} from '../qualityGates';
-import { mockQualityGateStatusCondition, mockQualityGateProjectStatus } from '../testMocks';
+import { mockQualityGateProjectStatus, mockQualityGateStatusCondition } from '../testMocks';
describe('extractStatusConditionsFromProjectStatus', () => {
it('should correclty extract the conditions for the project status', () => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import {
- getComponentIssuesUrl,
getComponentDrilldownUrl,
+ getComponentIssuesUrl,
getQualityGatesUrl,
getQualityGateUrl
} from '../urls';
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* eslint-disable sonarjs/no-duplicate-string */
-import { InjectedRouter } from 'react-router';
-import { Store, createStore } from 'redux';
import { Location } from 'history';
+import { InjectedRouter } from 'react-router';
+import { createStore, Store } from 'redux';
+import { DocumentationEntry } from '../apps/documentation/utils';
import { ParsedAnalysis } from '../apps/projectActivity/utils';
import { Profile } from '../apps/quality-profiles/types';
-import { DocumentationEntry } from '../apps/documentation/utils';
export function mockAlmApplication(overrides: Partial<T.AlmApplication> = {}): T.AlmApplication {
return {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { getBaseUrl, Location } from 'sonar-ui-common/helpers/urls';
+import { getProfilePath } from '../apps/quality-profiles/utils';
import {
- isShortLivingBranch,
- isPullRequest,
+ getBranchLikeQuery,
isLongLivingBranch,
- getBranchLikeQuery
+ isPullRequest,
+ isShortLivingBranch
} from './branches';
-import { getProfilePath } from '../apps/quality-profiles/utils';
type Query = Location['query'];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { getBranchLikeKey } from '../../helpers/branches';
+import {
+ mockLongLivingBranch,
+ mockPullRequest,
+ mockQualityGateStatusCondition,
+ mockShortLivingBranch
+} from '../../helpers/testMocks';
import reducer, {
- registerBranchStatusAction,
getBranchStatusByBranchLike,
+ registerBranchStatusAction,
State
} from '../branches';
-import {
- mockPullRequest,
- mockLongLivingBranch,
- mockShortLivingBranch,
- mockQualityGateStatusCondition
-} from '../../helpers/testMocks';
-import { getBranchLikeKey } from '../../helpers/branches';
type TestArgs = [T.BranchLike, string, T.Status, T.QualityGateStatusCondition[], boolean?];
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import reducer, {
- getOrganizationByKey,
areThereCustomOrganizations,
+ createOrganization,
+ deleteOrganization,
getMyOrganizations,
- State,
- receiveOrganizations,
+ getOrganizationByKey,
receiveMyOrganizations,
- createOrganization,
- updateOrganization,
- deleteOrganization
+ receiveOrganizations,
+ State,
+ updateOrganization
} from '../organizations';
const state0: State = { byKey: {}, my: [] };
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { registerBranchStatus, fetchBranchStatus } from '../rootActions';
import { mockLongLivingBranch, mockQualityGateStatusCondition } from '../../helpers/testMocks';
import { registerBranchStatusAction } from '../branches';
+import { fetchBranchStatus, registerBranchStatus } from '../rootActions';
jest.useFakeTimers();
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getBranchStatusByBranchLike, Store } from '../rootReducer';
-import * as fromBranches from '../branches';
import { mockPullRequest } from '../../helpers/testMocks';
+import * as fromBranches from '../branches';
+import { getBranchStatusByBranchLike, Store } from '../rootReducer';
jest.mock('../branches', () => {
return {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { ActionType } from './utils/actions';
import { EditionKey } from '../apps/marketplace/utils';
+import { ActionType } from './utils/actions';
export const enum Actions {
SetAppState = 'SET_APP_STATE',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { ActionType } from './utils/actions';
import { getBranchLikeKey } from '../helpers/branches';
+import { ActionType } from './utils/actions';
export interface BranchStatusData {
conditions?: T.QualityGateStatusCondition[];
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { combineReducers } from 'redux';
import { omit, uniq, without } from 'lodash';
+import { combineReducers } from 'redux';
import { ActionType } from './utils/actions';
type ReceiveOrganizationsAction =
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Dispatch } from 'redux';
-import { InjectedRouter } from 'react-router';
import { debounce } from 'lodash';
-import { requireAuthorization as requireAuthorizationAction } from './appState';
-import { registerBranchStatusAction } from './branches';
-import { addGlobalErrorMessage } from './globalMessages';
-import { receiveLanguages } from './languages';
-import { receiveMetrics } from './metrics';
-import { receiveOrganizations } from './organizations';
+import { InjectedRouter } from 'react-router';
+import { Dispatch } from 'redux';
import * as auth from '../api/auth';
import { getLanguages } from '../api/languages';
import { getAllMetrics } from '../api/metrics';
-import { getOrganizations, getOrganization, getOrganizationNavigation } from '../api/organizations';
+import { getOrganization, getOrganizationNavigation, getOrganizations } from '../api/organizations';
import { getQualityGateProjectStatus } from '../api/quality-gates';
import { getBranchLikeQuery } from '../helpers/branches';
import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates';
+import { requireAuthorization as requireAuthorizationAction } from './appState';
+import { registerBranchStatusAction } from './branches';
+import { addGlobalErrorMessage } from './globalMessages';
+import { receiveLanguages } from './languages';
+import { receiveMetrics } from './metrics';
+import { receiveOrganizations } from './organizations';
export function fetchLanguages() {
return (dispatch: Dispatch) => {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { combineReducers } from 'redux';
+import settingsApp, * as fromSettingsApp from '../apps/settings/store/rootReducer';
import appState from './appState';
import branches, * as fromBranches from './branches';
import globalMessages, * as fromGlobalMessages from './globalMessages';
import metrics, * as fromMetrics from './metrics';
import organizations, * as fromOrganizations from './organizations';
import users, * as fromUsers from './users';
-import settingsApp, * as fromSettingsApp from '../apps/settings/store/rootReducer';
export type Store = {
appState: T.AppState;
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { uniq } from 'lodash';
-import { Dispatch, combineReducers } from 'redux';
-import { ActionType } from './utils/actions';
-import { isLoggedIn } from '../helpers/users';
+import { combineReducers, Dispatch } from 'redux';
import * as api from '../api/users';
+import { isLoggedIn } from '../helpers/users';
+import { ActionType } from './utils/actions';
const enum Actions {
ReceiveCurrentUser = 'RECEIVE_CURRENT_USER',
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { createStore, applyMiddleware, compose } from 'redux';
+import { applyMiddleware, compose, createStore } from 'redux';
import thunk, { ThunkMiddleware } from 'redux-thunk';
type RootReducer = typeof import('../rootReducer').default;