5758 - Navigation: Data errors - #5776
Draft
yaguzmang wants to merge 149 commits into
Draft
Conversation
* 5758 - Validations type & api definitions * 5758 - Fix api order * 5758 - Rename files * 5758 - Rename to summary.ts * 5758 - Rename to table.ts
8 tasks
* 5758 - Mirror updateDependencies Context * 5758 - Remove collect * 5758 - Remove context result
* 5758 - Add validateNodeUpdates * 5758 - Update cache once * 5758 - Add missing Objects.isEmpty * 5758 - Fix build * 5758 - Remove redis calls from validation function * 5758 - Remove async * 5758 - Add promise.all & add types * 5758 - Remove empty checks * 5758 - Remove incosistent cache check * 5758 - Update touchedTableNames.add placement based on new conditions * 5758 - Fail on missing row/col target * 5758 - Store empty object for valid tables
* 5758 - Update validations * 5758 - Update validations for nodes without calculation dependants * 5758 - Update function structure
* 5758 - Implement partial summary * 5758 - Add redis getSummary * 5758 - Add redis setSummary * 5758 - Remove summary cache changes * 5758 - Add getSummary * 5758 - Fix export names * 5758 - Use section redis * 5758 - Iterate over sections
* 5758 - getSummary redux * 5758 - Remove table event
…update (#5827) * 5758 - Update summary on table validations update * 5758 - Subscribe only editors * 5758 - Rename reducer to updateSummaryReducer * 5758 - Rename event to getTableValidationsUpdateEvent * 5758 - Remove validations on return * 5758 - Rename file * 5758 - Combine hooks * 5758 - Fix tests
… - 1 (#5833) * 5758 - Remove t Function param * 5758 - Add validatorName param to messages * 5758 - Remove getValidationMessage util * 5758 - Remove unused labels from calculateCategoriesSum * 5758 - Add ValidatorName enum
… - 2 (#5837) * 5758 - Translate validation messages * 5758 - Add MessageParser
* 5758 - Support row validation * 5758 - Remove cross assessment support from data context * 5758 - Undo changes to ContextFactory * 5758 - Add new ValidationDependencyCache type * 5758 - Fix build * 5758 - Remove ValidationTargetCache --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* 5758 - Add useSummaryHasErrors * 5758 - Add validation warning * 5758 - Reduce icon size --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…5852) * 5758 - Show ValidationErrorIndicator * 5758 - Add inline-flex to Flex * 5758 - Fix RTL * 5758 - Remove inline-flex --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* 5758 - Build validation dependants by source cell * 5758 - Context - get dependant with colName * 5758 - Update metacache getters * 5758 - Refactor Member Co-authored-by: Alejandro Guzman <alejandroguzman.dev@gmail.com> * 5758 - Refactor Member (restore variable) Co-authored-by: Alejandro Guzman <alejandroguzman.dev@gmail.com> * 5758 - Fix deepscan Co-authored-by: Alejandro Guzman <alejandroguzman.dev@gmail.com> --------- Co-authored-by: Mino Togna <mino.togna@gmail.com>
* 5758 - Fix validateFns precedence * 5758 - Prevent adding dependant from other assessment/cycles
* 5758 - use shouldSkipValidationFormula in evaluateTableValidations * 5758 - Add computeTableValidations * 5758 - Add initial backfillTableValidations * 5758 - Remove evaluateTableValidations * 5758 - Remove TODO * 5758 - Remove computeValidations * 5758 - Replace backfillTableValidations * 5758 - Fix deepscan * 5758 - Centralize context building and cache setting --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* 5758 - Add validateAll tool * 5758 - Add migration step * 5758 - Only use generateMetaCache
* 5758 - Add getTableValidations * 5758 - Fetch init table validations * 5758 - Add useGetTableValidations * 5758 - Remove return after dispatch * 5758 - Revert changes to useGetTableData * 5758 - Remove change to useGetTableData * 5758 - Use tableSections instead of dependencies * 5758 - Finish clean up
* 5758 - Add E2E tests for validations * 5758 - Change target country * 5758 - Add missing param * 5758 - Fix tableNames param * 5758 - Improve cell locator & fill cell * 5758 - Unlock editing * 5758 - Add prev cycle validation test * 5758 - Split tests * 5758 - Change atlantis country * 5758 - Add numbers to folder files
…n validations from worker (#6130) * 57585 - Add redis decriptions deleteValidations & remove updateDescriptionLinkValidations * 5758 - Add common refreshDescriptionValidations * 5758 - Call refreshDescriptionValidations from worker * 5758 - Fix single description edit clearing other description validations
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…sections (#6133) * 5758 - Calculate NDP validation summary per section * 5758 - Use redis repos
…ons/data sources from summary (#6135) * 5758 - Exclude hidden descriptions from summary * 5758 - Refactor and move descriptions utility --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…itLinksVerificationEvent & insertLinksCheckActivityLog (#6137) * 5758 - Extract common emitLinksVerificationEvent & insertLinksCheckActivityLog * 5758 - Add meta/socket/event/links.ts --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…verifyLinks (#6140) * 5758 - Remove activity log & add db client arg to verifyAllLinks * 5758 - Add LinksService
…oller (#6145) * 5758 - Add common folder * 5758 - Move validateCountryTables * 5758 - Move validateCountryNationalDataPoints
* 5758 - Move validations reducer outside tableData * 5758 - Split summary validations reducer * 5758 - Split table validations reducer * 5758 - Split national data point validations reducer * 5758 - Split description validations reducer * 5758 - Combine validation reducers * 5758 - Add renames in description validations * 5758 - Add renames in ndp validations * 5758 - Add renames in table validations * 5758 - Add renames in summary validations * 5758 - Add validation summary listener * 5758 - Rename selectors * 5758 - Add useValidationSummaryListener * 5758 - Add ValidationSummaries.compute utility * 5758 - Reuse new utility in the backend * 5758 - Move useValidationSummaryListener --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…domly (#6134) * 5758 - Fix tests passing and failing randomly * 5758 - Fix flaky NDP E2E navigation and national class editing * 5758 - Add ensureEditingUnlocked --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
… validation only for affected description or data source (#6146) * 5758 - Add DataValidationService & trigger validation only for affected description or data source * 5758 - Skip data source field validation for FRA 2020 text descriptions * 5758 - Remove redundant calls to canValidateDataSources * 5758 - Validate data source fields only for sections with data source tables * 5758 - Rename tool to validateDataSources --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…NationalDataPointLinks (#6163) * 5758 - Remove visitDescriptionLinks and add enqueueDescriptionLinksValidation * 5758 - Remove visitNationalDataPointLinks and add enqueueNationalDataPointLinksValidation * 5758 - Rename addVerifyLinksJob to enqueueVerifyLinksJob
…dation (#6167) * 5758 - Add LinksService.enqueueAllLinksValidation * 5758 - Rename scheduleVerifyAllLinks to enqueueAllLinksValidation --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…n-data-errors__merge-dev-newest-2
…merge-dev-newest-2 5758 - Navigation: Data errors - Merge dev newest
…6170) * 5758 - Add TableValidations.remove * 5758 - Add DataValidationService.validateNodes * 5758 - Add comments to initQueue * 5758 - Move table validations logic to service * 5758 - Unify validation ContextFactory initQueue into a single loop --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…6176) * 5758 - Add DataValidationService.notifyDescriptionValidationUpdate * 5758 - Add DataValidationService.validateNDPYear and validateNDPNationalClasses * 5758 - Add DataValidationService.removeNDPValidation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Table validations
Server-side table node validation
Frontend table validation flow
Validation summary and submission warning
Test table validations
Description validations
Validate description text
Validate data sources
Required fields
Reference links
Trigger links validation after approving/disapproving a link that is in a description
In the links worker, use section name + description name instead of description ids
In validateAll, validate also descriptions
To see if we do:
Test description validations
ODP validations
CommentsandReference to data sourcevisitCycleLinksso it updates validation cache like the new description and ndp link jobsFrom Miró e Cosimo
ValidateCountry[XXX](e.g. Descriptions) to be moved under tools (purpose: keep controller clean).Split Validation reducer -> tableValidationReducer, descriptionValidationReducer ...
DescriptionValidation:
src/server/controller/cycleData/validations/descriptions/updateDescriptionValidations.ts:22src/server/controller/cycleData/validations/descriptions/updateDescriptionValidations.ts:DataValidationService.validateDescriptions.updateDescriptionLinkValidations.tsline 21 (inline the code).updateDataSourceFieldValidationsonly if needed, which is renamed tovalidateDataSources.visitDescriptionLinks:
LinkService.validateLinks.visitDescriptionLinks, and what is the difference withtriggerVerifyLinksWorker?Revisit
DescriptionIdentifiertype — maybe usePickand revisit name.context factory for validations:
#initQueuesrc/server/controller/cycleData/validations/tables/updateTableValidations.tsDataValidationService.validateNodes()_removeValidation→TableValidations.remove(props)move
src/server/controller/cycleData/validations/descriptions/notifyDescriptionValidationUpdate.tsunder
src/server/service/dataValidationand expose itDataValidationService.notifyDescriptionValidationUpdateremove
src/server/controller/cycleData/validations/nationalDataPointand expose methods inDataValidationServiceDataValidationService.validateNDPYearDataValidationService.validateNDPNationalClassesin
src/server/controller/cycleData/nationalDataPoint/remove.tsline 83-89 must be grouped in
DataValidationService.removeNDPValidationremove completely
ValidationsController. all exposed methods should be exposed fromDataValidationServicesrc/tools/validations/nationalDataPoint/validateCountryNationalDataPoints.tshere we should remove all existing validations and validate from scratch all NDP
src/tools/validations/tables/validateCountryTables.tsline 15: expose the method in
DataValidationService.removeTableValidationsand rename repos methodTableValidationRedisRepository.removeValidationsValidation repositories should only be used in
DataValidationService.src/server/worker/tasks/verifyLinks/visitDescriptionLinks/utils/refreshDescriptionValidations.tswhat is this?src/server/worker/tasks/verifyLinks/visitNationalDataPointLinks/utils/refreshNationalDataPointValidations.tswhat is this?NDP Validation methods:
each validation should validate, set and notify client (not get validation first, but return the validation from the repo)
e.g for national classes:
const validation = NationalDataPointValidator.validateNationalClasses({..})const validations = NationalDataPointValidationRedisRepository.setNationalClassValidations({...,validation})notifyNationalDataPointValidationUpdate({...validation})To see if we do: