Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compact the default history view #517

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const routeOpts = {
clusterName: params.clusterName,
domain: params.domain,
eventId: Number(query.eventId) || undefined,
format: query.format || 'grid',
format: query.format || 'compact',
runId: params.runId,
showGraph: Boolean(query.showGraph) === true,
graphView: query.graphView,
Expand Down
26 changes: 18 additions & 8 deletions client/test/workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ describe('Workflow', () => {
await historyEl.waitUntilExists('section.results');
const resultsEl = historyEl.querySelector('section.results');

historyEl.querySelector('.view-formats a.grid').trigger('click');

await retry(() =>
resultsEl.querySelectorAll('.tr').should.have.length(6)
);
Expand Down Expand Up @@ -769,8 +771,16 @@ describe('Workflow', () => {
});

describe('Grid View', () => {
async function gridViewTest(mochaTest, o) {
const [summaryEl, scenario] = await historyTest(mochaTest, {
query: 'format=grid',
...(o || {}),
});

return [summaryEl, scenario];
}
it('should show full results in a grid', async function test() {
return historyTest(this.test).then(async ([historyEl]) => {
return gridViewTest(this.test).then(async ([historyEl]) => {
await historyEl.waitUntilExists(
'.results .table .vue-recycle-scroller__item-view:nth-child(5) .tr'
);
Expand Down Expand Up @@ -830,7 +840,7 @@ describe('Workflow', () => {
});

it('should show details as flattened key-value pairs from parsed json, except for result and input', async function test() {
const [historyEl] = await historyTest(this.test);
const [historyEl] = await gridViewTest(this.test);
const startDetails = await historyEl.waitUntilExists(
'.results .tr:first-child .td:nth-child(5)'
);
Expand Down Expand Up @@ -867,7 +877,7 @@ describe('Workflow', () => {
baz: new Array(100).fill('aa').join('|'),
};

const [historyEl, scenario] = await historyTest(this.test, {
const [historyEl, scenario] = await gridViewTest(this.test, {
attach: true,
events: [
{
Expand Down Expand Up @@ -909,7 +919,7 @@ describe('Workflow', () => {
});

it('should allow toggling of the details column between summary and full details', async function test() {
const [historyEl] = await historyTest(this.test);
const [historyEl] = await gridViewTest(this.test);

await historyEl.waitUntilExists(
'.results .vue-recycle-scroller__item-view:nth-child(5) .tr'
Expand Down Expand Up @@ -949,7 +959,7 @@ describe('Workflow', () => {

it('should use the details format from local storage if available', async function test() {
localStorage.setItem('ci-test:history-compact-details', 'true');
const [historyEl] = await historyTest(this.test);
const [historyEl] = await gridViewTest(this.test);

await retry(() =>
historyEl
Expand All @@ -961,7 +971,7 @@ describe('Workflow', () => {
});

it('should specially handle MarkerRecorded events', async function test() {
const [historyEl] = await historyTest(this.test, {
const [historyEl] = await gridViewTest(this.test, {
events: [
{
eventId: 1,
Expand Down Expand Up @@ -1063,7 +1073,7 @@ describe('Workflow', () => {
});

it('should render event inputs as highlighted json', async function test() {
const [historyEl] = await historyTest(this.test);
const [historyEl] = await gridViewTest(this.test);
const startDetails = await historyEl.waitUntilExists(
'.results .tr:first-child .td:nth-child(5)'
);
Expand All @@ -1082,7 +1092,7 @@ describe('Workflow', () => {
});

it('should link to child workflows, and load its history when navigated too', async function test() {
const [historyEl] = await historyTest(this.test, {
const [historyEl] = await gridViewTest(this.test, {
events: [
{
eventType: 'WorkflowExecutionStarted',
Expand Down