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
Show more breadcrumbs
Cassiopée
nghyd
Commits
840cc4a2
Commit
840cc4a2
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
refactor: FieldSet class: rename getPropValue to getNubPropValue, setPropValue to setNubPropValue
refs
#483
parent
c88385a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/fieldset-container/fieldset-container.component.ts
+2
-2
2 additions, 2 deletions
...onents/fieldset-container/fieldset-container.component.ts
src/app/formulaire/elements/fieldset.ts
+15
-7
15 additions, 7 deletions
src/app/formulaire/elements/fieldset.ts
with
17 additions
and
9 deletions
src/app/components/fieldset-container/fieldset-container.component.ts
+
2
−
2
View file @
840cc4a2
...
...
@@ -89,8 +89,8 @@ export class FieldsetContainerComponent implements DoCheck, AfterViewInit {
const
prms
=
after
.
backupParameters
();
// replace in-place to change properties (overkill)
// @WTF why only those two ?
newFs
.
setPropValue
(
"
structureType
"
,
after
.
properties
.
getPropValue
(
"
structureType
"
));
newFs
.
setPropValue
(
"
loiDebit
"
,
after
.
properties
.
getPropValue
(
"
loiDebit
"
));
newFs
.
set
Nub
PropValue
(
"
structureType
"
,
after
.
properties
.
getPropValue
(
"
structureType
"
));
newFs
.
set
Nub
PropValue
(
"
loiDebit
"
,
after
.
properties
.
getPropValue
(
"
loiDebit
"
));
// au cas où un des paramètres du fieldset source est en mode calcul,
// on met le paramètre copié en mode fixé (nghyd#567)
...
...
This diff is collapsed.
Click to expand it.
src/app/formulaire/elements/fieldset.ts
+
15
−
7
View file @
840cc4a2
...
...
@@ -140,9 +140,11 @@ export class FieldSet extends FormulaireElement implements Observer {
}
/**
* get associated nub property value
* @param key property name
* @param inSection if true, will look for the required property in the Nub's section (children[0])
*/
private
getPropValue
(
key
:
string
,
inSection
:
boolean
=
false
):
any
{
private
get
Nub
PropValue
(
key
:
string
,
inSection
:
boolean
=
false
):
any
{
if
(
inSection
)
{
return
this
.
sectionProperties
.
getPropValue
(
key
);
}
else
{
...
...
@@ -150,7 +152,13 @@ export class FieldSet extends FormulaireElement implements Observer {
}
}
public
setPropValue
(
key
:
string
,
val
:
any
):
boolean
{
/**
* assign associated nub property
* @param key nub property name
* @param val value to assign with
* @returns true if property value has changed
*/
public
setNubPropValue
(
key
:
string
,
val
:
any
):
boolean
{
return
this
.
properties
.
setPropValue
(
key
,
val
,
this
);
}
...
...
@@ -259,7 +267,7 @@ export class FieldSet extends FormulaireElement implements Observer {
private
setSelectValueFromProperty
(
selectId
:
string
,
inSection
:
boolean
=
false
)
{
const
selectField
:
SelectField
=
this
.
getFormulaireNodeById
(
selectId
)
as
SelectField
;
if
(
selectField
)
{
let
propVal
:
any
=
this
.
getPropValue
(
selectField
.
associatedProperty
,
inSection
);
let
propVal
:
any
=
this
.
get
Nub
PropValue
(
selectField
.
associatedProperty
,
inSection
);
if
(
propVal
===
undefined
)
{
propVal
=
""
;
// clodo bullet-proof loading
}
...
...
@@ -288,7 +296,7 @@ export class FieldSet extends FormulaireElement implements Observer {
const
ct
:
string
=
json
[
"
calcType
"
];
const
currentCt
=
this
.
properties
.
getPropValue
(
"
calcType
"
);
const
calc_type
:
CalculatorType
=
currentCt
?
currentCt
:
(
ct
?
CalculatorType
[
ct
]
:
this
.
parentForm
.
calculatorType
);
this
.
setPropValue
(
"
calcType
"
,
calc_type
);
this
.
set
Nub
PropValue
(
"
calcType
"
,
calc_type
);
// parse fields once, so that SelectField elements are present
// when setting default properties below
...
...
@@ -313,7 +321,7 @@ export class FieldSet extends FormulaireElement implements Observer {
if
(
enumClass
)
{
formalValue
=
enumClass
[
defaultValue
];
}
this
.
setPropValue
(
prop
,
formalValue
);
this
.
set
Nub
PropValue
(
prop
,
formalValue
);
}
}
}
...
...
@@ -401,9 +409,9 @@ export class FieldSet extends FormulaireElement implements Observer {
const
prop
=
(
fe
as
SelectField
).
associatedProperty
;
// for multiple select
if
(
Array
.
isArray
(
data
.
value
))
{
this
.
setPropValue
(
prop
,
data
.
value
.
map
((
v
:
any
)
=>
v
.
value
));
this
.
set
Nub
PropValue
(
prop
,
data
.
value
.
map
((
v
:
any
)
=>
v
.
value
));
}
else
{
this
.
setPropValue
(
prop
,
data
.
value
.
value
);
this
.
set
Nub
PropValue
(
prop
,
data
.
value
.
value
);
}
}
}
...
...
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