Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: replacing npm with yarn instructions

...

  • Before firing a PR, always ensure your code works on the server (disable javascript in your browser and see if it still works) as well as the client, and that it works with the AoT build (npm yarn run start) as well as the webpack build (npm yarn run watch:dev)
  • Keep adaptability in mind. An institution installing DSpace will often want to modify a few things about the UI. The easier we can make that, the better. Therefore keep your components small (divide them in to sub-components), make sub-modules for coherent functionality, use SASS variables, etc.
  • We agreed to remove the concept of Communities from the UI. They should be called Collections as well. The decision to remove the concept of Communities from the UI was reversed in the meeting of April 13th

...

  • In the component I specify collection$. The dollar is a convention to indicate an observable

  • In the OnInit: this.collection$ = this.cds.findAll();

  • And then in the template, handle the different cases: dedicated messages for isLoading and hasFailed and the actual data for hasSucceeded 

    • of course in a more realistic scenario you might send the error to a notification service instead of handling it yourself

  • In the template I use an ng-container and the async pipe to unwrap the observable: every time the observable changes the contents of this block will be re-rendered, and collectionRD will have the latest value

  • The question marks check for null or undefined: the rest of the statement won't be executed unless that variable before the question mark has a value.

...