Skip to content

Commit 37504e9

Browse files
committed
Use grid layout for env tables with buttons
1 parent 5e8a7ce commit 37504e9

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

webui/src/css/app.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,25 @@ h6:first-child {
460460
margin: 0;
461461
}
462462

463+
/* container for oj-tables with a button beside each */
464+
.wkt-table-button-grid {
465+
display: grid;
466+
grid-column-gap: 1em;
467+
grid-row-gap: 1em;
468+
grid-auto-columns: auto auto;
469+
margin-bottom: var(--oj-form-layout-margin-bottom);
470+
}
471+
472+
.wkt-table-button-grid .oj-table {
473+
grid-column-start: 1;
474+
grid-column-end: 1;
475+
}
476+
477+
.wkt-table-button-grid .oj-button {
478+
grid-column-start: 2;
479+
grid-column-end: 2;
480+
}
481+
463482
/* the oj-switcher in the code view should use the remaining height */
464483
.wkt-code-view-switcher {
465484
min-height: 1px;

webui/src/js/viewModels/project-settings-page.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
'use strict';
77

88
define(['accUtils', 'knockout', 'utils/i18n', 'models/wkt-project', 'ojs/ojarraydataprovider',
9-
'ojs/ojbufferingdataprovider', 'utils/common-utilities', 'utils/dialog-helper', 'utils/wkt-logger',
10-
'utils/url-catalog', 'ojs/ojinputtext', 'ojs/ojlabel', 'ojs/ojbutton', 'ojs/ojformlayout', 'ojs/ojradioset',
11-
'ojs/ojswitch', 'ojs/ojselectsingle', 'ojs/ojtable' ],
12-
function(accUtils, ko, i18n, project, ArrayDataProvider, BufferingDataProvider, utils, dialogHelper) {
9+
'ojs/ojbufferingdataprovider', 'utils/common-utilities', 'utils/dialog-helper', 'utils/view-helper',
10+
'utils/wkt-logger', 'utils/url-catalog', 'ojs/ojinputtext', 'ojs/ojlabel', 'ojs/ojbutton', 'ojs/ojformlayout',
11+
'ojs/ojradioset', 'ojs/ojswitch', 'ojs/ojselectsingle', 'ojs/ojtable' ],
12+
function(accUtils, ko, i18n, project, ArrayDataProvider,
13+
BufferingDataProvider, utils, dialogHelper, viewHelper) {
14+
1315
function ProjectSettingsViewModel() {
1416

1517
this.connected = () => {
@@ -38,14 +40,16 @@ function(accUtils, ko, i18n, project, ArrayDataProvider, BufferingDataProvider,
3840
'headerClassName': 'wkt-table-add-header',
3941
'headerTemplate': 'chooseHeaderTemplate',
4042
'template': 'actionTemplate',
41-
'sortable': 'disable'
43+
'sortable': 'disable',
44+
width: viewHelper.BUTTON_COLUMN_WIDTH
4245
},
4346
{
4447
'className': 'wkt-table-delete-cell',
4548
'headerClassName': 'wkt-table-add-header',
4649
'headerTemplate': 'headerTemplate',
4750
'template': 'actionTemplate',
48-
'sortable': 'disable'
51+
'sortable': 'disable',
52+
width: viewHelper.BUTTON_COLUMN_WIDTH
4953
}
5054
];
5155

@@ -76,7 +80,8 @@ function(accUtils, ko, i18n, project, ArrayDataProvider, BufferingDataProvider,
7680
'headerClassName': 'wkt-table-add-header',
7781
'headerTemplate': 'headerTemplate',
7882
'template': 'actionTemplate',
79-
'sortable': 'disable'
83+
'sortable': 'disable',
84+
width: viewHelper.BUTTON_COLUMN_WIDTH
8085
}
8186
];
8287

webui/src/js/views/project-settings-page.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ <h6><oj-bind-text value="[[labelMapper('title')]]"></oj-bind-text></h6>
88
<oj-bind-if test="[[isMac()]]">
99
<div class="oj-panel" id="kubectl-mac-only">
1010
<h6 class="wkt-subheading"><oj-bind-text value="[[labelMapper('mac-environment-question')]]"></oj-bind-text></h6>
11-
<oj-form-layout max-columns="1" direction="row">
11+
<div class="wkt-table-button-grid">
1212
<oj-table id="extra-path-directories-table"
1313
class="wkt-paths-table"
1414
aria-label="Extra Path Directories Table"
1515
data="[[extraPathDirectoriesDataProvider]]"
1616
display="grid"
17+
layout="fixed"
1718
horizontal-grid-visible="enabled"
1819
vertical-grid-visible="enabled"
1920
edit-mode="rowEdit"
@@ -73,6 +74,7 @@ <h6 class="wkt-subheading"><oj-bind-text value="[[labelMapper('mac-environment-q
7374
aria-label="Extra Environment Variables Table"
7475
data="[[extraEnvironmentVariablesDataProvider]]"
7576
display="grid"
77+
layout="fixed"
7678
horizontal-grid-visible="enabled"
7779
vertical-grid-visible="enabled"
7880
edit-mode="rowEdit"
@@ -119,7 +121,7 @@ <h6 class="wkt-subheading"><oj-bind-text value="[[labelMapper('mac-environment-q
119121
<oj-bind-text value="[[labelMapper('button-macos-environment-variables')]]"></oj-bind-text>
120122
</span>
121123
</oj-button>
122-
</oj-form-layout>
124+
</div>
123125
<p><oj-bind-text value="[[labelMapper('mac-environment-answer-message')]]"></oj-bind-text></p>
124126
</div>
125127
</oj-bind-if>

0 commit comments

Comments
 (0)