From cfb9bec6c6a5c60233478dce928a333790a5a4b2 Mon Sep 17 00:00:00 2001 From: sheshankarvapally Date: Wed, 22 Apr 2026 16:15:55 +1000 Subject: [PATCH 1/4] Investigate config dependencies and clean up legacy root-controller usage --- src/app/config/config.coffee | 2 +- src/app/config/root-controller/root-controller.coffee | 1 + src/app/config/routing/routing.coffee | 1 + src/app/config/runtime/runtime.coffee | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/config/config.coffee b/src/app/config/config.coffee index b7699efbf5..29d0059ba8 100644 --- a/src/app/config/config.coffee +++ b/src/app/config/config.coffee @@ -4,7 +4,7 @@ # # 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' diff --git a/src/app/config/root-controller/root-controller.coffee b/src/app/config/root-controller/root-controller.coffee index 4a9854fc0e..346752bb23 100644 --- a/src/app/config/root-controller/root-controller.coffee +++ b/src/app/config/root-controller/root-controller.coffee @@ -6,3 +6,4 @@ angular.module('doubtfire.config.root-controller', []) .controller("AppCtrl", (GlobalStateService) -> ) + \ No newline at end of file diff --git a/src/app/config/routing/routing.coffee b/src/app/config/routing/routing.coffee index 0091a888a7..82e64b668a 100644 --- a/src/app/config/routing/routing.coffee +++ b/src/app/config/routing/routing.coffee @@ -11,3 +11,4 @@ angular.module('doubtfire.config.routing', []) # TODO: (@alexcu) probably change it to map to /dashboard at some point. $urlRouterProvider.when "/", "/home" ) + \ No newline at end of file diff --git a/src/app/config/runtime/runtime.coffee b/src/app/config/runtime/runtime.coffee index b5b9f95f0d..cf1bef937c 100644 --- a/src/app/config/runtime/runtime.coffee +++ b/src/app/config/runtime/runtime.coffee @@ -1,6 +1,6 @@ # # Runtime settings for when Doubtfire is about to launch -# +# angular.module('doubtfire.config.runtime', []) .run(($rootScope, $state, $filter, $location, authenticationService, editableOptions, editableThemes, $transitions) -> From a928450d22e5572b8093f2502828f1c0e96f9a7e Mon Sep 17 00:00:00 2001 From: sheshankarvapally Date: Wed, 6 May 2026 08:45:23 +1000 Subject: [PATCH 2/4] refactor: investigate AngularJS config dependency cleanup for Angular 17 migration --- src/app/config/config.coffee | 16 ------- .../root-controller/root-controller.coffee | 9 ---- src/app/config/routing/routing.coffee | 14 ------ src/app/config/runtime/runtime.coffee | 47 ------------------- src/app/doubtfire-angularjs.module.ts | 10 ++-- src/index.html | 2 +- 6 files changed, 6 insertions(+), 92 deletions(-) delete mode 100644 src/app/config/config.coffee delete mode 100644 src/app/config/root-controller/root-controller.coffee delete mode 100644 src/app/config/routing/routing.coffee delete mode 100644 src/app/config/runtime/runtime.coffee diff --git a/src/app/config/config.coffee b/src/app/config/config.coffee deleted file mode 100644 index 29d0059ba8..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 346752bb23..0000000000 --- a/src/app/config/root-controller/root-controller.coffee +++ /dev/null @@ -1,9 +0,0 @@ -angular.module('doubtfire.config.root-controller', []) - -# -# The Doubtfire root application controller -# -.controller("AppCtrl", (GlobalStateService) -> - -) - \ No newline at end of file diff --git a/src/app/config/routing/routing.coffee b/src/app/config/routing/routing.coffee deleted file mode 100644 index 82e64b668a..0000000000 --- a/src/app/config/routing/routing.coffee +++ /dev/null @@ -1,14 +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" -) - \ No newline at end of file diff --git a/src/app/config/runtime/runtime.coffee b/src/app/config/runtime/runtime.coffee deleted file mode 100644 index cf1bef937c..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..5fe4b7674e 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/index.html b/src/index.html index af609f230c..72d1cf66b9 100644 --- a/src/index.html +++ b/src/index.html @@ -52,7 +52,7 @@ rel="stylesheet" /> - +
From ffde53a8b3c48ea8c65eca5e8f54caf661bd2424 Mon Sep 17 00:00:00 2001 From: sheshankarvapally Date: Wed, 6 May 2026 14:36:32 +1000 Subject: [PATCH 3/4] fix(upload-submission-modal): migrate modal service to uibModal --- .../upload-submission-modal/upload-submission-modal.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' From 4fd0c5a0a2f159b89b8aac190bb38b2989ed1aad Mon Sep 17 00:00:00 2001 From: sheshankarvapally Date: Wed, 6 May 2026 16:37:44 +1000 Subject: [PATCH 4/4] Fix duplicate comma in module dependencies --- src/app/doubtfire-angularjs.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/doubtfire-angularjs.module.ts b/src/app/doubtfire-angularjs.module.ts index 5fe4b7674e..dc66e047e7 100644 --- a/src/app/doubtfire-angularjs.module.ts +++ b/src/app/doubtfire-angularjs.module.ts @@ -244,7 +244,7 @@ export const DoubtfireAngularJSModule = angular 'doubtfire.config.vendor-dependencies', 'doubtfire.config.analytics', 'doubtfire.config.debug', -'doubtfire.config.privacy-policy',, +'doubtfire.config.privacy-policy', 'doubtfire.sessions', 'doubtfire.common', 'doubtfire.errors',