Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
nghyd
Commits
c04b0308
Commit
c04b0308
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
refactor: remove unused NgParam "modified" flag
refs
#516
parent
4e39f694
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!133
Release version 4.15.0
,
!126
Resolve "Cloisons > Générer une PAB: vider les champs"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/generic-input/generic-input.component.ts
+1
-6
1 addition, 6 deletions
src/app/components/generic-input/generic-input.component.ts
src/app/formulaire/elements/ngparam.ts
+0
-33
0 additions, 33 deletions
src/app/formulaire/elements/ngparam.ts
with
1 addition
and
39 deletions
src/app/components/generic-input/generic-input.component.ts
+
1
−
6
View file @
c04b0308
...
...
@@ -263,12 +263,7 @@ export abstract class GenericInputComponentDirective implements OnChanges {
if
(
valid
&&
this
.
_uiValue
!==
""
)
{
val
=
+
this
.
_uiValue
;
// cast UI value to Number
}
if
(
this
.
setAndValidateModel
(
this
,
val
))
{
// set parameter "modified" flag
if
(
this
.
_model
instanceof
NgParameter
)
{
this
.
_model
.
isValueModified
=
true
;
}
}
this
.
setAndValidateModel
(
this
,
val
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/formulaire/elements/ngparam.ts
+
0
−
33
View file @
c04b0308
...
...
@@ -38,9 +38,6 @@ export class NgParameter extends InputField implements Observer {
public
disabled
:
boolean
;
/** true if value has been modified by user */
private
_isValueModified
=
false
;
constructor
(
private
_paramDef
:
ParamDefinition
,
parent
:
FormulaireNode
)
{
super
(
parent
);
this
.
radioConfig
=
this
.
radioState
;
...
...
@@ -284,14 +281,6 @@ export class NgParameter extends InputField implements Observer {
return
this
.
_paramDef
.
valuesIterator
;
}
public
get
isValueModified
():
boolean
{
return
this
.
_isValueModified
;
}
public
set
isValueModified
(
b
:
boolean
)
{
this
.
_isValueModified
=
b
;
}
/**
* Reads radio config from parameter calculability
*/
...
...
@@ -404,18 +393,6 @@ export class NgParameter extends InputField implements Observer {
);
}
/**
* fixe la valeur du paramètre en tant que valeur par défaut
*/
public
resetValue
(
sender
:
any
,
val
:
number
)
{
const
changed
=
(
this
.
_paramDef
.
getValue
()
!==
val
);
this
.
_isValueModified
=
false
;
if
(
changed
)
{
this
.
_paramDef
.
setValue
(
val
,
sender
);
this
.
notifyValueModified
(
sender
);
}
}
/**
* fixe la valeur du paramètre.
* une notification préalable est envoyée pour laisser l'occasion aux objets liés de préciser le contexte
...
...
@@ -433,7 +410,6 @@ export class NgParameter extends InputField implements Observer {
public
resetMinValue
(
sender
:
any
,
v
:
number
)
{
const
changed
=
(
this
.
_paramDef
.
min
!==
v
);
this
.
_isValueModified
=
false
;
if
(
changed
)
{
this
.
_paramDef
.
min
=
v
;
this
.
notifyMinValueModified
(
sender
);
...
...
@@ -444,14 +420,12 @@ export class NgParameter extends InputField implements Observer {
const
changed
=
(
this
.
_paramDef
.
min
!==
v
);
if
(
changed
)
{
this
.
_paramDef
.
min
=
v
;
this
.
_isValueModified
=
true
;
this
.
notifyMinValueModified
(
sender
);
}
}
public
resetMaxValue
(
sender
:
any
,
v
:
number
)
{
const
changed
=
(
this
.
_paramDef
.
max
!==
v
);
this
.
_isValueModified
=
false
;
if
(
changed
)
{
this
.
_paramDef
.
max
=
v
;
this
.
notifyMaxValueModified
(
sender
);
...
...
@@ -462,14 +436,12 @@ export class NgParameter extends InputField implements Observer {
const
changed
=
(
this
.
_paramDef
.
max
!==
v
);
if
(
changed
)
{
this
.
_paramDef
.
max
=
v
;
this
.
_isValueModified
=
true
;
this
.
notifyMaxValueModified
(
sender
);
}
}
public
resetStepValue
(
sender
:
any
,
v
:
number
)
{
const
changed
=
(
this
.
_paramDef
.
step
!==
v
);
this
.
_isValueModified
=
false
;
if
(
changed
)
{
this
.
_paramDef
.
step
=
v
;
this
.
notifyStepValueModified
(
sender
);
...
...
@@ -480,14 +452,12 @@ export class NgParameter extends InputField implements Observer {
const
changed
=
(
this
.
_paramDef
.
step
!==
v
);
if
(
changed
)
{
this
.
_paramDef
.
step
=
v
;
this
.
_isValueModified
=
true
;
this
.
notifyStepValueModified
(
sender
);
}
}
public
resetValueList
(
sender
:
any
,
l
:
number
[])
{
const
changed
=
(
JSON
.
stringify
(
this
.
_paramDef
.
valueList
)
!==
JSON
.
stringify
(
l
));
this
.
_isValueModified
=
false
;
if
(
changed
)
{
this
.
_paramDef
.
valueList
=
l
;
this
.
notifyListValueModified
(
sender
);
...
...
@@ -498,7 +468,6 @@ export class NgParameter extends InputField implements Observer {
const
changed
=
(
JSON
.
stringify
(
this
.
_paramDef
.
valueList
)
!==
JSON
.
stringify
(
l
));
if
(
changed
)
{
this
.
_paramDef
.
valueList
=
l
;
this
.
_isValueModified
=
true
;
this
.
notifyListValueModified
(
sender
);
}
}
...
...
@@ -520,7 +489,6 @@ export class NgParameter extends InputField implements Observer {
allowEmpty
:
this
.
_allowEmpty
,
unit
:
this
.
unit
,
radioConfig
:
this
.
radioConfig
,
modified
:
this
.
_isValueModified
}
}
...
...
@@ -530,7 +498,6 @@ export class NgParameter extends InputField implements Observer {
this
.
_allowEmpty
=
rep
.
allowEmpty
;
this
.
unit
=
rep
.
unit
;
this
.
radioConfig
=
rep
.
radioConfig
;
this
.
_isValueModified
=
rep
.
_isValueModified
;
}
}
...
...
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