fhir-react 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fhir-react",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "React component library for displaying FHIR Resources ",
5
5
  "main": "build/index.js",
6
6
  "peerDependencies": {
@@ -17,7 +17,8 @@
17
17
  "md5": "^2.2.1",
18
18
  "pretty-bytes": "^5.3.0",
19
19
  "prop-types": "^15.7.2",
20
- "react": "^17.0.1"
20
+ "react": "^17.0.1",
21
+ "svg-url-loader": "^7.1.1"
21
22
  },
22
23
  "scripts": {
23
24
  "test": "NODE_ENV=test jest",
@@ -101,7 +101,8 @@ function Condition(props) {
101
101
  dateRecorded,
102
102
  } = resourceDTO(fhirVersion, fhirResource);
103
103
 
104
- const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
104
+ const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
105
+
105
106
  const tableData = [
106
107
  {
107
108
  label: 'Asserted by',
@@ -125,7 +125,7 @@ const Immunization = props => {
125
125
  note,
126
126
  } = resourceDTO(fhirVersion, fhirResource);
127
127
 
128
- const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
128
+ const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
129
129
  const tableData = [
130
130
  {
131
131
  label: 'Manufacturer Text',
@@ -37,7 +37,7 @@ const Procedure = props => {
37
37
  const note = _get(fhirResource, 'note', []);
38
38
  const outcome = _get(fhirResource, 'outcome');
39
39
 
40
- const headerIcon = fhirIcons[_get(fhirResource, 'resourceType')];
40
+ const headerIcon = fhirIcons && fhirIcons[_get(fhirResource, 'resourceType')];
41
41
  const tableData = [
42
42
  {
43
43
  label: 'Identification',
@@ -1,5 +1,4 @@
1
1
  import { Root, Title } from '../../ui';
2
- import ChevronRight from '../../../assets/common/chevron-right.svg';
3
2
  import HeaderIcon from '../../datatypes/HeaderIcon';
4
3
  import React from 'react';
5
4
  import PropTypes from 'prop-types';
@@ -13,7 +12,7 @@ const ResourceCategory = props => {
13
12
  const getItemsCountLabel = () =>
14
13
  `${parsedItemsCount} ${parsedItemsCount === 1 ? 'item' : 'items'}`;
15
14
 
16
- const headerIcon = fhirIcons['ResourceCategoryPlaceholder'];
15
+ const headerIcon = fhirIcons && fhirIcons['ResourceCategory'];
17
16
  const parsedItemsCount = parseNumber(itemsCount);
18
17
 
19
18
  return (
@@ -38,7 +37,7 @@ const ResourceCategory = props => {
38
37
  </div>
39
38
  )}
40
39
  <img
41
- src={ChevronRight}
40
+ src={require('../../../assets/common/chevron-right.svg')}
42
41
  alt="chevron"
43
42
  style={{ height: 28, width: 28 }}
44
43
  />
@@ -5,7 +5,7 @@ import fhirIcons from '../../../fixtures/example-icons';
5
5
  import ResourceCategory from './ResourceCategory';
6
6
 
7
7
  describe('should render ResourceCategory component properly', () => {
8
- const placeholderResource = fhirIcons['ResourceCategoryPlaceholder'].props;
8
+ const placeholderResource = fhirIcons['ResourceCategory'].props;
9
9
 
10
10
  it('should render ResourceCategory component with icon and itemsCount > 1 correctly', () => {
11
11
  const defaultProps = {
@@ -37,6 +37,7 @@ import Questionnaire from './resources/Questionnaire';
37
37
  import QuestionnaireResponse from './resources/QuestionnaireResponse';
38
38
  import ReferralRequest from './resources/ReferralRequest';
39
39
  import ResearchStudy from './resources/ResearchStudy';
40
+ import ResourceCategory from './resources/ResourceCategory';
40
41
 
41
42
  export {
42
43
  Appointment,
@@ -78,4 +79,5 @@ export {
78
79
  QuestionnaireResponse,
79
80
  ReferralRequest,
80
81
  ResearchStudy,
82
+ ResourceCategory,
81
83
  };
@@ -160,7 +160,7 @@ export default {
160
160
  alt="finger pointing something in a book"
161
161
  />
162
162
  ),
163
- ResourceCategoryPlaceholder: (
163
+ ResourceCategory: (
164
164
  <img
165
165
  src={require('../assets/containers/ResourceCategory/resource-placeholder.svg')}
166
166
  alt="header icon"
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import 'bootstrap/dist/css/bootstrap.min.css';
2
2
  import './style.css';
3
+ import './style.scss';
3
4
 
4
5
  import FhirResource from './components/containers/FhirResource';
5
6
  import fhirVersions from './components/resources/fhirResourceVersions';
package/webpack.config.js CHANGED
@@ -25,7 +25,7 @@ module.exports = {
25
25
  },
26
26
  },
27
27
  {
28
- test: /\.css$/,
28
+ test: /\.(css|scss)$/,
29
29
  exclude: path.resolve(
30
30
  __dirname,
31
31
  'src/components/ui/bootstrap-reboot.min.css',
@@ -35,6 +35,15 @@ module.exports = {
35
35
  loader: MiniCssExtractPlugin.loader,
36
36
  },
37
37
  'css-loader',
38
+ 'sass-loader',
39
+ ],
40
+ },
41
+ {
42
+ test: /\.svg$/,
43
+ use: [
44
+ {
45
+ loader: 'svg-url-loader',
46
+ },
38
47
  ],
39
48
  },
40
49
  ],