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.
- checksums.yaml +4 -4
- data/lib/foreman_tasks/version.rb +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +3 -1
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +2 -2
- data/webpack/ForemanTasks/Components/TaskDetails/index.js +1 -4
- data/webpack/ForemanTasks/Components/TasksDashboard/index.js +1 -4
- data/webpack/ForemanTasks/Components/TasksTable/Components/ActionConfirmation.js +49 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/ActionSelectButton.js +37 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/CancelResumeConfirm.js +51 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionCell.js +32 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/TableSelectionHeaderCell.js +38 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionConfirmation.test.js +18 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/ActionSelectButton.test.js +13 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/CancelResumeConfirm.test.js +28 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionCell.test.js +15 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/TableSelectionHeaderCell.test.js +15 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionConfirmation.test.js.snap +89 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/ActionSelectButton.test.js.snap +32 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/CancelResumeConfirm.test.js.snap +37 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionCell.test.js.snap +14 -0
- data/webpack/ForemanTasks/Components/TasksTable/Components/__test__/__snapshots__/TableSelectionHeaderCell.test.js.snap +15 -0
- data/webpack/ForemanTasks/Components/TasksTable/TasksTable.js +29 -1
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableActions.js +78 -3
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableConstants.js +11 -0
- data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.js +47 -1
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableReducer.js +30 -11
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableSchema.js +23 -5
- data/webpack/ForemanTasks/Components/TasksTable/TasksTableSelectors.js +8 -0
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTable.fixtures.js +9 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableActions.test.js +46 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/TasksTableReducer.test.js +29 -1
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/SubTasksPage.test.js.snap +9 -5
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksIndexPage.test.js.snap +9 -5
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableActions.test.js.snap +77 -17
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +46 -10
- data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTableReducer.test.js.snap +62 -7
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionCellFormatter.test.js.snap +14 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +9 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/dateCellFormmatter.test.js.snap +9 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/durationCellFormmatter.test.js.snap +18 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionCellFormatter.test.js.snap +10 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/selectionHeaderCellFormatter.test.js.snap +10 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js +11 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js +8 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/dateCellFormmatter.test.js +7 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js +12 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js +12 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionHeaderCellFormatter.test.js +12 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/actionCellFormatter.js +16 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +5 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/dateCellFormmatter.js +7 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/durationCellFormmatter.js +7 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/index.js +7 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionCellFormatter.js +10 -0
- data/webpack/ForemanTasks/Components/TasksTable/formatters/selectionHeaderCellFormatter.js +10 -0
- data/webpack/ForemanTasks/Components/TasksTable/index.js +5 -4
- data/webpack/__mocks__/foremanReact/components/common/table.js +1 -0
- metadata +36 -3
- 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[`
|
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[`
|
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[`
|
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[`
|
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,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
|
+
`;
|
data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionCellFormatter.test.js
ADDED
@@ -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
|
+
});
|
data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/actionNameCellFormatter.test.js
ADDED
@@ -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
|
+
});
|
data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/durationCellFormmatter.test.js
ADDED
@@ -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
|
+
});
|
data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/selectionCellFormatter.test.js
ADDED
@@ -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,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
|
+
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);
|
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.
|
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-
|
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
|
-
);
|