* TOONODE support when already logged in

* Work on new user / NUA flow
* Various cleanup
This commit is contained in:
Bryan Ashby 2015-10-15 23:41:24 -06:00
parent a5c2e6f50b
commit d02d9e4a7c
6 changed files with 125 additions and 74 deletions

View File

@ -7,6 +7,7 @@ var ansi = require('./ansi_term.js');
var userDb = require('./database.js').dbs.user;
var async = require('async');
var _ = require('lodash');
exports.login = login;
exports.logoff = logoff;
@ -48,13 +49,30 @@ function login(callingMenu, formData, extraArgs) {
'Already logged in'
);
// :TODO: display custom message if present (Obv/2: TOONODE.ANS)
client.term.write('\nA user by that name is already logged in.\n');
client.term.rawWrite(ansi.resetScreen());
setTimeout(function timeout() {
client.gotoMenuModule( { name : callingMenu.menuConfig.fallback } );
}, 500);
var tooNodeArt;
if(_.has(callingMenu, 'menuConfig.config.tooNodeArt')) {
tooNodeArt = callingMenu.menuConfig.config.tooNodeArt;
} else {
tooNodeArt = 'TOONODE';
}
var artOpts = {
client : client,
font : callingMenu.menuConfig.font,
name : tooNodeArt,
};
theme.displayThemeArt(artOpts, function artDisplayed(err) {
if(err) {
client.term.write('\nA user by that name is already logged in.\n');
}
setTimeout(function timeout() {
client.fallbackMenuModule();
}, 2000);
});
return;
}

View File

@ -117,8 +117,11 @@
login2: {
art: USERLOG
next: messageArea
//"next" : "fullLoginSequenceLoginArt",
//next: messageArea
next: fullLoginSequenceLoginArt
config: {
tooNodeArt: TOONODE
}
form: {
0: {
mci: {
@ -246,7 +249,7 @@
}
newUserFeedbackToSysOpPreamble: {
art: NUAFDBK
art: LETTER
options: { pause: true }
next: newUserFeedbackToSysOp
extraArgs: {
@ -257,7 +260,9 @@
newUserFeedbackToSysOp: {
status: Feedback to SysOp
module: msg_area_post_fse
fallback: mainMenu
// :TODO: If the user is auto-approved, login seq. else, DONE.ANS -> Logoff
// :TODO: client.nextOrFallback(): go next or fallback. Use in MenuModule base also
fallback: fullLoginSequenceLoginArt
config: {
art: {
header: MSGEHDR
@ -273,65 +278,57 @@
0: {
mci: {
TL1: {
width: 27
argName: from
}
ET2: {
width: 27
argName: to
focus: true
argName: to
focus: true
text: @config:general.sysOp.username
// :TODO: readOnly: true
}
ET3: {
width: 27
argName: subject
maxLength: 72
submit: true
text: New user feedback
},
"MA5" : {
"width" : 27,
"textOverflow" : "..."
}
}
submit: {
3: [
{
"value" : { "subject" : null },
"action" : "@method:headerSubmit"
value: { subject: null }
action: @method:headerSubmit
}
]
}
}
"1" : {
"mci" : {
1: {
mci: {
MT1: {
width: 79
height: 14
argName: `
mode: edit
width: 79
argName: message
mode: edit
}
}
submit: {
*: [ { "value": "message", "action": "@method:editModeEscPressed" } ]
},
"actionKeys" : [
*: [ { value: "message", action: "@method:editModeEscPressed" } ]
}
actionKeys: [
{
"keys" : [ "escape" ],
"viewId" : 1
keys: [ "escape" ]
viewId: 1
}
]
},
"2" : {
"TLTL" : {
"mci" : {
"TL1" : {
"width" : 5
},
"TL2" : {
"width" : 4
2: {
TLTL: {
mci: {
TL1: {
width: 5
}
TL2: {
width: 4
}
}
}
@ -340,7 +337,8 @@
HM: {
mci: {
HM1: {
items: [ "Save", "Discard", "Help" ]
// :TODO: clear
items: [ "save", "help" ]
}
}
submit: {
@ -351,10 +349,6 @@
}
{
value: { 1: 1 }
action: @systemMethod:fallbackMenu
}
{
value: { 1: 2 }
action: @method:editModeMenuHelp
}
]
@ -373,29 +367,26 @@
}
}
}
"fullLoginSequenceLoginArt" : {
"art" : "LOGIN",
"options" : { "pause" : true },
"next" : "fullLoginSequenceLastCallers"
},
"fullLoginSequenceLastCallers": {
"module" : "last_callers",
"art" : "LASTCALL",
"options" : { "pause" : true },
"config" : {
"dateTimeFormat" : "ddd MMM Do h:mm a"
},
"next" : "fullLoginSequenceSysStats"
},
"fullLoginSequenceSysStats" : {
"art" : "SYSSTAT",
"options" : { "pause" : true },
"next" : "fullLoginSequenceUserStats"
},
"fullLoginSequenceUserStats" : {
fullLoginSequenceLoginArt: {
art: LOGIN
options: { pause: true }
next: fullLoginSequenceLastCallers
}
fullLoginSequenceLastCallers: {
module: last_callers
art: LASTCALL
options: { pause: true }
next: fullLoginSequenceSysStats
}
fullLoginSequenceSysStats: {
art: SYSSTAT
options: { pause: true }
next: fullLoginSequenceUserStats
}
fullLoginSequenceUserStats: {
art: STATUS
"options" : { "pause" : true },
"next" : "mainMenu"
options: { pause: true }
next: mainMenu
},
"newUserActive" : {
"art" : "SO-CC1.ANS",
@ -516,10 +507,14 @@
value: { command: "Q" }
action: @menu:mainMenu
}
{
value: { command: "G" }
action: @menu:logoff
}
{
value: 1
action: @menu:messageArea
}
}
]
}
messageAreaChangeCurrentArea: {
@ -854,10 +849,10 @@
}
}
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
"messageAreaNewPost" : {
"status" : "Posting message",
"module" : "msg_area_post_fse",
"fallback" : "messageArea", // :TODO: remove once default fallback is in place
messageAreaNewPost: {
status: Posting message,
module: msg_area_post_fse
//"fallback" : "messageArea", // :TODO: remove once default fallback is in place
config: {
art: {
header: MSGEHDR
@ -865,10 +860,10 @@
footerEditor: MSGEFTR
footerEditorMenu: MSGEMFT
help: MSGEHLP
},
}
editorMode: edit
editorType: area
},
}
form: {
0: {
mci: {

Binary file not shown.

Binary file not shown.

View File

@ -44,6 +44,21 @@
}
}
newUserFeedbackToSysOp: {
0: {
mci: {
TL1: { width: 19, textOverflow: "..." }
ET2: { width: 19, textOverflow: "..." }
ET3: { width: 19, textOverflow: "..." }
}
}
1: {
mci: {
MT1: { height: 14 }
}
}
}
login2: {
mci: {
ET1: { width: 14 }
@ -162,6 +177,29 @@
}
}
}
fullLoginSequenceLastCallers: {
config: {
dateTimeFormat: MMM Do H:mm a
}
}
fullLoginSequenceSysStats: {
}
fullLoginSequenceUserStats: {
mci: {
UN1: { width: 17 }
UR2: { width: 17 }
LO3: { width: 17 }
UF4: { width: 17 }
UG5: { width: 17 }
UT6: { width: 17 }
UC7: { width: 17 }
}
}
}
}
}