forked from EVOgeek/Vmeda.Online
		
	MOBILE-3833 data: Hide All participants with visible groups
This commit is contained in:
		
							parent
							
								
									604e866943
								
							
						
					
					
						commit
						9c2116c33b
					
				| @ -218,6 +218,12 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); |         this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); | ||||||
|  |         if (this.groupInfo.visibleGroups && this.groupInfo.groups?.length) { | ||||||
|  |             // There is a bug in Moodle with All participants and visible groups (MOBILE-3597). Remove it.
 | ||||||
|  |             this.groupInfo.groups = this.groupInfo.groups.filter(group => group.id !== 0); | ||||||
|  |             this.groupInfo.defaultGroupId = this.groupInfo.groups[0].id; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); |         this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); | ||||||
| 
 | 
 | ||||||
|         this.access = await AddonModData.getDatabaseAccessInformation(this.database.id, { |         this.access = await AddonModData.getDatabaseAccessInformation(this.database.id, { | ||||||
|  | |||||||
| @ -174,6 +174,12 @@ export class AddonModDataEditPage implements OnInit { | |||||||
| 
 | 
 | ||||||
|                 if (refresh) { |                 if (refresh) { | ||||||
|                     this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); |                     this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); | ||||||
|  |                     if (this.groupInfo.visibleGroups && this.groupInfo.groups?.length) { | ||||||
|  |                         // There is a bug in Moodle with All participants and visible groups (MOBILE-3597). Remove it.
 | ||||||
|  |                         this.groupInfo.groups = this.groupInfo.groups.filter(group => group.id !== 0); | ||||||
|  |                         this.groupInfo.defaultGroupId = this.groupInfo.groups[0].id; | ||||||
|  |                     } | ||||||
|  | 
 | ||||||
|                     this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); |                     this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); | ||||||
|                     this.initialSelectedGroup = this.selectedGroup; |                     this.initialSelectedGroup = this.selectedGroup; | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -174,6 +174,12 @@ export class AddonModDataEntryPage implements OnInit, OnDestroy { | |||||||
|             this.access = await AddonModData.getDatabaseAccessInformation(this.database.id, { cmId: this.moduleId }); |             this.access = await AddonModData.getDatabaseAccessInformation(this.database.id, { cmId: this.moduleId }); | ||||||
| 
 | 
 | ||||||
|             this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); |             this.groupInfo = await CoreGroups.getActivityGroupInfo(this.database.coursemodule); | ||||||
|  |             if (this.groupInfo.visibleGroups && this.groupInfo.groups?.length) { | ||||||
|  |                 // There is a bug in Moodle with All participants and visible groups (MOBILE-3597). Remove it.
 | ||||||
|  |                 this.groupInfo.groups = this.groupInfo.groups.filter(group => group.id !== 0); | ||||||
|  |                 this.groupInfo.defaultGroupId = this.groupInfo.groups[0].id; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|             this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); |             this.selectedGroup = CoreGroups.validateGroupId(this.selectedGroup, this.groupInfo); | ||||||
| 
 | 
 | ||||||
|             const actions = AddonModDataHelper.getActions(this.database, this.access, this.entry!); |             const actions = AddonModDataHelper.getActions(this.database, this.access, this.entry!); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user