Skip to content

Commit

Permalink
Merge pull request #13 from eapearson/master
Browse files Browse the repository at this point in the history
Code cleanup, integration of latest auth2 service changes
  • Loading branch information
eapearson authored Apr 18, 2017
2 parents 9cf0912 + 8d970ed commit 9de1c14
Show file tree
Hide file tree
Showing 41 changed files with 1,505 additions and 449 deletions.
38 changes: 38 additions & 0 deletions .vscode/formatter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"onSave": true,
"javascript": {
"indent_size": 4,
"indent_char": " ",
"eol": "auto",
"preserve_newlines": true,
"break_chained_methods": false,
"max_preserve_newlines": 0,
"space_in_paren": false,
"space_in_empty_paren": false,
"jslint_happy": false,
"space_after_anon_function": true,
"keep_array_indentation": false,
"space_before_conditional": true,
"unescape_strings": false,
"wrap_line_length": 0,
"e4x": false,
"end_with_newline": false,
"comma_first": false,
"brace_style": "collapse-preserve-inline"
},
"css": {
"indent_size": 4,
"indentCharacter": " ",
"indent_char": " ",
"selector_separator_newline": true,
"end_with_newline": false,
"newline_between_rules": true,
"eol": "\n"
},
"html": {
"indent_inner_html": false,
"indent_size": 4,
"indent_char": " ",
"indent_character": " "
}
}
29 changes: 23 additions & 6 deletions src/plugin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ install:
id: auth2Info
type: factory
-
module: login
id: auth2Login
module: signin
id: auth2Signin
css: true
type: factory
-
Expand All @@ -36,8 +36,8 @@ install:
id: auth2Account
type: factory
-
module: loginWidget
id: auth2_login
module: signinWidget
id: auth2_signin
type: factory
-
module: linkContinue
Expand All @@ -63,15 +63,28 @@ install:
module: signedout
id: auth2_signedout
type: factory
-
module: interrupted
id: auth2_interrupted
type: factory
-
module: logout
id: auth2_logout
type: factory
routes:
# -
# path: ['auth2', 'info']
# widget: auth2Info
# queryParams:
# nextrequest: {}
-
path: ['auth2', 'login']
widget: auth2Login
path: ['login']
widget: auth2Signin
queryParams:
nextrequest: {}
-
path: ['logout']
widget: auth2Logout
queryParams:
nextrequest: {}
-
Expand Down Expand Up @@ -112,6 +125,10 @@ install:
path: ['auth2', 'signedout']
widget: auth2_signedout
authorization: false
-
path: ['auth2', 'interrupted']
widget: auth2_interrupted
authorization: false

menu:
# -
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 13 additions & 9 deletions src/plugin/modules/account/components/userInfoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define([
p([
'The username associates your account with the Narratives, data, ',
'and applications you create within KBase. It is also recorded with internal log files ',
'and other records to assist in providing run-time services, metrics and suppport.'
'and other records to assist in providing services, metrics and suppport.'
])
])
},
Expand Down Expand Up @@ -58,8 +58,8 @@ define([
]),
more: div([
p([
'When you create your profile, ',
'you will be able to add additional information, including title, suffix, and affiliations. '
'In your profile, ',
'you have the option to add additional information, including title, suffix, and affiliations. '
]),
p([
'Your name will be displayed in any context within the KBase in which you are identified. ',
Expand All @@ -73,12 +73,16 @@ define([
type: 'text',
placeholder: 'Your E-Mail Address',
description: span([
'Your email address may be used by KBase staff to contact you. ',
'It will not be displayed to other users.'
'Your email address may be used by KBase staff to contact you. '
]),
more: div([
p([
'This email address is'
'The email address will not be displayed to other users. ',
'It will only be used to contact you in case of issues relating to your account, ',
'data, applications, or jobs. '
]),
p([
'At a future time it may be used to provide account recovery in case of loss of access to your account.'
])
])
}
Expand Down Expand Up @@ -198,12 +202,12 @@ define([
class: 'row'
}, [
div({
class: 'col-md-6'
},
class: 'col-md-6'
}, [
div({
dataBind: 'text: ' + (field.vmId || field.name)
})
),
]),
div({
class: 'col-md-6'
}, [
Expand Down
18 changes: 9 additions & 9 deletions src/plugin/modules/account/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,23 @@ define([
'kb_common/bootstrapUtils',
'./personalInfoEditorKO',
'./linksManager',
'./rolesManagerKO',
'./developerManager',
'./tokenManager',
'./developerTokenManager',
'./serviceTokenManager',
'./agreementsManager',
'./signinManager'
], function(
$,
M_Html,
Html,
html,
BS,
PersonalInfoEditor,
LinksManager,
RolesManager,
DeveloperManager,
TokenManager,
DeveloperTokenManager,
ServiceTokenManager,
AgreementsManager,
SigninManager
) {
// var html = new M_Html.Html();
// var html = new Html.Html();
var // t = html.tagMaker(),
t = html.tag,
div = t('div'),
Expand Down Expand Up @@ -397,7 +391,13 @@ define([
});

runtime.send('ui', 'setTitle', 'Account Manager');
renderLayout(container, params);
try {
renderLayout(container, params);
} catch (ex) {
console.error('ERROR', ex);
// renderError(ex);
throw (ex);
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugin/modules/account/personalInfoEditorKO.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define([
var vm;


function render(id, vmMap) {
function render(id) {
var tabs = BS.buildTabs({
initialTab: 0,
tabs: [{
Expand Down
149 changes: 82 additions & 67 deletions src/plugin/modules/account/signinManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,23 @@ define([
}

function renderIntro() {
vm.intro.node.innerHTML = div({}, [
vm.intro.node.innerHTML = div({
style: {
maxWidth: '60em'
}
}, [
p([
'The "Sign-Ins" tab allows you to manage your current sign-ins. A sign-in is created when you ',
'sign in to KBase. Normally a sign-in is removed when you logout. However, if you do not create ',
' '
'A sign-in session is created when you ',
'sign in to KBase. Normally a sign-in is removed when you logout. ',
'However, if you do not logout, your sign-in session will remain active for two weeks.'
]),
p([
'The browser and operating system columns can help you locate the browser with which ',
'an active session is associated. If you have left the "keep me logged in" option checked ',
'when logging in, the browser will have a sign-in cookie lasting for two weeks, even if you ',
'close and re-open your browser. ',
'However, if you unselected the "keep me logged in" option your KBase browser cookie will be removed ',
'when your browser is exited.'
])
]);
}
Expand Down Expand Up @@ -186,77 +198,80 @@ define([
style: {
width: '20%'
}
}, 'System'),
}, 'Operating System'),
th({
style: {
width: '20%',
textAlign: 'right'
}
}, revokeAllButton)
])
].concat(vm.allTokens.value.map(function(token) {
console.log('token', token);
return tr([
td(format.niceTime(token.created)),
td(format.niceElapsedTime(token.expires)),
td((function() {
if (token.os === null || token.os.length === 0) {
return span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, 'n/a');
}
return span([
token.agent,
span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, token.agentver)
]);
}())),
td((function() {
if (token.os === null || token.os.length === 0) {
return span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, 'n/a');
}
return span([
token.os,
span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, token.osver)
]);
}())),
td({
style: {
textAlign: 'right'
}
}, button({
class: 'btn btn-danger',
type: 'button',
id: events.addEvent({
type: 'click',
handler: function() {
doRevokeToken(token.id);
].concat(vm.allTokens.value
.sort(function(a, b) {
return (a.created - b.created);
})
.map(function(token) {
return tr([
td(format.niceTime(token.created)),
td(format.niceElapsedTime(token.expires)),
td((function() {
if (token.os === null || token.os.length === 0) {
return span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, 'n/a');
}
})
}, 'Revoke'))
]);
})));
return span([
token.agent,
span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, token.agentver)
]);
}())),
td((function() {
if (token.os === null || token.os.length === 0) {
return span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, 'n/a');
}
return span([
token.os,
span({
style: {
fontStyle: 'italic',
marginLeft: '0.2em',
color: '#888'
}
}, token.osver)
]);
}())),
td({
style: {
textAlign: 'right'
}
}, button({
class: 'btn btn-danger',
type: 'button',
id: events.addEvent({
type: 'click',
handler: function() {
doRevokeToken(token.id);
}
})
}, 'Revoke'))
]);
})));
events.attachEvents();
}

Expand Down
Loading

0 comments on commit 9de1c14

Please sign in to comment.