white-space: nowrap;
}
+.text-limited-small {
+ display: inline-block;
+ max-width: 8vw;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
.text-limited {
display: inline-block;
max-width: 16vw;
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 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.
- */
-/* @flow */
-import React from 'react';
-/*:: import type { Task } from '../types'; */
-import { translateWithParameters } from '../../../helpers/l10n';
-
-const LIMIT = 1000;
-
-const Footer = ({ tasks } /*: { tasks: Task[] } */) => {
- if (tasks.length < LIMIT) {
- return null;
- }
-
- return (
- <footer className="spacer-top note text-center">
- {translateWithParameters('max_results_reached', LIMIT)}
- </footer>
- );
-};
-
-export default Footer;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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 { translateWithParameters } from '../../../helpers/l10n';
+import { Task } from '../types';
+
+const LIMIT = 1000;
+
+interface Props {
+ tasks: Task[];
+}
+
+export default function Footer({ tasks }: Props) {
+ if (tasks.length < LIMIT) {
+ return null;
+ }
+
+ return (
+ <footer className="spacer-top note text-center">
+ {translateWithParameters('max_results_reached', LIMIT)}
+ </footer>
+ );
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 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.
- */
-/* @flow */
-import React from 'react';
-import { STATUSES } from '../constants';
-import Select from '../../../components/controls/Select';
-import { translate } from '../../../helpers/l10n';
-
-const StatusFilter = ({ value, onChange } /*: { value: ?string, onChange: Function } */) => {
- const options = [
- { value: STATUSES.ALL, label: translate('background_task.status.ALL') },
- {
- value: STATUSES.ALL_EXCEPT_PENDING,
- label: translate('background_task.status.ALL_EXCEPT_PENDING')
- },
- { value: STATUSES.PENDING, label: translate('background_task.status.PENDING') },
- { value: STATUSES.IN_PROGRESS, label: translate('background_task.status.IN_PROGRESS') },
- { value: STATUSES.SUCCESS, label: translate('background_task.status.SUCCESS') },
- { value: STATUSES.FAILED, label: translate('background_task.status.FAILED') },
- { value: STATUSES.CANCELED, label: translate('background_task.status.CANCELED') }
- ];
-
- return (
- <Select
- value={value}
- onChange={option => onChange(option.value)}
- className="input-medium"
- options={options}
- clearable={false}
- searchable={false}
- />
- );
-};
-
-export default StatusFilter;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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 { STATUSES } from '../constants';
+import Select from '../../../components/controls/Select';
+import { translate } from '../../../helpers/l10n';
+
+interface Props {
+ value?: string;
+ onChange: (value?: string) => void;
+}
+
+export default class StatusFilter extends React.PureComponent<Props> {
+ handleChange = ({ value }: { value: string }) => {
+ this.props.onChange(value);
+ };
+
+ render() {
+ const options = [
+ { value: STATUSES.ALL, label: translate('background_task.status.ALL') },
+ {
+ value: STATUSES.ALL_EXCEPT_PENDING,
+ label: translate('background_task.status.ALL_EXCEPT_PENDING')
+ },
+ { value: STATUSES.PENDING, label: translate('background_task.status.PENDING') },
+ { value: STATUSES.IN_PROGRESS, label: translate('background_task.status.IN_PROGRESS') },
+ { value: STATUSES.SUCCESS, label: translate('background_task.status.SUCCESS') },
+ { value: STATUSES.FAILED, label: translate('background_task.status.FAILED') },
+ { value: STATUSES.CANCELED, label: translate('background_task.status.CANCELED') }
+ ];
+
+ return (
+ <Select
+ className="input-medium"
+ clearable={false}
+ onChange={this.handleChange}
+ options={options}
+ searchable={false}
+ value={this.props.value}
+ />
+ );
+ }
+}
!prevSubmittedAt || !isSameDay(parseDate(submittedAt), parseDate(prevSubmittedAt));
return (
- <td className="thin nowrap text-right">
+ <td className="thin nowrap text-right small">
{shouldDisplay ? <DateFormatter date={submittedAt} long={true} /> : ''}
</td>
);
}
export default function TaskSubmitter({ submitter }: Props) {
- return <td className="thin nowrap note">{submitter || translate('anonymous')}</td>;
+ return (
+ <td className="thin note">
+ <span className="text-limited-small text-bottom">{submitter || translate('anonymous')}</span>
+ </td>
+ );
}
<th>{translate('background_tasks.table.status')}</th>
<th>{translate('background_tasks.table.task')}</th>
<th>{translate('background_tasks.table.id')}</th>
- <th className="text-right">{translate('background_tasks.table.submitter')}</th>
+ <th>{translate('background_tasks.table.submitter')}</th>
<th> </th>
<th className="text-right">{translate('background_tasks.table.submitted')}</th>
<th className="text-right">{translate('background_tasks.table.started')}</th>
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 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.
- */
-/* @flow */
-import React from 'react';
-import { ALL_TYPES } from '../constants';
-import Select from '../../../components/controls/Select';
-import { translate } from '../../../helpers/l10n';
-
-const TypesFilter = (
- { value, onChange, types } /*: {
- value: string,
- onChange: Function,
- types: string[]
-} */
-) => {
- const options = types.map(t => {
- return {
- value: t,
- label: translate('background_task.type', t)
- };
- });
-
- const allOptions = [
- { value: ALL_TYPES, label: translate('background_task.type.ALL') },
- ...options
- ];
-
- return (
- <Select
- value={value}
- onChange={option => onChange(option.value)}
- className="input-medium"
- options={allOptions}
- clearable={false}
- searchable={false}
- />
- );
-};
-
-export default TypesFilter;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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 { ALL_TYPES } from '../constants';
+import Select from '../../../components/controls/Select';
+import { translate } from '../../../helpers/l10n';
+
+interface Props {
+ value: string;
+ onChange: Function;
+ types: string[];
+}
+
+export default class TypesFilter extends React.PureComponent<Props> {
+ handleChange = ({ value }: { value: string }) => {
+ this.props.onChange(value);
+ };
+
+ render() {
+ const { value, types } = this.props;
+ const options = types.map(t => {
+ return {
+ value: t,
+ label: translate('background_task.type', t)
+ };
+ });
+
+ const allOptions = [
+ { value: ALL_TYPES, label: translate('background_task.type.ALL') },
+ ...options
+ ];
+
+ return (
+ <Select
+ className="input-medium"
+ clearable={false}
+ onChange={this.handleChange}
+ options={allOptions}
+ searchable={false}
+ value={value}
+ />
+ );
+ }
+}
exports[`renders 1`] = `
<td
- className="thin nowrap text-right"
+ className="thin nowrap text-right small"
>
<DateFormatter
date="2017-01-02T00:00:00.000Z"
exports[`renders 2`] = `
<td
- className="thin nowrap text-right"
+ className="thin nowrap text-right small"
/>
`;