Commit 8f5f8244 authored by Kevin Robert's avatar Kevin Robert
Browse files

UNOTOPLYS-192 : Correction de l'affichage des variables.

parent bf45bdb6
......@@ -144,21 +144,33 @@ public class VariableResource {
.build();
}
// TODO : Fonctionnement avec la gestion des expressions. Réactiver dès que ce sera pris en charge.
// /**
// * Récupération d'une variable.
// *
// * @param id L'identifiant de la variable.
// */
// @GetMapping("/variables/{id}")
// public VariableAPI getVariableTest(@PathVariable Long id) {
// Optional<VariableDTO> optionalVariableDTO = variableService.findOne(id);
// VariableDTO variableDTO = optionalVariableDTO.orElseThrow(() -> new VariableNotFoundException(id));
// VariableAPI variableAPI = FactoryVariableAPI.getVariableAPI(variableDTO.getType());
// if (variableAPI != null) {
// variableAPI.generate(variableDTO);
// return variableAPI;
// }
// return null;
// }
/**
* Récupération d'une variable.
*
* @param id L'identifiant de la variable.
*/
@GetMapping("/variables/{id}")
public VariableAPI getVariableTest(@PathVariable Long id) {
public VariableDTO getVariable(@PathVariable Long id) {
Optional<VariableDTO> optionalVariableDTO = variableService.findOne(id);
VariableDTO variableDTO = optionalVariableDTO.orElseThrow(() -> new VariableNotFoundException(id));
VariableAPI variableAPI = FactoryVariableAPI.getVariableAPI(variableDTO.getType());
if (variableAPI != null) {
variableAPI.generate(variableDTO);
return variableAPI;
}
return null;
return optionalVariableDTO.orElseThrow(() -> new VariableNotFoundException(id));
}
/**
......
......@@ -34,6 +34,7 @@ export default class VariableEdit extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.headerService().filArianeForForm(to.params.idForm);
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, TABS.KEY_VARIABLE);
const idVariable = to.params.idVariable;
vm.variable.formId = to.params.idForm;
......
......@@ -36,6 +36,7 @@ export default class VariableList extends Vue {
next(vm => {
vm.idForm = to.params.idForm;
vm.idWorkspace = to.params.idWorkspace;
vm.headerService().filArianeForForm(vm.idForm);
vm.headerService().updateTabsForFormId(vm.idWorkspace, vm.idForm, TABS.KEY_VARIABLE);
vm.loadAll(to.params.idForm);
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment