deleteAnalysis: (analysis: string) => Promise<*>,
deleteEvent: (analysis: string, event: string) => Promise<*>,
loading: boolean,
+ project: { qualifier: string },
query: Query,
updateQuery: RawQuery => void
};
<ul
className={classNames('project-activity-versions-list', this.props.className)}
onScroll={this.handleScroll}
- ref={element => (this.scrollContainer = element)}>
+ ref={element => (this.scrollContainer = element)}
+ style={{ paddingTop: this.props.project.qualifier === 'APP' ? undefined : 52 }}>
{byVersionByDay.map((version, idx) => {
const days = Object.keys(version.byDay);
if (days.length <= 0) {
addVersion={this.props.addVersion}
analysis={analysis}
canAdmin={this.props.canAdmin}
+ canCreateVersion={this.props.project.qualifier !== 'APP'}
changeEvent={this.props.changeEvent}
deleteAnalysis={this.props.deleteAnalysis}
deleteEvent={this.props.deleteEvent}
addVersion: (analysis: string, version: string) => Promise<*>,
analysis: Analysis,
canAdmin: boolean,
+ canCreateVersion: boolean,
changeEvent: (event: string, name: string) => Promise<*>,
deleteAnalysis: (analysis: string) => Promise<*>,
deleteEvent: (analysis: string, event: string) => Promise<*>,
</button>
<ul className="dropdown-menu dropdown-menu-right">
{!hasVersion &&
+ this.props.canCreateVersion &&
<li>
<AddEventForm
addEvent={this.props.addVersion}
deleteEvent: (analysis: string, event: string) => Promise<*>,
graphLoading: boolean,
loading: boolean,
- project: { configuration?: { showHistory: boolean }, key: string, leakPeriodDate: string },
+ project: {
+ configuration?: { showHistory: boolean },
+ key: string,
+ leakPeriodDate: string,
+ qualifier: string
+ },
metrics: Array<Metric>,
measuresHistory: Array<MeasureHistory>,
query: Query,
<ProjectActivityPageHeader
category={query.category}
from={query.from}
+ project={props.project}
to={query.to}
updateQuery={props.updateQuery}
/>
deleteAnalysis={props.deleteAnalysis}
deleteEvent={props.deleteEvent}
loading={props.loading}
+ project={props.project}
query={props.query}
updateQuery={props.updateQuery}
/>
type Props = {
location: { pathname: string, query: RawQuery },
- project: { configuration?: { showHistory: boolean }, key: string, leakPeriodDate: string },
+ project: {
+ configuration?: { showHistory: boolean },
+ key: string,
+ leakPeriodDate: string,
+ qualifier: string
+ },
router: {
push: ({ pathname: string, query?: RawQuery }) => void,
replace: ({ pathname: string, query?: RawQuery }) => void
import ProjectActivityEventSelectOption from './ProjectActivityEventSelectOption';
import ProjectActivityEventSelectValue from './ProjectActivityEventSelectValue';
import ProjectActivityDateInput from './ProjectActivityDateInput';
-import { EVENT_TYPES } from '../utils';
+import { EVENT_TYPES, APPLICATION_EVENT_TYPES } from '../utils';
import { translate } from '../../../helpers/l10n';
import type { RawQuery } from '../../../helpers/query';
type Props = {
category?: string,
from: ?Date,
+ project: { qualifier: string },
to: ?Date,
updateQuery: RawQuery => void
};
options: Array<{ label: string, value: string }>;
props: Props;
- constructor(props: Props) {
- super(props);
- this.options = EVENT_TYPES.map(category => ({
- label: translate('event.category', category),
- value: category
- }));
- }
-
handleCategoryChange = (option: ?{ value: string }) =>
this.props.updateQuery({ category: option ? option.value : '' });
render() {
+ const eventTypes =
+ this.props.project.qualifier === 'APP' ? APPLICATION_EVENT_TYPES : EVENT_TYPES;
+ this.options = eventTypes.map(category => ({
+ label: translate('event.category', category),
+ value: category
+ }));
+
return (
<header className="page-header">
<Select
deleteAnalysis: () => {},
deleteEvent: () => {},
loading: false,
+ project: { qualifier: 'TRK' },
query: { category: '', graph: DEFAULT_GRAPH, project: 'org.sonarsource.sonarqube:sonarqube' },
updateQuery: () => {}
};
<ProjectActivityPageHeader
category=""
from={new Date('2016-10-27T12:21:15+0200')}
+ project={{}}
updateQuery={() => {}}
/>
)
<ul
className="project-activity-versions-list"
onScroll={[Function]}
+ style={
+ Object {
+ "paddingTop": 52,
+ }
+ }
>
<li>
<div
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
<ul
className="project-activity-versions-list"
onScroll={[Function]}
+ style={
+ Object {
+ "paddingTop": 52,
+ }
+ }
>
<li>
<div
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
<ul
className="project-activity-versions-list"
onScroll={[Function]}
+ style={
+ Object {
+ "paddingTop": 52,
+ }
+ }
>
<li>
<div
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
}
}
canAdmin={false}
+ canCreateVersion={true}
changeEvent={[Function]}
deleteAnalysis={[Function]}
deleteEvent={[Function]}
/>
<ProjectActivityPageHeader
category=""
+ project={
+ Object {
+ "key": "org.sonarsource.sonarqube:sonarqube",
+ "leakPeriodDate": "2017-05-16T13:50:02+0200",
+ }
+ }
updateQuery={[Function]}
/>
<div
deleteAnalysis={[Function]}
deleteEvent={[Function]}
loading={false}
+ project={
+ Object {
+ "key": "org.sonarsource.sonarqube:sonarqube",
+ "leakPeriodDate": "2017-05-16T13:50:02+0200",
+ }
+ }
query={
Object {
"category": "",
overflow: auto;
flex-grow: 1;
flex-shrink: 0;
- padding-top: 52px;
}
.project-activity-graphs {
import type { Serie } from '../../components/charts/AdvancedTimeline';
export const EVENT_TYPES = ['VERSION', 'QUALITY_GATE', 'QUALITY_PROFILE', 'OTHER'];
+export const APPLICATION_EVENT_TYPES = ['QUALITY_GATE', 'OTHER'];
export const DEFAULT_GRAPH = 'issues';
export const GRAPH_TYPES = ['issues', 'coverage', 'duplications', 'custom'];
export const GRAPHS_METRICS_DISPLAYED = {