Commit 1b762638 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Fix #63330 : La liste des flux de jalon s'actualise correctement lors d'un...

 - Fix #63330 : La liste des flux de jalon s'actualise correctement lors d'un modification des modèles
 - Fix #63317 : Lors de la modification d'un modèle de jalon, le créateur est conservé
parent cb94538b
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ class ActivityDateFlowService
     * Retourne les modèles de jalons disponibles.
     * @return array
     */
    public function getDateFlows()
    public function getDateFlows(?int $creatorId)
    {
        $dateflows = $this->getActivityDateFlowRepository()->findAll();
        /** @var AuthentificationRepository $authentificationRepository */
@@ -71,6 +71,7 @@ class ActivityDateFlowService
                'id' => $dateflow->getId(),
                'label' => $dateflow->getLabel(),
                'description' => $dateflow->getDescription(),
                'mine' => $dateflow->getCreatedBy() == $creatorId,
                'createdBy' => $creator,
                'datetypes' => $elements,
                'public' => $dateflow->getPublic(),
@@ -146,6 +147,7 @@ class ActivityDateFlowService
            }
        } else {
            $dateflow = new ActivityDateFlow();
            $dateflow->setCreatedBy($creatorId);
            $this->entityManager->persist($dateflow);
        }

@@ -153,7 +155,6 @@ class ActivityDateFlowService

        $dateflow->setLabel($jsonDatas['label']);
        $dateflow->setDescription($jsonDatas['description']);
        $dateflow->setCreatedBy($creatorId);
        $dateflow->setPublic($isPublic);

        // Trier les données par ORDER*
+13 −12
Original line number Diff line number Diff line
<template>
  <div class="row">
    <div class="col-md-4">
    <div class="col-md-4" style="border-right: thin solid #eee">
      <h3>Mes modèles</h3>
      <button class="btn btn-default" @click="handlerNew">
        Nouveau modèle
      </button>
      <article v-for="f in displayedFlow" class="flow-element-list">
      <article v-for="f in displayedFlow" class="flow-element-list" :class="{'selected': editFlow && f.id == editFlow.id }">
        <h4>
          {{ f.label }}
          <i class="icon-globe" v-show="f.public"></i>
        </h4>
        <p>{{ f.description }}</p>
        <section>
          <article v-for="j in f.datetypes">
            {{ j.datetype.label }}
            ({{ j.interval }} jour(s))
          </article>
        </section>
        <nav class="buttons-bar">
          <nav style="display: inline">
            <button class="btn btn-danger btn-xs" @click="handlerDelete(f)">
              Supprimer
            </button>
@@ -25,7 +17,8 @@
              Modifier
            </button>
          </nav>

        </h4>
        <p>{{ f.description }}</p>
      </article>
    </div>
    <div class="col-md-8">
@@ -125,6 +118,7 @@ export default {
    },
    handlerSelectMilestone(event){
      let type = this.types.find(i => i.id == event.target.value);
      event.target.value = "";
      if( type ){
        this.editFlow.datetypes.push({
          id: null,
@@ -144,6 +138,7 @@ export default {
      promise.then(ok=>{
        console.log("DONE", ok);
        this.$emit('update', ok.data);
        this.editFlow = null;
      })

    },
@@ -163,6 +158,12 @@ export default {
<style lang="scss">
.flow-element-list{
  border: thin solid #eee;
  margin-top: 1em;
  background: #eee;
  padding: .25em .5em;
  &:hover, &.selected {
    background: #b1c1d9;
  }
}
.flow-element-list-item {
  border: thin solid #eee;
+0 −4
Original line number Diff line number Diff line
@@ -28,10 +28,6 @@
            <activity-milestone-flow-editor :flow="flow" :types="types" :url="urlFlowAdmin" @update="onUpdateFlow"/>

            <nav class="buttons-bar">
              <button class="btn btn-success" @click="performSaveFlowModel" :class="{'disabled': flowData.datetypes.length == 0}" >
                <i class="icon-floppy"></i>
                Enregistrer mes modèles
              </button>
              <button class="btn btn-default" @click="screen = 'default'">
                <i class="icon-cancel-outline"></i>
                Terminer