Skip to content

Commit afe04a3

Browse files
committed
Merge branch 'column-editing'
* column-editing: Added basic unit_boundaries view Fixed section page More updates for column builder
2 parents 6430bdb + 850b6a4 commit afe04a3

File tree

13 files changed

+272
-61
lines changed

13 files changed

+272
-61
lines changed

packages/column-builder/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"name": "@macrostrat-web/column-builder",
3-
"scripts": {
4-
"dev": "next dev -p 1234",
5-
"build": "next build",
6-
"start": "next start -p 1234",
7-
"lint": "next lint"
8-
},
93
"module": "src/index.ts",
104
"dependencies": {
115
"@blueprintjs/core": "^5.10.5",

packages/column-builder/src/components/comp.module.sass

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,100 @@
22
a
33
color: inherit
44
text-decoration: none
5+
56
*
67
box-sizing: border-box
8+
79
.table-container
810
margin: 10px
911
height: 100%
1012
padding: 0px
1113
border-radius: 3px
14+
1215
.col-group-name
1316
display: flex
1417
justify-content: center
1518
align-items: center
19+
1620
.bp5-menu
1721
max-height: 400px
1822
max-width: 400px
1923
overflow: auto
24+
2025
.mySuggest
2126
overflow: scroll
2227
max-height: 200px
28+
2329
.itemSelectPopover
2430
padding: 5px
2531
background-color: var(--panel-background-color)
2632
-ms-overflow-style: none
2733
/* Internet Explorer 10+ */
2834
scrollbar-width: none
2935
/* Firefox */
36+
3037
::-webkit-scrollbar
3138
display: none
32-
/* Safari and Chrome */
39+
/* Safari and Chrome */
3340
.interval-row
3441
display: flex
3542
justify-content: space-between
43+
3644
.row
3745
display: flex
3846
align-items: baseline
47+
3948
.color-block
4049
border-style: solid
4150
//border-color: black
4251
border-width: 0.5px
4352
height: 30px
4453
width: 30px
54+
4555
.page
4656
margin: 10px
57+
4758
.bread-crumbs
4859
display: flex
60+
4961
.strat-name-con
5062
display: flex
5163
align-items: baseline
64+
5265
.strat-name
5366
margin: 0
67+
5468
.tag-container,
5569
.tag-popover
5670
flex-wrap: wrap
5771
display: flex
5872
align-items: baseline
73+
5974
.tag-popover
6075
padding: 10px
6176
height: 300px
6277
width: 900px
6378
overflow-y: scroll
79+
6480
.tag
6581
margin: 1px
82+
6683
.interval-cell-min-editor
6784
display: flex
6885
flex-direction: column
6986
height: 8em
7087
justify-content: space-between
88+
7189
.nomargin
7290
margin-bottom: 0px
91+
7392
.margin-bottom-spacing
7493
margin-bottom: 20px
94+
7595
.map-container
7696
height: 200px
7797
width: 100%
98+
7899
.header,
79100
.header-drag
80101
min-height: 15px
@@ -84,53 +105,66 @@
84105
font-size: 15px
85106
//background: rgb(211, 216, 222)
86107
font-weight: bold
108+
87109
.header-drag
88110
cursor: grab
111+
89112
&:active
90113
cursor: grabbing
114+
91115
.lng-lat-inputs
92116
margin: 5px
93117
display: flex
94118
justify-content: space-around
119+
95120
.col-editor-container
96121
display: flex
97122
justify-content: space-between
98-
.unit-section-tables
99-
width: 75%
123+
100124
.unit-section-container
101125
display: flex
102126
justify-content: center
103127
margin-top: 10px
128+
104129
.unit-moved
105130
box-shadow: -6px 0px 0px 0px #10b146
131+
106132
.btwn-row-btn
107133
height: 10px
108134
width: 100%
109135
margin: -10px 0%
110136
padding-top: 5px
137+
111138
&:hover
112139
cursor: pointer
140+
113141
.base-table
114142
border: solid 1px
115143
//border-color: #c5cbd3
116144
margin: 10px
117145
//background-color: white
118146
border-radius: 5px
147+
119148
.full-width
120149
width: 100%
121150
table-layout: fixed
151+
122152
.ellipse
123153
text-overflow: ellipsis
124154
overflow: hidden
125155
max-width: 80px
126156
white-space: nowrap
157+
127158
.strat-name-tooltip
128159
h4
129160
margin: 0
161+
130162
.underline
131163
text-decoration: underline
164+
132165
i
133166
color: rgb(166, 170, 174)
167+
134168
a
135169
text-decoration: underline
136170
color: rgb(108, 138, 175)
@@ -144,11 +178,13 @@
144178
h4
145179
margin: 0
146180
font-size: 15px
181+
147182
.geologic-age
148183
font-style: italic
149-
//color: #7b7b7b
184+
//color: #7b7b7b
150185
p
151186
margin: 0
187+
152188
a
153189
text-decoration: underline
154190

@@ -157,22 +193,28 @@
157193
margin: 0
158194
display: flex
159195
justify-content: space-between
196+
160197
.related-strat-card
161198
h3
162199
margin: 0
200+
163201
.strat-name-dialog-container
164202
display: flex
165203
padding: 10px
204+
166205
.left,
167206
.right
168207
margin: 5px
208+
169209
.strat-dialog-bottom
170210
margin: 10px
171211
/////////////// ref list item //////////////////
172212
.ref-author
173213
font-style: italic
214+
174215
&::before
175216
content: "-"
217+
176218
.doi
177219
&::before
178220
content: "DOI: "

packages/column-builder/src/components/lith/renderer.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { hyperStyled } from "@macrostrat/hyper";
22
import { Lith, LithUnit } from "~/types";
3-
import { mergeRefs, Tag, Dialog } from "@blueprintjs/core";
4-
import { Tooltip2, Popover2 } from "@blueprintjs/popover2";
3+
import { Tag } from "@blueprintjs/core";
4+
import { Tooltip2 } from "@blueprintjs/popover2";
55
import styles from "./lith.module.scss";
66
import classNames from "classnames";
77

@@ -98,7 +98,6 @@ function LithSegment(props: {
9898
style: {
9999
borderRadius: 0,
100100
},
101-
elementRef: mergeRefs(),
102101
onRemove: (evt) => {
103102
props.onRemove?.(props.lith);
104103
evt?.stopPropagation();

packages/column-builder/src/components/table.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from "react-beautiful-dnd";
1111
import { Card, Icon } from "@blueprintjs/core";
1212
import { useNavigate } from "../components";
13+
import classNames from "classnames";
1314

1415
interface RowProps {
1516
children: ReactChild;
@@ -164,7 +165,7 @@ interface DnDTableProps {
164165
headers?: any[];
165166
droppableId?: string;
166167
draggableId?: string;
167-
title?: string;
168+
title?: React.ReactNode;
168169
index: number;
169170
widths?: number[];
170171
}
@@ -177,10 +178,7 @@ function DnDTable(props: DnDTableProps) {
177178
droppableId = "table-drop-zone",
178179
} = props;
179180
const baseClass =
180-
"bp5-html-table .bp5-html-table-condensed .bp5-html-table-bordered .base-table .full-width";
181-
let tableClassName = props.interactive
182-
? `${baseClass} .bp5-interactive`
183-
: baseClass;
181+
"bp5-html-table bp5-html-table-condensed bp5-html-table-bordered base-table full-width";
184182

185183
return h(
186184
Draggable,
@@ -192,11 +190,16 @@ function DnDTable(props: DnDTableProps) {
192190
},
193191
[
194192
(provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {
193+
const className = classNames(baseClass, {
194+
"bp5-interactive": props.interactive,
195+
});
196+
195197
return h(
196-
`table.${tableClassName}`,
198+
`table`,
197199
{
198200
ref: provided.innerRef,
199201
...provided.draggableProps,
202+
className,
200203
},
201204
[
202205
h.if(headers.length > 0)(TableHeader, {
@@ -252,7 +255,7 @@ function TableHeader(props: {
252255
...props.dragProps,
253256
colSpan: props.headers.length,
254257
},
255-
[props.title]
258+
props.title
256259
),
257260
]),
258261
]),

packages/column-builder/src/components/unit-section-table/helpers.ts

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function MergeDivideBtn(props: {
3737
disabled: props.disabled,
3838
onClick: props.onClick,
3939
},
40-
[props.text]
40+
props.text
4141
);
4242
}
4343

@@ -70,7 +70,7 @@ function ColumnPageBtnMenu(props: ColBtnMenuI) {
7070
intent: unitsView ? "primary" : "none",
7171
disabled: unitsView,
7272
},
73-
["Unit view"]
73+
"Unit view"
7474
),
7575
h.if(!props.noSectionView)(
7676
Button,
@@ -79,12 +79,12 @@ function ColumnPageBtnMenu(props: ColBtnMenuI) {
7979
intent: !unitsView ? "primary" : "none",
8080
disabled: !unitsView,
8181
},
82-
["Section View"]
82+
"Section view"
8383
),
8484
h.if(!unitsView)(MergeDivideBtn, {
8585
onClick: props.mergeSections,
8686
disabled: mergeIds.length < 2,
87-
text: "Merge Sections",
87+
text: "Merge sections",
8888
}),
8989
]),
9090
h.if(unitsView)(ReorderUnitsBtnGrp, {
@@ -142,7 +142,7 @@ export interface UnitRowContextMenuI {
142142
function UnitRowContextMenu(props: UnitRowContextMenuI) {
143143
const { state, runAction } = useUnitSectionContext();
144144
const SubMenu = ({ pos }: { pos: UNIT_ADD_POISITON }) => {
145-
return h(React.Fragment, [
145+
return h([
146146
h(MenuItem, {
147147
text: `Copy unit #${props.unit.id}`,
148148
icon: "duplicate",
@@ -208,7 +208,7 @@ function UnitRowContextMenu(props: UnitRowContextMenuI) {
208208
minimal: true,
209209
position: "left-top",
210210
},
211-
[h(Button, { minimal: true, icon: "more" })]
211+
h(Button, { minimal: true, icon: "more" })
212212
);
213213
}
214214

@@ -227,28 +227,26 @@ function AddBtnBetweenRows(props: {
227227
position: "right",
228228
intent: "success",
229229
},
230-
[
231-
h(
232-
"div.btwn-row-btn",
233-
{
234-
onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => {
235-
setStyle({ display: "flex" });
236-
},
237-
onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => {
238-
setStyle({ display: "none" });
239-
},
240-
onClick: props.onClick,
230+
h(
231+
"div.btwn-row-btn",
232+
{
233+
onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => {
234+
setStyle({ display: "flex" });
235+
},
236+
onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => {
237+
setStyle({ display: "none" });
241238
},
242-
[
243-
h(Button, {
244-
intent: "success",
245-
fill: true,
246-
onClick: props.onClick,
247-
style: { ...style, minHeight: "5px" },
248-
}),
249-
]
250-
),
251-
]
239+
onClick: props.onClick,
240+
},
241+
[
242+
h(Button, {
243+
intent: "success",
244+
fill: true,
245+
onClick: props.onClick,
246+
style: { ...style, minHeight: "5px" },
247+
}),
248+
]
249+
)
252250
),
253251
]),
254252
]);

0 commit comments

Comments
 (0)