Created
December 3, 2019 16:34
-
-
Save svngoku/d56aa215aa4f8e0ed41628aae38cefd7 to your computer and use it in GitHub Desktop.
workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const choice = ['Aléatoire','Permanent','Quotidien','Inconnue']; | |
const priority = ['Urgent', 'Modéré', "Demande dinformation"]; | |
const status = ['A TRAITER', 'EN COURS', 'COMPLEMENT INFOS', 'A REPRENDRE', 'CLOS']; | |
let actualStatusState = []; | |
let demande = prompt('Status: '); | |
function Workflow() { | |
if(demande === 'A TRAITER') { | |
console.log('Statut: ', demande); | |
status.forEach((s) => { | |
if(s !== demande && s !== "A REPRENDRE") { | |
actualStatusState.push(s) | |
} | |
}) | |
} else if(demande === "EN COURS") { | |
console.log('Statut: ', demande); | |
status.forEach((s) => { | |
if(s !== demande && (s !== "A TRAITER" && s!== "COMPLEMENT INFOS")) { | |
actualStatusState.push(s); | |
} | |
}) | |
} else if(demande === "COMPLEMENT INFOS") { | |
console.log('Statut: ', demande); | |
status.forEach((s) => { | |
if(s !== demande && s !== "A TRAITER" && s !== "A REPRENDRE" ) { | |
console.log(s); | |
} | |
}) | |
} else if(demande === "A REPRENDRE") { | |
console.log('Statut: ', demande); | |
status.forEach((s) => { | |
if(s !== demande && s !== "A TRAITER") { | |
actualStatusState.push(s); | |
} | |
}) | |
} else { | |
console.log('Statut: ', demande); | |
status.forEach((s) => { | |
if(s !== demande) { | |
actualStatusState.push(s); | |
} | |
}); | |
} | |
return actualStatusState; | |
} | |
Workflow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment