@ampath/esm-reports-app 1.0.0-next.2 → 1.0.0-next.21
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/dist/138.js +2 -0
- package/dist/138.js.LICENSE.txt +20 -0
- package/dist/138.js.map +1 -0
- package/dist/184.js +1 -1
- package/dist/184.js.map +1 -1
- package/dist/205.js +1 -0
- package/dist/205.js.map +1 -0
- package/dist/282.js +1 -1
- package/dist/282.js.LICENSE.txt +3 -3
- package/dist/282.js.map +1 -1
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/353.js +1 -1
- package/dist/353.js.map +1 -1
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/51.js +1 -0
- package/dist/51.js.map +1 -0
- package/dist/540.js +1 -1
- package/dist/540.js.map +1 -1
- package/dist/812.js +1 -0
- package/dist/812.js.map +1 -0
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/ampath-esm-reports-app.js +1 -1
- package/dist/ampath-esm-reports-app.js.buildmanifest.json +128 -151
- package/dist/ampath-esm-reports-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -1
- package/src/common/report-filters/report-filters.component.tsx +127 -0
- package/src/common/report-filters/report-filters.scss +49 -0
- package/src/config-schema.ts +6 -37
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/reports-dasboard.tsx +44 -0
- package/src/dashboard/reports-dashboard.module.scss +14 -0
- package/src/dashboard-meta/reports-dashboard.meta.ts +6 -0
- package/src/index.ts +6 -35
- package/src/reports/datatable-wrapper/datatable-wrapper.component.tsx +54 -0
- package/src/reports/moh-240/moh-240-header.component.tsx +61 -0
- package/src/reports/moh-240/moh-240.component.tsx +68 -0
- package/src/reports/moh-240/moh-240.scss +3 -0
- package/src/reports/moh-240/sub-reports/moh-240-register.component.tsx +72 -0
- package/src/reports/moh-240/sub-reports/page-summary.component.tsx +95 -0
- package/src/reports/moh-505/moh-505-header.component.tsx +62 -0
- package/src/reports/moh-505/moh-505.component.tsx +240 -0
- package/src/reports/moh-505/moh-505.scss +3 -0
- package/src/reports/moh-705B/moh-705b.component.tsx +466 -0
- package/src/reports/moh-705B/moh-705b.scss +41 -0
- package/src/reports/moh-705a/moh-705a.component.tsx +473 -0
- package/src/reports/moh-705a/moh-705a.scss +41 -0
- package/src/reports/moh-706/moh-706-header.component.tsx +61 -0
- package/src/reports/moh-706/moh-706.component.tsx +104 -0
- package/src/reports/moh-706/moh-706.scss +30 -0
- package/src/reports/moh-706/sub-reports/bacteriology/bacteriology.component.tsx +124 -0
- package/src/reports/moh-706/sub-reports/blood-chemistry/blood-chemistry.component.tsx +318 -0
- package/src/reports/moh-706/sub-reports/drug-susceptibility-testing/drug-susceptibility-testing.component.tsx +137 -0
- package/src/reports/moh-706/sub-reports/haematology/haematology.component.tsx +179 -0
- package/src/reports/moh-706/sub-reports/histology-and-cytology/histology-and-cytology.component.tsx +88 -0
- package/src/reports/moh-706/sub-reports/parasitology/parasitology.component.tsx +121 -0
- package/src/reports/moh-706/sub-reports/serology/serology.component.tsx +47 -0
- package/src/reports/moh-706/sub-reports/specimen-referral-to-higher-levels/specimen-referral-to-higher-levels.component.tsx +39 -0
- package/src/reports/moh-706/sub-reports/urine-analysis/urine-analysis.component.tsx +108 -0
- package/src/reports/moh-710/moh-710.component.tsx +663 -0
- package/src/reports/moh-710/moh-710.scss +41 -0
- package/src/reports/moh-711/moh-711.component.tsx +121 -0
- package/src/reports/moh-711/moh711.scss +71 -0
- package/src/reports/moh-711/sections/anc.component.tsx +134 -0
- package/src/reports/moh-711/sections/cervical-cancer.component.tsx +104 -0
- package/src/reports/moh-711/sections/chanis.component.tsx +367 -0
- package/src/reports/moh-711/sections/family-planning.component.tsx +221 -0
- package/src/reports/moh-711/sections/gbv.component.tsx +115 -0
- package/src/reports/moh-711/sections/maternity.component.tsx +280 -0
- package/src/reports/moh-711/sections/medical-social-work.component.tsx +83 -0
- package/src/reports/moh-711/sections/other.component.tsx +47 -0
- package/src/reports/moh-711/sections/physiotherapy.component.tsx +61 -0
- package/src/reports/moh-711/sections/pnc.component.tsx +92 -0
- package/src/reports/moh-711/sections/post-abortion.component.tsx +42 -0
- package/src/reports/moh-711/sections/rehabilitation.component.tsx +57 -0
- package/src/reports/moh-711/sections/report-compiled-by.component.tsx +42 -0
- package/src/reports/moh-711/sections/tb-screening.component.tsx +57 -0
- package/src/reports/moh-717/moh-717.component.tsx +152 -0
- package/src/reports/moh-717/moh717.scss +150 -0
- package/src/reports/moh-717/sections/finance.component.tsx +42 -0
- package/src/reports/moh-717/sections/inpatient.component.tsx +374 -0
- package/src/reports/moh-717/sections/maternity.component.tsx +94 -0
- package/src/reports/moh-717/sections/medical-records.component.tsx +35 -0
- package/src/reports/moh-717/sections/mortuary.component.tsx +43 -0
- package/src/reports/moh-717/sections/operations.component.tsx +53 -0
- package/src/reports/moh-717/sections/orthopaedic-trauma.component.tsx +98 -0
- package/src/reports/moh-717/sections/outpatient.component.tsx +489 -0
- package/src/reports/moh-717/sections/pharmacy.component.tsx +43 -0
- package/src/reports/moh-717/sections/preparedby.component.tsx +47 -0
- package/src/reports/moh-717/sections/special-services.component.tsx +114 -0
- package/src/reports/moh-740/moh-740.component.scss +120 -0
- package/src/reports/moh-740/moh-740.component.tsx +907 -0
- package/src/reports/moh-740/moh-740.resource.ts +42 -0
- package/src/reports/moh-740/registers/moh-222-daily-register/moh-222-daily-register.tsx +6 -0
- package/src/reports/moh-740/registers/moh-270-permanent-register/moh-270-permanent-register.tsx +58 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.scss +0 -0
- package/src/reports/moh-740/registers/moh-740-patient-list.tsx +43 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.scss +6 -0
- package/src/reports/moh-740/shared/data-cell/data-cell.tsx +23 -0
- package/src/reports/moh-740/types/index.ts +115 -0
- package/src/reports/moh-745/moh-745.component.tsx +629 -0
- package/src/reports/moh-745/moh-745.scss +69 -0
- package/src/reports/table-wrapper/table-row-mapper.component.tsx +51 -0
- package/src/reports/table-wrapper/table-wrapper.component.tsx +21 -0
- package/src/reports/table-wrapper/table-wrapper.scss +31 -0
- package/src/resources/moh-705.resource.ts +60 -0
- package/src/resources/moh-706.resource.ts +86 -0
- package/src/resources/moh-710.resource.ts +34 -0
- package/src/resources/moh-711.resource.ts +34 -0
- package/src/resources/moh-717.resource.ts +35 -0
- package/src/resources/moh-745.resource.ts +34 -0
- package/src/root.component.tsx +30 -32
- package/src/routes.json +14 -17
- package/src/utils/get-base-url.ts +12 -0
- package/src/utils/utils.ts +36 -0
- package/dist/19.js +0 -2
- package/dist/19.js.LICENSE.txt +0 -39
- package/dist/19.js.map +0 -1
- package/dist/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/389.js +0 -1
- package/dist/389.js.map +0 -1
- package/dist/451.js +0 -1
- package/dist/451.js.map +0 -1
- package/dist/488.js +0 -1
- package/dist/488.js.map +0 -1
- package/dist/557.js +0 -1
- package/dist/557.js.map +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/970.js +0 -1
- package/dist/970.js.map +0 -1
- package/src/boxes/extensions/blue-box.component.tsx +0 -15
- package/src/boxes/extensions/box.scss +0 -23
- package/src/boxes/extensions/brand-box.component.tsx +0 -15
- package/src/boxes/extensions/red-box.component.tsx +0 -15
- package/src/boxes/slot/boxes.component.tsx +0 -25
- package/src/boxes/slot/boxes.scss +0 -29
- package/src/greeter/greeter.component.tsx +0 -42
- package/src/greeter/greeter.scss +0 -20
- package/src/greeter/greeter.test.tsx +0 -28
- package/src/patient-getter/patient-getter.component.tsx +0 -40
- package/src/patient-getter/patient-getter.resource.ts +0 -39
- package/src/patient-getter/patient-getter.scss +0 -16
- package/src/patient-getter/patient-getter.test.tsx +0 -40
- package/src/resources/resources.component.tsx +0 -56
- package/src/resources/resources.scss +0 -68
- package/src/root.test.tsx +0 -51
package/dist/91.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.webpackChunk_ampath_esm_reports_app=globalThis.webpackChunk_ampath_esm_reports_app||[]).push([[91],{8091(e,r,t){"use strict";t.r(r),t.d(r,{blueBox:()=>u,brandBox:()=>d,importTranslation:()=>i,redBox:()=>p,root:()=>c,startupApp:()=>l});var n=t(2141),o={casualGreeting:{_type:n.Type.Boolean,_default:!1,_description:"Whether to use a casual greeting (or a formal one)."},whoToGreet:{_type:n.Type.Array,_default:["World"],_description:"Who should be greeted. Names will be separated by a comma and space.",_elements:{_type:n.Type.String},_validators:[(0,n.validator)((function(e){return e.length>0}),"At least one person must be greeted.")]}},a="@ampath/esm-reports-app",s={featureName:"root-world",moduleName:a},i=t(4767);function l(){(0,n.defineConfigSchema)(a,o)}var c=(0,n.getAsyncLifecycle)((function(){return Promise.all([t.e(961),t.e(19),t.e(72),t.e(76),t.e(451)]).then(t.bind(t,1451))}),s),p=(0,n.getAsyncLifecycle)((function(){return Promise.all([t.e(72),t.e(970)]).then(t.bind(t,970))}),s),u=(0,n.getAsyncLifecycle)((function(){return Promise.all([t.e(72),t.e(389)]).then(t.bind(t,1389))}),s),d=(0,n.getAsyncLifecycle)((function(){return Promise.all([t.e(72),t.e(488)]).then(t.bind(t,488))}),s)},4767(e,r,t){var n={"./am.json":[1197,[197]],"./en.json":[4300,[300]],"./es.json":[3099,[99]],"./fr.json":[4055,[55]],"./he.json":[4652,[652]],"./km.json":[4335,[335]]};function o(e){try{if(!t.o(n,e))return Promise.resolve().then((()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}))}catch(e){return Promise.reject(e)}var r=n[e],o=r[0];return t.e(r[1][0]).then((()=>t(o)))}o.keys=()=>Object.keys(n),o.id=4767,e.exports=o}}]);
|
package/dist/91.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"91.js","mappings":"qQA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OD,KAAKf,GAC9CC,EAAoBa,GAAK,KACzBG,EAAOC,QAAUjB,C","sources":["webpack://@ampath/esm-reports-app/./src/config-schema.ts","webpack://@ampath/esm-reports-app/./src/index.ts","webpack://@ampath/esm-reports-app/./translations/ lazy nonrecursive .json$"],"names":["configSchema","casualGreeting","_type","Type","Boolean","_default","_description","whoToGreet","Array","_elements","String","_validators","validator","v","length","moduleName","options","featureName","importTranslation","require","startupApp","defineConfigSchema","root","getAsyncLifecycle","redBox","blueBox","brandBox","map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","err","reject","ids","id","keys","Object","module","exports"],"sourceRoot":""}
|
package/dist/970.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_ampath_esm_reports_app=globalThis.webpackChunk_ampath_esm_reports_app||[]).push([[970],{4101(n,e,r){r.d(e,{A:()=>s});var t=r(4991),a=r.n(t),o=r(6314),i=r.n(o)()(a());i.push([n.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-reports__box__blue___62DJr{background-color:#00008b}.-esm-reports__box__red___w2gGh{background-color:darkred}.-esm-reports__box__brand___DgXfT{background-color:#005d5d;background-color:var(--brand-01);color:#fff;padding:.5rem}","",{version:3,sources:["webpack://./node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/boxes/extensions/box.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CCtDD,iCACC,wBAAA,CAGF,gCACE,wBAAA,CAMF,kCDsBE,wBAAA,CACA,gCAAA,CCrBA,UAAA,CACA,aAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","/* Extensions should supply the minimum amount of styling\n * necessary. Here, the extensions set only their colors.\n * Their sizes and other general features of their display\n * is controlled by the slot. */\n@use \"@carbon/layout\";\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n .blue {\n background-color: darkblue;\n}\n\n.red {\n background-color: darkred;\n}\n\n/* Brand colors are special. They must be included using a\n * SASS mix-in (shown here) or using a CSS variable like\n * `var(--brand-01)`. */\n.brand {\n @include brand-01(background-color);\n color: white;\n padding: layout.$spacing-03;\n}\n"],sourceRoot:""}]),i.locals={blue:"-esm-reports__box__blue___62DJr",red:"-esm-reports__box__red___w2gGh",brand:"-esm-reports__box__brand___DgXfT"};const s=i},6314(n){n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var r=n(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(n,r,t){"string"==typeof n&&(n=[[null,n,""]]);var a={};if(t)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<n.length;s++){var c=[].concat(n[s]);t&&a[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),e.push(c))}},e}},4991(n){function e(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}n.exports=function(n){var r,t,a=(t=4,function(n){if(Array.isArray(n))return n}(r=n)||function(n,e){var r=n&&("undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"]);if(null!=r){var t,a,o=[],i=!0,s=!1;try{for(r=r.call(n);!(i=(t=r.next()).done)&&(o.push(t.value),!e||o.length!==e);i=!0);}catch(n){s=!0,a=n}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}(r,t)||function(n,r){if(n){if("string"==typeof n)return e(n,r);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?e(n,r):void 0}}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[1],i=a[3];if(!i)return o;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),d="/*# ".concat(c," */"),u=i.sources.map((function(n){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(n," */")}));return[o].concat(u).concat([d]).join("\n")}return[o].join("\n")}},1232(n,e,r){r.d(e,{A:()=>v});var t=r(5072),a=r.n(t),o=r(7825),i=r.n(o),s=r(7659),c=r.n(s),d=r(5056),u=r.n(d),p=r(540),l=r.n(p),f=r(1113),b=r.n(f),m=r(4101),h={};h.styleTagTransform=b(),h.setAttributes=u(),h.insert=c().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=l(),a()(m.A,h);const v=m.A&&m.A.locals?m.A.locals:void 0},5072(n){var e=[];function r(n){for(var r=-1,t=0;t<e.length;t++)if(e[t].identifier===n){r=t;break}return r}function t(n,t){for(var o={},i=[],s=0;s<n.length;s++){var c=n[s],d=t.base?c[0]+t.base:c[0],u=o[d]||0,p="".concat(d," ").concat(u);o[d]=u+1;var l=r(p),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==l)e[l].references++,e[l].updater(f);else{var b=a(f,t);t.byIndex=s,e.splice(s,0,{identifier:p,updater:b,references:1})}i.push(p)}return i}function a(n,e){var r=e.domAPI(e);return r.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;r.update(n=e)}else r.remove()}}n.exports=function(n,a){var o=t(n=n||[],a=a||{});return function(n){n=n||[];for(var i=0;i<o.length;i++){var s=r(o[i]);e[s].references--}for(var c=t(n,a),d=0;d<o.length;d++){var u=r(o[d]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}o=c}}},7659(n){var e={};n.exports=function(n,r){var t=function(n){if(void 0===e[n]){var r=document.querySelector(n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(n){r=null}e[n]=r}return e[n]}(n);if(!t)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");t.appendChild(r)}},540(n){n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},5056(n,e,r){n.exports=function(n){var e=r.nc;e&&n.setAttribute("nonce",e)}},7825(n){n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(r){!function(n,e,r){var t="";r.supports&&(t+="@supports (".concat(r.supports,") {")),r.media&&(t+="@media ".concat(r.media," {"));var a=void 0!==r.layer;a&&(t+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),t+=r.css,a&&(t+="}"),r.media&&(t+="}"),r.supports&&(t+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(t+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(t,n,e.options)}(e,n,r)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},1113(n){n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},970(n,e,r){r.r(e),r.d(e,{default:()=>o});var t=r(6072),a=r(1232);const o=function(){return t.createElement("div",{className:a.A.red})}}}]);
|
package/dist/970.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"970.js","mappings":"4LAGIA,E,MAA0B,GAA4B,KAE1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uC,IACFvC,GAAO,KAELD,EAAIE,QACND,GAAO,KAELD,EAAII,WACNH,GAAO,KAET,IAAIE,EAAYH,EAAIG,UAChBA,GAA6B,oBAAThC,OACtB8B,GAAO,uDAAuD1E,OAAO4C,KAAKE,SAASC,mBAAmBC,KAAKC,UAAU2B,MAAe,QAKtIpB,EAAQC,kBAAkBiB,EAAKoC,EAActD,EAAQA,QACvD,CAoBM0D,CAAMJ,EAActD,EAASiB,EAC/B,EACAc,OAAQ,YArBZ,SAA4BuB,GAE1B,GAAgC,OAA5BA,EAAaK,WACf,OAAO,EAETL,EAAaK,WAAWC,YAAYN,EACtC,CAgBMO,CAAmBP,EACrB,EAEJ,C,UC9CAzH,EAAOG,QAVP,SAA2BkF,EAAKoC,GAC9B,GAAIA,EAAaQ,WACfR,EAAaQ,WAAWC,QAAU7C,MAC7B,CACL,KAAOoC,EAAaU,YAClBV,EAAaM,YAAYN,EAAaU,YAExCV,EAAaJ,YAAYT,SAASwB,eAAe/C,GACnD,CACF,C,mECEA,QAJyB,WACvB,OAAO,gBAACgD,MAAAA,CAAIC,UAAWC,EAAAA,EAAOC,KAChC,C","sources":["webpack://@ampath/esm-reports-app/./src/boxes/extensions/box.scss","webpack://@ampath/esm-reports-app/./node_modules/css-loader/dist/runtime/api.js","webpack://@ampath/esm-reports-app/./node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack://@ampath/esm-reports-app/./src/boxes/extensions/box.scss?64f3","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://@ampath/esm-reports-app/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://@ampath/esm-reports-app/./src/boxes/extensions/red-box.component.tsx"],"names":["___CSS_LOADER_EXPORT___","push","module","id","locals","exports","cssWithMappingToString","list","toString","this","map","item","content","concat","join","i","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","_arrayLikeToArray","arr","len","arr2","Array","_item","isArray","_arrayWithHoles","Symbol","iterator","_s","_e","_arr","_n","_d","call","next","done","value","err","_iterableToArrayLimit","o","minLen","n","Object","prototype","slice","constructor","name","from","test","_unsupportedIterableToArray","TypeError","_nonIterableRest","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","sourceURLs","sources","source","sourceRoot","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","stylesInDOM","getIndexByIdentifier","identifier","result","modulesToDom","idCountMap","identifiers","base","count","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","api","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_index","memo","style","target","styleTarget","document","querySelector","window","HTMLIFrameElement","contentDocument","head","e","getTarget","Error","appendChild","element","createElement","attributes","styleElement","nonce","setAttribute","needLayer","apply","parentNode","removeChild","removeStyleElement","styleSheet","cssText","firstChild","createTextNode","div","className","styles","red"],"sourceRoot":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component demonstrates the creation of an extension.
|
|
3
|
-
*
|
|
4
|
-
* Check out the Extension System docs:
|
|
5
|
-
* https://o3-docs.vercel.app/docs/extension-system
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import styles from './box.scss';
|
|
10
|
-
|
|
11
|
-
const BlueBox: React.FC = () => {
|
|
12
|
-
return <div className={styles.blue}></div>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default BlueBox;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* Extensions should supply the minimum amount of styling
|
|
2
|
-
* necessary. Here, the extensions set only their colors.
|
|
3
|
-
* Their sizes and other general features of their display
|
|
4
|
-
* is controlled by the slot. */
|
|
5
|
-
@use "@carbon/layout";
|
|
6
|
-
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
7
|
-
|
|
8
|
-
.blue {
|
|
9
|
-
background-color: darkblue;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.red {
|
|
13
|
-
background-color: darkred;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Brand colors are special. They must be included using a
|
|
17
|
-
* SASS mix-in (shown here) or using a CSS variable like
|
|
18
|
-
* `var(--brand-01)`. */
|
|
19
|
-
.brand {
|
|
20
|
-
@include brand-01(background-color);
|
|
21
|
-
color: white;
|
|
22
|
-
padding: layout.$spacing-03;
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component demonstrates the creation of an extension.
|
|
3
|
-
*
|
|
4
|
-
* Check out the Extension System docs:
|
|
5
|
-
* https://o3-docs.vercel.app/docs/extension-system
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import styles from './box.scss';
|
|
10
|
-
|
|
11
|
-
const RedBox: React.FC = () => {
|
|
12
|
-
return <div className={styles.brand}></div>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default RedBox;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component demonstrates the creation of an extension.
|
|
3
|
-
*
|
|
4
|
-
* Check out the Extension System docs:
|
|
5
|
-
* https://o3-docs.vercel.app/docs/extension-system
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import styles from './box.scss';
|
|
10
|
-
|
|
11
|
-
const RedBox: React.FC = () => {
|
|
12
|
-
return <div className={styles.red}></div>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default RedBox;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Extension, ExtensionSlot } from '@openmrs/esm-framework';
|
|
4
|
-
import styles from './boxes.scss';
|
|
5
|
-
|
|
6
|
-
export const Boxes: React.FC = () => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<div className={styles.container}>
|
|
11
|
-
<h5>{t('extensionSystem', 'Extension system')}</h5>
|
|
12
|
-
<p>
|
|
13
|
-
{t(
|
|
14
|
-
'extensionExplainer',
|
|
15
|
-
'Here are some colored boxes. Because they are attached as extensions within a slot, an admin can change what boxes are shown using configuration. These boxes happen to be defined in this module, but they could attach to this slot even if they were in a different module.',
|
|
16
|
-
)}
|
|
17
|
-
</p>
|
|
18
|
-
<ExtensionSlot name="Boxes" className={styles.boxes}>
|
|
19
|
-
<div className={styles.box}>
|
|
20
|
-
<Extension />
|
|
21
|
-
</div>
|
|
22
|
-
</ExtensionSlot>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* General features of extension styling are controlled
|
|
2
|
-
* at the slot level. The boxes should know as little as
|
|
3
|
-
* possible about the context where they are used, so
|
|
4
|
-
* they do not set their own sizes.
|
|
5
|
-
*
|
|
6
|
-
* `> * > *` is used to target the outermost DOM node of
|
|
7
|
-
* the extension.
|
|
8
|
-
*/
|
|
9
|
-
@use '@carbon/layout';
|
|
10
|
-
|
|
11
|
-
.box > * > * {
|
|
12
|
-
height: layout.$spacing-10;
|
|
13
|
-
width: layout.$spacing-10;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.boxes {
|
|
17
|
-
margin: layout.$spacing-07 0;
|
|
18
|
-
display: flex;
|
|
19
|
-
gap: layout.$spacing-05;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.container {
|
|
23
|
-
max-width: 50rem;
|
|
24
|
-
margin-top: layout.$spacing-09;
|
|
25
|
-
|
|
26
|
-
> * + * {
|
|
27
|
-
margin-top: layout.$spacing-06;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component demonstrates usage of the config object. Its structure
|
|
3
|
-
* comes from `../config-schema.ts`. For more information about the
|
|
4
|
-
* configuration system, read the docs: https://o3-docs.vercel.app/docs/configuration-system
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { Tile } from '@carbon/react';
|
|
8
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
9
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
10
|
-
import { type Config } from '../config-schema';
|
|
11
|
-
import styles from './greeter.scss';
|
|
12
|
-
|
|
13
|
-
const Greeter: React.FC = () => {
|
|
14
|
-
const { t } = useTranslation();
|
|
15
|
-
const config: Config = useConfig();
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div className={styles.container}>
|
|
19
|
-
<h5>{t('configSystem', 'Configuration system')}</h5>
|
|
20
|
-
<p>
|
|
21
|
-
<Trans key="configSystemExplainer">
|
|
22
|
-
The greeting shown below is driven by the configuration system. To change the configuration properties, click
|
|
23
|
-
the spanner icon in the navbar to pull up the Implementer Tools panel. Then, type <em>template</em> into the{' '}
|
|
24
|
-
<em>Search configuration</em> input. This should filter the configuration properties to show only those that
|
|
25
|
-
are relevant to this module. You can change the values of these properties and click <em>Save</em> to see the
|
|
26
|
-
changes reflected in the UI
|
|
27
|
-
</Trans>
|
|
28
|
-
.
|
|
29
|
-
</p>
|
|
30
|
-
<div className={styles.greeting}>
|
|
31
|
-
<Tile className={styles.tile}>
|
|
32
|
-
{config.casualGreeting ? <Trans key="casualGreeting">hey</Trans> : <Trans key="formalGreeting">hello</Trans>}{' '}
|
|
33
|
-
{/* t('world') */}
|
|
34
|
-
{config.whoToGreet.join(', ')}!
|
|
35
|
-
</Tile>
|
|
36
|
-
</div>
|
|
37
|
-
<br />
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default Greeter;
|
package/src/greeter/greeter.scss
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@use '@carbon/layout';
|
|
2
|
-
@use '@carbon/type';
|
|
3
|
-
|
|
4
|
-
.container {
|
|
5
|
-
max-width: 50rem;
|
|
6
|
-
|
|
7
|
-
> * + * {
|
|
8
|
-
margin-top: layout.$spacing-05;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.greeting {
|
|
13
|
-
text-transform: capitalize;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.tile {
|
|
17
|
-
border: 1px solid lightgray;
|
|
18
|
-
max-width: 15rem;
|
|
19
|
-
@include type.type-style('heading-compact-01');
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
4
|
-
import { Config } from '../config-schema';
|
|
5
|
-
import Greeter from './greeter.component';
|
|
6
|
-
|
|
7
|
-
const mockUseConfig = jest.mocked(useConfig<Config>);
|
|
8
|
-
|
|
9
|
-
it('displays the expected default text', () => {
|
|
10
|
-
const config: Config = { casualGreeting: false, whoToGreet: ['World'] };
|
|
11
|
-
mockUseConfig.mockReturnValue(config);
|
|
12
|
-
|
|
13
|
-
render(<Greeter />);
|
|
14
|
-
|
|
15
|
-
expect(screen.getByText(/world/i)).toHaveTextContent('hello World!');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('casually greets my friends', () => {
|
|
19
|
-
const config: Config = {
|
|
20
|
-
casualGreeting: true,
|
|
21
|
-
whoToGreet: ['Ariel', 'Barak', 'Callum'],
|
|
22
|
-
};
|
|
23
|
-
mockUseConfig.mockReturnValue(config);
|
|
24
|
-
|
|
25
|
-
render(<Greeter />);
|
|
26
|
-
|
|
27
|
-
expect(screen.getByText(/ariel/i)).toHaveTextContent('hey Ariel, Barak, Callum!');
|
|
28
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Components that make queries delegate the query-making logic to a
|
|
3
|
-
* `.resource.ts` function. This component leverages the`usePatient`
|
|
4
|
-
* hook to fetch a patient from the backend. When the button is clicked,
|
|
5
|
-
* the `patientName` variable is set to "test", which triggers the hook
|
|
6
|
-
* to make a request to the backend. The hook returns patient data from the
|
|
7
|
-
* request, which is then rendered in the UI. The hook also returns a boolean
|
|
8
|
-
* property called `isLoading` that is set to true while the request is being
|
|
9
|
-
* made. This component renders a loading indicator while `isLoading` is true.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import React, { useState } from 'react';
|
|
13
|
-
import { Button, InlineLoading, Tile } from '@carbon/react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { usePatient } from './patient-getter.resource';
|
|
16
|
-
import styles from './patient-getter.scss';
|
|
17
|
-
|
|
18
|
-
function PatientGetter() {
|
|
19
|
-
const { t } = useTranslation();
|
|
20
|
-
const [patientName, setPatientName] = useState(null);
|
|
21
|
-
const { patient, isLoading } = usePatient(patientName);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={styles.container}>
|
|
25
|
-
<h5>{t('dataFetching', 'Data fetching')}</h5>
|
|
26
|
-
<p>{t('patientGetterExplainer', 'Try clicking the button below to fetch a patient from the backend')}:</p>
|
|
27
|
-
<Button onClick={() => setPatientName('test')}>{t('getPatient', 'Get a patient named')} 'test'</Button>
|
|
28
|
-
{isLoading ? <InlineLoading description={t('loading', 'Loading') + '...'} role="progressbar" /> : null}
|
|
29
|
-
{patient ? (
|
|
30
|
-
<Tile className={styles.tile}>
|
|
31
|
-
{patient
|
|
32
|
-
? `${patient.name[0].given} ${patient.name[0].family} / ${patient.gender} / ${patient.birthDate}`
|
|
33
|
-
: null}
|
|
34
|
-
</Tile>
|
|
35
|
-
) : null}
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default PatientGetter;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import useSWR from 'swr';
|
|
2
|
-
import { fhirBaseUrl, openmrsFetch } from '@openmrs/esm-framework';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This hook searches for a patient using the provided search term from the
|
|
6
|
-
* OpenMRS FHIR API.It leverages the useSWR hook from the SWR library
|
|
7
|
-
* https://swr.vercel.app/docs/data-fetching to fetch data. SWR provides a
|
|
8
|
-
* number of benefits over the standard React useEffect hook, including:
|
|
9
|
-
*
|
|
10
|
-
* - Fast, lightweight and reusable data fetching
|
|
11
|
-
* - Built-in cache and request deduplication
|
|
12
|
-
* - Real-time updates
|
|
13
|
-
* - Simplified error and loading state handling, and more.
|
|
14
|
-
*
|
|
15
|
-
* We recommend using SWR for data fetching in your OpenMRS frontend modules.
|
|
16
|
-
*
|
|
17
|
-
* See the docs for the underlying fhir.js Client object: https://github.com/FHIR/fhir.js#api
|
|
18
|
-
* See the OpenMRS FHIR Module docs: https://wiki.openmrs.org/display/projects/OpenMRS+FHIR+Module
|
|
19
|
-
* See the OpenMRS REST API docs: https://rest.openmrs.org/#openmrs-rest-api
|
|
20
|
-
*
|
|
21
|
-
* @param query A patient name or ID
|
|
22
|
-
* @returns The first matching patient
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export function usePatient(query: string) {
|
|
26
|
-
const url = `${fhirBaseUrl}/Patient?name=${query}&_summary=data`;
|
|
27
|
-
const { data, error, isLoading } = useSWR<
|
|
28
|
-
{
|
|
29
|
-
data: { entry: Array<{ resource: fhir.Patient }> };
|
|
30
|
-
},
|
|
31
|
-
Error
|
|
32
|
-
>(query ? url : null, openmrsFetch);
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
patient: data ? data?.data?.entry[0].resource : null,
|
|
36
|
-
error: error,
|
|
37
|
-
isLoading,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@use '@carbon/layout';
|
|
2
|
-
@use '@carbon/type';
|
|
3
|
-
|
|
4
|
-
.container {
|
|
5
|
-
margin-top: layout.$spacing-09;
|
|
6
|
-
|
|
7
|
-
> * + * {
|
|
8
|
-
margin-top: layout.$spacing-06;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.tile {
|
|
13
|
-
border: 1px solid lightgray;
|
|
14
|
-
max-width: 20rem;
|
|
15
|
-
@include type.type-style('heading-compact-01');
|
|
16
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import PatientGetter from './patient-getter.component';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This is an idiomatic mock of a backend resource. We generally mock resource fetching functions like `usePatient`, rather than mocking `fetch` or anything lower-level.
|
|
8
|
-
*/
|
|
9
|
-
jest.mock('./patient-getter.resource.ts', () => ({
|
|
10
|
-
usePatient: jest.fn(() => ({
|
|
11
|
-
patient: {
|
|
12
|
-
birthDate: '1997-05-21',
|
|
13
|
-
gender: 'male',
|
|
14
|
-
name: [
|
|
15
|
-
{
|
|
16
|
-
family: 'Testguy',
|
|
17
|
-
given: 'Joeboy',
|
|
18
|
-
id: 'abc123',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
})),
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
it('gets a patient when the button is clicked', async () => {
|
|
26
|
-
render(<PatientGetter />);
|
|
27
|
-
|
|
28
|
-
const user = userEvent.setup();
|
|
29
|
-
const heading = screen.getByRole('heading', { name: /data fetching/i });
|
|
30
|
-
const button = screen.getByRole('button', {
|
|
31
|
-
name: /get a patient named 'test'/i,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
expect(heading).toBeInTheDocument();
|
|
35
|
-
expect(button).toBeInTheDocument();
|
|
36
|
-
|
|
37
|
-
await waitFor(() => user.click(button));
|
|
38
|
-
|
|
39
|
-
expect(screen.getByText(/Joeboy Testguy \/ male \/ 1997-05-21/)).toBeInTheDocument();
|
|
40
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ClickableTile } from '@carbon/react';
|
|
3
|
-
import { ChevronRight } from '@carbon/react/icons';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import styles from './resources.scss';
|
|
6
|
-
|
|
7
|
-
function Resources() {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<div className={styles.resources}>
|
|
12
|
-
<h4 className={styles.heading}>{t('resources', 'Resources')}</h4>
|
|
13
|
-
<span className={styles.explainer}>{t('usefulLinks', 'Below are some links to useful resources')}:</span>
|
|
14
|
-
<div className={styles.cardsContainer}>
|
|
15
|
-
<Card
|
|
16
|
-
title={t('getStarted', 'Get started')}
|
|
17
|
-
subtitle={t('getStartedExplainer', 'Create a frontend module from this template') + '.'}
|
|
18
|
-
link="https://github.com/openmrs/openmrs-esm-template-app/generate"
|
|
19
|
-
/>
|
|
20
|
-
<Card
|
|
21
|
-
title={t('frontendDocs', 'Frontend docs')}
|
|
22
|
-
subtitle={t('learnExplainer', 'Learn how to use the O3 framework') + '.'}
|
|
23
|
-
link="https://openmrs.atlassian.net/wiki/spaces/docs/pages/151093495/Introduction+to+O3+for+Developers"
|
|
24
|
-
/>
|
|
25
|
-
<Card
|
|
26
|
-
title={t('designDocs', 'Design docs')}
|
|
27
|
-
subtitle={t('designDocsExplainer', 'Read the O3 design documentation') + '.'}
|
|
28
|
-
link="https://zeroheight.com/23a080e38/p/880723-introduction"
|
|
29
|
-
/>
|
|
30
|
-
<Card
|
|
31
|
-
title={t('connect', 'Connect')}
|
|
32
|
-
subtitle={t('connectExplainer', 'Get in touch with the community') + '.'}
|
|
33
|
-
link="https://slack.openmrs.org/"
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function Card({ title, subtitle, link }: { title: string; subtitle: string; link: string }) {
|
|
41
|
-
return (
|
|
42
|
-
<a href={link} target="_blank" rel="noopener noreferrer" className={styles.cardLink}>
|
|
43
|
-
<ClickableTile className={styles.card}>
|
|
44
|
-
<div className={styles.cardContent}>
|
|
45
|
-
<div className={styles.title}>
|
|
46
|
-
<h4>{title}</h4>
|
|
47
|
-
<ChevronRight />
|
|
48
|
-
</div>
|
|
49
|
-
<span className={styles.subtitle}>{subtitle}</span>
|
|
50
|
-
</div>
|
|
51
|
-
</ClickableTile>
|
|
52
|
-
</a>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default Resources;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
@use '@carbon/layout';
|
|
2
|
-
@use '@carbon/type';
|
|
3
|
-
|
|
4
|
-
.container {
|
|
5
|
-
padding: layout.$spacing-07;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.heading {
|
|
9
|
-
@include type.type-style('heading-04');
|
|
10
|
-
margin: layout.$spacing-05 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.explainer {
|
|
14
|
-
display: block;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.resources {
|
|
18
|
-
margin-top: layout.$spacing-10;
|
|
19
|
-
margin-bottom: layout.$spacing-09;
|
|
20
|
-
|
|
21
|
-
> * + * {
|
|
22
|
-
margin-right: layout.$spacing-05;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.cardsContainer {
|
|
27
|
-
display: grid;
|
|
28
|
-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
29
|
-
column-gap: layout.$spacing-06;
|
|
30
|
-
margin-top: layout.$spacing-07;
|
|
31
|
-
max-width: 75%;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.card {
|
|
35
|
-
margin: layout.$spacing-03 0;
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
|
|
39
|
-
&:hover {
|
|
40
|
-
border: 1px solid lightgray;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
svg {
|
|
44
|
-
margin-left: layout.$spacing-02;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.cardLink {
|
|
49
|
-
text-decoration: none;
|
|
50
|
-
color: inherit;
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.cardContent {
|
|
55
|
-
display: flex;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.title {
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
margin-bottom: layout.$spacing-05;
|
|
63
|
-
|
|
64
|
-
h4 {
|
|
65
|
-
@include type.type-style('heading-02');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
package/src/root.test.tsx
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is the root test for this page. It simply checks that the page
|
|
3
|
-
* renders. If the components of your page are highly interdependent,
|
|
4
|
-
* (e.g., if the `Root` component had state that communicated
|
|
5
|
-
* information between `Greeter` and `PatientGetter`) then you might
|
|
6
|
-
* want to do most of your testing here. If those components are
|
|
7
|
-
* instead quite independent (as is the case in this example), then
|
|
8
|
-
* it would make more sense to test those components independently.
|
|
9
|
-
*
|
|
10
|
-
* The key thing to remember, always, is: write tests that behave like
|
|
11
|
-
* users. They should *look* for elements by their visual
|
|
12
|
-
* characteristics, *interact* with them, and (mostly) *assert* based
|
|
13
|
-
* on things that would be visually apparent to a user.
|
|
14
|
-
*
|
|
15
|
-
* To learn more about how we do testing, see the following resources:
|
|
16
|
-
* https://o3-docs.vercel.app/docs/frontend-modules/testing
|
|
17
|
-
* https://kentcdodds.com/blog/how-to-know-what-to-test
|
|
18
|
-
* https://kentcdodds.com/blog/testing-implementation-details
|
|
19
|
-
* https://kentcdodds.com/blog/common-mistakes-with-react-testing-library
|
|
20
|
-
*
|
|
21
|
-
* Kent C. Dodds is the inventor of `@testing-library`:
|
|
22
|
-
* https://testing-library.com/docs/guiding-principles
|
|
23
|
-
*/
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import { render, screen } from '@testing-library/react';
|
|
26
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
27
|
-
import { Config } from './config-schema';
|
|
28
|
-
import Root from './root.component';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* This is an idiomatic way of dealing with mocked files. Note that
|
|
32
|
-
* `useConfig` is already mocked; the Jest moduleNameMapper (see the
|
|
33
|
-
* Jest config) has mapped the `@openmrs/esm-framework` import to a
|
|
34
|
-
* mock file. This line just tells TypeScript that the object is, in
|
|
35
|
-
* fact, a mock, and so will have methods like `mockReturnValue`.
|
|
36
|
-
*/
|
|
37
|
-
const mockUseConfig = jest.mocked(useConfig<Config>);
|
|
38
|
-
|
|
39
|
-
it('renders a landing page for the Template app', () => {
|
|
40
|
-
const config: Config = { casualGreeting: false, whoToGreet: ['World'] };
|
|
41
|
-
mockUseConfig.mockReturnValue(config);
|
|
42
|
-
|
|
43
|
-
render(<Root />);
|
|
44
|
-
|
|
45
|
-
expect(screen.getByRole('heading', { name: /welcome to the o3 template app/i })).toBeInTheDocument();
|
|
46
|
-
expect(screen.getByRole('heading', { name: /configuration system/i })).toBeInTheDocument();
|
|
47
|
-
expect(screen.getByRole('heading', { name: /extension system/i })).toBeInTheDocument();
|
|
48
|
-
expect(screen.getByRole('heading', { name: /data fetching/i })).toBeInTheDocument();
|
|
49
|
-
expect(screen.getByRole('heading', { name: /resources/i })).toBeInTheDocument();
|
|
50
|
-
expect(screen.getByRole('button', { name: /get a patient named 'test'/i })).toBeInTheDocument();
|
|
51
|
-
});
|