diff --git a/src/app/config/config.coffee b/src/app/config/config.coffee deleted file mode 100644 index b7699efbf5..0000000000 --- a/src/app/config/config.coffee +++ /dev/null @@ -1,16 +0,0 @@ -# -# The Doubtfire configuration module stores all configuration settings -# for Doubtfire loaded at runtime. -# -# The order in which the modules load here is IMPORTANT so do not rearrange -# them -# -angular.module('doubtfire.config', [ - 'doubtfire.config.vendor-dependencies' - 'doubtfire.config.routing' - 'doubtfire.config.analytics' - 'doubtfire.config.runtime' - 'doubtfire.config.root-controller' - 'doubtfire.config.debug' - 'doubtfire.config.privacy-policy' -]) diff --git a/src/app/config/root-controller/root-controller.coffee b/src/app/config/root-controller/root-controller.coffee deleted file mode 100644 index 4a9854fc0e..0000000000 --- a/src/app/config/root-controller/root-controller.coffee +++ /dev/null @@ -1,8 +0,0 @@ -angular.module('doubtfire.config.root-controller', []) - -# -# The Doubtfire root application controller -# -.controller("AppCtrl", (GlobalStateService) -> - -) diff --git a/src/app/config/routing/routing.coffee b/src/app/config/routing/routing.coffee deleted file mode 100644 index 0091a888a7..0000000000 --- a/src/app/config/routing/routing.coffee +++ /dev/null @@ -1,13 +0,0 @@ -angular.module('doubtfire.config.routing', []) -# -# Configuration for angular routing -# -.config(($urlRouterProvider, $httpProvider) -> - # Catch bad URLs. - # $urlRouterProvider.otherwise "/not_found" - $urlRouterProvider.when "", "/" - - # Map root/home URL to a default state of our choosing. - # TODO: (@alexcu) probably change it to map to /dashboard at some point. - $urlRouterProvider.when "/", "/home" -) diff --git a/src/app/config/runtime/runtime.coffee b/src/app/config/runtime/runtime.coffee deleted file mode 100644 index b5b9f95f0d..0000000000 --- a/src/app/config/runtime/runtime.coffee +++ /dev/null @@ -1,47 +0,0 @@ -# -# Runtime settings for when Doubtfire is about to launch -# -angular.module('doubtfire.config.runtime', []) - -.run(($rootScope, $state, $filter, $location, authenticationService, editableOptions, editableThemes, $transitions) -> - # Angular xeditable - editableOptions.theme = 'bs3' - editableThemes.bs3.inputClass = 'input-sm' - editableThemes.bs3.buttonsClass = 'btn-sm' - - handleUnauthorisedDest = (toState) -> - if authenticationService.isAuthenticated() - $state.go "unauthorised" - else if $state.current.name isnt "sign_in" - $state.go "sign_in" - - handleTokenTimeout = -> - if $state.current.name isnt "timeout" - $state.go "timeout" - - handleUnauthorised = -> - handleUnauthorisedDest($state.current) - - # Don't let the user see pages not intended for their role - - # Redirect the user if they make an unauthorised API request - $rootScope.$on "unauthorisedRequestIntercepted", handleUnauthorised - - # Redirect the user if their token expires - $rootScope.$on("tokenTimeout", handleTokenTimeout) - - # Watch for state transition and check role whitelist - $transitions.onStart {}, (trans) -> - toState = trans.to() - return true unless toState.data.roleWhitelist - - # Get the auth service to check this when the auth is complete - authenticationService.afterAuthCall( - (isAuthenticated) -> - unless isAuthenticated && authenticationService.isAuthorised(toState.data.roleWhitelist) - handleUnauthorisedDest(toState) - ) - - # We can always transition... but may have to redirect after auth call... - return true -) diff --git a/src/app/doubtfire-angularjs.module.ts b/src/app/doubtfire-angularjs.module.ts index ca57426fd2..dc66e047e7 100644 --- a/src/app/doubtfire-angularjs.module.ts +++ b/src/app/doubtfire-angularjs.module.ts @@ -51,10 +51,7 @@ import 'build/src/app/tasks/task-ilo-alignment/modals/task-ilo-alignment-modal/t import 'build/src/app/tasks/task-ilo-alignment/task-ilo-alignment-editor/task-ilo-alignment-editor.js'; import 'build/src/app/tasks/task-ilo-alignment/task-ilo-alignment-viewer/task-ilo-alignment-viewer.js'; import 'build/src/app/config/privacy-policy/privacy-policy.js'; -import 'build/src/app/config/runtime/runtime.js'; -import 'build/src/app/config/config.js'; -import 'build/src/app/config/root-controller/root-controller.js'; -import 'build/src/app/config/routing/routing.js'; + import 'build/src/app/config/vendor-dependencies/vendor-dependencies.js'; import 'build/src/app/config/analytics/analytics.js'; import 'build/src/app/config/debug/debug.js'; @@ -244,7 +241,10 @@ import {TutorNotesComponent} from './projects/states/tutor-notes/tutor-notes.com export const DoubtfireAngularJSModule = angular .module('doubtfire', [ - 'doubtfire.config', + 'doubtfire.config.vendor-dependencies', +'doubtfire.config.analytics', +'doubtfire.config.debug', +'doubtfire.config.privacy-policy', 'doubtfire.sessions', 'doubtfire.common', 'doubtfire.errors', diff --git a/src/app/tasks/modals/upload-submission-modal/upload-submission-modal.coffee b/src/app/tasks/modals/upload-submission-modal/upload-submission-modal.coffee index a310b31abf..50ab144e28 100644 --- a/src/app/tasks/modals/upload-submission-modal/upload-submission-modal.coffee +++ b/src/app/tasks/modals/upload-submission-modal/upload-submission-modal.coffee @@ -3,7 +3,7 @@ angular.module('doubtfire.tasks.modals.upload-submission-modal', []) # # A modal to run through uploading a submission # -.factory('UploadSubmissionModal', ($modal, alertService) -> +.factory('UploadSubmissionModal', ($uibModal, alertService) -> UploadSubmissionModal = {} # # Open a grade task modal with the provided task @@ -20,7 +20,7 @@ angular.module('doubtfire.tasks.modals.upload-submission-modal', []) # task.project = -> project task.isTestSubmission = isTestSubmission - $modal.open + $uibModal.open templateUrl: 'tasks/modals/upload-submission-modal/upload-submission-modal.tpl.html' controller: 'UploadSubmissionModalCtrl' size: 'lg' diff --git a/src/index.html b/src/index.html index af609f230c..72d1cf66b9 100644 --- a/src/index.html +++ b/src/index.html @@ -52,7 +52,7 @@ rel="stylesheet" /> -
+