Skip to content

Commit

Permalink
Abstracted View column to Grid class
Browse files Browse the repository at this point in the history
  • Loading branch information
KathrynElrod committed Jul 28, 2021
1 parent f4f5610 commit 611324f
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 73 deletions.
6 changes: 3 additions & 3 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="UTF-8"/>
<title>SMART Patient Browser</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="shortcut icon" href="img/icon.png" type="image/png?_=381ff76dbb86d9bb031f" />
<link rel="shortcut icon" href="img/icon.png" type="image/png?_=09a9ebc8d86e2de4483d" />
<link rel="stylesheet" href="vendor/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="vendor/bootstrap-3.3.7-dist/css/bootstrap.min.css">
</head>
<body>
<div id="overlay"></div>
<div id="main"></div>
<script src="vendor/babel-polyfill.min.js"></script>
<script src="js/commons.js?_=381ff76dbb86d9bb031f"></script>
<script src="js/index.js?_=381ff76dbb86d9bb031f"></script>
<script src="js/commons.js?_=09a9ebc8d86e2de4483d"></script>
<script src="js/index.js?_=09a9ebc8d86e2de4483d"></script>
<script src="vendor/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="vendor/jdenticon-1.4.0.min.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion build/js/commons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/js/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/js/index.js.09a9ebc8d86e2de4483d.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/js/index.js.381ff76dbb86d9bb031f.map

This file was deleted.

4 changes: 2 additions & 2 deletions build/js/report.html

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions src/components/Fhir/ConditionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,6 @@ export default class ConditionList extends React.Component
);
}
},
{
label: <div className="text-center">View</div>,
render: o => {
let url = `${this.props.settings.server.url}/${o.resourceType}/${o.id}`;
if (this.props.settings.fhirViewer.enabled) {
url = this.props.settings.fhirViewer.url +
(this.props.settings.fhirViewer.url.indexOf("?") > -1 ? "&" : "?") +
this.props.settings.fhirViewer.param + "=" +
encodeURIComponent(url);
}

return (
<div style={{ color: '#337ab7', textAlign: 'center' }}>
<button onClick={ () => window.open(url, "_blank") }>
<i className="fa fa-eye fas fa-bold"/>
</button>
</div>
)
}
},
{
label: <div style={{textAlign: 'center'}}>
<button
Expand Down
12 changes: 12 additions & 0 deletions src/components/Fhir/Grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ export class Grid extends React.Component
)
})
}
{this.props.settings.fhirViewer.enabled ?
<td>
<div style={{ color: '#337ab7', textAlign: 'center' }}>
<button onClick={ () => window.open(url, "_blank") }>
<i className="fa fa-eye fas fa-bold"/>
</button>
</div>
</td>
: null}
</tr>
)
}
Expand Down Expand Up @@ -168,6 +177,9 @@ export class Grid extends React.Component
)
})
}
{ this.props.settings.fhirViewer.enabled ?
<th><div className="text-center">View</div></th>
: null}
</tr>
</thead>
<tbody>
Expand Down
20 changes: 0 additions & 20 deletions src/components/Fhir/ImmunizationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@ export default class ImmunizationList extends React.Component
o.occurrenceString || "-"
)
},
{
label: <div className="text-center">View</div>,
render: o => {
let url = `${this.props.settings.server.url}/${o.resourceType}/${o.id}`;
if (this.props.settings.fhirViewer.enabled) {
url = this.props.settings.fhirViewer.url +
(this.props.settings.fhirViewer.url.indexOf("?") > -1 ? "&" : "?") +
this.props.settings.fhirViewer.param + "=" +
encodeURIComponent(url);
}

return (
<div style={{ color: '#337ab7', textAlign: 'center' }}>
<button onClick={ () => window.open(url, "_blank") }>
<i className="fa fa-eye fas fa-bold"/>
</button>
</div>
)
}
},
{
label: <div style={{textAlign: 'center'}}>
<button
Expand Down
24 changes: 1 addition & 23 deletions src/components/Fhir/ResourceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,29 +405,7 @@ export default class ResourceList extends React.Component
])
});

// 4. View External ----------------------------------------------------
out.push ({
label: <div className="text-center">View</div>,
render: o => {
let url = `${this.props.settings.server.url}/${o.resourceType}/${o.id}`;
if (this.props.settings.fhirViewer.enabled) {
url = this.props.settings.fhirViewer.url +
(this.props.settings.fhirViewer.url.indexOf("?") > -1 ? "&" : "?") +
this.props.settings.fhirViewer.param + "=" +
encodeURIComponent(url);
}

return (
<div style={{ color: '#337ab7', textAlign: 'center' }}>
<button onClick={ () => window.open(url, "_blank") }>
<i className="fa fa-eye fas fa-bold"/>
</button>
</div>
)
}
})

// 5. Insights ---------------------------------------------------------
// 4. Insights ---------------------------------------------------------
out.push ({
label: <div style={{textAlign: 'center'}}>
<button
Expand Down

0 comments on commit 611324f

Please sign in to comment.