Merge pull request #3565 from alfonso-salces/MOBILE-4077
Mobile 4077 - Open in browser
This commit is contained in:
		
						commit
						e20f2c9f8f
					
				| @ -23,8 +23,11 @@ import { | |||||||
| import { IonRefresher } from '@ionic/angular'; | import { IonRefresher } from '@ionic/angular'; | ||||||
| import { CoreNavigator } from '@services/navigator'; | import { CoreNavigator } from '@services/navigator'; | ||||||
| import { CoreScreen } from '@services/screen'; | import { CoreScreen } from '@services/screen'; | ||||||
|  | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreDomUtils } from '@services/utils/dom'; | import { CoreDomUtils } from '@services/utils/dom'; | ||||||
|  | import { CoreTextErrorObject } from '@services/utils/text'; | ||||||
| import { CoreUtils } from '@services/utils/utils'; | import { CoreUtils } from '@services/utils/utils'; | ||||||
|  | import { Translate } from '@singletons'; | ||||||
| import { BehaviorSubject, Observable } from 'rxjs'; | import { BehaviorSubject, Observable } from 'rxjs'; | ||||||
| import { map } from 'rxjs/operators'; | import { map } from 'rxjs/operators'; | ||||||
| 
 | 
 | ||||||
| @ -111,8 +114,33 @@ export class CoreReportBuilderReportDetailComponent implements OnInit { | |||||||
|             }); |             }); | ||||||
| 
 | 
 | ||||||
|             this.onReportLoaded.emit(report.details); |             this.onReportLoaded.emit(report.details); | ||||||
|         } catch (err) { |         } catch { | ||||||
|             await CoreDomUtils.showErrorModal(err); |             const errorConfig: CoreTextErrorObject = { | ||||||
|  |                 title: Translate.instant('core.error'), | ||||||
|  |                 body: ` | ||||||
|  |                     <p>${Translate.instant('addon.mod_page.errorwhileloadingthepage')}</p> | ||||||
|  |                     <p>${Translate.instant('core.course.useactivityonbrowser')}</p> | ||||||
|  |                 `,
 | ||||||
|  |                 buttons: [ | ||||||
|  |                     { | ||||||
|  |                         text: Translate.instant('core.cancel'), | ||||||
|  |                         role: 'cancel', | ||||||
|  |                         handler: async () => await CoreNavigator.back(), | ||||||
|  |                     }, | ||||||
|  |                     { | ||||||
|  |                         text: Translate.instant('core.openinbrowser'), | ||||||
|  |                         role: 'confirm', | ||||||
|  |                         handler: async () => { | ||||||
|  |                             const site = CoreSites.getRequiredCurrentSite(); | ||||||
|  |                             const href = `${site.getURL()}/reportbuilder/view.php?id=${this.reportId}`; | ||||||
|  |                             await CoreUtils.openInBrowser(href, { showBrowserWarning: false }); | ||||||
|  |                             await CoreNavigator.back(); | ||||||
|  |                         }, | ||||||
|  |                     }, | ||||||
|  |                 ], | ||||||
|  |             }; | ||||||
|  | 
 | ||||||
|  |             await CoreDomUtils.showErrorModal(errorConfig); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -39,8 +39,8 @@ | |||||||
|         <ion-label> |         <ion-label> | ||||||
|             <p> |             <p> | ||||||
|                 <ion-icon name="fas-info-circle" aria-hidden="true"></ion-icon> |                 <ion-icon name="fas-info-circle" aria-hidden="true"></ion-icon> | ||||||
|                 <core-format-text [text]="'core.reportbuilder.filtersapplied' | translate: { $a: reportUrl }" [filter]="false" |                 <core-format-text [text]="'core.reportbuilder.filtersapplied' | translate: { $a: reportUrl }" [filter]="false"> | ||||||
|                     [clean]="true"></core-format-text> |                 </core-format-text> | ||||||
|             </p> |             </p> | ||||||
|         </ion-label> |         </ion-label> | ||||||
|     </ion-item> |     </ion-item> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user