App-Dochazka-WWW

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.111  2014-09-24 08:03 CEST
- restore basic change password functionality

0.112  2014-09-24 10:21 CEST
- redesign changePassword dialog - it now asks for confirmation, but the
  password is still displayed on-screen (ick!)

0.113  2014-09-24 11:55 CEST
- emp-lib.js: when password change is saved successfully, display "Password
  changed" message instead of "Employee profile updated"

0.114  2014-09-24 16:41 CEST
- js/: migrate lots of employee profile code from previous incarnation
- status: new employee functionality works as long as non-ASCII characters
  are not entered; when non-ASCII characters are entered, the REST server
  inserts the employee properly but 500 Internal Server Error is returned
  because Plack::MiddleWare::Lint detects wide characters in the entity
  body (unknown ATM whether request or response)

0.115  2014-09-25 09:27 CEST

Changes  view on Meta::CPAN


0.135 2016-09-25 10:01 CEST
- build/ops: require REST 0.546 and MFILE::WWW 0.144

0.136 2016-09-25 12:03 CEST
- dform-init.js: add status, statusSince empProfile entries
- js: drop dispEmployee target
- Make "My profile" display "Status" and "Status since"
- Rename empProfileEdit target to empProfileEditRemark
- emp-lib.js: separate myProfile function
- Make "Edit remark" display updated employee profile

0.137 2016-09-25 21:47 CEST
- Fix hook in empProfileEditRemark
- Rip out password change feature
- Fix "My profile" + Masquerade mode
- Replace "newEmployee" target with "ldapLookup"
- Replace "newEmplSubmit" with "ldapLookupSubmit"
- Rip out "insertEmployee" target
- Implement "LDAP lookup" feature
- Provide masquerade option if LDAP lookup succeeds

share/js/dochazka-www/caches.js  view on Meta::CPAN

            }
            eid = parseInt(profileObj.emp.eid, 10);
            nick = String(profileObj.emp.nick);
            console.log("setProfileCache() EID, nick", eid, nick);
            console.log(profileCache.length + " objects in profileCache");
            for (i = 0; i < profileCache.length; i += 1) {
                cacheEID = parseInt(profileCache[i].emp.eid, 10);
                if (eid === cacheEID) {
                    cached = true;
                    profileCache[i] = $.extend(profileCache[i], profileObj);
                    console.log("Employee " + nick + ": profile cache updated");
                    profileObj = profileCache[i];
                }
            }
            if (! cached) {
                profileCache.push($.extend({}, profileObj));
                coreLib.displayResult("Employee " + nick + ": profile cache created");
            }
            profileByEID[eid] = $.extend({}, profileObj);
            profileByNick[nick] = $.extend({}, profileObj);
        }

share/js/dochazka-www/emp-lib.js  view on Meta::CPAN

                    parentTarget = stack.getTarget(-1);
                    console.log("parentTarget", parentTarget);
                    empObj = Object.create(prototypes.empObject);
                    $.extend(empObj, st.payload);
                    if (parentTarget.name === 'empProfile') {
                        console.log("Employee object is", empObj);
                        currentUser('obj', empObj);
                        appCaches.setProfileCache({"emp": empObj});
                        stack.unwindToTarget(
                            'myProfileAction', undefined,
                            {"resultLine": "Employee profile updated"}
                        );
                    } else if (parentTarget.name === 'simpleEmployeeBrowser') {
                        console.log("Parent target is " + parentTarget.name);
                        console.log("current object in dbrowerState set",
                                    coreLib.dbrowserState.set[coreLib.dbrowserState.pos]);
                        $.extend(
                            coreLib.dbrowserState.set[coreLib.dbrowserState.pos],
                            empObj,
                        );
                        stack.pop(undefined, {"resultLine": "Employee profile updated"});
                    } else {
                        console.log("FATAL ERROR: unexpected parent target", parentTarget);
                    }
                },
                fc = function (st) {
                    console.log("AJAX: " + rest["path"] + " failed with", st);
                    coreLib.displayError(st.payload.message);
                };
            ajax(rest, sc, fc);
        },

share/js/dochazka-www/ldap-lib.js  view on Meta::CPAN

                    }
                    stackTarget = stack.getTarget().name;
                    console.log("Detected target ' + stackTarget + ' on top of stack");
                    if (stackTarget === 'ldapDisplayEmployee') {
                        ldapEmployeeLink();
                    } else if (stackTarget === 'simpleEmployeeBrowser') {
                        // FIXME: this code belongs in App::MFILE::WWW
                        bo = coreLib.dbrowserState.set[coreLib.dbrowserState.pos];
                        $.extend(coreLib.dbrowserState.obj, ldapEmployeeObject);
                        $.extend(bo, ldapEmployeeObject);
                        start.dbrowserListen("Employee profile updated from LDAP");
                    } else if (stackTarget === 'empProfile') {
                        stack.restart(
                            $.extend(ldapEmp, ldapEmployeeObject),
                            {"resultLine": "Employee profile updated from LDAP"},
                        );
                    }
                },
                // failure callback -- employee doesn't exist
                fc = function (st) {
                    var err = st.payload.code,
                        msg;
                    if (err === '404') {
                        msg = 'Employee ' + ldapEmp.nick + ' not found in LDAP';
                    } else {

share/js/dochazka-www/tests/main-empl.js  view on Meta::CPAN

                // $('input[name="sel"]').focus();
                // start.mmKeyListener($.Event("keydown", {keyCode: 13}));
                // assert.ok(true, "*** REACHED pressed 0 for LDAP sync");
                done();
            }, 3000);
            setTimeout(function () {
                // ct.contains(
                //     assert,
                //     $('#result').html(),
                //     "#result html",
                //     "Employee profile updated from LDAP",
                // );
                ct.stack(
                    assert,
                    4,
                    'in simpleEmployeeBrowser dbrowser',
                    'dbrowser',
                    'simpleEmployeeBrowser'
                );
                $('input[name="sel"]').val('x');
                $('input[name="sel"]').focus();



( run in 0.344 second using v1.01-cache-2.11-cpan-05444aca049 )