Mulligan-Fund / grant-calculator

A better way to apply for Grants
https://mulligan-fund.github.io/grant-calculator/
0 stars 1 forks source link

Calculations not working on seeker side? #48

Closed dahnag closed 6 years ago

dahnag commented 6 years ago

I put in limited data on the seeker side (one team member, 2 or 3 activities) and clicked "show result." There were no results.

image

Are there required fields without which the calculations do not appear? If so, we need to indicate those and provide feedback to let users know which fields they need to complete before results will appear. If not, what's preventing the results from appearing?

lovettbarron commented 6 years ago

The maker calculations:


        makerCalcExpected: function(d) {
            console.log("d",d)
            return (d.amount_of_grants / d.number_of_grants) * (d.number_of_grants / d.number_of_applications)
        },

        makerProgramCost: function(progcost, grantcost) {
            return grantcost - progcost;
        },

and then those are combined in:

 var expect = _this.makerCalcExpected(t);
                        var cost = _this.calculateCost(hr)
                        var pcost = _this.makerProgramCost(cost, expect)
                        $('#expected').append("$"+ _this.addComma(expect.toFixed(2)))
                        $('#cost').append("$"+ _this.addComma(cost.toFixed(2)))
                        $('#total').append("$"+ _this.addComma(pcost.toFixed(2)))

So some are definitely required. We can indicate a field as "required" in the form (i.e. red) by just adding "required: yes" to the yaml under that section. Will take a stab at getting it in there.

dahnag commented 6 years ago

I'm happy to do it. How can I tell which fields are required by the calculator?

On Sun, Apr 29, 2018 at 5:32 AM, Andrew Lovett-Barron < notifications@github.com> wrote:

The maker calculations:

    makerCalcExpected: function(d) {
        console.log("d",d)
        return (d.amount_of_grants / d.number_of_grants) * (d.number_of_grants / d.number_of_applications)
    },

    makerProgramCost: function(progcost, grantcost) {
        return grantcost - progcost;
    },

and then those are combined in:

var expect = _this.makerCalcExpected(t); var cost = _this.calculateCost(hr) var pcost = _this.makerProgramCost(cost, expect) $('#expected').append("$"+ _this.addComma(expect.toFixed(2))) $('#cost').append("$"+ _this.addComma(cost.toFixed(2))) $('#total').append("$"+ _this.addComma(pcost.toFixed(2)))

So some are definitely required. We can indicate a field as "required" in the form (i.e. red) by just adding "required: yes" to the yaml under that section. Will take a stab at getting it in there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Mulligan-Fund/grant-calculator/issues/48#issuecomment-385238265, or mute the thread https://github.com/notifications/unsubscribe-auth/AeleKUyfXSmsf5SuI-Vi76S5u0eUgialks5ttYi7gaJpZM4TgO3H .

lovettbarron commented 6 years ago

ce2311d Accidentally committed w/ 42

lovettbarron commented 6 years ago

Ah, hunted down the actual error. It's tied to the salary calculation and undefined users.