Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 3bcf7e7

Browse files
committed
Merge branch 'sticky_footer'
2 parents 4dd5d15 + 3ffe615 commit 3bcf7e7

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@types/jest": "28.1.6",
2626
"@testing-library/jest-dom": "5.16.4",
2727
"@testing-library/react": "13.3.0",
28-
"@types/node": "18.0.6",
28+
"@types/node": "18.6.1",
2929
"@types/react": "18.0.15",
3030
"@types/react-dom": "18.0.6",
3131
"@types/react-color": "3.0.6",
@@ -50,7 +50,7 @@
5050
},
5151
"dependencies": {
5252
"@emotion/styled": "11.9.3",
53-
"@mui/material": "5.9.1",
53+
"@mui/material": "5.9.2",
5454
"@mui/icons-material": "5.8.4",
5555
"@popperjs/core": "2.11.5",
5656
"immutability-helper": "3.1.1",
@@ -63,7 +63,7 @@
6363
"react-dom": "18.2.0",
6464
"react-csv": "2.2.2",
6565
"react-popper": "2.3.0",
66-
"@tanstack/react-table": "8.3.3",
66+
"@tanstack/react-table": "8.3.6",
6767
"@tanstack/match-sorter-utils": "8.1.1",
6868
"react-select": "5.4.0",
6969
"react-color": "2.19.3",

src/components/Table.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,18 @@ export function Table(tableData: TableDataType) {
250250
const [rowTemplateState, setRowTemplateState] = React.useState(
251251
view.diskConfig.yaml.config.current_row_template
252252
);
253-
const rowTemplatesOptions = get_tfiles_from_folder(
254-
view.diskConfig.yaml.config.row_templates_folder
255-
).map((tfile) => {
256-
return {
257-
value: tfile.path,
258-
label: tfile.path,
259-
};
260-
});
253+
const rowTemplatesOptions = React.useMemo(
254+
() =>
255+
get_tfiles_from_folder(
256+
view.diskConfig.yaml.config.row_templates_folder
257+
).map((tfile) => {
258+
return {
259+
value: tfile.path,
260+
label: tfile.path,
261+
};
262+
}),
263+
[]
264+
);
261265

262266
function handleChangeRowTemplate(
263267
newValue: OnChangeValue<RowTemplateOption, false>,
@@ -443,10 +447,11 @@ export function Table(tableData: TableDataType) {
443447
isClearable={true}
444448
isMulti={false}
445449
onChange={handleChangeRowTemplate}
446-
defaultValue={{ label: "Choose a Template", value: "None" }}
450+
placeholder={<div>Without template. Select one to use...</div>}
447451
menuPortalTarget={document.body}
448452
menuShouldBlockScroll={true}
449453
isSearchable
454+
menuPlacement="top"
450455
/>
451456
</div>
452457
{/* ENDS NEW ROW */}

src/components/styles/RowTemplateStyles.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ const CustomTemplateSelectorStyles: StylesConfig<any, true, GroupBase<any>> = {
99
width: 'auto',
1010
}
1111
},
12+
placeholder: (styles) => {
13+
return {
14+
...styles,
15+
fontSize: '12px',
16+
textAlign: 'left',
17+
minWidth: '17rem',
18+
}
19+
}
1220
}
1321

1422
export default CustomTemplateSelectorStyles;

styles.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,20 +286,23 @@ div.database-plugin__checkbox {
286286
align-items: center;
287287
font-size: 0.875rem;
288288
cursor: pointer;
289+
position: sticky;
290+
bottom: 0;
291+
background-color: var(--background-primary);
289292
}
290293

291-
.database-plugin__add-row:hover {
294+
.database-plugin__add-row .svg-icon:hover {
292295
background-color: var(--background-secondary);
293296
color: var(--text-accent-hover);
297+
padding: 0.3rem;
294298
}
295299

296300
.database-plugin__add-row .database-plugin__td {
297301
border: none;
298302
background-color: transparent;
299303
color: var(--text-muted);
300-
flex-direction: row;
301-
align-items: center;
302-
display: inline-grid;
304+
display: inline-flex;
305+
vertical-align: middle;
303306
}
304307

305308
.database-plugin__th {

0 commit comments

Comments
 (0)