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

PB-1212: Allow delete last point by button when on line editing mode. #1138

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Nov 26, 2024

@ismailsunni ismailsunni requested review from ltshb, pakb and ltkum and removed request for ltshb November 26, 2024 10:38
Copy link

cypress bot commented Nov 26, 2024

web-mapviewer    Run #3902

Run Properties:  status check passed Passed #3902  •  git commit 7ba9206170: PB-1212: Fix vue warning wrong type for props and improve code for add vertex bu...
Project web-mapviewer
Branch Review pb-1212-allow-delete-last-point-on-editing-mode
Run status status check passed Passed #3902
Run duration 04m 01s
Commit git commit 7ba9206170: PB-1212: Fix vue warning wrong type for props and improve code for add vertex bu...
Committer Ismail Sunni
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 212
View all changes introduced in this branch ↗︎

@@ -38,6 +39,33 @@ const isDrawingLineOrMeasure = computed(() =>
currentDrawingMode.value
)
)
const selectedEditableFeatures = computed(() => store.state.features.selectedEditableFeatures)
const selectedLineString = computed(() => {
if (selectedEditableFeatures.value && selectedEditableFeatures.value.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (selectedEditableFeatures.value?.length > 0) { is fine too

const selectedEditableFeatures = computed(() => store.state.features.selectedEditableFeatures)
const selectedLineString = computed(() => {
if (selectedEditableFeatures.value && selectedEditableFeatures.value.length > 0) {
const selectedFeature = selectedEditableFeatures.value[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

can there be more than one feature selected while drawing?

Comment on lines +46 to +54
if (
selectedFeature.geometry.type === 'LineString' &&
(selectedFeature.featureType === EditableFeatureTypes.LINEPOLYGON ||
selectedFeature.featureType === EditableFeatureTypes.MEASURE)
) {
return selectedFeature
}
}
return null
Copy link
Contributor

Choose a reason for hiding this comment

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

if not, we could transform this in a simple

return selectedEditableFeatures.value.find((feature) => {
    return feature.geometry.type === 'LineString' &&
         [EditableFeatureTypes.LINEPOLYGON, EditableFeatureTypes.MEASURE].includes(feature.featureType))
})

Which will also return null if there's no match

Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

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

when finishing editing/adding more point to a line measure, the last point is sometimes automatically removed, there might be some call to the remove function where it shouldn't be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants