Api pole emploi, reglage corentin

This commit is contained in:
2021-04-08 13:02:47 +02:00
parent 48a9ca5fe9
commit 4dc3e224fc
2 changed files with 30 additions and 20 deletions
+20 -13
View File
@@ -488,9 +488,16 @@ class AccountEtape1 extends Component {
};
// Trigger suggestions
getSuggestionMetierValue = suggestion => (
suggestion.libelle
)
getSuggestionMetierValue = suggestion => {
console.log('getSuggestionMetierValue Le code : '+suggestion.code);
console.log('getSuggestionMetierValue Le libellé : '+suggestion.libelle);
document.getElementById('appellation_id').value =suggestion.code;
document.getElementById('appellation_libelle').value = suggestion.libelle;
this.setState({ appellationId: suggestion.code })
this.setState({ appellationLibelle: suggestion.libelle })
this.soumettre("appellation", "unitaire")
return suggestion.libelle;
}
// Render Each Option
renderSuggestionMetier = suggestion => (
// <div style="position: absolute; right: 0px; z-index: 1; will-change: transform; top: 0px; left: 0px; transform: translate3d(14px, 53px, 0px);" data-placement="bottom-start">
@@ -507,7 +514,7 @@ class AccountEtape1 extends Component {
// </div>
// </div>
<span className="suggestion-content" onClick={this.handleClick(suggestion.code, suggestion.libelle)}>
<span className="suggestion-content" >
<span className="name" >
{suggestion.libelle}
@@ -521,13 +528,13 @@ class AccountEtape1 extends Component {
handleClick(code, libelle) {
console.log('Le code : '+code);
document.getElementById('appellation_id').value =code;
document.getElementById('appellation_libelle').value = libelle;
this.setState({ appellationId: code })
this.setState({ appellationLibelle: libelle })
this.soumettre("appellation", "unitaire")
console.log('Le libellé : '+libelle);
//console.log('Le code : '+code);
// document.getElementById('appellation_id').value =code;
// document.getElementById('appellation_libelle').value = libelle;
// this.setState({ appellationId: code })
// this.setState({ appellationLibelle: libelle })
// this.soumettre("appellation", "unitaire")
//console.log('Le libellé : '+libelle);
}
// OnChange event handler
@@ -547,6 +554,8 @@ class AccountEtape1 extends Component {
suggestionsMetier: []
});
} else {
console.log("onSuggestionsMetierFetchRequested"+data);
console.log("onSuggestionsMetierFetchRequested"+value);
this.setState({
suggestionsMetier: data
});
@@ -685,8 +694,6 @@ class AccountEtape1 extends Component {
getSuggestionValue={this.getSuggestionMetierValue}
renderSuggestion={this.renderSuggestionMetier}
inputProps={inputPropsMetier}
value={"ress"}
id="metier"
/>
<input type="hidden" id="appellation_id" value={this.state.appellationId =='null' || this.state.appellationId =='' ? '' :this.state.appellationId}></input>
<input type="hidden" id="appellation_libelle" value={this.state.appellationLibelle =='null' || this.state.appellationLibelle =='' ? '' :this.state.appellationLibelle}></input>
+10 -7
View File
@@ -1,15 +1,18 @@
.react-autosuggest__container {
position: relative;
width: 85%;
}
.react-autosuggest__input {
width: 240px;
width: 100%;
height: 30px;
padding: 10px 20px;
font-family: Helvetica, sans-serif;
font-weight: 300;
padding: 10px 0;
font-family: Roboto;
font-weight: 400;
font-size: 16px;
border: 1px solid #aaa;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.23);
border-radius: 4px;
}
@@ -33,12 +36,12 @@
width: 280px;
border: 1px solid #aaa;
background-color: #fff;
font-family: Helvetica, sans-serif;
font-family: Roboto;
font-weight: 300;
font-size: 16px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
z-index: 2;
z-index: 10;
}
.react-autosuggest__suggestions-list {