Skip to content
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

fix: geometry edit tools and styling #1762

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions src/bootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ const renderApp = async () => {
<ConfigProvider
locale={getConfigLang(i18n.language)}
theme={{
cssVar: true,
token: {
colorPrimary: Color(style['--primaryColor']).isLight() ?
Color(style['--primaryColor']).darken(0.5).hex() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
left: -45px;
top: 50%;
transform: translateY(-50%);
button {
background: var(--secondaryColor);
border-color: var(--secondaryColor);

&:hover {
background: var(--ant-primary-color-hover);
border-color: var(--ant-primary-color-hover);
}
.ant-btn-variant-solid.react-geo-togglebutton {
background: var(--secondaryColor);
}

.ant-btn-variant-solid {
&:disabled {
background: #f5f5f5;
border-color: #d9d9d9
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import DrawButton from '@terrestris/react-geo/dist/Button/DrawButton/DrawButton';
import { ModifyButton } from '@terrestris/react-geo/dist/Button/ModifyButton/ModifyButton';
import SimpleButton from '@terrestris/react-geo/dist/Button/SimpleButton/SimpleButton';
import { ToggleGroup } from '@terrestris/react-geo/dist/Button/ToggleGroup/ToggleGroup';
import ToggleGroup from '@terrestris/react-geo/dist/Button/ToggleGroup/ToggleGroup';

Check warning on line 37 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Using exported name 'ToggleGroup' as identifier for default import

import { useMap } from '@terrestris/react-util/dist/Hooks/useMap/useMap';
import {
Expand Down Expand Up @@ -77,6 +77,7 @@

const [editLayer, setEditLayer] = useState<OlLayerVector<OlSourceVector>>();
const [, setRevision] = useState<number>(0);
const [selected, setSelected] = useState<string | undefined>(undefined);

const gjFormat = useMemo(() => new OlFormatGeoJson(), []);

Expand Down Expand Up @@ -104,8 +105,8 @@
if (isModified && !formDirty) {
dispatch(setFormDirty(true));
}
// we only want to change formDirty state when the editHistory changes
// eslint-disable-next-line react-hooks/exhaustive-deps
// we only want to change formDirty state when the editHistory changes
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, editHistory.current.past]);

useEffect(() => {
Expand Down Expand Up @@ -221,10 +222,16 @@
className="geometry-edit-tb"
alignment="vertical"
>
<ToggleGroup>
<ToggleGroup
selected={selected}

Check warning on line 226 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 10 spaces but found 8
onChange={(_evt: any, value: string | undefined) => {

Check warning on line 227 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 10 spaces but found 8
setSelected(value)

Check warning on line 228 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 10

Check warning on line 228 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Missing semicolon
}}

Check warning on line 229 in src/components/EditFeatureDrawer/EditFeatureGeometryToolbar/index.tsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 10 spaces but found 8
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<ToggleGroup
selected={selected}
onChange={(_evt: any, value: string | undefined) => {
setSelected(value)
}}
>
<ToggleGroup
selected={selected}
onChange={(_evt: any, value: string | undefined) => {
setSelected(value)
}}
>

{
allowedEditMode.includes('CREATE') ?
<DrawButton
value="one"
AmandaTamanda marked this conversation as resolved.
Show resolved Hide resolved
icon={
<FontAwesomeIcon icon={faPencil} />
}
Expand All @@ -243,6 +250,7 @@
{
allowedEditMode.includes('UPDATE') ?
<ModifyButton
value="two"
icon={
<FontAwesomeIcon icon={faDrawPolygon} />
}
Expand All @@ -262,6 +270,7 @@
{
allowedEditMode.includes('DELETE') ?
<DeleteButton
value="three"
icon={
<FontAwesomeIcon icon={faTrash} />
}
Expand Down
Loading