Skip to content

Conversation

@sommerfe
Copy link
Contributor

@sommerfe sommerfe commented Nov 11, 2025

@sommerfe sommerfe self-assigned this Nov 11, 2025
@sommerfe sommerfe changed the base branch from develop to feat-PB-1383-pinia-store November 11, 2025 15:04
@github-actions github-actions bot added the bug label Nov 11, 2025
@sommerfe sommerfe force-pushed the fix-pb-2064-reportproblem-cypress branch from 330f582 to ed0d7b9 Compare November 13, 2025 08:18
@cypress
Copy link

cypress bot commented Nov 13, 2025

web-mapviewer    Run #6105

Run Properties:  status check errored Errored #6105  •  git commit c53bf1d217: PB-2027: remove double call to validate
Project web-mapviewer
Branch Review fix-pb-2064-reportproblem-cypress
Run status status check errored Errored #6105
Run duration 11m 10s
Commit git commit c53bf1d217: PB-2027: remove double call to validate
Committer Pascal Barth
View all properties for this run ↗︎

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

Tests for review

Failed  drawing.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  legacyParamImport.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  3d/layers.cy.ts • 10 failed tests • e2e/chrome/mobile

View Output

Test Artifacts
Test of layer handling in 3D > add layer from search bar Test Replay Screenshots
Test of layer handling in 3D > sets the opacity to the value defined in the layers URL param or menu UI Test Replay Screenshots
Test of layer handling in 3D > sets the timestamp of a layer when specified in the layers URL param Test Replay Screenshots
Test of layer handling in 3D > reorders visible layers when corresponding buttons are pressed Test Replay Screenshots
Test of layer handling in 3D > add GeoJson layer with opacity from URL param Test Replay Screenshots
Test of layer handling in 3D > removes a layer from the visible layers when the "remove" button is pressed Test Replay Screenshots
Test of layer handling in 3D > uses the 3D configuration of a layer if one exists Test Replay Screenshots
Test of layer handling in 3D > add KML layer from drawing Test Replay Screenshots
Test of layer handling in 3D > Verify layer features in 2D and 3D Test Replay Screenshots
Test of layer handling in 3D > Verify a layer with EPSG:4326(WEBMERCATOR) bounding box in 2D and 3D Test Replay Screenshots
Failed  layers.cy.ts • 11 failed tests • e2e/chrome/mobile

View Output

Test Artifacts
Test of layer handling > Layer in URL at app startup > adds a layers with config to the map when opening the app layers URL param Test Replay Screenshots
Test of layer handling > Layer in URL at app startup > uses the default timestamp of a time enabled layer when not specified in the URL Test Replay Screenshots
Test of layer handling > Layer in URL at app startup > sets the timestamp of a layer when specified in the layers URL param Test Replay Screenshots
... > reads and adds an external WMS correctly Test Replay Screenshots
... > reads and adds an external WMTS correctly Test Replay Screenshots
... > reads and adds an external WMTS correctly but doesn't show the invisible layer Test Replay Screenshots
Test of layer handling > Background layer in URL at app startup > sets the background to the void layer if we set the bgLayer parameter to "void" Test Replay Screenshots
Test of layer handling > Background layer in URL at app startup > sets the background to the topic default if none is defined in the URL, even if a layer (out of topic scope) is defined in it Test Replay Screenshots
... > layer with timestamp can be configured Test Replay Screenshots
... > Reorder layers using the "move" button Test Replay Screenshots
The first 10 failed tests are shown, see all 11 tests in Cypress Cloud.
Failed  shareShortLink.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots

The first 5 failed specs are shown, see all 22 specs in Cypress Cloud.

@sommerfe sommerfe force-pushed the fix-pb-2064-reportproblem-cypress branch 5 times, most recently from d7a8296 to b098f29 Compare November 18, 2025 13:08
@sommerfe sommerfe requested a review from pakb November 19, 2025 15:21
Comment on lines 59 to 60
/** Flag to indicate if the user is currently reporting a problem with the drawing */
reportProblemDrawing: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling that online was exactly there to cover this use-case.

Can you check if you can get by only by setting/reading drawingStore.online (with maybe an option to set it correctly when calling drawingStore.initiateDrawing if it doesn't exist yet)?

Here we are bringing business names and logic (report a problem) that has nothing to do with the drawing per-say, I'd like to keep that separated as much as possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem i was facing was when we do first report problem drawing and before submitting, create a normal drawing. Or the other way around first normal drawing and then report problem drawing. In this case the online variable is not sufficient, because we then loose track of the fact that we have a report problem drawing which is not submitted yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then we should change how initiateDrawing works, and be able to give there the "on-going" drawing from the report a problem.

If we could keep the drawing module the most oblivious to the rest of the app, the better we will be able to make a module out of it down the line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok i can have a look at it and see if i can find a simpler solution for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pakb I refactored the boolean online into an enum to hold the different states we have, please check if it is ok like this

validate = undefined,
dataCy = '',
} = defineProps<{
const props = withDefaults(defineProps<{
Copy link
Contributor

Choose a reason for hiding this comment

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

validMarker and invalidMarker are already flagged with ? (optional), I don't think it's required to set a defautl value to them anyway.

If it's the case because the TS type-checking complains otherwise, I'd not use withDefaults, but do a two phase deconstruct.

const props = defineProps<...>()

const { propsNeedingDefault = undefined } = props

// don't do a full `toRefs` on all the props (it will wrap some that we don't require) but specifically ref some
const label = toRef(props, 'label' /* eventual default value here as 3rd arg */)
// ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i tried using this, but all the reactivity didn't work anymore, this is what copilot told me why it is not working

The problem is that in TypeScript/Vue 3, when you define optional props without withDefaults, they default to undefined when not provided. However, boolean props have special behavior in Vue:
When you don't use withDefaults and a boolean prop is not provided, it's undefined
But Vue's prop system can sometimes treat missing boolean props as false instead of undefined

I checked and the values are really evaluated as false, and i think this is killing the reactivity because when they change value to false e.g. it is not passed along since the value was already false before

force: true,
})
cy.get('@submit').click()
cy.get('[data-cy="file-input-text"]').should('have.class', 'is-valid')
Copy link
Contributor

Choose a reason for hiding this comment

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

wasn't that some valid testing? Why remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the submitting worked, the file-input-text is not there anymore, the report problem modal just shows a confirmation of the submitting message. Not sure why it worked before

cy.log('Write description and email')
cy.get('[data-cy="report-problem-text-area"] [data-cy="text-area-input"]')
.as('textArea')
.scrollIntoView()
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK all the call to .scrollIntoView were there to help the CI that was a bit flaky there, I don't know if it's a good idea to remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my tests the .scrollIntoView did not work and without it it worked

@sommerfe sommerfe requested a review from pakb November 20, 2025 08:35
@sommerfe sommerfe force-pushed the feat-PB-1383-pinia-store branch from a1cccff to 9e6d8d7 Compare December 2, 2025 08:43
@sommerfe sommerfe closed this Dec 2, 2025
@sommerfe sommerfe reopened this Dec 2, 2025
sommerfe and others added 14 commits December 2, 2025 15:12
icons were doubly scaled because the scale was applied on top of a smaller icon URL. Reverting back to what was the use-case before the TS migration, which is that icons are always requested in the same size to the backend, and are scaled on the map (could we get rid of the scaling on the backend?)
simplifying a bit the useFieldValidation composable, and trying to maintain reactivity of props given there, even if it is two components down (EmailInput calls TextInput which calls useFieldValidation)
removing most bi-directional links and having all the "config" in one big catch'em all bag
Some props need to be transformed to ref so that the composable doesn't loose the reactivity on them.

Also changing the logic of the userFieldValidation "pristin" flag, to clarify what it was meant for (and removing its usage whenever the default behavior was the one in place)
watchEffect will be called whenever the composable is set up, and then each time one of the props is changed (so the onMounted hook will create a double unnecessary call)
@sommerfe sommerfe force-pushed the fix-pb-2064-reportproblem-cypress branch from 5f30e01 to c53bf1d Compare December 2, 2025 14:12
@sommerfe
Copy link
Contributor Author

sommerfe commented Dec 2, 2025

@pakb after your merge of #1512 this MR should be reviewed again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants