https://alice.its.cern.ch/jira/browse/O2B-927

The log titles are in logTreeViewModel._logTreeLeafs_.payload Page title is in logTreeViewComponent

Should the main title be the same as the parent log? What happens when we have different titles? and should we stop displaying the log titles?

it’s changed a bit lol, so now

  • if the title is the same as the parent, it is not displayed.
  • The author and date are displayed in italics underneath the title(?).
  • Runs and attachments are displayed next to the author, and …
    • [-] make them into a table?
  • [-] not on mobile unless the log is uncollapsed.
  • Tags are displayed next to these.
  • Tags should be styled like this
  • this was the table
// h('table', [

// h('tr' , [h('th', 'Runs'), h('th', 'Attachments')]),

// h('tbody', [

// h('tr', [

// h('td', logFields.runs.format(log.runs)),

// h('td', logFields.attachments.format(log.attachments)),

// ]),

// ])

// ])

Reviews

  • Linter Errors
  • Log highlight

  • Fix tests

expect(attachmentNamesText).to.equal(${file1}, ${file2}); fails with

AssertionError: expected '1200px-CERN_logo.png, hadron_collider_(é_è).jpg' to equal 'Attachments:\n1200px-CERN_logo.png,\nhadron_collider_(é_è).jpg'

expect(attachmentNamesText).to.equal(${file1}, ${file2});

AssertionError: expected 'Attachments:\n1200px-CERN_logo.png,\nhadron_collider_(é_è).jpg' to equal '1200px-CERN_logo.png, hadron_collider_(é_è).jpg'

When I change the file names, because it fetches the real files from the local storage, there is an error, so the log won’t be created.

READ THE LINE NUMBERS In one case, 202 was failing, and in the other case 204 was failing, but the lines looked exactly the same :(

  • Add link button

Adding the copy to clipboard link button was more work than I thought it would be. Added a new component clipboardTarget which wraps any children elements in a target tag which checks if the window is secure before copying to clipboard.

So I had a function that accepted four arguments but was called with 5 and nothing came up in the linter?

Also I wonder if it’s possible to add takeScreenshot to the linter?


Note for monday: Trying to add a test to check that the correct log url is copied to the clipboard. Currently using page.evaluate() to get the value of navigator.clipboard.readText(), but getting the error that the DOM is not focussed. tried await page.focus() on the element but this doesnt work either. https://stackoverflow.com/questions/56306153/domexception-on-calling-navigator-clipboard-readtext/70386674#70386674

Mocking the clipboard didn’t work:

await goToPage(page, 'log-detail', { queryParameters: { id: 119 } });

takeScreenshot();

  

// Mock the clipboard to avoid having to bypass permissions

await page.evaluate(() => {

let clipboardText = null;

navigator.clipboard = {

writeText: text => new Promise(resolve => clipboardText = text),

readText: () => new Promise(resolve => resolve(clipboardText))

}

})

console.log("test");

console.log(await page.evaluate(() => navigator.clipboard));

await page.evaluate(() => navigator.clipboard.writeText("hello"));

console.log(await page.evaluate(() => navigator.clipboard.readText()));

  

// Expect the button to be there. Log 117 should be a parent to 119.

const log117CopyBtn = await page.$('#copy-117');

expect(log117CopyBtn).to.exist;

  

console.log("focus")

await page.focus('#copy-117');

console.log('click');

await log117CopyBtn.click();

console.log('eval')

actualClipboardContents = await page.evaluate(() => navigator.clipboard.readText())

// const actualClipboardContents = await page.evaluate(() => new Promise(resolve => resolve('hello')));

  

console.log('expect');

// await log117CopyBtn.click();

expectedClipboardContents = '';

expect(actualClipboardContents).to.equal(expectedClipboardContents);

});

There is an open issue about accessing the clipboard in headless? https://github.com/puppeteer/puppeteer/issues/8692

Hangs on evaluate.

Fixed. Solution in Using the clipboard in puppeteer headless


Feedback: