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
9ac7ac41
Commit
9ac7ac41
authored
7 years ago
by
francois.grand
Browse files
Options
Downloads
Patches
Plain Diff
#64
: SingleResultComponent : ajout d'une icône rouge en cas d'erreur de la valeur
parent
a18ba41d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Resolve "Faire les modifs nécessaires pour prendre en compte cassiopee/jalhyd#36"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/single-result/single-result.component.html
+9
-3
9 additions, 3 deletions
...app/components/single-result/single-result.component.html
src/app/components/single-result/single-result.component.ts
+42
-19
42 additions, 19 deletions
src/app/components/single-result/single-result.component.ts
with
51 additions
and
22 deletions
src/app/components/single-result/single-result.component.html
+
9
−
3
View file @
9ac7ac41
<!-- template pour le popup
*ngIf="hasLog"
-->
<!-- template pour le popup -->
<ng-template
#popTemplate
>
<div
[innerHtml]=
"html
Log
"
></div>
<div
[innerHtml]=
"html
Tooltip
"
></div>
</ng-template>
<div
class=
"row"
[mdbTooltip]=
"popTemplate"
[isDisabled]=
"tooltipDisabled"
>
<div
class=
"col-12"
>
{{value}}
<!-- icône en cas d'erreur -->
<i
*ngIf=
"hasError"
class=
"fa fa-exclamation-triangle"
style=
"color:red"
aria-hidden=
"true"
></i>
<!-- valeur -->
<span
*ngIf=
"!hasError"
>
{{value}}
</span>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/components/single-result/single-result.component.ts
+
42
−
19
View file @
9ac7ac41
...
...
@@ -14,29 +14,48 @@ export class SingleResultComponent implements OnChanges {
@
Input
(
"
result
"
)
private
_result
:
ResultElement
;
private
_htmlLog
:
string
;
/**
* valeur à afficher
*/
private
_value
:
string
;
private
_logEmpty
:
boolean
=
false
;
/**
* true si la valeur est en erreur
*/
private
_hasError
:
boolean
;
/**
* code HTML du tooltip
*/
private
_htmlTooltip
:
string
;
/**
* true si pas de texte à afficher dans le tooltip
*/
private
_emptyTooltip
:
boolean
=
false
;
constructor
(
private
appSetupService
:
ApplicationSetupService
,
private
intlService
:
InternationalisationService
)
{
}
)
{
}
private
get
hasValue
():
boolean
{
return
this
.
_result
!=
undefined
&&
this
.
_result
.
ok
;
/**
* appelé quand les @Input changent
*/
ngOnChanges
()
{
this
.
updateTooltip
();
}
private
get
value
():
string
{
private
updateTooltip
()
{
// valeur à afficher
const
nDigits
=
this
.
appSetupService
.
displayDigits
;
const
r
:
ResultElement
=
this
.
_result
;
if
(
r
==
undefined
||
r
.
vCalc
==
undefined
)
return
undefined
;
return
r
.
vCalc
.
toFixed
(
nDigits
);
}
this
.
_hasError
=
r
==
undefined
||
r
.
vCalc
==
undefined
;
this
.
_value
=
this
.
_hasError
?
"
"
:
this
.
_value
=
r
.
vCalc
.
toFixed
(
nDigits
)
;
// texte du tooltip
private
updateTooltip
()
{
let
res
=
""
;
if
(
this
.
_result
!=
undefined
)
...
...
@@ -46,19 +65,23 @@ export class SingleResultComponent implements OnChanges {
res
+=
this
.
intlService
.
localizeMessage
(
m
);
}
this
.
_html
Log
=
res
;
this
.
_
logEmpty
=
this
.
_html
Log
.
length
==
0
;
this
.
_html
Tooltip
=
res
;
this
.
_
emptyTooltip
=
this
.
_html
Tooltip
.
length
==
0
;
}
ngOnChanges
()
{
this
.
updateTooltip
();
private
get
value
():
string
{
return
this
.
_value
;
}
private
get
hasError
()
{
return
this
.
_hasError
;
}
private
get
html
Log
():
string
{
return
this
.
_html
Log
;
private
get
html
Tooltip
():
string
{
return
this
.
_html
Tooltip
;
}
private
get
tooltipDisabled
():
boolean
{
return
this
.
_
logEmpty
;
return
this
.
_
emptyTooltip
;
}
}
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