Tangerine-Community / Tangerine

Digitize your offline data collection. Create your Forms online with Tangerine Editor, conduct them offline with the Tangerine Android App. All results you collect can be exported as a CSV file, easy for processing in a spreadsheet. Tangerine has been used in over 1 million assessments and surveys in over 60 countries and in 100 languages.
http://www.tangerinecentral.org/
GNU General Public License v3.0
48 stars 30 forks source link

Tangerine v3.0.0 Application Shell #244

Closed rjcorwin closed 7 years ago

rjcorwin commented 7 years ago

Code: https://github.com/Tangerine-Community/Tangerine/tree/v3.x.x/client-v3

Related User Stories

To do

rjcorwin commented 7 years ago

We should take a deep look at Ionic. It seems to be very well supported soup to nuts framework using a lot of the same ingredients we are looking to brew together. The catch with Ionic might be is that the Angular team might be making tools that could soon dwarf Ionic's tooling. For example, Ionic's CLI vs the new officially supported Angular CLI.

rjcorwin commented 7 years ago

From Ionic's v2.0.0 announcement on Jan 25, 2017:

Ionic 2.0 final is hardly the end of Ionic’s development. Coming next we are working on new features to add proper desktop and electron support, something we’ve dipped our toes into in the past but will be making a bigger priority going forward. Similarly, we will be ramping up our Progressive Web App efforts to enable Ionic developers to deploy the same app with the same code across the app stores and the mobile web to take advantage of those diverse channels.

An Angular server is coming in Angular 4. This is pushing the best practice of having your frontend served on a frontend server with a separate backend service. It puts the pressure on us to write separate Dockerfile's for frontend and backend while strapping it together with a Docker Compose file. The original motivation was to improve build times.

jwaldermo commented 7 years ago

Links to good sites for this discussion.docx

The above document has some great links for this discussion.

rjcorwin commented 7 years ago

Ionic brings a lot to the table. Here's a couple notes thinking about those things and comparing them to other things.

rjcorwin commented 7 years ago

I been thinking about what the Unique Selling Proposition (USP) of Ionic is. Last year I think it went as follows...

  1. Angular doesn't have a standard way of compiling the application and so everyone uses starter projects. Ionic is the most extensive Angular starter project for mobile, it even builds to Android/iOS apps by configuring Cordova for you.
  2. Ionic Components are the most feature complete set of Angular Components for Mobile. Especially if your requirement is that the components are themed to look native according to the target platform you build for.

Today I have have reservations about those USPs.

On the first USP, Angular now has supported Angular CLI which provides the best practices for starting an Angular Application, building it, mind blowing generators, test harness, and amazing upgrade path tools. Going with Ionic means we don't get to use Angular CLI (for now, maybe in the future). Ionic has their own opinions about how an app should be structured, for example they don't use the Angular Router. The one thing that Ionic CLI has over Angular CLI is that Ionic CLI can build to APK out of the box. Building to APK after a Angular CLI build requires setting up Cordova yourself.

On the second USP, Ionic Components are cool, but Angular Material is equally if not even more cool than Ionic Components (https://material.angularjs.org/). There seems to be a real solid commitment to Angular Material, some great best practices (like using wrapper elements over native tags), and it works great on both Desktop format, Tablet, and mobile. While Ionic Components are now also targeting the Desktop format, I'm not sure they are going to as good of a job of making a UI library that work well on both Mobile and Desktop as the Google has done with Material.

rjcorwin commented 7 years ago

A note on installing Material, angular-cli has its own doc page for installing Material. The thing I think that page does differently than the standard Material docs is that it imports all of the Material components with one require. That's probably just going to result in a dist size that is much larger than necessary.

rjcorwin commented 7 years ago

Angular Material has been added to our client-v3 codebase with this commit https://github.com/Tangerine-Community/Tangerine/commit/d0d2a1a30c4f87ad71521e1eb40fe831d55afb88

rjcorwin commented 7 years ago

Researching databases and auth...

rjcorwin commented 7 years ago

Modular Router is now in client-v3.

rjcorwin commented 7 years ago

Updated this ticket's summary with the following and some more things to do.

Code: https://github.com/Tangerine-Community/Tangerine/tree/v3.x.x/client-v3

rjcorwin commented 7 years ago

For reference, the [i18n] plans for v4 and beyond issue. Olivier mentions "looking at possible solutions, using an external file is one of them." Which would I think make it easier for us to serve the use case of needing to update translations quickly without having to wait for another release of Tangerine.

evansdianga commented 7 years ago
rjcorwin commented 7 years ago

My current directions for starting Test Driven Development on a Component by Component basis.

  1. Generate module
  2. Generate component
  3. Modify spec file to import Component's module and not declare the component.
  4. Modify the component's tests from using it function to using fit function.
  5. Run ng test.
  6. Click DEBUG.
  7. Open developer tools.
  8. Start development of that component.

Also see https://aio-staging.firebaseapp.com/guide/testing#import-the-feature-module for examples of things like fixture.debugElement.query(By.css('input')).nativeElement.

rjcorwin commented 7 years ago

Here's an example of a more advanced Component Spec where we feed it data and then check to make sure that the DOM of the component is as expected https://github.com/Tangerine-Community/Tangerine/blob/v3.x.x--tangerine-forms/client-v3/src/app/tangerine-forms/tangerine-page/tangerine-page.component.spec.ts

rjcorwin commented 7 years ago

@evansdianga The test spec for Tangerine Page Component now simulates adding input to a form, submitting it, and then makes sure that corresponding @Output matches what we would expect. There is a click function used that is taken directly from the docs and requires passing in the "nativeElement" I think. We're getting closer to the level of testing complexity we want but still have things to learn from https://aio-staging.firebaseapp.com/guide/testing.

evansdianga commented 7 years ago

@rjsteinert Angular documentation currently points towards using SystemJS as a module loader. This is especially true for the documentation on i18n. Our configuration uses Webpack. Digging through the various configuration options, docs for Webpack is missing not only for the i18n but for most parts of Angular. Check this open issue for details. https://github.com/angular/angular.io/issues/3163 Another option with Webpack is to use this method. https://medium.com/@feloy/deploying-an-i18n-angular-app-with-angular-cli-fc788f17e358 Integrating this configuration into our app may solve the issue. Any thoughts?

rjcorwin commented 7 years ago

@evansdianga That blog post looks helpful. To supplement that post, the angular-cli wiki might have more up to date information. Keeping an eye on this search result might help https://github.com/angular/angular-cli/search?q=i18n&type=Wikis&utf8=%E2%9C%93

The pages relevant to use I think are these.

rjcorwin commented 7 years ago

I added documentation on how to do TDD with Angular Units Tests when creating Components https://github.com/Tangerine-Community/Tangerine/blob/v3.x.x/docs/how-to-create-a-new-component.md.

I also got Travis CI working correctly thanks to @chrisekelley https://travis-ci.org/Tangerine-Community/Tangerine/builds/240416270

I also started setting up Greenskeeper.io so it will send us pull requests when we have a package that needs updating. I integrated it with the Tangerine repository but I can't seem to find a way to show that the package.json it needs to care about lives at client-v3/package.json.