From: Tiago Melo Date: Mon, 5 Feb 2018 18:26:33 +0000 (+0000) Subject: mgr/dashboard_v2: add style guide to the frontend README X-Git-Tag: wip-pdonnell-testing-20180317.202121~127^2~93 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4216759d5888fa73c47d3c419f53eaf0bd191d7c;p=ceph-ci.git mgr/dashboard_v2: add style guide to the frontend README Add a README section for style guide where it mentions how to organize the typescript imports. Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard_v2/frontend/README.md b/src/pybind/mgr/dashboard_v2/frontend/README.md index 5e39db51953..75554d5f287 100644 --- a/src/pybind/mgr/dashboard_v2/frontend/README.md +++ b/src/pybind/mgr/dashboard_v2/frontend/README.md @@ -54,3 +54,22 @@ src/app/core/auth> ng generate component login -m=core/auth or, alternatively: src/app> ng generate component core/auth/login -m=core/auth ``` + +## Recommended style guide + +### Typescript + +Group the imports based on its source and separate them with a blank line. + +The source groups can be either from angular, external or internal. + +Example: +```javascript +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { ToastsManager } from 'ng2-toastr'; + +import { Credentials } from '../../../shared/models/credentials.model'; +import { HostService } from './services/host.service'; +``` \ No newline at end of file