Merge pull request #4063 from hashicorp/b-ui-display-message
UI: Read the task event message from the DisplayMessage prop
This commit is contained in:
commit
cbfeca8678
|
@ -12,17 +12,5 @@ export default Fragment.extend({
|
|||
time: attr('date'),
|
||||
timeNanos: attr('number'),
|
||||
|
||||
downloadError: attr('string'),
|
||||
driverError: attr('string'),
|
||||
driverMessage: attr('string'),
|
||||
killError: attr('string'),
|
||||
killReason: attr('string'),
|
||||
killTimeout: attr('number'),
|
||||
restartReason: attr('string'),
|
||||
setupError: attr('string'),
|
||||
startDelay: attr('number'),
|
||||
taskSignal: attr('string'),
|
||||
taskSignalReason: attr('string'),
|
||||
validationError: attr('string'),
|
||||
message: attr('string'),
|
||||
});
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import ApplicationSerializer from './application';
|
||||
|
||||
export default ApplicationSerializer.extend({
|
||||
attrs: {
|
||||
message: 'DisplayMessage',
|
||||
},
|
||||
|
||||
normalize(typeHash, hash) {
|
||||
// Time is in the form of nanoseconds since epoch, but JS dates
|
||||
// only understand time to the millisecond precision. So store
|
||||
|
|
|
@ -11,14 +11,5 @@ export default Factory.extend({
|
|||
exitCode: () => null,
|
||||
time: () => faker.date.past(2 / 365, REF_TIME) * 1000000,
|
||||
|
||||
downloadError: () => '',
|
||||
driverError: () => '',
|
||||
driverMessage: () => '',
|
||||
killError: () => '',
|
||||
killReason: () => '',
|
||||
restartReason: () => '',
|
||||
setupError: () => '',
|
||||
taskSignalReason: () => '',
|
||||
validationError: () => '',
|
||||
message: () => faker.lorem.sentence(),
|
||||
displayMessage: () => faker.lorem.sentence(),
|
||||
});
|
||||
|
|
|
@ -18,7 +18,6 @@ export default Factory.extend({
|
|||
const props = [
|
||||
'task-event',
|
||||
faker.random.number({ min: 1, max: 10 }),
|
||||
false,
|
||||
{
|
||||
taskStateId: state.id,
|
||||
},
|
||||
|
|
|
@ -95,7 +95,7 @@ test('each task row should list high-level information for the task', function(a
|
|||
.find('[data-test-message]')
|
||||
.text()
|
||||
.trim(),
|
||||
event.message,
|
||||
event.displayMessage,
|
||||
'Event Message'
|
||||
);
|
||||
assert.equal(
|
||||
|
|
|
@ -172,7 +172,7 @@ test('each recent event should list the time, type, and description of the event
|
|||
);
|
||||
assert.equal(
|
||||
recentEvent.querySelector('[data-test-task-event-message]').textContent.trim(),
|
||||
event.message,
|
||||
event.displayMessage,
|
||||
'Event message'
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue