Merge lp:~blake-rouse/maas/fix-1581318-1.9 into lp:maas/1.9

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 4578
Proposed branch: lp:~blake-rouse/maas/fix-1581318-1.9
Merge into: lp:maas/1.9
Diff against target: 103 lines (+33/-19)
2 files modified
src/maasserver/static/js/angular/maas.js (+18/-6)
src/maasserver/templates/maasserver/js-conf.html (+15/-13)
To merge this branch: bzr merge lp:~blake-rouse/maas/fix-1581318-1.9
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+295740@code.launchpad.net

Commit message

Append version to templateUrl in maas.js angular code.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Self-approving for backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/js/angular/maas.js'
2--- src/maasserver/static/js/angular/maas.js 2015-09-30 05:38:27 +0000
3+++ src/maasserver/static/js/angular/maas.js 2016-05-25 15:55:48 +0000
4@@ -13,6 +13,12 @@
5 $interpolateProvider.startSymbol('{$');
6 $interpolateProvider.endSymbol('$}');
7
8+ // Helper that wrappers the templateUrl to append the files version
9+ // to the path. Used to override client cache.
10+ function versionedPath(path) {
11+ return path + "?v=" + MAAS_config.files_version;
12+ }
13+
14 // Setup routes only for the index page, all remaining pages should
15 // not use routes. Once all pages are converted to using Angular this
16 // will go away. Causing the page to never have to reload.
17@@ -24,27 +30,33 @@
18 if(path === href) {
19 $routeProvider.
20 when('/nodes', {
21- templateUrl: 'static/partials/nodes-list.html',
22+ templateUrl: versionedPath(
23+ 'static/partials/nodes-list.html'),
24 controller: 'NodesListController'
25 }).
26 when('/node/:system_id', {
27- templateUrl: 'static/partials/node-details.html',
28+ templateUrl: versionedPath(
29+ 'static/partials/node-details.html'),
30 controller: 'NodeDetailsController'
31 }).
32 when('/node/:system_id/result/:filename', {
33- templateUrl: 'static/partials/node-result.html',
34+ templateUrl: versionedPath(
35+ 'static/partials/node-result.html'),
36 controller: 'NodeResultController'
37 }).
38 when('/node/:system_id/events', {
39- templateUrl: 'static/partials/node-events.html',
40+ templateUrl: versionedPath(
41+ 'static/partials/node-events.html'),
42 controller: 'NodeEventsController'
43 }).
44 when('/subnets', {
45- templateUrl: 'static/partials/subnets-list.html',
46+ templateUrl: versionedPath(
47+ 'static/partials/subnets-list.html'),
48 controller: 'SubnetsListController'
49 }).
50 when('/subnet/:subnet_id', {
51- templateUrl: 'static/partials/subnet-details.html',
52+ templateUrl: versionedPath(
53+ 'static/partials/subnet-details.html'),
54 controller: 'SubnetDetailsController'
55 }).
56 otherwise({
57
58=== modified file 'src/maasserver/templates/maasserver/js-conf.html'
59--- src/maasserver/templates/maasserver/js-conf.html 2015-11-12 16:13:05 +0000
60+++ src/maasserver/templates/maasserver/js-conf.html 2016-05-25 15:55:48 +0000
61@@ -1,16 +1,3 @@
62-<script type="text/javascript"
63- src="{% url "merge" filename="jquery.js" %}?v={{files_version}}">
64-</script>
65-<script type="text/javascript"
66- src="{% url "merge" filename="angular.js" %}?v={{files_version}}">
67-</script>
68-<script type="text/javascript"
69- src="{% url "merge" filename="ng-tags-input.js" %}?v={{files_version}}">
70-</script>
71-<script type="text/javascript"
72- src="{% url "merge" filename="maas-angular.js" %}?v={{files_version}}">
73-</script>
74-
75 <script type="text/javascript">
76 <!--
77 var YUI_config = {
78@@ -30,10 +17,25 @@
79 account_handler: '{% url "account_handler" %}',
80 images_handler: '{% url "images" %}'
81 },
82+ files_version: '{{files_version}}',
83 debug: {% if YUI_DEBUG %}true{% else %}false{% endif %}
84 };
85 // -->
86 </script>
87+
88+<script type="text/javascript"
89+ src="{% url "merge" filename="jquery.js" %}?v={{files_version}}">
90+</script>
91+<script type="text/javascript"
92+ src="{% url "merge" filename="angular.js" %}?v={{files_version}}">
93+</script>
94+<script type="text/javascript"
95+ src="{% url "merge" filename="ng-tags-input.js" %}?v={{files_version}}">
96+</script>
97+<script type="text/javascript"
98+ src="{% url "merge" filename="maas-angular.js" %}?v={{files_version}}">
99+</script>
100+
101 <script type="text/javascript"
102 src="{% url "merge" filename="yui.js" %}?v={{files_version}}">
103 </script>

Subscribers

People subscribed via source and target branches