From: Laurence Maultsby Date: Thu, 23 Mar 2017 15:25:23 +0000 (-0400) Subject: Removed mock data from project, user, and platform role sources X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=c5950910c89bba8bbd1809258a7a56c9c09c2261;p=osm%2FUI.git Removed mock data from project, user, and platform role sources Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/project_management/src/dashboard/projectMgmtSource.js b/skyquake/plugins/project_management/src/dashboard/projectMgmtSource.js index 72fc2d3c7..ce0c984fe 100644 --- a/skyquake/plugins/project_management/src/dashboard/projectMgmtSource.js +++ b/skyquake/plugins/project_management/src/dashboard/projectMgmtSource.js @@ -13,9 +13,6 @@ if (DEV_MODE) { } -let Projects = mockProjects(); -let Users = mockUsers(); - module.exports = function(Alt) { return { @@ -23,9 +20,6 @@ module.exports = function(Alt) { getUsers: { remote: function() { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(Users); - // }, 1000); $.ajax({ url: `/user?api_server=${API_SERVER}`, type: 'GET', @@ -49,9 +43,6 @@ module.exports = function(Alt) { getProjects: { remote: function() { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(Projects); - // }, 1000) $.ajax({ url: `/project?api_server=${API_SERVER}`, type: 'GET', @@ -99,9 +90,6 @@ module.exports = function(Alt) { deleteProject: { remote: function(state, project) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/project/${project['name']}?api_server=${API_SERVER}`, type: 'DELETE', @@ -126,9 +114,6 @@ module.exports = function(Alt) { remote: function(state, project) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/project?api_server=${API_SERVER}`, type: 'POST', @@ -166,61 +151,3 @@ function interceptResponse (responses) { } } -function mockProjects() { - let data = []; - let count = 10; - for(let i = 0; i < 3; i++) { - data.push({ - name: `Test Project ${i}`, - description: 'Some description', - roles: ['Some-Role', 'Some-Other-Role'], - users: [ - { - 'user-name': 'Some-User', - 'user-domain': 'system', - role: [ - { - 'role': 'Some-Role', - 'key-set' : 'some key' - }, - { - 'role': 'Some-Other-Role', - 'key-set' : 'some key' - } - ] - }, - { - 'user-name': 'Some-User', - 'user-domain': 'system', - role: [ - { - 'role': 'Some-Role', - 'key-set' : 'some key' - } - ] - } - ] - }) - } - return data; -} -function mockUsers() { - let data = []; - let count = 10; - for(let i = 0; i < 10; i++) { - data.push({ - 'user-name': `Tester ${i}`, - 'user-domain': 'Some Domain', - platformRoles: { - super_admin: true, - platform_admin: false, - platform_oper: false - }, - disabled: false, - projectRoles: [ - 'Project:Role' - ] - }) - } - return data; -} diff --git a/skyquake/plugins/user_management/src/dashboard/userMgmtSource.js b/skyquake/plugins/user_management/src/dashboard/userMgmtSource.js index 7bccc6658..a5c62429c 100644 --- a/skyquake/plugins/user_management/src/dashboard/userMgmtSource.js +++ b/skyquake/plugins/user_management/src/dashboard/userMgmtSource.js @@ -13,7 +13,6 @@ if (DEV_MODE) { } -let Users = mockUsers(); module.exports = function(Alt) { @@ -21,9 +20,6 @@ module.exports = function(Alt) { getUsers: { remote: function() { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(Users); - // }, 1000) $.ajax({ url: `/user?api_server=${API_SERVER}`, type: 'GET', @@ -81,9 +77,6 @@ module.exports = function(Alt) { deleteUser: { remote: function(state, user) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/user/${user['user-name']}/${user['user-domain']}?api_server=${API_SERVER}`, type: 'DELETE', @@ -114,9 +107,6 @@ module.exports = function(Alt) { remote: function(state, user) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/user?api_server=${API_SERVER}`, type: 'POST', @@ -159,23 +149,3 @@ function interceptResponse (responses) { } } -function mockUsers() { - let data = []; - let count = 10; - for(let i = 0; i < 10; i++) { - data.push({ - username: `Tester ${i}`, - domain: 'Some Domain', - platformRoles: { - super_admin: true, - platform_admin: false, - platform_oper: false - }, - disabled: false, - projectRoles: [ - 'Project:Role' - ] - }) - } - return data; -} diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js index 0327e86e2..ad6e818ee 100644 --- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js +++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js @@ -13,9 +13,6 @@ if (DEV_MODE) { } -let Projects = mockProjects(); -let Users = mockUsers(); - module.exports = function(Alt) { return { @@ -23,9 +20,6 @@ module.exports = function(Alt) { getUsers: { remote: function() { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(Users); - // }, 1000); $.ajax({ url: `/user?api_server=${API_SERVER}`, type: 'GET', @@ -54,9 +48,6 @@ module.exports = function(Alt) { getPlatform: { remote: function() { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(Projects); - // }, 1000) $.ajax({ url: `/platform?api_server=${API_SERVER}`, type: 'GET', @@ -114,9 +105,6 @@ module.exports = function(Alt) { deleteProject: { remote: function(state, project) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/project/${project['name']}?api_server=${API_SERVER}`, type: 'DELETE', @@ -146,9 +134,6 @@ module.exports = function(Alt) { remote: function(state, project) { return new Promise(function(resolve, reject) { - // setTimeout(function() { - // resolve(true); - // }, 1000) $.ajax({ url: `/project?api_server=${API_SERVER}`, type: 'POST', @@ -191,61 +176,3 @@ function interceptResponse (responses) { } } -function mockProjects() { - let data = []; - let count = 10; - for(let i = 0; i < 3; i++) { - data.push({ - name: `Test Project ${i}`, - description: 'Some description', - roles: ['Some-Role', 'Some-Other-Role'], - users: [ - { - 'user-name': 'Some-User', - 'user-domain': 'system', - role: [ - { - 'role': 'Some-Role', - 'key-set' : 'some key' - }, - { - 'role': 'Some-Other-Role', - 'key-set' : 'some key' - } - ] - }, - { - 'user-name': 'Some-User', - 'user-domain': 'system', - role: [ - { - 'role': 'Some-Role', - 'key-set' : 'some key' - } - ] - } - ] - }) - } - return data; -} -function mockUsers() { - let data = []; - let count = 10; - for(let i = 0; i < 10; i++) { - data.push({ - 'user-name': `Tester ${i}`, - 'user-domain': 'Some Domain', - platformRoles: { - super_admin: true, - platform_admin: false, - platform_oper: false - }, - disabled: false, - projectRoles: [ - 'Project:Role' - ] - }) - } - return data; -}