-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MessagesStorage & RequestStorage #4
base: master
Are you sure you want to change the base?
Conversation
See also related pull request. |
Awesome! 👍 |
src/Application/IMessagesStorage.php
Outdated
* Checks if a flash session namespace exists. | ||
* @return bool | ||
*/ | ||
function isOpened(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK it should be isOpen()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually should be hasMessages()
anything else is misleading.
Great work! :) |
src/Application/IMessagesStorage.php
Outdated
|
||
|
||
/** | ||
* Checks if a flash session namespace exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment assumes implementation will use session.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true and it should be changed. But storing flash messages into another storage than sessions is quite problematic, because you have to handle, that no one can see another user's messages. Sessions gives you this for free.
What is the reason for refactoring two different functionalities in one pull? |
@mishak87 you should take a breath, calm down and think before you write. |
@mishak87 @rostenkowski I have already did a review, you are just copying my notes ;) |
@mishak87 My goal was to separate |
@fprochazka Next time write what I did wrong instead of how you think I should handle myself which is extremely rude. @MartinMajor Such note would be very helpful in the description As Majkl always reminds people don't force push pulls it messes up comments. |
@mishak87 I think it's extremely rude to push people into doing work that is not neccesary. For example telling them to separate code to two pullrequests if it's already separated by commits. FYI pullrequests are meant to be forcepushed in. |
@fprochazka Nobody is rushing anyone. I asked a simple question and got an answer. Your little tantrums are OT. What pull requests mean or not I do consult only The Spaghetti Monster. |
…essageStorage service (thanks to Filip Prochazka)
…stStorage service; restoreRequest() redirects to original URL
I've renamed |
I don't know what problem is with FLASH_KEY in IMessageStorage. FLASH_KEY in Presenter has to be for back compatibility. |
@MartinMajor Name of the key is related to routing or presenter. Storage should not know about it. |
@mishak87 And where would you put that constant? In Presenter? So all services, that need to use it (e.g. RequestStorage) had to have dependency on Presenter? |
*/ | ||
public function getMessages($id = NULL) | ||
{ | ||
return $this->getSession()->$id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably here should by (array)
I think it is great. The only little bit confusing thing is mixing terms message vs flash. |
@MartinMajor To sum it up. I think this is step forward. But there is still missing what I would call bluntly layer for embedding non presenter related parameters into url (set of interfaces or events). If you try separating flash message functionality into own package you would see the issues. IMO flash message is Web 1.0 concept and should be done away completely. It does not help with UX issues and offers only limiting functionality to user. User can't react on it. Some Nette projects modify its behavior, because they are lazy to write its own component. Or just for translating text. Final solution should enable creation of more featured replacements. Icons, links, buttons, templating etc. |
Now I think that MessageStorage is over-engeneered :-) Because it is not about "messages" and it's doubled $id in setId() and setMessage() is confusing and very closely tighted to components in presenter. In fact, MessageStorage is just storage for any values. It can become FlashStorage, And This pull should therefore look like dg@0147db4 |
Another thing: is it really needed to have REQUEST_KEY and FLASH_KEY in URL together? |
@dg: ok, as I wrote above, my main goal was to refactor RequestStorage, so I have nothing against TabStorage. |
e3d05b3
to
929a242
Compare
426e735
to
c19ebdc
Compare
2b9da37
to
30d90f4
Compare
bf86204
to
c91f90a
Compare
57bd587
to
e908315
Compare
c5ecbda
to
ecb200c
Compare
This pull request separates flash messages into new service MessagesStorage. It also separates store & restore requests into new service RequestStorage. This new service redirects to original URL when restoring old requests.