import * as React from 'react';
import ComponentName from './ComponentName';
import ComponentMeasure from './ComponentMeasure';
-import ComponentDetach from './ComponentDetach';
+import ComponentLink from './ComponentLink';
import ComponentPin from './ComponentPin';
import { Component as IComponent } from '../types';
componentAction = <ComponentPin branch={branch} component={component} />;
break;
default:
- componentAction = <ComponentDetach branch={branch} component={component} />;
+ componentAction = <ComponentLink branch={branch} component={component} />;
}
}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import * as React from 'react';
-import { Link } from 'react-router';
-import { translate } from '../../../helpers/l10n';
-import { Component } from '../types';
-
-interface Props {
- branch?: string;
- component: Component;
-}
-
-export default function ComponentDetach({ component, branch }: Props) {
- return (
- <Link
- to={{ pathname: '/dashboard', query: { branch, id: component.refKey || component.key } }}
- className="icon-detach"
- title={translate('code.open_component_page')}
- />
- );
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { Link } from 'react-router';
+import { Component } from '../types';
+import LinkIcon from '../../../components/icons-components/LinkIcon';
+import { translate } from '../../../helpers/l10n';
+import { getProjectUrl } from '../../../helpers/urls';
+
+interface Props {
+ branch?: string;
+ component: Component;
+}
+
+export default function ComponentLink({ component, branch }: Props) {
+ return (
+ <Link
+ className="link-no-underline"
+ title={translate('code.open_component_page')}
+ to={getProjectUrl(component.refKey || component.key, branch)}>
+ <LinkIcon />
+ </Link>
+ );
+}
*/
// @flow
import React from 'react';
+import { Link } from 'react-router';
+import LinkIcon from '../../../components/icons-components/LinkIcon';
import QualifierIcon from '../../../components/icons-components/QualifierIcon';
import { splitPath } from '../../../helpers/path';
import { getPathUrlAsString, getProjectUrl } from '../../../helpers/urls';
if (['DIR', 'FIL', 'UTS'].includes(component.qualifier)) {
const parts = splitPath(component.path);
- head = parts.head;
- tail = parts.tail;
+ ({ head, tail } = parts);
}
return (
<span title={component.refKey || component.key}>
{this.renderInner()}
</a>
) : (
- <a
- id={'component-measures-component-link-' + component.key}
+ <Link
className="link-no-underline"
- href={getPathUrlAsString(getProjectUrl(component.refKey, branch))}>
+ id={'component-measures-component-link-' + component.key}
+ to={getProjectUrl(component.refKey, branch)}>
<span className="big-spacer-right">
- <i className="icon-detach" />
+ <LinkIcon />
</span>
{this.renderInner()}
- </a>
+ </Link>
)}
</div>
</td>
*/
// @flow
import React from 'react';
+import { Link } from 'react-router';
import QualifierIcon from '../shared/QualifierIcon';
import FavoriteContainer from '../controls/FavoriteContainer';
import { getPathUrlAsString, getProjectUrl, getComponentIssuesUrl } from '../../helpers/urls';
<div className="source-viewer-header-measure">
<span className="source-viewer-header-measure-value">
- <a
- href={getPathUrlAsString(
- getComponentIssuesUrl(project, {
- resolved: 'false',
- fileUuids: uuid,
- branch: this.props.branch
- })
- )}
- className="source-viewer-header-external-link"
- target="_blank">
- {measures.issues != null ? formatMeasure(measures.issues, 'SHORT_INT') : 0}{' '}
- <i className="icon-detach" />
- </a>
+ <Link
+ to={getComponentIssuesUrl(project, {
+ resolved: 'false',
+ fileUuids: uuid,
+ branch: this.props.branch
+ })}>
+ {measures.issues != null ? formatMeasure(measures.issues, 'SHORT_INT') : 0}
+ </Link>
</span>
<span className="source-viewer-header-measure-label">
{translate('metric.violations.name')}
display: block;
line-height: 18px;
color: var(--baseFontColor);
- font-size: 18px;
- font-weight: 300;
-}
-
-.source-viewer-header-external-link {
- border-bottom: none;
-}
-
-.source-viewer-header-external-link i {
- position: relative;
- top: -4px;
+ font-size: var(--bigFontSize);
}
.source-viewer-header-actions {