Frontend Coding Guidelines
Project and folder structure according to this article
CSS class names:
Structure HTML files with sections and separate them with comments:
<!-- <section name> -->
Use RxJS operator
take(1)
instead offirst()
In the state, we have to use
take(1)
whenever we get an observable from a function we callOur store’s actions always return observables (no void)
Use lambda function instead of .bind(this)
example:ret.children.map(children => this.classificationsDeepCopy(children));
instead ofret.children.map(this.classificationsDeepCopy.bind(this));
We use
ExampleType[]
instead ofArray<ExampleType>
, when refactoring or writing new codeTest name pattern:
should_ExpectedBehavior
orshould_ExpectedBehavior_When_StateUnderTest
depending on the specific testTesting standards according to this article
All entities (displayed in the UI) should start with a capital letter
How to write TASKANA specific words which are displayed in the UI:
Entities: White spaces instead of camel case, all words start with a capital letter
e.g. WorkbasketAccessItem → Workbasket Access ItemInstance variables: White spaces instead of camel case, all words start with lower case in continuous text and with capital letter otherwise (e.g. in captions)
e.g. in continuous text: <Classification>.serviceLevel → service level
e.g. in a caption: <Classification>.serviceLevel → Service Level
For maps, we recommend to use ‘valueByKey’ naming convention
Use quotes when writing values of variables in strings:
e.g.
Task with id '152'
instead ofTask with id 152
Â