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
07a36106
Commit
07a36106
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
refactor: FieldSet: remove inSection parameter from setSelectValueFromProperty(), getPropValue()
refs
#596
parent
a7d8b1cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!225
Release v4.17.0
,
!200
Resolve "Conduites en charge : ajouter loi de Strickler"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/formulaire/elements/fieldset.ts
+5
-14
5 additions, 14 deletions
src/app/formulaire/elements/fieldset.ts
with
5 additions
and
14 deletions
src/app/formulaire/elements/fieldset.ts
+
5
−
14
View file @
07a36106
...
...
@@ -205,7 +205,7 @@ export class FieldSet extends FormulaireElement implements IProperties {
if
(
this
.
parentForm
instanceof
FormulaireFixedVar
)
{
for
(
const
sel
of
this
.
parentForm
.
allSelectFields
)
{
if
(
sel
.
hasAssociatedNubProperty
)
{
// ie. if select is a standard select
this
.
setSelectValueFromProperty
(
sel
.
id
,
(
this
.
_confId
===
"
fs_section
"
)
);
this
.
setSelectValueFromProperty
(
sel
.
id
);
}
}
}
...
...
@@ -213,12 +213,11 @@ export class FieldSet extends FormulaireElement implements IProperties {
/**
* Reflects a property value in the interface, through the value of a <select> field, if this select exists
* @param inSection if true, will look for the required property in the Nub's section (children[0])
*/
private
setSelectValueFromProperty
(
selectId
:
string
,
inSection
:
boolean
=
false
)
{
private
setSelectValueFromProperty
(
selectId
:
string
)
{
const
selectField
:
SelectField
=
this
.
getFormulaireNodeById
(
selectId
)
as
SelectField
;
if
(
selectField
)
{
let
propVal
:
any
=
this
.
getPropValue
(
selectField
.
associatedProperty
,
inSection
);
let
propVal
:
any
=
this
.
getPropValue
(
selectField
.
associatedProperty
);
if
(
propVal
===
undefined
)
{
propVal
=
""
;
// clodo bullet-proof loading
}
...
...
@@ -327,7 +326,7 @@ export class FieldSet extends FormulaireElement implements IProperties {
if
(
senderId
===
"
select_section
"
)
{
// sections paramétrées, courbes de remous, régimes uniformes
// "nodeType" is a property of the section child, not of the parent
const
oldNodeType
=
this
.
nub
.
getChildren
()[
0
].
getPropValue
(
"
nodeType
"
);
const
oldNodeType
=
this
.
getPropValue
(
"
nodeType
"
);
if
(
oldNodeType
!==
data
.
value
.
value
)
{
// avoid infinite loops
// manually notify parent so that it replaces the child Nub @WARNING clodo trick
this
.
parentForm
.
update
(
this
,
{
...
...
@@ -379,16 +378,8 @@ export class FieldSet extends FormulaireElement implements IProperties {
/**
* 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])
*/
public
getPropValue
(
key
:
string
,
inSection
:
boolean
=
false
):
any
{
if
(
inSection
)
{
const
section
=
this
.
nub
.
getChildren
()[
0
];
if
(
section
)
{
return
section
.
getPropValue
(
key
);
}
return
undefined
;
}
public
getPropValue
(
key
:
string
):
any
{
return
this
.
nub
.
getPropValue
(
key
);
}
...
...
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