Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
addons:
chrome: stable
language: java
dist: trusty
jdk:
- oraclejdk8
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void purgeFlag(Integer flagId) throws DAOException {
@SuppressWarnings("unchecked")
public List<Tag> getAllTags() throws DAOException {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Tag.class);
criteria.add(Restrictions.eq("retired", false));
return (List<Tag>) criteria.list();
}

Expand Down Expand Up @@ -233,6 +234,7 @@ public void purgeTag(Integer tagId) throws DAOException {
@SuppressWarnings("unchecked")
public List<Priority> getAllPriorities() throws DAOException {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Priority.class);
criteria.add(Restrictions.eq("retired", false));
return (List<Priority>) criteria.list();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
description = new DelegatingResourceDescription();
description.addProperty("name");
description.addProperty("criteria");
description.addProperty("evaluator");
description.addProperty("message");
description.addProperty("priority");
description.addProperty("enabled");
description.addProperty("tags");

if (rep instanceof DefaultRepresentation) {
description.addProperty("criteria", Representation.FULL);
description.addProperty("evaluator", Representation.FULL);
description.addProperty("message", Representation.FULL);
description.addProperty("priority", Representation.FULL);
description.addProperty("enabled", Representation.FULL);
description.addProperty("tags", Representation.FULL);
description.addSelfLink();
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
} else if (rep instanceof FullRepresentation) {
description.addProperty("auditInfo");
description.addProperty("flagId");
description.addProperty("criteria", Representation.FULL);
description.addProperty("evaluator", Representation.FULL);
description.addProperty("message", Representation.FULL);
description.addProperty("priority", Representation.FULL);
description.addProperty("enabled", Representation.FULL);
description.addProperty("tags", Representation.REF);
description.addSelfLink();
return description;
}
Expand Down Expand Up @@ -73,6 +79,7 @@ public DelegatingResourceDescription getCreatableProperties() {
cp.addProperty("priority");
cp.addProperty("enabled");
cp.addProperty("tags");
cp.addProperty("flagId");

return cp;
}
Expand All @@ -87,6 +94,7 @@ public DelegatingResourceDescription getUpdatableProperties() {
cp.addProperty("priority");
cp.addProperty("enabled");
cp.addProperty("tags");
cp.addProperty("flagId");

return cp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
description = new DelegatingResourceDescription();
description.addProperty("name");
description.addProperty("style");
description.addProperty("rank");

if (rep instanceof DefaultRepresentation) {
description.addProperty("style", RestConstants.REPRESENTATION_FULL);
description.addProperty("rank", RestConstants.REPRESENTATION_FULL);

description.addProperty("style", RestConstants.REPRESENTATION_REF);
description.addProperty("rank", RestConstants.REPRESENTATION_REF);
description.addSelfLink();
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
} else if (rep instanceof FullRepresentation) {
description.addProperty("auditInfo");
description.addProperty("style");
description.addProperty("rank");
description.addSelfLink();
return description;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public Tag getByUniqueId(String tagId) {
return tag;
}

@Override
public void delete(Tag delegate, String reason, RequestContext context) throws ResponseException {
getService().retireTag(delegate, reason);
}

@Override
public void purge(Tag tag, RequestContext arg1) throws ResponseException {
getService().purgeTag(tag.getTagId());
Expand Down Expand Up @@ -77,16 +82,19 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
// metadata
description.addProperty("tagId");
description.addProperty("name");
description.addProperty("roles");
description.addProperty("displayPoints");

// links
description.addSelfLink();
if (rep instanceof DefaultRepresentation) {
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
description.addProperty("roles", Representation.REF);
description.addProperty("displayPoints", Representation.REF);
description.addProperty("auditInfo", Representation.REF);
} else {
// Relies on a getter method annotated with @PropertyGetter
description.addProperty("auditInfo");
description.addProperty("roles");
description.addProperty("displayPoints");
}
}

Expand Down
2 changes: 2 additions & 0 deletions owa/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
4 changes: 4 additions & 0 deletions owa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
bower_components
dist
config.json
25 changes: 18 additions & 7 deletions owa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@

This repository contains the patientflags OpenMRS Open Web App.

> Add a description of what your app does here.
## Pending Tasks

For further documentation about OpenMRS Open Web Apps see
[the wiki page](https://wiki.openmrs.org/display/docs/Open+Web+Apps+Module).
1. Usage of Providers to implement Services.
2. Store to implement DTOs.
3. Routes for dynamic rendering of tabs.
4. Splitting REST Calls in each component into Services.

## Dependencies List

*Please see package.json file.

*Modals are rendered using popup.js
*Table is rendered using react-table

*We also use the Font-Awesome React library to render icons.

## Development

### Production Build

You will need NodeJS 4+ installed to do this. See the install instructions [here](https://nodejs.org/en/download/package-manager/).
You will need NodeJS 6+ installed to do this. See the install instructions [here](https://nodejs.org/en/download/package-manager/).

Once you have NodeJS installed, install the dependencies (first time only):

Expand All @@ -38,14 +49,14 @@ To deploy directly to your local Open Web Apps directory, run:
npm run build:deploy
````

This will build and deploy the app to the `/home/yassin/openmrs/openmrs-platform/owa`
This will build and deploy the app to the `C:/Users/Rishav/openmrs/openmrs-platform/owa`
directory. To change the deploy directory, edit the `LOCAL_OWA_FOLDER` entry in
`config.json`. If this file does not exists, create one in the root directory
that looks like:

```js
{
"LOCAL_OWA_FOLDER": "/home/yassin/openmrs/openmrs-platform/owa"
"LOCAL_OWA_FOLDER": "C:/Users/Rishav/openmrs/openmrs-platform/owa"
}
```

Expand All @@ -57,7 +68,7 @@ will need the `APP_ENTRY_POINT` entry in your `config.json` file:

```js
{
"LOCAL_OWA_FOLDER": "/home/yassin/openmrs/openmrs-platform/owa",
"LOCAL_OWA_FOLDER": "C:/Users/Rishav/openmrs/openmrs-platform/owa",
"APP_ENTRY_POINT": "http://localhost:8080/openmrs/owa/patientflags/index.html"
}
```
Expand Down
44 changes: 44 additions & 0 deletions owa/app/css/patientflags.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/

@import url(//fonts.googleapis.com/css?family=Open+Sans);

body {
font-family: "OpenSans", Arial, sans-serif;
-webkit-font-smoothing: subpixel-antialiased;
Expand Down Expand Up @@ -69,4 +72,45 @@ header .logo img {
.instructions {
align-self: center;
}
.tabs{
list-style-type: none;
border-bottom: 1px solid grey;
padding-bottom:10px;
}
.tabs li{
display:inline;
margin:10px;
padding:5px;
}
.tabs li.active{
background-color: #363463;
color:white;
}
.selectionContainer{
border:2px solid #ccc;
width:300px;
height: 100px;
overflow-y: scroll;

}
.stylePriority{
background-color:#efefef;
border-radius: 5px;
padding:10px;
}
.displayTable{
margin: 10%;
}
.Modal{
overflow-y: scroll
}
.form-control{
border: 1px solid grey;
}
.iconButton{
background:none;
background-color:none;
border:none;
}


Loading