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:
Michael Lange 2018-03-28 14:50:34 -06:00 committed by GitHub
commit cbfeca8678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 25 deletions

View File

@ -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'),
});

View File

@ -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

View File

@ -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(),
});

View File

@ -18,7 +18,6 @@ export default Factory.extend({
const props = [
'task-event',
faker.random.number({ min: 1, max: 10 }),
false,
{
taskStateId: state.id,
},

View File

@ -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(

View File

@ -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'
);
});