Fixes app.dev to not include ui.sortable. Fixes server vars mocks to have an entry for dashboardApiBaseUrl, adds dashboard.mocks to not throw an exception when trying access that data.

This commit is contained in:
Shannon
2013-09-05 14:54:40 +10:00
parent 038780614c
commit 0b1cad7687
5 changed files with 34 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ var app = angular.module('umbraco', [
'umbraco.httpbackend',
'ngCookies',
'ngMobile',
'ui.sortable',
/*'ui.sortable',*/
'blueimp.fileupload'
]);

View File

@@ -0,0 +1,24 @@
angular.module('umbraco.mocks').
factory('dashboardMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) {
'use strict';
function getDashboard(status, data, headers) {
//check for existence of a cookie so we can do login/logout in the belle app (ignore for tests).
if (!mocksUtils.checkAuth()) {
return [401, null, null];
}
else {
//TODO: return real mocked data
return [200, [], null];
}
}
return {
register: function() {
$httpBackend
.whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Dashboard/GetDashboard'))
.respond(getDashboard);
}
};
}]);

View File

@@ -1,7 +1,7 @@
var umbracoAppDev = angular.module('umbraco.httpbackend', ['umbraco', 'ngMockE2E', 'umbraco.mocks']);
function initBackEnd($httpBackend, contentMocks, mediaMocks, treeMocks, userMocks, contentTypeMocks, sectionMocks, entityMocks, dataTypeMocks) {
function initBackEnd($httpBackend, contentMocks, mediaMocks, treeMocks, userMocks, contentTypeMocks, sectionMocks, entityMocks, dataTypeMocks, dashboardMocks) {
console.log("httpBackend inited");
@@ -11,7 +11,7 @@ function initBackEnd($httpBackend, contentMocks, mediaMocks, treeMocks, userMock
sectionMocks.register();
treeMocks.register();
dataTypeMocks.register();
dashboardMocks.register();
userMocks.register();
contentTypeMocks.register();

View File

@@ -14,7 +14,8 @@ Umbraco.Sys.ServerVariables = {
"authenticationApiBaseUrl": "/umbraco/UmbracoApi/Authentication/",
//For this we'll just provide a file that exists during the mock session since we don't really have legay js tree stuff
"legacyTreeJs": "/belle/lib/yepnope/empty.js",
"entityApiBaseUrl": "/umbraco/UmbracoApi/Entity/"
"entityApiBaseUrl": "/umbraco/UmbracoApi/Entity/",
"dashboardApiBaseUrl" : "/umbraco/UmbracoApi/Dashboard/"
},
umbracoSettings: {
"umbracoPath": "/umbraco",