Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Convert Week Goodie to Structured Template, update tests #950

Closed
wants to merge 4 commits into from

Conversation

moollaza
Copy link
Member

Fixes #712.

My only thought is that I've kinda "abused" the operation to provide a subtitle. I tried a few permutation where I properly indicated the operation and input but in every case it looked repetitive and ugly.

//cc @jagtalon @mintsoft @gsquire @javathunderman

2015-01-22_19h01_30


The triggering could be relaxed a bit, but I think that's an issue for another day. Someone from the community is welcome to tackle that ;)

@MrChrisW
Copy link
Collaborator

@moollaza Will be good to see this finally released into the wild 🌵

One thing I've noticed is the use of the simple past tense began for dates in the future, this seems incorrect. Can a conditional statement to change wording be added?

Edit: Actually I've just looked at the triggers and it's incorrect, "what was the 6th week of 2016" shouldn't trigger "what is the 6th week of 2016" should. Guessing that's what you mean by:

The triggering could be relaxed a bit, but I think that's an issue for another day.

Current
selection_105

Suggestions:
selection_107
selection_108
selection_109

return $response,
structured_answer => {
input => [],
operation => "Assuming the week starts on Monday",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could support this as a mechanism if we just change structured answers to have "subtitle" instead of "operation" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mintsoft I agree, but on a very awesome note, we already have a working demo of Goodies passing along data to the frontend (in an almost identical fashion to Spice's passing an object to Spice.add())

Once that's available I suspect we'll be able to port Goodies to use that approach where we'd have "title", "subtitle" etc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@javathunderman
Copy link
Collaborator

@moollaza @MrChrisW Nice to see this moving. Just a question, what is the status on the other "release goodie" issues? Can they be put up?

@moollaza
Copy link
Member Author

@MrChrisW really good find regarding the trigger/word tense. I'll see if I can fix that up

@moollaza
Copy link
Member Author

@javathunderman I'll run through them to see if any need updating. We should be able to launch the ones that don't.

@moollaza
Copy link
Member Author

Should be fixed now!

@javathunderman
Copy link
Collaborator

@moollaza Great!

@mintsoft
Copy link
Collaborator

@moollaza the tests are failing across the board on this PR, I'm guessing it's something else that's done it though?

@MrChrisW
Copy link
Collaborator

@mintsoft Travis is failing to include Goodie.pm so all tests are currently failing. I was going to lodge an issue but I think @moollaza is aware of it.

@javathunderman
Copy link
Collaborator

@MrChrisW Yikes. When is that going to be fixed?

@moollaza
Copy link
Member Author

@MrChrisW @mintsoft not sure why that error is happening again, same thing happens for Spice on Travis as well. But all the tests for week are passing locally. Feel free to verify and merge :)

@moollaza
Copy link
Member Author

Should be fixed now, also added "when" to triggers so we can handle grammatically correct questions for future dates

@gsquire
Copy link
Collaborator

gsquire commented Jan 30, 2015

@moollaza Thanks for seeing this through. I have gotten pretty busy with school. Great job! :)

@MrChrisW
Copy link
Collaborator

@moollaza Tested and working! 👍
One last small thing ..... Should it be displaying dates in the future 5th week of 2018 with a query like "what was the" ?

@jagtalon
Copy link
Member

@moollaza In the case where we're in the current week of the year, it would still say it in the past tense:

screen shot 2015-01-30 at 3 59 24 am

CC @abeyang what do you think of the look? Pretty standard though. :)

@jagtalon
Copy link
Member

I wonder if we should add the end day too? Probably not important--I'm not the target audience of this goodie. :) Works pretty well! Fails when I put in "what was the 5th week of 0000", though:

screen shot 2015-01-30 at 4 04 49 am

@jagtalon
Copy link
Member

Also fails when I put in "what was the 0 week of 2011":

screen shot 2015-01-30 at 4 06 20 am

@jagtalon
Copy link
Member

Another one with "what was the 99th week of 2011"--sorry for all the comments!

@MrChrisW
Copy link
Collaborator

@jagtalon Damn nice catch! image

The $yearneeds to validated (between1900 to 2099) before feeding it to Monday_of_Week and ensure the week is between a valid range also!

@jagtalon
Copy link
Member

@MrChrisW thanks! How do you know that we need to limit it to 1900 and 2099? It looks like it's working for the year 1100 for me (and correct too)

@MrChrisW
Copy link
Collaborator

@jagtalon I was just trying to think of a reasonable/useful range 😄
Turns out Date::Calc supports 1 to the largest positive integer representable on your system (at least 32767)!!!

@moollaza
Copy link
Member Author

@jagtalon good catch! Will fix. Verifying years sounds like another good helper function. Maybe we should add one to the dates role?
/cc @mintsoft

@javathunderman
Copy link
Collaborator

Seems like I have called attention to this.

Mission accomplished. I'm going to work on some other goodies that have to be released.

@mintsoft
Copy link
Collaborator

@moollaza IIRC there's already a regex for the years within the role; it probably just needs wrapping with a getter

@javathunderman
Copy link
Collaborator

@moollaza Seems like this has taken a back seat- any update?

@moollaza
Copy link
Member Author

Sorry guys, I've been busy dealing with other new IA's and bugs -- I'll get to this eventually. If anyone else wants to finish it up, you're welcome to do so!

@mintsoft
Copy link
Collaborator

@moollaza I'll see if I can slot it in this weeked; I'll probably supplant some year validation into the DatesRole and then use it here

@mintsoft mintsoft self-assigned this Apr 10, 2015
@javathunderman
Copy link
Collaborator

ping @mintsoft

@mintsoft
Copy link
Collaborator

mintsoft commented Jul 6, 2015

@javathunderman Apologies; I've been moving house so I've not really had the time! Hopefully, now I'm all done I can dig something up.

@javathunderman
Copy link
Collaborator

@mintsoft No problem!

@mintsoft mintsoft closed this Jul 31, 2015
@mintsoft
Copy link
Collaborator

Highjacked in: #1348

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reviving the "Week" Goodie
6 participants