1
- import { css , customElement , html , LitElement , property , unsafeCSS } from 'lit-element' ;
1
+ import { css , customElement , html , LitElement , property , PropertyValues , unsafeCSS } from 'lit-element' ;
2
2
import { repeat } from "lit-html/directives/repeat" ;
3
3
import { styleMap } from "lit-html/directives/style-map" ;
4
4
import globalCss from "../styles/global.scss" ;
@@ -55,6 +55,8 @@ export abstract class AbstractVmdRdvView extends LitElement {
55
55
56
56
protected derniereCommuneSelectionnee : Commune | undefined = undefined ;
57
57
58
+ private eligibilityCriteriaTimeout : number | undefined = undefined ;
59
+ private eligibilityCriteriaDisplayed : boolean = true ;
58
60
59
61
get communeSelectionnee ( ) : Commune | undefined {
60
62
if ( this . derniereCommuneSelectionnee ) {
@@ -76,6 +78,14 @@ export abstract class AbstractVmdRdvView extends LitElement {
76
78
this . derniereCommuneSelectionnee = commune ;
77
79
}
78
80
81
+ protected firstUpdated ( _changedProperties : PropertyValues ) {
82
+ super . firstUpdated ( _changedProperties ) ;
83
+ this . eligibilityCriteriaTimeout = setTimeout ( async ( ) => {
84
+ this . eligibilityCriteriaDisplayed = false ;
85
+ await this . requestUpdate ( ) ;
86
+ } , 10000 ) ;
87
+ }
88
+
79
89
protected getDepartementSelectionne ( ) : Departement | undefined {
80
90
if ( this . codeDepartementSelectionne && this . departementsDisponibles ) {
81
91
return this . departementsDisponibles . find ( d => this . codeDepartementSelectionne === d . code_departement ) ;
@@ -241,13 +251,21 @@ export abstract class AbstractVmdRdvView extends LitElement {
241
251
} ) }
242
252
` : html `` }
243
253
</ div >
244
- < div class ="eligibility-criteria ">
245
- < p > Soyons citoyens et respectons les conditions d'éligibilité :-)</ p >
246
- </ div >
254
+ ${ this . renderEligibilityCriteria ( ) }
247
255
` }
248
256
` ;
249
257
}
250
258
259
+ private renderEligibilityCriteria ( ) {
260
+ if ( this . eligibilityCriteriaDisplayed ) {
261
+ return html `
262
+ < div class ="eligibility-criteria ">
263
+ < p > Soyons citoyens et respectons les conditions d'éligibilité :-)</ p >
264
+ </ div > ` ;
265
+ }
266
+
267
+ return `` ;
268
+ }
251
269
onCommuneAutocompleteLoaded ( autocompletes : string [ ] ) : Promise < void > {
252
270
return Promise . resolve ( ) ;
253
271
}
0 commit comments