foreman-tasks 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/foreman_tasks/version.rb +1 -1
  3. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +3 -1
  4. data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +2 -2
  5. data/webpack/ForemanTasks/Components/TaskDetails/index.js +1 -4
  6. data/webpack/ForemanTasks/Components/TasksDashboard/index.js +1 -4
  7. data/webpack/ForemanTasks/Components/TasksTable/Components/ActionConfirmation.js +49 -0
  8. data/webpack/ForemanTasks/Components/TasksTable/Components/ActionSelectButton.js +37 -0
  9. data/webpack/ForemanTasks/Components/TasksTable/Components/CancelResumeConfirm.js +51 -0
  10. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js +32 -0
  11. data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js +38 -0
  12. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionConfirmation.test.js +18 -0
  13. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js +13 -0
  14. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelResumeConfirm.test.js +28 -0
  15. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js +15 -0
  16. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js +15 -0
  17. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionConfirmation.test.js.snap +89 -0
  18. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionSelectButton.test.js.snap +32 -0
  19. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelResumeConfirm.test.js.snap +37 -0
  20. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap +14 -0
  21. data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap +15 -0
  22. data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +29 -1
  23. data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +78 -3
  24. data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +11 -0
  25. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +47 -1
  26. data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +30 -11
  27. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSchema.js +23 -5
  28. data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +8 -0
  29. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +9 -1
  30. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +46 -1
  31. data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +29 -1
  32. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +9 -5
  33. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +9 -5
  34. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +77 -17
  35. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +46 -10
  36. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +62 -7
  37. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionCellFormatter.test.js.snap +14 -0
  38. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +9 -0
  39. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/dateCellFormmatter.test.js.snap +9 -0
  40. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/durationCellFormmatter.test.js.snap +18 -0
  41. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionCellFormatter.test.js.snap +10 -0
  42. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionHeaderCellFormatter.test.js.snap +10 -0
  43. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js +11 -0
  44. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js +8 -0
  45. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/dateCellFormmatter.test.js +7 -0
  46. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js +12 -0
  47. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js +12 -0
  48. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +12 -0
  49. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionCellFormatter.js +16 -0
  50. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +5 -0
  51. data/webpack/ForemanTasks/Components/TasksTable/formatters/dateCellFormmatter.js +7 -0
  52. data/webpack/ForemanTasks/Components/TasksTable/formatters/durationCellFormmatter.js +7 -0
  53. data/webpack/ForemanTasks/Components/TasksTable/formatters/index.js +7 -0
  54. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionCellFormatter.js +10 -0
  55. data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +10 -0
  56. data/webpack/ForemanTasks/Components/TasksTable/index.js +5 -4
  57. data/webpack/__mocks__/foremanReact/components/common/table.js +1 -0
  58. metadata +36 -3
  59. data/webpack/ForemanTasks/Components/TasksTable/TaskTableFormmatters.js +0 -53
@@ -1,32 +1,87 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`TasksTablePaginationReducer reducer should handle TASKS_TABLE_SET_PAGINATION 1`] = `
3
+ exports[`TasksTableReducer reducer should handle SELECT_ROWS 1`] = `
4
4
  Object {
5
- "tasksTableQuery": Object {},
5
+ "tasksTableQuery": Object {
6
+ "modalStatus": "CLOSED",
7
+ "selectedRows": Array [
8
+ 1,
9
+ 2,
10
+ 3,
11
+ 4,
12
+ 5,
13
+ 6,
14
+ 7,
15
+ ],
16
+ },
17
+ }
18
+ `;
19
+
20
+ exports[`TasksTableReducer reducer should handle TASKS_TABLE_SELECTED_MODAL 1`] = `
21
+ Object {
22
+ "tasksTableQuery": Object {
23
+ "modalStatus": "RESUME",
24
+ "selectedRows": Array [],
25
+ },
6
26
  }
7
27
  `;
8
28
 
9
- exports[`TasksTablePaginationReducer reducer should handle TASKS_TABLE_SET_SORT 1`] = `
29
+ exports[`TasksTableReducer reducer should handle TASKS_TABLE_SET_PAGINATION 1`] = `
10
30
  Object {
11
- "tasksTableQuery": Object {},
31
+ "tasksTableQuery": Object {
32
+ "modalStatus": "CLOSED",
33
+ "selectedRows": Array [],
34
+ },
35
+ }
36
+ `;
37
+
38
+ exports[`TasksTableReducer reducer should handle TASKS_TABLE_SET_SORT 1`] = `
39
+ Object {
40
+ "tasksTableQuery": Object {
41
+ "modalStatus": "CLOSED",
42
+ "selectedRows": Array [],
43
+ },
12
44
  }
13
45
  `;
14
46
 
15
- exports[`TasksTablePaginationReducer reducer should handle TASKS_TABLE_SUCCESS 1`] = `
47
+ exports[`TasksTableReducer reducer should handle TASKS_TABLE_SUCCESS 1`] = `
16
48
  Object {
17
49
  "tasksTableQuery": Object {
18
50
  "actionName": undefined,
19
51
  "itemCount": 120,
52
+ "modalStatus": "CLOSED",
20
53
  "pagination": Object {
21
54
  "page": 3,
22
55
  "perPage": 12,
23
56
  },
57
+ "selectedRows": Array [],
58
+ },
59
+ }
60
+ `;
61
+
62
+ exports[`TasksTableReducer reducer should handle UNSELECT_ALL_ROWS 1`] = `
63
+ Object {
64
+ "tasksTableQuery": Object {
65
+ "modalStatus": "CLOSED",
66
+ "selectedRows": Array [],
24
67
  },
25
68
  }
26
69
  `;
27
70
 
28
- exports[`TasksTablePaginationReducer reducer should return the initial state 1`] = `
71
+ exports[`TasksTableReducer reducer should handle UNSELECT_ROWS 1`] = `
29
72
  Object {
30
- "tasksTableQuery": Object {},
73
+ "tasksTableQuery": Object {
74
+ "modalStatus": "CLOSED",
75
+ "selectedRows": Array [],
76
+ },
77
+ }
78
+ `;
79
+
80
+ exports[`TasksTableReducer reducer should return the initial state 1`] = `
81
+ Object {
82
+ "tasksTableQuery": Object {
83
+ "modalStatus": "CLOSED",
84
+ "selectedRows": Array [],
85
+ },
31
86
  }
32
87
  `;
@@ -0,0 +1,14 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`actionCellFormatter render 1`] = `
4
+ <ActionButton
5
+ availableActions={
6
+ Object {
7
+ "cancellable": true,
8
+ }
9
+ }
10
+ id="some-id"
11
+ name="some-name"
12
+ taskActions={Object {}}
13
+ />
14
+ `;
@@ -0,0 +1,9 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`actionNameCellFormatter render 1`] = `
4
+ <a
5
+ href="/some-url/some-id"
6
+ >
7
+ action-name
8
+ </a>
9
+ `;
@@ -0,0 +1,9 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`dateCellFormmatter render 1`] = `
4
+ <LongDateTime
5
+ date="some-value"
6
+ defaultValue="N/A"
7
+ seconds={true}
8
+ />
9
+ `;
@@ -0,0 +1,18 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`durationCellFormmatter render with tooltip 1`] = `
4
+ <span
5
+ className="param-value"
6
+ title="some-tooltip"
7
+ >
8
+ some-value
9
+ </span>
10
+ `;
11
+
12
+ exports[`durationCellFormmatter render without tooltip 1`] = `
13
+ <span
14
+ className="param-value"
15
+ >
16
+ some-value
17
+ </span>
18
+ `;
@@ -0,0 +1,10 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`selectionCellFormatter render 1`] = `
4
+ <TableSelectionCell
5
+ checked={true}
6
+ id="selectsome-index"
7
+ label="Select row"
8
+ onChange={[Function]}
9
+ />
10
+ `;
@@ -0,0 +1,10 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`selectionHeaderCellFormatter render 1`] = `
4
+ <TableSelectionHeaderCell
5
+ checked={true}
6
+ id="selectAll"
7
+ label="some-label"
8
+ onChange={[Function]}
9
+ />
10
+ `;
@@ -0,0 +1,11 @@
1
+ import { actionCellFormatter } from '../actionCellFormatter';
2
+
3
+ describe('actionCellFormatter', () => {
4
+ it('render', () => {
5
+ const data = [
6
+ { cancellable: true },
7
+ { rowData: { action: 'some-name', id: 'some-id' } },
8
+ ];
9
+ expect(actionCellFormatter({})(...data)).toMatchSnapshot();
10
+ });
11
+ });
@@ -0,0 +1,8 @@
1
+ import { actionNameCellFormatter } from '../actionNameCellFormatter';
2
+
3
+ describe('actionNameCellFormatter', () => {
4
+ it('render', () => {
5
+ const data = ['action-name', { rowData: { id: 'some-id' } }];
6
+ expect(actionNameCellFormatter('some-url')(...data)).toMatchSnapshot();
7
+ });
8
+ });
@@ -0,0 +1,7 @@
1
+ import { dateCellFormmatter } from '../dateCellFormmatter';
2
+
3
+ describe('dateCellFormmatter', () => {
4
+ it('render', () => {
5
+ expect(dateCellFormmatter('some-value')).toMatchSnapshot();
6
+ });
7
+ });
@@ -0,0 +1,12 @@
1
+ import { durationCellFormmatter } from '../durationCellFormmatter';
2
+
3
+ describe('durationCellFormmatter', () => {
4
+ it('render with tooltip', () => {
5
+ expect(
6
+ durationCellFormmatter({ text: 'some-value', tooltip: 'some-tooltip' })
7
+ ).toMatchSnapshot();
8
+ });
9
+ it('render without tooltip', () => {
10
+ expect(durationCellFormmatter({ text: 'some-value' })).toMatchSnapshot();
11
+ });
12
+ });
@@ -0,0 +1,12 @@
1
+ import selectionCellFormatter from '../selectionCellFormatter';
2
+
3
+ describe('selectionCellFormatter', () => {
4
+ it('render', () => {
5
+ expect(
6
+ selectionCellFormatter(
7
+ { isSelected: () => true },
8
+ { rowIndex: 'some-index' }
9
+ )
10
+ ).toMatchSnapshot();
11
+ });
12
+ });
@@ -0,0 +1,12 @@
1
+ import selectionHeaderCellFormatter from '../selectionHeaderCellFormatter';
2
+
3
+ describe('selectionHeaderCellFormatter', () => {
4
+ it('render', () => {
5
+ expect(
6
+ selectionHeaderCellFormatter(
7
+ { allRowsSelected: () => true },
8
+ 'some-label'
9
+ )
10
+ ).toMatchSnapshot();
11
+ });
12
+ });
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { cellFormatter } from 'foremanReact/components/common/table';
3
+ import { ActionButton } from '../../common/ActionButtons/ActionButton';
4
+
5
+ export const actionCellFormatter = taskActions => (
6
+ value,
7
+ { rowData: { action, id } }
8
+ ) =>
9
+ cellFormatter(
10
+ <ActionButton
11
+ id={id}
12
+ name={action}
13
+ taskActions={taskActions}
14
+ availableActions={value}
15
+ />
16
+ );
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { cellFormatter } from 'foremanReact/components/common/table';
3
+
4
+ export const actionNameCellFormatter = url => (value, { rowData: { id } }) =>
5
+ cellFormatter(<a href={`/${url}/${id}`}>{value}</a>);
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import LongDateTime from 'foremanReact/components/common/dates/LongDateTime';
3
+ import { translate as __ } from 'foremanReact/common/I18n';
4
+
5
+ export const dateCellFormmatter = value => (
6
+ <LongDateTime seconds date={value} defaultValue={__('N/A')} />
7
+ );
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ export const durationCellFormmatter = value => (
4
+ <span className="param-value" title={value.tooltip}>
5
+ {value.text}
6
+ </span>
7
+ );
@@ -0,0 +1,7 @@
1
+ export { default as selectionHeaderCellFormatter } from './selectionHeaderCellFormatter';
2
+ export { default as selectionCellFormatter } from './selectionCellFormatter';
3
+
4
+ export { actionNameCellFormatter } from './actionNameCellFormatter';
5
+ export { actionCellFormatter } from './actionCellFormatter';
6
+ export { dateCellFormmatter } from './dateCellFormmatter';
7
+ export { durationCellFormmatter } from './durationCellFormmatter';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import TableSelectionCell from '../Components/TableSelectionCell';
3
+
4
+ export default (selectionController, additionalData) => (
5
+ <TableSelectionCell
6
+ id={`select${additionalData.rowIndex}`}
7
+ checked={selectionController.isSelected(additionalData)}
8
+ onChange={() => selectionController.selectRow(additionalData)}
9
+ />
10
+ );
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import TableSelectionHeaderCell from '../Components/TableSelectionHeaderCell';
3
+
4
+ export default (selectionController, label) => (
5
+ <TableSelectionHeaderCell
6
+ label={label}
7
+ checked={selectionController.allRowsSelected()}
8
+ onChange={() => selectionController.selectAllRows()}
9
+ />
10
+ );
@@ -11,6 +11,8 @@ import {
11
11
  selectItemCount,
12
12
  selectSort,
13
13
  selectActionName,
14
+ selectSelectedRows,
15
+ selectModalStatus,
14
16
  } from './TasksTableSelectors';
15
17
 
16
18
  const mapStateToProps = state => ({
@@ -21,12 +23,11 @@ const mapStateToProps = state => ({
21
23
  pagination: selectPagitation(state),
22
24
  itemCount: selectItemCount(state),
23
25
  actionName: selectActionName(state),
26
+ selectedRows: selectSelectedRows(state),
27
+ modalStatus: selectModalStatus(state),
24
28
  });
25
29
  const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
26
30
 
27
31
  export const reducers = { tasksTable: reducer };
28
32
 
29
- export default connect(
30
- mapStateToProps,
31
- mapDispatchToProps
32
- )(TasksTablePage);
33
+ export default connect(mapStateToProps, mapDispatchToProps)(TasksTablePage);
@@ -2,3 +2,4 @@ import React from 'react';
2
2
 
3
3
  export const Table = () => <div className="table" />;
4
4
  export const createTableReducer = jest.fn(controller => controller);
5
+ export const cellFormatter = cell => cell;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-07 00:00:00.000000000 Z
11
+ date: 2019-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks-core
@@ -415,8 +415,22 @@ files:
415
415
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardActions.test.js.snap
416
416
  - webpack/ForemanTasks/Components/TasksDashboard/__tests__/__snapshots__/TasksDashboardReducer.test.js.snap
417
417
  - webpack/ForemanTasks/Components/TasksDashboard/index.js
418
+ - webpack/ForemanTasks/Components/TasksTable/Components/ActionConfirmation.js
419
+ - webpack/ForemanTasks/Components/TasksTable/Components/ActionSelectButton.js
420
+ - webpack/ForemanTasks/Components/TasksTable/Components/CancelResumeConfirm.js
421
+ - webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js
422
+ - webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js
423
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionConfirmation.test.js
424
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js
425
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelResumeConfirm.test.js
426
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js
427
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js
428
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionConfirmation.test.js.snap
429
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionSelectButton.test.js.snap
430
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelResumeConfirm.test.js.snap
431
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap
432
+ - webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap
418
433
  - webpack/ForemanTasks/Components/TasksTable/SubTasksPage.js
419
- - webpack/ForemanTasks/Components/TasksTable/TaskTableFormmatters.js
420
434
  - webpack/ForemanTasks/Components/TasksTable/TasksIndexPage.js
421
435
  - webpack/ForemanTasks/Components/TasksTable/TasksTable.js
422
436
  - webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js
@@ -441,6 +455,25 @@ files:
441
455
  - webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap
442
456
  - webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap
443
457
  - webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap
458
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionCellFormatter.test.js.snap
459
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap
460
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/dateCellFormmatter.test.js.snap
461
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/durationCellFormmatter.test.js.snap
462
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionCellFormatter.test.js.snap
463
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionHeaderCellFormatter.test.js.snap
464
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js
465
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js
466
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/dateCellFormmatter.test.js
467
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js
468
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js
469
+ - webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js
470
+ - webpack/ForemanTasks/Components/TasksTable/formatters/actionCellFormatter.js
471
+ - webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js
472
+ - webpack/ForemanTasks/Components/TasksTable/formatters/dateCellFormmatter.js
473
+ - webpack/ForemanTasks/Components/TasksTable/formatters/durationCellFormmatter.js
474
+ - webpack/ForemanTasks/Components/TasksTable/formatters/index.js
475
+ - webpack/ForemanTasks/Components/TasksTable/formatters/selectionCellFormatter.js
476
+ - webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js
444
477
  - webpack/ForemanTasks/Components/TasksTable/index.js
445
478
  - webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.js
446
479
  - webpack/ForemanTasks/Components/common/ActionButtons/ActionButton.test.js
@@ -1,53 +0,0 @@
1
- import React from 'react';
2
- import { FormattedDate } from 'react-intl';
3
- import { isoCompatibleDate } from 'foremanReact/common/helpers';
4
- import { translate as __ } from 'foremanReact/common/I18n';
5
- import EllipsisWithTooltip from 'react-ellipsis-with-tooltip';
6
- import { cellFormatter } from 'foremanReact/components/common/table';
7
- import { ActionButton } from '../common/ActionButtons/ActionButton';
8
-
9
- export const dateCellFormmatter = value => {
10
- if (value) {
11
- const isoDate = isoCompatibleDate(value);
12
- return (
13
- <span>
14
- <FormattedDate
15
- value={isoDate}
16
- day="2-digit"
17
- month="long"
18
- hour="2-digit"
19
- minute="2-digit"
20
- second="2-digit"
21
- year="numeric"
22
- />
23
- </span>
24
- );
25
- }
26
- return <span>{__('N/A')}</span>;
27
- };
28
-
29
- export const actionNameCellFormatter = url => (value, { rowData: { id } }) =>
30
- cellFormatter(
31
- <EllipsisWithTooltip>
32
- <a href={`/${url}/${id}`}>{value}</a>
33
- </EllipsisWithTooltip>
34
- );
35
-
36
- export const actionCellFormatter = taskActions => (
37
- value,
38
- { rowData: { action, id } }
39
- ) =>
40
- cellFormatter(
41
- <ActionButton
42
- taskActions={taskActions}
43
- availableActions={value}
44
- id={id}
45
- name={action}
46
- />
47
- );
48
-
49
- export const durationCellFormmatter = value => (
50
- <span className="param-value" title={value.tooltip}>
51
- {value.text}
52
- </span>
53
- );