-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Slim down QueryResultsService.setActionsForLayers()
function
#59
Labels
refactoring
Anything which could result in a API change
Comments
@Raruto agree |
Raruto
added a commit
that referenced
this issue
Aug 25, 2023
* refactor `src/app/gui/queryresults/queryresultsservice.js` - add FIXME comments (eg. please "add function description") - code cleanup (eg. tons of weird ternary conditions, short-circuiting logic and missing brackets!) - full function rewrite `QueryResultsService::updateLayerResultFeatures(layer)` - notable function rewrite `QueryResultsService::_digestFeaturesForLayers (featuresForLayers)` * Fix misspelling and properties position declaration * Add comments * Closes #59 * wrong parameter * add geometry check within `QueryResultsService::showGeometry(geometry)` * extract function `QueryResultsService::_handleFeatureForLayer(featuresForLayer)` * remove undefined action `QueryResultsService.zoomToElement` * clean up some code * convert `QueryResultsService` to ES6 class * update @SInCE tags * update @param tag * 🐛 Fix bugs due refactoring * wrong merge * 🐛 Fix undefined check and change layer.selection.features to empty array instead empty object * code readability - slim down function `updateLayerResultFeatures()` - alias long variable name `this._addFeaturesLayerResultInteraction` - slim down function `downloadFeatures()` - extract function `_handleExternalVectorLayerSelection()` - extract function `_handleProjectLayerSelection()` * 🐛 Ensure that find array method return undefined (not found). Add extenal parameter into _getFeaturesIds * slim down `unRegisterCustomComponent` * 🐛 Fix add feature to a external layer. fix add settimeout to querycontrol * code readability - slim down comments - alias long variable name `this.state.currentactiontools` - alias long variable name `this.state.currentactionfeaturelayer` - alias long variable name ` this.state.layersFeaturesBoxes` - extract function `_clearActions` - alias prototype function `QueryResultsService.init` - alias prototype function `QueryResultsService.reset` * refactor function `QueryControl.setMap()` * refactor `_handleFeatureForLayer` * ♻️ Set right event 'picked' on queryControl * comments * 🐛 Fix setCurrentActionLayerFeatureTool * Check and correct some refactoring code * ✨ Create common downloadApplicationWrapper to run download * ♻️ Move downloadApplicationWrapper from queryresultsservice.js to index.prod.js as GUI method * move application wrapper * extract `_hasLayerObjGeometry` and `_parseLayerObjFeatures` * params destrcuturing: `featuresForLayer` * simplify condition * refactor `setQueryResponse` - remove function `_digestFeaturesForLayers()` - rename function `_handleFeatureForLayer()` into `_responseToLayer()` - extract function `_hasLayerObjGeometry()` - extract function `_hasLayerObjImageField()` - refactor function `_parseLayerObjFormStructure()` * alias `_changeLayerResult` * remove `_orderResponseByProjectLayers` * apply some fixme and todos - remove nested if-else in: `getVectorLayerFeaturesFromQueryRequest()` - incorporate function `_addVectorLayersDataToQueryResponse()` into `*/ setQueryResponse()` setter - simplify destructuring assignment within `_printSingleAtlas()` function - remove function `_addComponent()` * wrong variable reference * wrong variable name * 🐛 Fix case when click to add feature to layer result and no current mapcontrol is active (undefined). Need to be set null to align default value and evaluation. * `console.warn` * wrong comments * 🐛 In case of no features for a specific layer, return undefind, so layer is not add to query results state layers array * simplify conditions * 🐛 Need to refer to instance and not to "class" * 🐛 Handle selection feature action when add new feature to layer result * 🐛 Add custom drawpolygon type for query by drw polygon otherwise it conflict to download action to get all attributes of polygon query (query by polygon) * 🐛 fix download action * boolean logic --------- Co-authored-by: volterra79 <boccacci.francesco@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following function is nearly 250 lines long:
g3w-client/src/app/gui/queryresults/queryresultsservice.js
Lines 386 to 634 in e8996a7
If possible, consider simplifying it by using subroutines.
The text was updated successfully, but these errors were encountered: