Skip to content
Snippets Groups Projects
Commit 8e0be158 authored by Niklas Knagenhielm-Karlsson's avatar Niklas Knagenhielm-Karlsson
Browse files

Buttons hidden when work is finalized

parent e736f76e
No related branches found
No related tags found
1 merge request!238Buttons hidden when project is finalized
......@@ -187,29 +187,34 @@ async function checkInputFields(projectId: string, formId: string) {
}
function loadInitiateAndFinalizeBtn(projectId : string, completed : boolean) {
const nolanModelElement = document.getElementById("NolansModel") as HTMLElement;
//Creates buttons with classname, id, attribute and text
const finalizeButton = document.createElement("button");
const iterationButton = document.createElement("button");
if (nolanModelElement) {
finalizeButton.id = "toCurrentProjects";
iterationButton.id = "toCurrentProjects";
finalizeButton.classList.add("btn", "btn-primary");
iterationButton.classList.add("btn", "btn-primary");
iterationButton.setAttribute('role', 'button');
finalizeButton.setAttribute('role', 'button');
finalizeButton.textContent = 'Avsluta Förbättringsarbete';
iterationButton.textContent = 'En till iteration';
alert("hej");
if(!completed) {
alert("not completed");
const nolanModelElement = document.getElementById("projectPageNolandsModel") as HTMLElement;
//Creates buttons with classname, id, attribute and text
const finalizeButton = document.createElement("button");
const iterationButton = document.createElement("button");
if (nolanModelElement) {
alert("finds element");
finalizeButton.id = "toCurrentProjects";
iterationButton.id = "toCurrentProjects";
finalizeButton.classList.add("btn", "btn-primary");
iterationButton.classList.add("btn", "btn-primary");
iterationButton.setAttribute('role', 'button');
finalizeButton.setAttribute('role', 'button');
finalizeButton.textContent = 'Avsluta Förbättringsarbete';
iterationButton.textContent = 'En till iteration';
}
//Append buttons to html
nolanModelElement.append(iterationButton);
nolanModelElement.append(finalizeButton);
//Eventlistener for button
finalizeButton.addEventListener('click', function() {
checkInputFields(projectId, "formPageA");;
});
}
//Append buttons to html
nolanModelElement.append(iterationButton);
nolanModelElement.append(finalizeButton);
//Eventlistener for button
finalizeButton.addEventListener('click', function() {
checkInputFields(projectId, "formPageA");;
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment