]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard_v2: add style guide to the frontend README
authorTiago Melo <tmelo@suse.com>
Mon, 5 Feb 2018 18:26:33 +0000 (18:26 +0000)
committerRicardo Dias <rdias@suse.com>
Mon, 5 Mar 2018 13:07:06 +0000 (13:07 +0000)
Add a README section for style guide where it mentions how to organize
the typescript imports.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard_v2/frontend/README.md

index 5e39db51953b29c701e2190a9bcb16a3a4e6908f..75554d5f2871de6bc0ce102f0f1f3910b5c48084 100644 (file)
@@ -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