Skip to content

Improvements to Null values handling #409

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"default": "Name",
"enum": [
"Name",
"Label"
"Label",
"Both"
],
"enumDescriptions": [
"Show the column name",
Expand Down
107 changes: 74 additions & 33 deletions src/views/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,105 @@ export function getHeader(options: {withCollapsed?: boolean} = {}): string {
<style>
#resultset {
height: 100%;
border-collapse: collapse;
font-size: 0.9em;
font-family: sans-serif;
min-width: 100%;
display: grid;
position: relative;
}

thead tr {
.header {
background-color: var(--vscode-banner-background);
color: var(--vscode-banner-foreground);
text-align: left;
position: sticky; /* Lock the header row to the top so it's always visible as rows are scrolled */
top: 0; /* Don't forget this, required for the stickiness */
z-index: 1;
}

tfoot {
position: sticky;
bottom: 0;
.row {
grid-column: 1 / -1;
display: contents;
}

tfoot tr {
.row:hover > .cell {
background-color: var(--vscode-list-hoverBackground);
}

#footer {
position: sticky;
bottom: 0;
background-color: var(--vscode-multiDiffEditor-headerBackground);
text-align: left;
grid-column: 1 / -1;
opacity: 1;
padding: 5px 15px;
}

#resultset th,
#resultset td {
.header,
.cell {
padding: 5px 15px;
}

#resultset tbody tr:hover {
background-color: var(--vscode-list-hoverBackground);
.cell {
position: relative;
}

#resultset tbody tr {
border-bottom: 1px solid var(--vscode-activityBar-border);

.header {
/* stop content from "spilling" */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

${options.withCollapsed ? /*css*/`
.hoverable {
/* your initial height */
height: 12px;
/* stop content from "spilling" */
overflow: hidden;
.hoverable {
/* stop content from "spilling" */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-word;
}

text-overflow: ellipsis;
max-width: 200px;
text-wrap: nowrap;
}
.hoverable:hover {
/* or height: auto then it will expand to text height */
max-width: initial;
height: auto;
text-wrap: initial;
}
#resultset tbody tr {
overflow: hidden;
}
` : ''}
.hoverable:hover {
/* stop content from "spilling" */
overflow: initial;
text-overflow: initial;
text-wrap-mode: wrap !important;
height: auto;
}

#resultset div.cell {
overflow: visible;
}

#resultset div[contenteditable="true"].nullable:before {
color: var(--vscode-banner-foreground);
position: absolute;
top: -22px;
content: "Shift+Enter for null";
background-color: var(--vscode-list-hoverBackground);
opacity: 1;
padding: 2px;
font-style: normal;
border: 1px solid var(--vscode-banner-foreground);
width: max-content;
z-index: 2;
}

#resultset .null {
font-style: italic;
background-color: var(--vscode-editor-wordHighlightBackground);
}

#resultset .grip {
top: 0;
right: 0;
bottom: 0;
width: 1px;
position: absolute;
cursor: col-resize;
border-right:1px solid #ffffff10;
}

.center-screen {
overflow: hidden;
Expand Down
52 changes: 24 additions & 28 deletions src/views/jobManager/jobLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,38 @@ function generatePage(rows: JobLogEntry[]) {
${getHeader()}
</head>
<body>
<table id="resultset">
<thead>
<tr>
<th>Sent</th>
<th>Type</th>
<th>Severity</th>
<th>Message ID</th>
<th>Message</th>
<th>Second Level Text</th>
</tr>
</thead>
<tbody>
<div style="grid-template-columns:150px auto auto auto auto auto;width: 100%;" id="resultset">
<div class="row">
<div class="header">Sent</div>
<div class="header">Type</div>
<div class="header">Severity</div>
<div class="header">Message ID</div>
<div class="header">Message</div>
<div class="header">Second Level Text</div>
</div>
${rows.map(row => {
return `<tr>
<td width="150px">
return `<div class="row">
<div class="cell">
${row.MESSAGE_TIMESTAMP}
</td>
<td>
</div>
<div class="cell">
${row.MESSAGE_TYPE}
</td>
<td>
</div>
<div class="cell">
${row.SEVERITY}
</td>
<td>
</div>
<div class="cell">
${row.MESSAGE_ID}
</td>
<td>
</div>
<div class="cell">
${escapeHTML(row.MESSAGE_TEXT || ``)}
</td>
<td>
</div>
<div class="cell">
${escapeHTML(row.MESSAGE_SECOND_LEVEL_TEXT || ``)}
</td>
</tr>`
</div>
</div>`
}).join(``)}
</tbody>
</table>
</div>
</body>
</html>
`;
Expand Down
3 changes: 2 additions & 1 deletion src/views/results/contributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"default": "Name",
"enum": [
"Name",
"Label"
"Label",
"Both"
],
"enumDescriptions": [
"Show the column name",
Expand Down
Loading
Loading