@@ -80,18 +80,18 @@ export default class QuestForm extends Component {
80
80
const snippets = JSON .parse (window .localStorage .getItem (LOCAL_STORAGE_KEY )) ?? {
81
81
objectRequirementsByLabel: {},
82
82
};
83
- const eligibilityRequirements = this .popToRootToPip (
83
+ const eligibilityRequirements = this .buildArrayRequirement (
84
84
this .eligibilityRequirementsStr ,
85
85
snippets .objectRequirementsByLabel ,
86
86
);
87
87
88
- const successRequirements = this .popToRootToPip (this .successRequirementsStr , snippets .objectRequirementsByLabel );
88
+ const successRequirements = this .buildArrayRequirement (this .successRequirementsStr , snippets .objectRequirementsByLabel );
89
89
90
90
const questToJson = JSON .stringify ({
91
91
rewardId: parseInt (this .rewardId ),
92
92
rewardType: this .rewardType ,
93
- eligibilityRequirements: [ eligibilityRequirements] ,
94
- successRequirements: successRequirements ? [successRequirements] : [] ,
93
+ eligibilityRequirements: eligibilityRequirements,
94
+ successRequirements: successRequirements,
95
95
});
96
96
97
97
console .log (questToJson);
@@ -121,7 +121,7 @@ export default class QuestForm extends Component {
121
121
ALL(ONE-OF(A,B),C) ---> Le jeton d'opération (all ou one-of) se trouve au début, et en arguments
122
122
on trouve la liste des opérandes.
123
123
*/
124
- popToRootToPip (str , objectRequirementsByLabel ) {
124
+ buildArrayRequirement (str , objectRequirementsByLabel ) {
125
125
// Dictionnaire des "mots" qui correspondent à des requirements feuilles
126
126
// qu'on pourrait retrouver dans la formule
127
127
const snippetNames = Object .keys (objectRequirementsByLabel);
@@ -248,7 +248,7 @@ export default class QuestForm extends Component {
248
248
</PixButtonLink >
249
249
250
250
<PixButton @ size =" small" @ variant =" success" @ triggerAction ={{this .copyEligibilityRequirementsToClipboard }} >
251
- Mettre le json des requirements d'éligibilité dans le presse-papiers
251
+ Copiez le JSON de quête dans le presse-papiers
252
252
</PixButton >
253
253
</div >
254
254
</section >
0 commit comments