Skip to content
Snippets Groups Projects
Commit c0aeffc6 authored by Florent's avatar Florent
Browse files

add loader to project creation

parent ed6d3c66
No related branches found
No related tags found
1 merge request!67REDMINE_TICKET-11878: ajout d'un loader à la création d'un projet
This diff is collapsed.
<template> <template>
<div class="fourteen wide column"> <div class="fourteen wide column">
<div
:class="{active: loading}"
class="ui inverted dimmer"
>
<div class="ui text loader">
Projet en cours de création. Vous allez être redirigé.
</div>
</div>
<form id="form-project-edit" class="ui form"> <form id="form-project-edit" class="ui form">
<h1> <h1>
<span v-if="action === 'edit'" <span v-if="action === 'edit'"
...@@ -206,6 +214,7 @@ export default { ...@@ -206,6 +214,7 @@ export default {
data() { data() {
return { return {
loading: false,
action: "create", action: "create",
levelPermissions: [ levelPermissions: [
{ name: "Utilisateur anonyme", value: "anonymous" }, { name: "Utilisateur anonyme", value: "anonymous" },
...@@ -376,6 +385,7 @@ export default { ...@@ -376,6 +385,7 @@ export default {
}; };
if (this.action === "create" || this.action === "duplicate") { if (this.action === "create" || this.action === "duplicate") {
this.loading = true;
await axios await axios
.post( .post(
`${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/`, `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/`,
...@@ -390,11 +400,13 @@ export default { ...@@ -390,11 +400,13 @@ export default {
this.goBackNrefresh(response.data.slug); this.goBackNrefresh(response.data.slug);
} }
} }
this.loading = false;
}) })
.catch((error) => { .catch((error) => {
if (error.response.data.title[0]) { if (error.response.data.title[0]) {
this.errors.title.push(error.response.data.title[0]); this.errors.title.push(error.response.data.title[0]);
} }
this.loading = false;
throw error; throw error;
}); });
} else if (this.action === "edit") { } else if (this.action === "edit") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment