Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] quickadd use condition before renderin the strig #287

Open
1 task
louwelyn-jeremy opened this issue Jun 28, 2024 · 0 comments
Open
1 task
Assignees
Labels
enhancement New feature or request

Comments

@louwelyn-jeremy
Copy link

i want to use modal form to add task on a specific file
for that i use:

in modal form

{
"title": "actions_tous",
"name": "TODO_global",
"fields": [
{
"name": "todo_type",
"label": "type d'action",
"description": "",
"isRequired": false,
"input": {
"type": "select",
"source": "fixed",
"options": [
{
"value": "- [ ]",
"label": "normal"
}
]
}
},
{
"name": "action",
"label": "action",
"description": "",
"isRequired": false,
"input": {
"type": "text"
}
},
{
"name": "choix_prio",
"label": "priorisation",
"description": "cocher pour ajouter une priorisation",
"isRequired": false,
"input": {
"type": "toggle"
}
},
{
"name": "prio",
"label": "type de priorisation",
"description": "",
"isRequired": false,
"input": {
"type": "select",
"source": "fixed",
"options": [
{
"value": "",
"label": "normal"
},
{
"value": "🔺",
"label": "très haute"
}
]
}
},
{
"name": "choix_echeance",
"label": "ajouter une echéance ?",
"description": "",
"isRequired": false,
"input": {
"type": "toggle"
}
},
{
"name": "type_echeance",
"label": "type d'échéance",
"description": "",
"isRequired": false,
"input": {
"type": "select",
"source": "fixed",
"options": [
{
"value": "📅",
"label": "echéance"
},
{
"value": "⏳",
"label": "planification"
}
]
}
},
{
"name": "date_echeance",
"label": "date de l'échéance",
"description": "",
"isRequired": false,
"input": {
"type": "date"
}
}
],
"version": "1"
}

in quickadd

	const modalForm = app.plugins.plugins.modalforms.api;
	const date_creation= "➕ " + window.moment().format("YYYY-MM-DD")
	const txt_prio = ""
	const txt_echeance = ""
	const result = await modalForm.openForm('TODO_global');
	if (result.get("choix_prio") == "true") {
		txt_prio = result.get("prio");
		txt_prio = "faux au choix prio";
	  }                           
	if (result.get("choix_echeance") == "true") {
		txt_echeance = result.get("type_echeance") + result.get("date_echeance");
		txt_echeance="faux au chois echéance";
	  } 
	return result.asString('{{todo_type}} TODO {{action}}')+ "|" + txt_prio + "|" + date_creation + "|" + txt_echeance + "|"

my problem is on the if statement ... quicka dd don't see them !
foe eremple, this is the result:

  • TODO xxxx||➕ 2024-06-28||

i don't have the value if true or value if false ....

@louwelyn-jeremy louwelyn-jeremy added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants