mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Added optional --user-profile-url for opening user profile page in an external domain, it was hardcoded.
This commit is contained in:
parent
f5cb2f91c0
commit
e1a7560bc0
6 changed files with 21 additions and 22 deletions
10
lib/cli.js
10
lib/cli.js
|
@ -593,6 +593,9 @@ program
|
|||
.option('-w, --websocket-url <url>'
|
||||
, 'URL to websocket client'
|
||||
, String)
|
||||
.option('--user-profile-url <url>'
|
||||
, 'URL to external user profile page'
|
||||
, String)
|
||||
.option('-d, --disable-watch'
|
||||
, 'disable watching resources')
|
||||
.action(function(options) {
|
||||
|
@ -612,6 +615,7 @@ program
|
|||
, ssid: options.ssid
|
||||
, authUrl: options.authUrl
|
||||
, websocketUrl: options.websocketUrl
|
||||
, userProfileUrl: options.userProfileUrl
|
||||
, disableWatch: options.disableWatch
|
||||
})
|
||||
})
|
||||
|
@ -871,6 +875,9 @@ program
|
|||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.option('--user-profile-url <url>'
|
||||
, 'URL to external user profile page'
|
||||
, String)
|
||||
.action(function() {
|
||||
var log = logger.createLogger('cli:local')
|
||||
, args = arguments
|
||||
|
@ -965,6 +972,9 @@ program
|
|||
if (options.disableWatch) {
|
||||
extra.push('--disable-watch')
|
||||
}
|
||||
if (options.userProfileUrl) {
|
||||
extra.push('--user-profile-url', options.userProfileUrl)
|
||||
}
|
||||
return extra
|
||||
})()))
|
||||
|
||||
|
|
|
@ -111,6 +111,13 @@ module.exports = function(options) {
|
|||
}
|
||||
, user: req.user
|
||||
}
|
||||
|
||||
if (options.userProfileUrl) {
|
||||
state.config.userProfileUrl = (function () {
|
||||
return options.userProfileUrl
|
||||
})()
|
||||
}
|
||||
|
||||
res.type('application/javascript')
|
||||
res.send('var GLOBAL_APPSTATE = ' + JSON.stringify(state))
|
||||
})
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
module.exports = angular.module('stf/device/enhance-device', [
|
||||
require('stf/app-state').name
|
||||
])
|
||||
.factory('EnhanceDeviceService', require('./enhance-device-service'))
|
||||
|
|
|
@ -245,7 +245,7 @@ module.exports = function DeviceColumnService($filter, gettext) {
|
|||
return device.owner ? device.owner.name : ''
|
||||
}
|
||||
, link: function(device) {
|
||||
return device.owner ? device.enhancedUserContactUrl : ''
|
||||
return device.owner ? device.enhancedUserProfileUrl : ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,28 +1,9 @@
|
|||
module.exports = angular.module('stf.user-profile', [])
|
||||
.config(function ($routeProvider) {
|
||||
|
||||
// if CONFIG.externalProfileURL else show page
|
||||
var externalProfileURL = ''
|
||||
var templateString
|
||||
|
||||
if (!externalProfileURL) {
|
||||
templateString = require('./user.jade')
|
||||
}
|
||||
|
||||
$routeProvider
|
||||
.when('/user/:user*', {
|
||||
template: function (params) {
|
||||
console.log('params', params)
|
||||
if (externalProfileURL) {
|
||||
window.location.href = 'http://www.google.com';
|
||||
}
|
||||
|
||||
return '<div></div>'
|
||||
},
|
||||
controller: function () {
|
||||
|
||||
}
|
||||
template: require('./user.jade')
|
||||
})
|
||||
|
||||
})
|
||||
.controller('UserProfileCtrl', require('./user-controller'))
|
||||
|
|
|
@ -1 +1 @@
|
|||
h1 Hola
|
||||
h1 User
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue