mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Fixed: [vue] add condition to use dropdown or single button
This commit is contained in:
		| @@ -298,12 +298,7 @@ | ||||
|       </li> | ||||
|        | ||||
|       <li> | ||||
|          <!-- | ||||
|          {% if accompanyingCourse.hasUser and accompanyingCourse.user is not same as(app.user) %} | ||||
|          {{ work.accompanyingPeriod.user }} | ||||
|          --> | ||||
|          <button | ||||
|              v-if="false" | ||||
|          <button v-if="AmIRefferer" | ||||
|              class="btn btn-notify" | ||||
|              @click="goToGenerateNotification(false)" | ||||
|          ></button> | ||||
| @@ -463,6 +458,7 @@ export default { | ||||
|          'isPosting', | ||||
|          'errors', | ||||
|          'templatesAvailablesForAction', | ||||
|          'me', | ||||
|       ]), | ||||
|       ...mapGetters([ | ||||
|          'hasResultsForAction', | ||||
| @@ -520,6 +516,10 @@ export default { | ||||
|             this.$store.commit('setPersonsPickedIds', v); | ||||
|          } | ||||
|       }, | ||||
|       AmIRefferer() { | ||||
|          return (!(this.work.accompanyingPeriod.user && this.me | ||||
|             && (this.work.accompanyingPeriod.user.id !== this.me.id))); | ||||
|       } | ||||
|    }, | ||||
|    methods: { | ||||
|       toggleSelect() { | ||||
|   | ||||
| @@ -116,12 +116,8 @@ | ||||
|                        ></list-workflow-modal> | ||||
|                     </li> | ||||
|                    <li> | ||||
|                       <!-- | ||||
|                       {% if accompanyingCourse.hasUser and accompanyingCourse.user is not same as(app.user) %} | ||||
|                       {{ work.accompanyingPeriod.user }} | ||||
|                       --> | ||||
|                       <button | ||||
|                          v-if="false" | ||||
|                          v-if="AmIRefferer" | ||||
|                          class="btn btn-notify" | ||||
|                          @click="goToGenerateDocumentNotification(d, false)"> | ||||
|                       </button> | ||||
| @@ -282,8 +278,13 @@ export default { | ||||
|    computed: { | ||||
|       ...mapState([ | ||||
|          'isPosting', | ||||
|          'work' | ||||
|          'work', | ||||
|          'me', | ||||
|       ]), | ||||
|       AmIRefferer() { | ||||
|          return (!(this.$store.state.work.accompanyingPeriod.user && this.$store.state.me | ||||
|             && (this.$store.state.work.accompanyingPeriod.user.id !== this.$store.state.me.id))); | ||||
|       }, | ||||
|       getTemplatesAvailables() { | ||||
|          return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); | ||||
|       }, | ||||
|   | ||||
| @@ -35,6 +35,7 @@ const store = createStore({ | ||||
|     referrers: window.accompanyingCourseWork.referrers, | ||||
|     isPosting: false, | ||||
|     errors: [], | ||||
|     me: null | ||||
|   }, | ||||
|   getters: { | ||||
|     socialAction(state) { | ||||
| @@ -130,6 +131,9 @@ const store = createStore({ | ||||
|     } | ||||
|   }, | ||||
|   mutations: { | ||||
|     setWhoAmiI(state, me) { | ||||
|         state.me = me; | ||||
|     }, | ||||
|     setEvaluationsPicked(state, evaluations) { | ||||
|       state.evaluationsPicked = evaluations.map((e, index) => { | ||||
|         var k = Object.assign(e, { | ||||
| @@ -385,6 +389,19 @@ const store = createStore({ | ||||
|     }, | ||||
|   }, | ||||
|   actions: { | ||||
|     getWhoAmI({ commit }) { | ||||
|         let url = `/api/1.0/main/whoami.json`; | ||||
|         window.fetch(url) | ||||
|             .then(response => { | ||||
|                 if (response.ok) { | ||||
|                     return response.json(); | ||||
|                 } | ||||
|                 throw { m: 'Error while retriving results for goal', s: response.status, b: response.body }; | ||||
|             }) | ||||
|             .then(data => { | ||||
|                 commit('setWhoAmiI', data); | ||||
|             }); | ||||
|     }, | ||||
|     updateThirdParty({ commit }, payload) { | ||||
|       commit('updateThirdParty', payload); | ||||
|     }, | ||||
| @@ -514,6 +531,7 @@ store.commit('setEvaluationsPicked', window.accompanyingCourseWork.accompanyingP | ||||
| store.dispatch('getReachablesResultsForAction'); | ||||
| store.dispatch('getReachablesGoalsForAction'); | ||||
| store.dispatch('getReachablesEvaluationsForAction'); | ||||
| store.dispatch('getWhoAmI'); | ||||
|  | ||||
| store.state.evaluationsPicked.forEach(evaluation => { | ||||
|   store.dispatch('fetchTemplatesAvailablesForEvaluation', evaluation.evaluation) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user