Avoid navigation on blocked projects

stable
Daniel García 2018-11-23 09:08:23 +01:00 committed by Alex Hermida
parent e89cf91654
commit 6232555a75
1 changed files with 6 additions and 1 deletions

View File

@ -780,7 +780,8 @@ i18nInit = (lang, $translate) ->
init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService,
loaderService, navigationBarService, errorHandlingService, lightboxService, $tgConfig) -> loaderService, navigationBarService, errorHandlingService, lightboxService, $tgConfig,
projectService) ->
$log.debug("Initialize application") $log.debug("Initialize application")
$rootscope.$on '$translatePartialLoaderStructureChanged', () -> $rootscope.$on '$translatePartialLoaderStructureChanged', () ->
@ -869,6 +870,9 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
$rootscope.$on '$locationChangeStart', (event) -> $rootscope.$on '$locationChangeStart', (event) ->
errorHandlingService.init() errorHandlingService.init()
if projectService.project?.get('blocked_code')
errorHandlingService.block()
if lightboxService.getLightboxOpen().length if lightboxService.getLightboxOpen().length
event.preventDefault(); event.preventDefault();
@ -1001,5 +1005,6 @@ module.run([
"tgErrorHandlingService", "tgErrorHandlingService",
"lightboxService", "lightboxService",
"$tgConfig", "$tgConfig",
"tgProjectService",
init init
]) ])