# Upgrade angular version in UICommons

**URL:** <https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161>\
**Category:** Development\
**Tags:** angular, uicommons\
**Created:** [July 6, 2016, 2:27pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161 "2016-07-06T14:27:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![insiderish](https://talk.openmrs.org/user_avatar/talk.openmrs.org/insiderish/32/6196_2.png) [@insiderish](https://talk.openmrs.org/u/insiderish)\
**Post date:** [July 6, 2016, 2:27pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/1 "2016-07-06T14:27:00Z")

</div>

Hi,

Are there any future plans of upgrading the angular version in uicommons? The current version is 1.3.0

-Andrew

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 6, 2016, 4:54pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/2 "2016-07-06T16:54:28Z")

</div>

The reason that the current version is stuck there is that I made an unwise choice years ago, and created a filter called “omrs.display”. Code [here](https://github.com/openmrs/openmrs-module-uicommons/blob/1.8/omod/src/main/webapp/resources/scripts/filters/display.js#L9). Unfortunately in the next Angular version it no longer works to have a filter with a dot in its name (which was a dumb idea in the first place.

I’d support renaming this filter to “omrs-display” (and then upgrading angular), but someone will have to do the legwork of doing the communications around this, and helping code-heavy implementations that contribute to uicommons (e.g. PIH) to make the necessary changes on their end.

So far nobody has prioritized doing that, and nobody has really complained about the existing old angular version. (Except of course for Angular 1.x vs 2.x, but that’s a different topic!)

---

<div class="post-metadata">

**Author:** ![insiderish](https://talk.openmrs.org/user_avatar/talk.openmrs.org/insiderish/32/6196_2.png) [@insiderish](https://talk.openmrs.org/u/insiderish)\
**Post date:** [July 7, 2016, 3:21am UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/3 "2016-07-07T03:21:38Z")

</div>

Thanks Darius. We can upgrade ones more devs request for an update

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [July 7, 2016, 3:44am UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/4 "2016-07-07T03:44:42Z")

</div>

> [@darius](#):
>
> I’d support renaming this filter to “omrs-display” (and then upgrading angular), but someone will have to do the legwork of doing the communications around this, and helping code-heavy implementations that contribute to uicommons (e.g. PIH) to make the necessary changes on their end.

According to [Angular filter documentation](https://docs.angularjs.org/guide/filter), using a hyphen would not be any better:

> **Note:** Filter names must be valid angular Expressions identifiers, such as `uppercase` or `orderBy`. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores (`myapp_subsection_filterx`).

Would something like this work?

#### Phase One

1. Rename `omrs.display` filter to `omrsDisplay`
2. Deprecate `omrs.display’:

```javascript
.filter('omrs.display', function(omrsDisplayFilter) {
    return function(text) {
      console.log('OpenMRS Angular filter "omrs.display" is deprecated. See http://om.rs/omrsDisplay for details.');
      return omrsDisplayFilter(text);
    }
})

```

1. Backport these changes to all supported versions of `uicommons` module

#### Phase Two

Run these commands on any/all modules using Angular + uicommons (we’d point [Upgrade angular version in UICommons - Development - OpenMRS Talk](http://om.rs/omrsdisplay) to a wiki page with an explanation and these instructions):

```bash
$ find . -type f -print0 | xargs -0 sed -i '' 's/omrs\.display/omrsDisplay/g'
$ git commit -am "upgrade angular omrsDisplay filter"
$ git push

```

#### Final Phase

After key modules have been upgraded (could probably be done on the next version of `uicommons`, since modules can be patched with a single sed command), drop the deprecated `omrs.display` filter and you’re free to upgrade Angular.

---

<div class="post-metadata">

**Author:** ![themoonraker13](https://talk.openmrs.org/user_avatar/talk.openmrs.org/themoonraker13/32/1607_2.png) [@themoonraker13](https://talk.openmrs.org/u/themoonraker13)\
**Post date:** [July 7, 2016, 11:04am UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/5 "2016-07-07T11:04:06Z")

</div>

I’m in favor of upgrading the angular version as well some third party solutions like `fullCalendar`, `dataTables`, `ngDialog`, etc. to make use of new features in ongoing and future implementations.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 8, 2016, 11:37pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/6 "2016-07-08T23:37:25Z")

</div>

I would even simplify that, in that for _modules_ I don’t think we need to deprecate, but we can just change this and release a new version, as long as we quickly release new versions of the dependent openmrs modules (mainly this will be coreapps).

This can be done as soon as someone wants to volunteer to do it!

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 10, 2016, 9:50am UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/7 "2016-07-10T09:50:40Z")

</div>

I would like to volunteer to make the changes to uicommons and coreapps.

Bear in mind that I only have a few hours a week to work on this and I am still working to release reference application 2.4.

I may be a good option if no one else volunteers who can get it done sooner.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 11, 2016, 9:26pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/8 "2016-07-11T21:26:04Z")

</div>

@jdegraft, I think it would be great for you to pick this up, unless @themoonraker13 or @insiderish is actively interested in doing the work sooner.

@themoonraker13 or @insiderish, could one of you please create a ticket for this, in the UICM project in JIRA?

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 20, 2016, 12:00pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/9 "2016-07-20T12:00:21Z")

</div>

@themoonraker13 & @insiderish, I am ready to start work on this. Unless you are going to work on this, can you create a ticket in JIRA so I can start?

---

<div class="post-metadata">

**Author:** ![insiderish](https://talk.openmrs.org/user_avatar/talk.openmrs.org/insiderish/32/6196_2.png) [@insiderish](https://talk.openmrs.org/u/insiderish)\
**Post date:** [July 20, 2016, 12:29pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/10 "2016-07-20T12:29:34Z")

</div>

Is this good enough?

> <https://issues.openmrs.org/browse/UICM-72>

Thanks

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 20, 2016, 12:36pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/11 "2016-07-20T12:36:12Z")

</div>

@insiderish, thanks.

At some point, the ticket has to be marked ready to work so I can claim. I am not sure who will do this.

However I will start working on it by investigating what needs to be done.

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 22, 2016, 1:45pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/12 "2016-07-22T13:45:54Z")

</div>

Reading through this thread, it seems like some coordination is needed between key users/implementers of uicommons to support this upgrade.

Though I am yet to review the code to determine the extent of changes needed to upgrade uicommons, I will like to invite users and implementers to comment on this upgrade. How it will impact them, how they need to be supported etc.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 22, 2016, 3:55pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/13 "2016-07-22T15:55:44Z")

</div>

@mogoodrich, @mksd/@mksrom, any concerns about this? (You’ll want to skim the thread, especially focusing on this message from Burke: [Upgrade angular version in UICommons](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/4))

@jdegraft if you read Burke’s message you’ll see he lays out a way of doing this that protects the downstream users as much as possible. So in practice the coordination part won’t be a bottleneck.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [July 22, 2016, 4:10pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/14 "2016-07-22T16:10:27Z")

</div>

Hi @darius,

Thanks for pinging us. This will happen over the next release of UI Commons, correct (1.9)? In which case it is ok with us, we are quite looking forward to seeing Angular being upgraded! 👍

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 22, 2016, 4:28pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/15 "2016-07-22T16:28:10Z")

</div>

Yes, this would happen in the next uicommons release.

Burke’s message mentions backporting, but actually we don’t support past versions of modules (only core), so you can ignore that one line.

-Darius (by phone)

---

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 22, 2016, 6:39pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/16 "2016-07-22T18:39:57Z")

</div>

I had half an eye on this thread, but thanks for the ping @darius.

I don’t have any major concerns around this–all we really should need to do is a global replace of omrs.display with omrsDisplay, correct?

We should do a uicommons release before making the change… I can kick off that release now if there are no objections?

Take care, Mark

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 22, 2016, 7:30pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/17 "2016-07-22T19:30:27Z")

</div>

@mogoodrich, (@darius correct me if I am wrong) however I will have to make that change to omrsDisplay in uicommons and make a pull request before uicommons can be released. (Hoping to do that this weekend.)

---

<div class="post-metadata">

**Author:** ![mogoodrich](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mogoodrich/32/3324_2.png) [@mogoodrich](https://talk.openmrs.org/u/mogoodrich)\
**Post date:** [July 22, 2016, 7:39pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/18 "2016-07-22T19:39:22Z")

</div>

I meant I thought it would make sense to release UI Commons as-is now, _before_ making the change to omrsDisplay or the angular update, just to have a stable version of the module with all the recent changes _prior_ to upgrading angular.

Take care, Mark

---

<div class="post-metadata">

**Author:** ![jdegraft](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jdegraft/32/1049_2.png) [@jdegraft](https://talk.openmrs.org/u/jdegraft)\
**Post date:** [July 22, 2016, 7:45pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/19 "2016-07-22T19:45:28Z")

</div>

That would be a great idea.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [July 22, 2016, 7:51pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/20 "2016-07-22T19:51:23Z")

</div>

Yes, @mogoodrich please do a “before” release now. (Of course you should peek to see if there is actually anything new since the last one.)

-Darius (by phone)

[Next page](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161.md?page=2)
