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
1cb7f6ff
Commit
1cb7f6ff
authored
5 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#222
parent
8ca96581
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/components/field-set/field-set.component.ts
+36
-0
36 additions, 0 deletions
src/app/components/field-set/field-set.component.ts
src/locale/messages.en.json
+7
-1
7 additions, 1 deletion
src/locale/messages.en.json
src/locale/messages.fr.json
+6
-0
6 additions, 0 deletions
src/locale/messages.fr.json
with
49 additions
and
1 deletion
src/app/components/field-set/field-set.component.ts
+
36
−
0
View file @
1cb7f6ff
...
...
@@ -10,6 +10,10 @@ import { SelectFieldModel } from "../../formulaire/select-field-model";
import
{
FormulairePab
}
from
"
../../formulaire/definition/concrete/form-pab
"
;
import
{
SelectModelFieldLineComponent
}
from
"
../select-model-field-line/select-model-field-line.component
"
;
import
{
FieldsetContainer
}
from
"
../../formulaire/fieldset-container
"
;
import
{
NotificationsService
}
from
"
../../services/notifications/notifications.service
"
;
import
{
I18nService
}
from
"
../../services/internationalisation/internationalisation.service
"
;
import
{
sprintf
}
from
"
sprintf-js
"
;
@
Component
({
selector
:
"
field-set
"
,
...
...
@@ -140,6 +144,11 @@ export class FieldSetComponent implements DoCheck {
@
Output
()
protected
tabPressed
=
new
EventEmitter
<
any
>
();
public
constructor
(
private
notifService
:
NotificationsService
,
private
i18nService
:
I18nService
)
{
}
private
hasRadioFix
():
boolean
{
if
(
this
.
_fieldSet
.
hasInputs
)
{
switch
(
this
.
_fieldSet
.
getInput
(
0
).
radioConfig
)
{
...
...
@@ -325,6 +334,13 @@ export class FieldSetComponent implements DoCheck {
clone
:
false
});
}
let
msg
:
string
;
if
(
this
.
childrenToAdd
===
1
)
{
msg
=
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_ADDED
"
);
}
else
{
msg
=
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_ADDED_N_TIMES
"
),
this
.
childrenToAdd
);
}
this
.
notifService
.
notify
(
msg
);
this
.
childrenToAdd
=
1
;
// reinit to avoid confusion
}
...
...
@@ -338,6 +354,14 @@ export class FieldSetComponent implements DoCheck {
clone
:
true
});
}
const
pos
=
(
this
.
_fieldSet
.
parent
as
FieldsetContainer
).
getFieldsetPosition
(
this
.
_fieldSet
)
+
1
;
let
msg
:
string
;
if
(
this
.
childrenToAdd
===
1
)
{
msg
=
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_COPIED
"
),
pos
);
}
else
{
msg
=
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_COPIED_N_TIMES
"
),
pos
,
this
.
childrenToAdd
);
}
this
.
notifService
.
notify
(
msg
);
this
.
childrenToAdd
=
1
;
// reinit to avoid confusion
}
...
...
@@ -345,20 +369,32 @@ export class FieldSetComponent implements DoCheck {
* clic sur le bouton supprimer
*/
private
onRemoveClick
()
{
const
pos
=
(
this
.
_fieldSet
.
parent
as
FieldsetContainer
).
getFieldsetPosition
(
this
.
_fieldSet
)
+
1
;
this
.
removeFieldset
.
emit
(
this
.
_fieldSet
);
this
.
notifService
.
notify
(
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_REMOVED
"
),
pos
)
);
}
/**
* clic sur le bouton monter
*/
private
onMoveUpClick
()
{
const
pos
=
(
this
.
_fieldSet
.
parent
as
FieldsetContainer
).
getFieldsetPosition
(
this
.
_fieldSet
)
+
1
;
this
.
moveFieldsetUp
.
emit
(
this
.
_fieldSet
);
this
.
notifService
.
notify
(
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_MOVED
"
),
pos
)
);
}
/**
* clic sur le bouton descendre
*/
private
onMoveDownClick
()
{
const
pos
=
(
this
.
_fieldSet
.
parent
as
FieldsetContainer
).
getFieldsetPosition
(
this
.
_fieldSet
)
+
1
;
this
.
moveFieldsetDown
.
emit
(
this
.
_fieldSet
);
this
.
notifService
.
notify
(
sprintf
(
this
.
i18nService
.
localizeText
(
"
INFO_FSC_FS_MOVED
"
),
pos
)
);
}
}
This diff is collapsed.
Click to expand it.
src/locale/messages.en.json
+
7
−
1
View file @
1cb7f6ff
...
...
@@ -88,6 +88,12 @@
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1"
:
"Partially submerged"
,
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2"
:
"Submerged"
,
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3"
:
"Zero flow"
,
"INFO_FSC_FS_ADDED"
:
"1 device added"
,
"INFO_FSC_FS_ADDED_N_TIMES"
:
"%s devices added"
,
"INFO_FSC_FS_COPIED"
:
"Device #%s copied"
,
"INFO_FSC_FS_COPIED_N_TIMES"
:
"Device #%s copied %s times"
,
"INFO_FSC_FS_MOVED"
:
"Device #%s moved"
,
"INFO_FSC_FS_REMOVED"
:
"Device #%s removed"
,
"INFO_LECHAPTCALMON_TITRE_COURT"
:
"Lechapt-C."
,
"INFO_LECHAPTCALMON_TITRE"
:
"Lechapt-Calmon"
,
"INFO_LIB_ALPHA"
:
"Alpha coefficient"
,
...
...
@@ -97,7 +103,7 @@
"INFO_LIB_BETA"
:
"Beta coefficient"
,
"INFO_LIB_BT"
:
"Half opening of the triangle"
,
"INFO_LIB_CD"
:
"Discharge coefficient"
,
"INFO_LIB_CLOISON"
:
"Cross wall
n°
"
,
"INFO_LIB_CLOISON"
:
"Cross wall
#
"
,
"INFO_LIB_CV"
:
"Cv: Velocity coefficient"
,
"INFO_LIB_CVQT"
:
"CV.QT: Corrected discharge"
,
"INFO_LIB_DH"
:
"Fall"
,
...
...
This diff is collapsed.
Click to expand it.
src/locale/messages.fr.json
+
6
−
0
View file @
1cb7f6ff
...
...
@@ -88,6 +88,12 @@
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1"
:
"Partiellement noyé"
,
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2"
:
"Noyé"
,
"INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3"
:
"Débit nul"
,
"INFO_FSC_FS_ADDED"
:
"1 ouvrage ajouté"
,
"INFO_FSC_FS_ADDED_N_TIMES"
:
"%s ouvrages ajoutés"
,
"INFO_FSC_FS_COPIED"
:
"Ouvrage n°%s copié"
,
"INFO_FSC_FS_COPIED_N_TIMES"
:
"Ouvrage n°%s copié %s fois"
,
"INFO_FSC_FS_MOVED"
:
"Ouvrage n°%s déplacé"
,
"INFO_FSC_FS_REMOVED"
:
"Ouvrage n°%s supprimé"
,
"INFO_LECHAPTCALMON_TITRE_COURT"
:
"Lechapt-C."
,
"INFO_LECHAPTCALMON_TITRE"
:
"Lechapt-Calmon"
,
"INFO_LIB_ALPHA"
:
"Coefficient alpha"
,
...
...
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