|
|
@ -15,8 +15,11 @@ import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
|
import com.vaadin.flow.component.textfield.TextArea; |
|
|
|
import com.vaadin.flow.component.textfield.TextField; |
|
|
|
import com.vaadin.flow.component.upload.Upload; |
|
|
|
import com.vaadin.flow.component.upload.receivers.MemoryBuffer; |
|
|
|
import com.vaadin.flow.router.Route; |
|
|
|
import jakarta.annotation.security.PermitAll; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -46,6 +49,12 @@ public class CrearnuevoTicketView extends VerticalLayout { |
|
|
|
descripcion.setHeight("250px"); |
|
|
|
|
|
|
|
|
|
|
|
//Campo para adjuntar archivos |
|
|
|
MemoryBuffer buffer = new MemoryBuffer(); |
|
|
|
Upload uploadFile = new Upload(); |
|
|
|
uploadFile.setUploadButton(new Button("Cargar archivo")); |
|
|
|
|
|
|
|
|
|
|
|
//Respuestas Json para verificar posibles errores al enviar los nuevos tickets no visibles en la interfaz |
|
|
|
TextArea jsonOutput = new TextArea("JSON Output"); |
|
|
|
jsonOutput.setReadOnly(true); |
|
|
@ -53,7 +62,7 @@ public class CrearnuevoTicketView extends VerticalLayout { |
|
|
|
responseField.setReadOnly(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Boton para crear los tickets |
|
|
|
Button createButton = new Button("Enviar ticket", event -> { |
|
|
|
Map<String, String> issueDetails = new HashMap<>(); |
|
|
|
issueDetails.put("project_id", "proyecto-de-prueba"); |
|
|
@ -91,7 +100,9 @@ public class CrearnuevoTicketView extends VerticalLayout { |
|
|
|
buttonLayout.setAlignItems(Alignment.END); |
|
|
|
buttonLayout.setMargin(true); |
|
|
|
|
|
|
|
add(new H2("Crear nuevo ticket"), firstFields, fieldsLayout,buttonLayout/*,jsonOutput,responseField*/); |
|
|
|
VerticalLayout uploadLayout = new VerticalLayout(uploadFile); |
|
|
|
|
|
|
|
add(new H2("Crear nuevo ticket"), firstFields, fieldsLayout, uploadLayout, buttonLayout/*,jsonOutput,responseField*/); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|