[arvados] created: 2.7.0-6120-g0666841c3d
git repository hosting
git at public.arvados.org
Tue Mar 5 22:55:28 UTC 2024
at 0666841c3d84bdb760b371972383156072db651c (commit)
commit 0666841c3d84bdb760b371972383156072db651c
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Fri Feb 16 19:50:27 2024 -0300
21461: Fixes log line-breaking behavior for really long strings.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/services/workbench2/src/views/process-panel/process-log-code-snippet.tsx b/services/workbench2/src/views/process-panel/process-log-code-snippet.tsx
index 50d343d622..091078c452 100644
--- a/services/workbench2/src/views/process-panel/process-log-code-snippet.tsx
+++ b/services/workbench2/src/views/process-panel/process-log-code-snippet.tsx
@@ -20,7 +20,7 @@ import classNames from 'classnames';
import { FederationConfig, getNavUrl } from 'routes/routes';
import { RootState } from 'store/store';
-type CssRules = 'root' | 'wordWrap' | 'logText';
+type CssRules = 'root' | 'wordWrapOn' | 'wordWrapOff' | 'logText';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
@@ -35,8 +35,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
logText: {
padding: `0 ${theme.spacing.unit*0.5}px`,
},
- wordWrap: {
- whiteSpace: 'pre-wrap',
+ wordWrapOn: {
+ overflowWrap: 'anywhere',
+ },
+ wordWrapOff: {
+ whiteSpace: 'nowrap',
},
});
@@ -119,8 +122,8 @@ export const ProcessLogCodeSnippet = withStyles(styles)(connect(mapStateToProps)
}
}}>
{ lines.map((line: string, index: number) =>
- <Typography key={index} component="pre"
- className={classNames(classes.logText, wordWrap ? classes.wordWrap : undefined)}>
+ <Typography key={index} component="span"
+ className={classNames(classes.logText, wordWrap ? classes.wordWrapOn : classes.wordWrapOff)}>
{renderLinks(fontSize, auth, dispatch)(line)}
</Typography>
) }
commit 74ce837d503853e33bec0b717ddf6bc82fb7623f
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Fri Feb 23 17:22:46 2024 -0300
21461: Adds test that confirms no horizontal scrollbar exist on long lines.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/services/workbench2/cypress/integration/process.spec.js b/services/workbench2/cypress/integration/process.spec.js
index f647560a5f..a73dac3abb 100644
--- a/services/workbench2/cypress/integration/process.spec.js
+++ b/services/workbench2/cypress/integration/process.spec.js
@@ -678,6 +678,51 @@ describe("Process tests", function () {
});
});
});
+
+ it("correctly break long lines when no obvious line separation exists", function () {
+ function randomString(length) {
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ let res = '';
+ for (let i = 0; i < length; i++) {
+ res += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return res;
+ }
+
+ const logLinesQty = 10;
+ const logLines = [];
+ for (let i = 0; i < logLinesQty; i++) {
+ const length = Math.floor(Math.random() * 500) + 500;
+ logLines.push(randomString(length));
+ }
+
+ createContainerRequest(activeUser, "test_container_request", "arvados/jobs", ["echo", "hello world"], false, "Committed").then(function (
+ containerRequest
+ ) {
+ cy.appendLog(adminUser.token, containerRequest.uuid, "stdout.txt", logLines).as("stdoutLogs");
+
+ cy.getAll("@stdoutLogs").then(function () {
+ cy.loginAs(activeUser);
+ cy.goToPath(`/processes/${containerRequest.uuid}`);
+ // Select 'stdout' log filter
+ cy.get("[data-cy=process-logs-filter]").click();
+ cy.get("body").contains("li", "stdout").click();
+ cy.get("[data-cy=process-logs] span > p")
+ .should('have.length', logLinesQty)
+ .each($p => {
+ expect($p.text().length).to.be.greaterThan(499);
+
+ // This looks like an ugly hack, but I was not able
+ // to get [client|scroll]Width attributes through
+ // the usual Cypress methods.
+ const parentClientWidth = $p[0].parentElement.clientWidth;
+ const parentScrollWidth = $p[0].parentElement.scrollWidth
+ // Scrollbar should not be visible
+ expect(parentClientWidth).to.be.eq(parentScrollWidth);
+ });
+ });
+ });
+ });
});
describe("I/O panel", function () {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list