krico / jas

Janes Asmussen Szarmach
3 stars 1 forks source link

Every activity action requires organizations.query #541

Open wszarmach opened 9 years ago

wszarmach commented 9 years ago

This is only a question! When changing to the activities screen the front end will call organizations.query two times Switching to a different organization will also result in a organizations.query call Adding or Editing an activity results in a organizations.query call.

Perhaps the current organization could be cached on the front end? Note that this call returns all organizations.

krico commented 9 years ago

Caching on frontend is a very good optimization! It is not trivial when it comes to updates and signing out...

I think with ui-router it could be easier

dragonflypl commented 9 years ago

With ui-router it is piece of cake. Nested states + resolves that depend on each other address many common scenarios. But in this case, this is because we cause full reload (it was implemented like that from the beginning) and change URL so it has organization id:

        function organizationSelected(organization) {
            $location.path('/admin/activities/' + organization.id);
        }

I don't know if this is really needed? Would people bookmark urls with organizations or try to send them to other users?

dragonflypl commented 9 years ago

Anyway, some time ago I suggested that we wait with ui-router because AngularJS 1.4 would have new router. But it was removed from 1.4 roadmap and won't be available:

There were two features that were pulled out of the 1.4 release. The component helper (#10007) and the component oriented hierarchical router. The main reason for this decision was that both of these deliverables were not ready for the important task of simplifying the migration path from Angular 1 to Angular 2. Rather than delay the 1.4 release further, we decided to move these two deliverables into the 1.5 release.

krico commented 9 years ago

I am a big fan of having the url for navigation. Not a big fan on reloading...

Is not only about copy paste, but also about history, reloading if ur session timed out, search engines, etc On Di., 23. Juni 2015 at 20:35 Paweł notifications@github.com wrote:

Anyway, some time ago I suggested that we wait with ui-router because AngularJS 1.4 would have new router. But it was removed from 1.4 roadmap and won't be available:

There were two features that were pulled out of the 1.4 release. The component helper (#10007) and the component oriented hierarchical router. The main reason for this decision was that both of these deliverables were not ready for the important task of simplifying the migration path from Angular 1 to Angular 2. Rather than delay the 1.4 release further, we decided to move these two deliverables into the 1.5 release.

— Reply to this email directly or view it on GitHub https://github.com/krico/jas/issues/541#issuecomment-114602138.

dragonflypl commented 9 years ago

Good arguments, especially with with history. So what is the plan, switching to ui-router or caching manually, eg. with https://docs.angularjs.org/api/ng/service/$cacheFactory ?