wasabee-project / Wasabee-IITC

ENL DrawTools and Op Management
Apache License 2.0
30 stars 21 forks source link

Allow duplicate marker type on a portal #321

Closed bgillock closed 2 years ago

bgillock commented 2 years ago

Fixes #319 by removing checks for existing marker of same type in type select list and when adding a marker.

le-jeu commented 2 years ago

Other related parts:

https://github.com/wasabee-project/Wasabee-IITC/blob/bd3020fd92f351f9a6b1da132f2d88fb5459a238/src/code/dialogs/markerChangeDialog.js#L38-L45

This function is bound to disappear https://github.com/wasabee-project/Wasabee-IITC/blob/bd3020fd92f351f9a6b1da132f2d88fb5459a238/src/code/model/operation.ts#L381-L390

But that needs work in the applyChanges method

bgillock commented 2 years ago

We can keep getPortalMarkers if we use the m.ID as the key instead of the type. Then make the appropriate changes in applyChanges.

le-jeu commented 2 years ago

that won't be really useful for the applyChanges function, getPortalMakers is there for two reasons:

bgillock commented 2 years ago

With your help, I think I addressed all of the places where a unique marker type was assumed and enforced.

le-jeu commented 2 years ago

No, if you change getPortalMakers you need to udate every uses. But this function can be keep as it was, since it's valid where it's used in applyChanges (1.). It's just that the mechanism that removes duplicates marker due to marker edit can be removed (2.)