Bram's Dev Blog

home

100 Days of Code Day 84 - Angular Testing

18 Nov 2018

Default language as a separate configuration variable

Before today’s work, the language configuration was represented by an array of LangConfig objects, that looked like this:

export interface LangConfig extends Config {
      code: string;
      label: string;
      active: boolean;
      default: boolean;
}

The goal was to make the variable default optional, and to use false as the standard value if it would not be filled out. The definition of default language is the following:

DSpace tries to render the repository user interface in the active browser language of the user. If the user’s browser language is not present in the DSpace configuration of active languages, it will render the repository in the default language

With this definition, only one language can be flagged as the default one. But by leaving it as a variable on the languages themselves, it is not prevented that the repository administrator would set this to true on several languages.

Since the loading of this config is giving me issues anyway, I’m going to experiment with extracting defaultlang as a separate variable, and keep it on the level of global-config.interface.ts

Cleaning up the final contribution

In order to measure coverage and get my code cleanly into the DSpace Angular mainline, I want to:

Merge all changes from another branch as a single commit helped me to do this.

  1. Made sure my local master branch was up to date with origin master
  2. Made a new local branch
  3. Merged my changes with the –squash flag
  4. Proposed as a new pull request.

Done?

After issuing the new pull request, I noticed there are now new JS lint issues that still need to be addressed.

Day 85 Plan

Resolve JS Style lint issues

Future days - DSpace 7 Angular

Future days - Analyzer.atmire.com work

Future Days - Productivity

Future days - Jekyll http://bram-atmire.github.io/ site

Future Days - Atmire.com work

Investigate and work on search engine optimization (SEO) for the main atmire.com website.

Future Days - Learning just for learning

Sustainability challenge - Finish before Christmas

If I continue like October, I could hit day 68 by end of October and day 98 by end of November.