llaske / sugarizer-server

Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server.
Apache License 2.0
42 stars 92 forks source link

Page navigation problem on language switching #142

Closed ashish0910 closed 4 years ago

ashish0910 commented 5 years ago

After switching the language the reload takes place and forgets the query of the user and redirects to default situation which is not good .

Example :

ezgif com-video-to-gif

Similar behaviour takes place in case of journal also .

ashish0910 commented 5 years ago

I have started working on this issue .

NikhilM98 commented 5 years ago

I think this is the expected result. Retaining the query data can give rise to unexpected bugs.

ashish0910 commented 5 years ago

@NikhilM98 I don't think it is a good idea . It will have a very bad impact on user experience . for example if you have set 3-4 parameters such as name , sort and classroom and then you change the language , it will delete all the queries and will show default result and then user will have to set all those parameters . @llaske what are your views on it ?

NikhilM98 commented 5 years ago

@ashish0910 To fix this, you've to check the query string on language change, search for the language parameter in the string, and adjust it accordingly retaining the other parameters. But this will cause the user to make the GET request twice on the route with the same parameters. This may have undesirable consequences in certain cases. This may also lead to other bugs in the future.

NikhilM98 commented 5 years ago

I cannot locate this issue in the Journal View. Can you please upload the screenshot?

ashish0910 commented 5 years ago

ezgif com-video-to-gif

ashish0910 commented 5 years ago

@ashish0910 To fix this, you've to check the query string on language change, search for the language parameter in the string, and adjust it accordingly retaining the other parameters. But this will cause the user to make the GET request twice on the route with the same parameters. This may have undesirable consequences in certain cases. This may also lead to other bugs in the future.

@NikhilM98 we might need some other way to handle this issue .

llaske commented 4 years ago

Fixed in https://github.com/llaske/sugarizer-server/commit/888e37593a5f8ec669aac1f4aeea82e09b48112d