mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 17:28:23 +00:00 
			
		
		
		
	Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles
This commit is contained in:
		| @@ -92,6 +92,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente | ||||
|  | ||||
|     /** | ||||
|      * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod", inversedBy="calendars") | ||||
|      * @Serializer\Groups({"calendar:read", "read"}) | ||||
|      */ | ||||
|     private ?AccompanyingPeriod $accompanyingPeriod = null; | ||||
|  | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
|           :picked="null !== this.$store.getters.getMainUser ? [this.$store.getters.getMainUser] : []" | ||||
|           :removableIfSet="false" | ||||
|           :displayPicked="false" | ||||
|           :suggested="this.suggestedUsers" | ||||
|           @addNewEntity="setMainUser" | ||||
|         ></pick-entity> | ||||
|       </div> | ||||
| @@ -143,6 +144,7 @@ export default { | ||||
|       slotMinTime: '09:00:00', | ||||
|       slotMaxTime: '18:00:00', | ||||
|       hideWeekEnds: true, | ||||
|       previousUser: [], | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
| @@ -188,11 +190,23 @@ export default { | ||||
|         users.push(this.$store.getters.getUserDataById(id).user); | ||||
|       } | ||||
|       return users; | ||||
|     } | ||||
|     }, | ||||
|     suggestedUsers() { | ||||
|       const suggested = []; | ||||
|  | ||||
|       this.$data.previousUser.forEach(u => { | ||||
|         if (u.id !== this.$store.getters.getMainUser.id) { | ||||
|           suggested.push(u) | ||||
|         } | ||||
|       }); | ||||
|  | ||||
|       return suggested; | ||||
|     }, | ||||
|   }, | ||||
|   methods: { | ||||
|     setMainUser(user) { | ||||
|       console.log('setMainUser APP', user); | ||||
|     setMainUser({entity}) { | ||||
|       const user = entity; | ||||
|       console.log('setMainUser APP', entity); | ||||
|  | ||||
|       if (user.id !== this.$store.getters.getMainUser && ( | ||||
|           this.$store.state.activity.calendarRange !== null | ||||
| @@ -205,6 +219,14 @@ export default { | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       // add the previous user, if any, in the previous user list (in use for suggestion) | ||||
|       if (null !== this.$store.getters.getMainUser) { | ||||
|         const suggestedUids = new Set(this.$data.previousUser.map(u => u.id)); | ||||
|         if (!suggestedUids.has(this.$store.getters.getMainUser.id)){ | ||||
|           this.$data.previousUser.push(this.$store.getters.getMainUser); | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       this.$store.dispatch('setMainUser', user); | ||||
|       this.$store.commit('showUserOnCalendar', {user, ranges: true, remotes: true}); | ||||
|     }, | ||||
|   | ||||
| @@ -202,6 +202,8 @@ export default { | ||||
|  | ||||
|     return dispatch('associateCalendarToRange', { range: null }).then(() => { | ||||
|       commit('setMainUser', mainUser); | ||||
|  | ||||
|       return dispatch('fetchCalendarEvents'); | ||||
|     }); | ||||
|   }, | ||||
|  | ||||
|   | ||||
| @@ -54,7 +54,7 @@ export const mapEntity = (entity: EventInput): EventInput => { | ||||
|  | ||||
| export const createUserData = (user: User, colorIndex: number): UserData  => { | ||||
|   const colorId = colorIndex % COLORS.length; | ||||
|   console.log('colorId', colorId); | ||||
|  | ||||
|   return { | ||||
|     user: user, | ||||
|     calendarRanges: [], | ||||
|   | ||||
| @@ -9,13 +9,13 @@ | ||||
| {% block js %} | ||||
|     {{ parent() }} | ||||
|     {{ encore_entry_script_tags('mod_answer') }} | ||||
|     {{ encore_entry_script_tags('mod_async_upload') }} | ||||
|     {{ encore_entry_script_tags('mod_document_action_buttons_group') }} | ||||
| {% endblock %} | ||||
|  | ||||
| {% block css %} | ||||
|     {{ parent() }} | ||||
|     {{ encore_entry_link_tags('mod_answer') }} | ||||
|     {{ encore_entry_link_tags('mod_async_upload') }} | ||||
|     {{ encore_entry_link_tags('mod_document_action_buttons_group') }} | ||||
| {% endblock %} | ||||
|  | ||||
| {% block content %} | ||||
|   | ||||
 Submodule tests/app updated: 5b35e7ccd0...5e478fdfbf
									
								
							
		Reference in New Issue
	
	Block a user