Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DLCM-Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DLCM
UI
DLCM-Portal
Commits
254a9442
Commit
254a9442
authored
5 years ago
by
Florent Poittevin
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove fix validation frontend
parent
5fb7c744
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/shared/directives/shared-validation/shared-validation.directive.ts
+0
-17
0 additions, 17 deletions
...rectives/shared-validation/shared-validation.directive.ts
with
0 additions
and
17 deletions
src/app/shared/directives/shared-validation/shared-validation.directive.ts
+
0
−
17
View file @
254a9442
...
...
@@ -21,7 +21,6 @@ import {
import
{
isArray
,
isEmptyArray
,
isFalse
,
isNullOrUndefined
,
ObjectUtil
,
}
from
"
solidify-frontend
"
;
...
...
@@ -58,27 +57,11 @@ export class SharedValidationDirective extends SharedAbstractDirective implement
ngOnInit
():
void
{
FormValidationHelper
.
initMetadataErrors
(
this
.
_ngControl
.
control
);
let
isDetectChangesFromParent
=
false
;
// This hack prevent in most case infinity loop call stack error due to parent update change
// TODO Find a clean way working at 100%. In some case we get call stack error when change access level in deposit create form...
this
.
subscribe
(
this
.
_ngControl
.
control
.
parent
.
statusChanges
.
pipe
(
tap
(
validity
=>
{
if
(
isFalse
(
isDetectChangesFromParent
))
{
// Allow to display frontend validation error when the field is not updated with backend error
this
.
_changeDetector
.
detectChanges
();
}
isDetectChangesFromParent
=
true
;
})),
);
this
.
updateErrorsMetadatas
(
this
.
_ngControl
.
control
.
status
as
FormState
);
this
.
subscribe
(
this
.
_ngControl
.
control
.
statusChanges
.
pipe
(
filter
(
s
=>
this
.
isDifferent
()),
tap
(
validity
=>
{
this
.
updateErrorsMetadatas
(
validity
);
setTimeout
(()
=>
{
isDetectChangesFromParent
=
false
;
},
1000
);
})),
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment