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
7014185c
Commit
7014185c
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
fix: default values for selects not read from configuration file
refs
#592
parent
63d385ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!225
Release v4.17.0
,
!199
Resolve "Incohérence dans les fichiers de session"
Pipeline
#140145
passed
2 years ago
Stage: install
Stage: build
Stage: clean-stale-branches
Stage: deploy-dev
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/formulaire/definition/form-definition.ts
+21
-0
21 additions, 0 deletions
src/app/formulaire/definition/form-definition.ts
src/app/services/formulaire.service.ts
+3
-1
3 additions, 1 deletion
src/app/services/formulaire.service.ts
with
24 additions
and
1 deletion
src/app/formulaire/definition/form-definition.ts
+
21
−
0
View file @
7014185c
...
...
@@ -117,6 +117,27 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
return
this
.
_props
;
}
public
parseConfigToProps
():
Props
{
const
res
:
Props
=
new
Props
();
const
jp
=
new
ConfigParser
(
this
.
_jsonConfig
);
for
(
const
fs
of
jp
.
forAll
(
"
fieldset
"
))
{
const
fsp
=
new
ConfigParser
(
fs
[
"
fields
"
]);
for
(
const
sel
of
fsp
.
forAll
(
"
select
"
))
{
const
p
=
sel
[
"
property
"
];
if
(
p
!==
undefined
)
{
// if select has associated property
const
v
=
sel
[
"
default
"
];
if
(
v
!==
undefined
)
{
// if select has a default value for associated property
const
enumClass
=
Props
.
enumFromProperty
[
p
];
res
.
setPropValue
(
p
,
enumClass
[
v
]);
}
}
}
}
return
res
;
}
/**
* Creates a Nub from the given properties, and associates it to the current form
*/
...
...
This diff is collapsed.
Click to expand it.
src/app/services/formulaire.service.ts
+
3
−
1
View file @
7014185c
...
...
@@ -371,7 +371,9 @@ export class FormulaireService extends Observable {
if
(
nub
)
{
f
.
currentNub
=
nub
;
}
else
{
f
.
initNub
();
const
confProps
=
f
.
parseConfigToProps
();
confProps
.
setPropValue
(
"
calcType
"
,
ct
);
f
.
initNub
(
confProps
);
}
// Restaure le nom du module, sinon affecte le nom par défaut
...
...
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