ehr-alerts-ui 0.0.19 → 0.0.22

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
@@ -3,15 +3,13 @@
3
3
  "main": "lib/index.cjs.js",
4
4
  "module": "lib/index.js",
5
5
  "types": "lib/components/index.d.ts",
6
- "version": "0.0.19",
6
+ "version": "0.0.22",
7
7
  "dependencies": {
8
8
  "@types/node": "^12.0.0",
9
9
  "@types/react": "^17.0.0",
10
10
  "@types/react-dom": "^17.0.0",
11
11
  "@types/redux-logger": "^3.0.9",
12
- "axios": "0.21.0",
13
12
  "ehr-auth-react": "0.0.38",
14
- "ehr-document-ui": "0.1.36",
15
13
  "ehr-components": "0.0.74",
16
14
  "http-proxy-middleware": "^2.0.1",
17
15
  "keycloak-js": "11.0.2",
@@ -30,6 +28,7 @@
30
28
  "web-vitals": "^1.0.1"
31
29
  },
32
30
  "devDependencies": {
31
+ "axios": "0.21.0",
33
32
  "@rollup/plugin-commonjs": "17.0.0",
34
33
  "@rollup/plugin-image": "2.0.6",
35
34
  "@rollup/plugin-json": "4.1.0",
@@ -64,7 +63,7 @@
64
63
  "start": "react-scripts start",
65
64
  "build": "rm -rf lib && rollup -c rollup.config.js",
66
65
  "prepack": "npm run build",
67
- "build_standalone": "rm -rf build && sed -i \"s~0.0.19~0.0.10~\" ./package.json && react-scripts build"
66
+ "build_standalone": "rm -rf build && sed -i \"s~0.0.22~0.0.10~\" ./package.json && react-scripts build"
68
67
  },
69
68
  "eslintConfig": {
70
69
  "extends": [
package/src/index.tsx CHANGED
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import './index.css';
4
4
  import App from './App';
5
- import 'ehr-document-ui/dist/static/css/App.css';
6
5
 
7
6
 
8
7
  ReactDOM.render(
@@ -23,6 +23,10 @@ export interface AlertsTableDispatch {
23
23
  duplicateAlert: (alert: Alert) => void,
24
24
  }
25
25
 
26
+ interface InnerAlert extends Alert {
27
+ time: string,
28
+ }
29
+
26
30
  const AlertsTable: React.FC<AlertsTableState & AlertsTableDispatch> = ({alerts, loadAlerts, clearAlerts, editAlert,
27
31
  clearDeletes, setDeleteOpen, deleteAlert,
28
32
  duplicateAlert}) => {
@@ -54,7 +58,10 @@ const AlertsTable: React.FC<AlertsTableState & AlertsTableDispatch> = ({alerts,
54
58
  // Update content
55
59
  useEffect(() => {
56
60
  setContent(
57
- alerts.filter((alert) => (!alert.deleted))
61
+ alerts.filter((alert) => (!alert.deleted)).map((alert) => ({
62
+ ...alert,
63
+ time: `${alert.begin} - ${alert.end}`,
64
+ }))
58
65
  );
59
66
 
60
67
  updateHeader();
@@ -135,7 +142,7 @@ const AlertsTable: React.FC<AlertsTableState & AlertsTableDispatch> = ({alerts,
135
142
  </div>
136
143
  );
137
144
 
138
- function onToggleDeletePopup(alert: Alert) {
145
+ function onToggleDeletePopup(alert: InnerAlert) {
139
146
  if (alert.isDeleteOpen) {
140
147
  clearDeletes();
141
148
  } else {
@@ -143,12 +150,12 @@ const AlertsTable: React.FC<AlertsTableState & AlertsTableDispatch> = ({alerts,
143
150
  }
144
151
  }
145
152
 
146
- function createTableRow(alert: Alert): any[] {
153
+ function createTableRow(alert: InnerAlert): any[] {
147
154
  return [
148
155
  alert.title,
149
156
  alert.audience,
150
157
  alert.level,
151
- `${alert.begin} - ${alert.end}`,
158
+ alert.time,
152
159
  alert.content,
153
160
  <Tooltip content='Kopeerin'>
154
161
  <button className='alerts-ui--icon-button' onClick={() => duplicateAlert(alert)}>