Commit 2ceb4135 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- UI (configuration des Process > On peut déplier les détails)

parent d506374a
Loading
Loading
Loading
Loading
+27 −9
Original line number Diff line number Diff line
@@ -114,7 +114,6 @@
            <button @click="handlerEditStepCancel" class="btn btn-danger">Annuler</button>
          </nav>
        </article>

        <article v-else-if="editSignatureFlow" class="signatureflows-edit">
          <h2>Edition de la procédure</h2>
          <div>
@@ -193,13 +192,14 @@
        </article>
        <section v-else>
          <article v-for="sf in signatureflows" class="signatureflow">
            <h3>
            <h3 @click="handleToggleOpen(sf)" class="openable">
              Procédure : <strong>{{ sf.label }}</strong> -
              <code v-if="sf.enabled" class="text-success">[ACTIVE]</code>
              <em v-else class="text-danger">[INACTIVE]</em>
              <span> / {{  sf.steps.length }} étape(s)</span>
            </h3>
            <p><small>{{ sf.description }}</small></p>
            <section class="steps" v-if="sf.steps.length">
            <section class="steps" v-if="sf.steps.length && !closed.includes(sf.id)">
              <article v-for="s in sf.steps" class="step">
                <h4>
                  Etape {{ s.order }} -
@@ -238,12 +238,9 @@
                  </div>
              </article>
            </section>
            <section class="alert alert-info" v-else>
              Aucune étape configurée
            </section>
            <nav class="buttons-bar">
              <button class="btn btn-xs" @click="handlerEditSignatureFlow(sf)">Modifier la procédure</button>
              <button class="btn btn-xs" @click="handlerDeleteSignatureFlow(sf)">Supprimer la procédure</button>
              <button class="btn btn-xs btn-default" @click="handlerEditSignatureFlow(sf)">Modifier la procédure</button>
              <button class="btn btn-xs btn-danger" @click="handlerDeleteSignatureFlow(sf)">Supprimer la procédure</button>
            </nav>
          </article>
          <nav>
@@ -262,6 +259,8 @@
import axios from 'axios';
import Recipients from '../components/Recipients.vue'

const localStorageKey = "oscar_kusanagi_signatureflow_closed";

export default {
  components: {
    Recipients
@@ -280,12 +279,22 @@ export default {
      editedStep: null,
      editSignatureFlow: null,
      editedSignatureFlow: null,
      error: ''
      error: '',
      closed: []
    }
  },

  methods: {

    handleToggleOpen(sf){
      if( this.closed.includes(sf.id) ){
        this.closed.splice(this.closed.indexOf(sf.id),1);
      } else {
        this.closed.push(sf.id);
      }
      localStorage.setItem(localStorageKey, JSON.stringify(this.closed));
    },

    handlerRecipientsChange(evt) {
      console.log('handlerRecipientsChange', evt)
    },
@@ -544,6 +553,10 @@ export default {

    fetch() {
      this.loading = "Chargement des processus";
      if( localStorage.getItem(localStorageKey) ){
        this.closed = JSON.parse(localStorage.getItem(localStorageKey));
      }

      axios.get(this.entrypoint).then(ok => {
        this.signatureflows = ok.data.signatureflows
        this.letterfiles = ok.data.letterfiles
@@ -598,6 +611,11 @@ export default {
</script>

<style lang="scss">

.openable {
  cursor: pointer;
}

.signatureflow {
  border: solid #cbd9e1 thin;
  border-left: solid #a3c2d3 4px;