@openmrs/esm-appointments-app 5.2.2-pre.2441 → 5.2.2-pre.2447
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/.turbo/turbo-build.log +2 -2
- package/dist/{755.js → 799.js} +1 -1
- package/dist/799.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-appointments-app.js +1 -1
- package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +28 -28
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/admin/appointment-services/appointment-services.component.tsx +1 -1
- package/src/appointments/appointment-tabs.component.tsx +2 -2
- package/src/appointments/appointment-tabs.test.tsx +4 -4
- package/src/appointments/common-components/appointments-actions.component.tsx +4 -2
- package/src/appointments/common-components/appointments-actions.test.tsx +1 -1
- package/src/appointments/common-components/appointments-table.component.tsx +2 -2
- package/src/appointments/common-components/appointments-table.test.tsx +1 -1
- package/src/appointments/common-components/checkin-button.component.tsx +1 -1
- package/src/appointments/details/appointment-details.component.tsx +1 -1
- package/src/appointments/forms/cancel-form/cancel-appointment.component.tsx +1 -1
- package/src/appointments/forms/cancel-form/cancel-appointment.test.tsx +3 -3
- package/src/appointments/forms/create-edit-form/appointments-form.component.tsx +5 -5
- package/src/appointments/forms/create-edit-form/appointments-form.test.tsx +14 -9
- package/src/appointments/forms/{useInitialFormValues.tsx → useInitialFormValues.ts} +3 -3
- package/src/appointments/unscheduled/unscheduled-appointments.component.tsx +1 -1
- package/src/appointments-calendar/calendar-view.component.tsx +1 -1
- package/src/appointments-calendar/daily/daily-calendar-view.component.tsx +2 -2
- package/src/appointments-calendar/daily/daily-header.component.tsx +2 -2
- package/src/appointments-calendar/daily/daily-view-workload.component.tsx +3 -3
- package/src/appointments-calendar/daily/daily-view-workload.test.tsx +1 -1
- package/src/appointments-calendar/monthly/monthly-calendar-view.component.tsx +2 -2
- package/src/appointments-calendar/monthly/monthly-header.module.tsx +3 -5
- package/src/appointments-calendar/weekly/weekly-calendar-view.component.tsx +4 -4
- package/src/appointments-calendar/weekly/weekly-header.component.tsx +5 -5
- package/src/appointments-calendar/weekly/weekly-view-workload.component.tsx +4 -4
- package/src/appointments-calendar/weekly/weekly-view-workload.test.tsx +1 -1
- package/src/appointments-metrics/appointments-metrics.test.tsx +8 -10
- package/src/appointments.test.tsx +6 -4
- package/src/createDashboardLink.component.tsx +5 -6
- package/src/home-appointments/appointments-list.component.tsx +2 -2
- package/src/home-appointments/appointments-list.test.tsx +3 -3
- package/src/hooks/{useAppointmentList.tsx → useAppointmentList.ts} +1 -1
- package/src/hooks/{useAppointmentService.tsx → useAppointmentService.ts} +1 -1
- package/src/hooks/{useAppointments.tsx → useAppointments.ts} +1 -1
- package/src/hooks/{useAppointmentsCalendar.tsx → useAppointmentsCalendar.ts} +1 -1
- package/src/hooks/{useClinicalMetrics.tsx → useClinicalMetrics.ts} +1 -1
- package/src/hooks/{useDefaultLocation.tsx → useDefaultLocation.ts} +1 -1
- package/src/hooks/{usePatientAppointmentHistory.tsx → usePatientAppointmentHistory.ts} +1 -1
- package/src/hooks/{useProviders.tsx → useProviders.ts} +1 -1
- package/src/hooks/{useUnscheduledAppointments.tsx → useUnscheduledAppointments.ts} +2 -2
- package/src/hooks/{useVisits.tsx → useVisits.ts} +1 -1
- package/src/overlay.component.tsx +2 -2
- package/src/past-visit/encounter-list.component.tsx +1 -1
- package/src/past-visit/past-visit.component.tsx +2 -2
- package/src/patient-queue/visit-form/visit-form.component.tsx +3 -3
- package/tsconfig.json +1 -1
- package/dist/755.js.map +0 -1
- /package/src/hooks/{useServiceQueus.tsx → useServiceQueus.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var _openmrs_esm_appointments_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,p,f,d,c,h,m={5605:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(255),t.e(549),t.e(268),t.e(325),t.e(
|
|
1
|
+
var _openmrs_esm_appointments_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,p,f,d,c,h,m={5605:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(255),t.e(549),t.e(268),t.e(325),t.e(799)]).then((()=>()=>t(4799)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},v={};function g(e){var r=v[e];if(void 0!==r)return r.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return m[e].call(t.exports,t,t.exports,g),t.loaded=!0,t.exports}g.m=m,g.c=v,g.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return g.d(r,{a:r}),r},g.d=(e,r)=>{for(var t in r)g.o(r,t)&&!g.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},g.f={},g.e=e=>Promise.all(Object.keys(g.f).reduce(((r,t)=>(g.f[t](e,r),r)),[])),g.u=e=>e+".js",g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@openmrs/esm-appointments-app:",g.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var p=s[u];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+o){i=p;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,g.nc&&i.setAttribute("nonce",g.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var f=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),l&&document.head.appendChild(i)}},g.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{g.S={};var e={},r={};g.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];g.o(g.S,t)||(g.S[t]={});var a=g.S[t],i="@openmrs/esm-appointments-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","5.3.1-pre.1182",(()=>Promise.all([g.e(130),g.e(268)]).then((()=>()=>g(130))))),l("react-i18next","11.18.6",(()=>Promise.all([g.e(268),g.e(610)]).then((()=>()=>g(610))))),l("react-router-dom","6.4.3",(()=>Promise.all([g.e(591),g.e(268)]).then((()=>()=>g(6591))))),l("react","18.2.0",(()=>g.e(784).then((()=>()=>g(2784))))),l("swr/_internal","2.0.1",(()=>Promise.all([g.e(729),g.e(268)]).then((()=>()=>g(4729))))),l("swr/immutable","2.0.1",(()=>Promise.all([g.e(255),g.e(268),g.e(325),g.e(152)]).then((()=>()=>g(2303)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;g.g.importScripts&&(e=g.g.location+"");var r=g.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),g.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(l=e[a]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var i=[];for(a=1;a<e.length;a++){var l=e[a];i.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?i.pop()+" "+i.pop():o(l))}return s();function s(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,s=!0;;l++,i++){var u,p,f=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(p=(typeof(u=r[i]))[0]))return!s||("u"==f?l>n&&!o:""==f!=o);if("u"==p){if(!s||"u"!=f)return!1}else if(s)if(f==p)if(l<=n){if(u!=e[l])return!1}else{if(o?u>e[l]:u<e[l])return!1;u!=e[l]&&(s=!1)}else if("s"!=f&&"n"!=f){if(o||l<=n)return!1;s=!1,l--}else{if(l<=n||p<f!=o)return!1;s=!1}else"s"!=f&&"n"!=f&&(s=!1,l--)}}var d=[],c=d.pop.bind(d);for(i=1;i<e.length;i++){var h=e[i];d.push(1==h?c()|c():2==h?c()&c():h?a(h,r):!c())}return!!c()},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},l=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",s=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||u(l(e,t,o,n)),p(e[t][o])},u=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},p=e=>(e.loaded=1,e.get()),f=(e=>function(r,t,n,o){var a=g.I(r);return a&&a.then?a.then(e.bind(e,r,g.S[r],t,n,o)):e(0,g.S[r],t,n,o)})(((e,r,t,n,o)=>r&&g.o(r,t)?s(r,0,t,n):o())),d={},c={268:()=>f("default","react",[1,18],(()=>g.e(784).then((()=>()=>g(2784))))),3325:()=>f("default","swr/_internal",[1,2],(()=>g.e(729).then((()=>()=>g(4729))))),2870:()=>f("default","@openmrs/esm-framework",[1,5],(()=>g.e(130).then((()=>()=>g(130))))),4924:()=>f("default","react-i18next",[1,11],(()=>g.e(469).then((()=>()=>g(610))))),8744:()=>f("default","react-router-dom",[1,6],(()=>g.e(591).then((()=>()=>g(6591))))),9198:()=>f("default","swr/immutable",[1,2],(()=>g.e(303).then((()=>()=>g(2303)))))},h={268:[268],325:[3325],799:[2870,4924,8744,9198]},g.f.consumes=(e,r)=>{g.o(h,e)&&h[e].forEach((e=>{if(g.o(d,e))return r.push(d[e]);var t=r=>{d[e]=0,g.m[e]=t=>{delete g.c[e],t.exports=r()}},n=r=>{delete d[e],g.m[e]=t=>{throw delete g.c[e],r}};try{var o=c[e]();o.then?r.push(d[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={529:0};g.f.j=(r,t)=>{var n=g.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(268|325)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=g.p+g.u(r),i=new Error;g.l(a,(t=>{if(g.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);l&&l(g)}for(r&&r(t);s<a.length;s++)o=a[s],g.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),g.nc=void 0;var b=g(5605);_openmrs_esm_appointments_app=b})();
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"initial": true,
|
|
81
81
|
"entry": true,
|
|
82
82
|
"recorded": false,
|
|
83
|
-
"size":
|
|
83
|
+
"size": 4539159,
|
|
84
84
|
"sizes": {
|
|
85
85
|
"consume-shared": 252,
|
|
86
|
-
"javascript":
|
|
86
|
+
"javascript": 4518237,
|
|
87
87
|
"share-init": 252,
|
|
88
88
|
"runtime": 20418
|
|
89
89
|
},
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"auxiliaryFiles": [
|
|
101
101
|
"main.js.map"
|
|
102
102
|
],
|
|
103
|
-
"hash": "
|
|
103
|
+
"hash": "f60c37a1371cf14c",
|
|
104
104
|
"childrenByOrder": {}
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"auxiliaryFiles": [
|
|
289
289
|
"openmrs-esm-appointments-app.js.map"
|
|
290
290
|
],
|
|
291
|
-
"hash": "
|
|
291
|
+
"hash": "56133487e3321f5e",
|
|
292
292
|
"childrenByOrder": {}
|
|
293
293
|
},
|
|
294
294
|
{
|
|
@@ -417,30 +417,6 @@
|
|
|
417
417
|
"hash": "72c13b51b2b3243a",
|
|
418
418
|
"childrenByOrder": {}
|
|
419
419
|
},
|
|
420
|
-
{
|
|
421
|
-
"rendered": true,
|
|
422
|
-
"initial": false,
|
|
423
|
-
"entry": false,
|
|
424
|
-
"recorded": false,
|
|
425
|
-
"size": 480625,
|
|
426
|
-
"sizes": {
|
|
427
|
-
"javascript": 480457,
|
|
428
|
-
"consume-shared": 168
|
|
429
|
-
},
|
|
430
|
-
"names": [],
|
|
431
|
-
"idHints": [],
|
|
432
|
-
"runtime": [
|
|
433
|
-
"@openmrs/esm-appointments-app"
|
|
434
|
-
],
|
|
435
|
-
"files": [
|
|
436
|
-
"755.js"
|
|
437
|
-
],
|
|
438
|
-
"auxiliaryFiles": [
|
|
439
|
-
"755.js.map"
|
|
440
|
-
],
|
|
441
|
-
"hash": "ec0e13a531b07fa9",
|
|
442
|
-
"childrenByOrder": {}
|
|
443
|
-
},
|
|
444
420
|
{
|
|
445
421
|
"rendered": true,
|
|
446
422
|
"initial": false,
|
|
@@ -509,6 +485,30 @@
|
|
|
509
485
|
"hash": "8586d3ab3d3eed3b",
|
|
510
486
|
"childrenByOrder": {}
|
|
511
487
|
},
|
|
488
|
+
{
|
|
489
|
+
"rendered": true,
|
|
490
|
+
"initial": false,
|
|
491
|
+
"entry": false,
|
|
492
|
+
"recorded": false,
|
|
493
|
+
"size": 480712,
|
|
494
|
+
"sizes": {
|
|
495
|
+
"javascript": 480544,
|
|
496
|
+
"consume-shared": 168
|
|
497
|
+
},
|
|
498
|
+
"names": [],
|
|
499
|
+
"idHints": [],
|
|
500
|
+
"runtime": [
|
|
501
|
+
"@openmrs/esm-appointments-app"
|
|
502
|
+
],
|
|
503
|
+
"files": [
|
|
504
|
+
"799.js"
|
|
505
|
+
],
|
|
506
|
+
"auxiliaryFiles": [
|
|
507
|
+
"799.js.map"
|
|
508
|
+
],
|
|
509
|
+
"hash": "cb650b910065da8e",
|
|
510
|
+
"childrenByOrder": {}
|
|
511
|
+
},
|
|
512
512
|
{
|
|
513
513
|
"rendered": true,
|
|
514
514
|
"initial": false,
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.2447"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, ButtonSet, Dropdown, Layer, SelectItem, TextInput, TimePicker, TimePickerSelect } from '@carbon/react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Form, Formik, FormikHelpers } from 'formik';
|
|
4
|
+
import { Form, Formik, type FormikHelpers } from 'formik';
|
|
5
5
|
import { validationSchema } from './appointment-services-validation';
|
|
6
6
|
import { useAppointmentServices } from './appointment-services-hook';
|
|
7
7
|
import { showNotification, showToast, useLocations } from '@openmrs/esm-framework';
|
|
@@ -2,12 +2,12 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Tab, TabList, Tabs, TabPanel, TabPanels } from '@carbon/react';
|
|
4
4
|
|
|
5
|
+
import { type ConfigObject } from '../config-schema';
|
|
6
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
5
7
|
import { useVisits } from '../hooks/useVisits';
|
|
6
8
|
import ScheduledAppointments from './scheduled/scheduled-appointments.component';
|
|
7
9
|
import UnscheduledAppointments from './unscheduled/unscheduled-appointments.component';
|
|
8
10
|
import styles from './appointment-tabs.scss';
|
|
9
|
-
import { ConfigObject } from '../config-schema';
|
|
10
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
11
11
|
|
|
12
12
|
interface AppointmentTabsProps {
|
|
13
13
|
appointmentServiceType: string;
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
5
|
-
import { renderWithSwr, waitForLoadingToFinish } from '
|
|
5
|
+
import { renderWithSwr, waitForLoadingToFinish } from 'tools';
|
|
6
|
+
import { mockAppointmentsData } from '__mocks__';
|
|
6
7
|
import AppointmentTabs from './appointment-tabs.component';
|
|
7
|
-
import { mockAppointmentsData } from '../../../../__mocks__/appointments.mock';
|
|
8
8
|
|
|
9
9
|
const mockOpenmrsFetch = openmrsFetch as jest.Mock;
|
|
10
10
|
|
|
11
|
-
jest.setTimeout(
|
|
11
|
+
jest.setTimeout(10000);
|
|
12
12
|
|
|
13
13
|
describe('AppointmentTabs', () => {
|
|
14
14
|
xit(`renders tabs showing different appointment lists`, async () => {
|
|
@@ -53,5 +53,5 @@ describe('AppointmentTabs', () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
function renderAppointmentTabs() {
|
|
56
|
-
renderWithSwr(<AppointmentTabs />);
|
|
56
|
+
renderWithSwr(<AppointmentTabs appointmentServiceType="" />);
|
|
57
57
|
}
|
|
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
9
9
|
import { launchOverlay } from '../../hooks/useOverlay';
|
|
10
10
|
import AppointmentForm from '../forms/create-edit-form/appointments-form.component';
|
|
11
11
|
import CheckInButton from './checkin-button.component';
|
|
12
|
-
import { MappedAppointment } from '../../types';
|
|
12
|
+
import { type MappedAppointment } from '../../types';
|
|
13
13
|
import { showModal } from '@openmrs/esm-framework';
|
|
14
14
|
import { useVisits } from '../../hooks/useVisits';
|
|
15
15
|
import DefaulterTracingForm from '../forms/defaulter-tracing-form/default-tracing-form.component';
|
|
@@ -70,7 +70,7 @@ const AppointmentActions: React.FC<AppointmentActionsProps> = ({ visits, appoint
|
|
|
70
70
|
{t('checkOut', 'Check out')}
|
|
71
71
|
</Button>
|
|
72
72
|
);
|
|
73
|
-
case isTodayAppointment:
|
|
73
|
+
case isTodayAppointment: {
|
|
74
74
|
const isAfterNoon = new Date().getHours() > 12;
|
|
75
75
|
|
|
76
76
|
if (scheduleType === 'Pending' && isAfterNoon) {
|
|
@@ -82,6 +82,8 @@ const AppointmentActions: React.FC<AppointmentActionsProps> = ({ visits, appoint
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
return <CheckInButton patientUuid={patientUuid} appointment={appointment} />;
|
|
85
|
+
}
|
|
86
|
+
|
|
85
87
|
default:
|
|
86
88
|
if (!isFutureAppointment) {
|
|
87
89
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AppointmentActions from './appointments-actions.component';
|
|
4
|
-
import { MappedAppointment } from '../../types';
|
|
4
|
+
import { type MappedAppointment } from '../../types';
|
|
5
5
|
|
|
6
6
|
describe('AppointmentActions', () => {
|
|
7
7
|
const defaultProps = {
|
|
@@ -25,9 +25,9 @@ import { Download } from '@carbon/react/icons';
|
|
|
25
25
|
import { EmptyState } from '../../empty-state/empty-state.component';
|
|
26
26
|
import { downloadAppointmentsAsExcel } from '../../helpers/excel';
|
|
27
27
|
import { launchOverlay } from '../../hooks/useOverlay';
|
|
28
|
-
import { MappedAppointment } from '../../types';
|
|
28
|
+
import { type MappedAppointment } from '../../types';
|
|
29
29
|
import { getPageSizes, useSearchResults } from '../utils';
|
|
30
|
-
import { ConfigObject } from '../../config-schema';
|
|
30
|
+
import { type ConfigObject } from '../../config-schema';
|
|
31
31
|
import AppointmentDetails from '../details/appointment-details.component';
|
|
32
32
|
import AppointmentActions from './appointments-actions.component';
|
|
33
33
|
import PatientSearch from '../../patient-search/patient-search.component';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import { MappedAppointment } from '../../types';
|
|
4
|
+
import { type MappedAppointment } from '../../types';
|
|
5
5
|
import { usePagination } from '@openmrs/esm-framework';
|
|
6
6
|
import { downloadAppointmentsAsExcel } from '../../helpers/excel';
|
|
7
7
|
import { launchOverlay } from '../../hooks/useOverlay';
|
|
@@ -3,7 +3,7 @@ import { Button } from '@carbon/react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { launchOverlay } from '../../hooks/useOverlay';
|
|
5
5
|
import VisitForm from '../../patient-queue/visit-form/visit-form.component';
|
|
6
|
-
import { MappedAppointment } from '../../types';
|
|
6
|
+
import { type MappedAppointment } from '../../types';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
8
|
import isToday from 'dayjs/plugin/isToday';
|
|
9
9
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { MappedAppointment } from '../../types/index';
|
|
3
|
+
import { type MappedAppointment } from '../../types/index';
|
|
4
4
|
import styles from './appointment-details.scss';
|
|
5
5
|
import { usePatientAppointmentHistory } from '../../hooks/usePatientAppointmentHistory';
|
|
6
6
|
import { formatDate } from '@openmrs/esm-framework';
|
|
@@ -6,7 +6,7 @@ import { cancelAppointment } from '../forms.resource';
|
|
|
6
6
|
import { useSWRConfig } from 'swr';
|
|
7
7
|
import { useAppointmentDate } from '../../../helpers';
|
|
8
8
|
import { closeOverlay } from '../../../hooks/useOverlay';
|
|
9
|
-
import { MappedAppointment } from '../../../types';
|
|
9
|
+
import { type MappedAppointment } from '../../../types';
|
|
10
10
|
import styles from './cancel-appointment.scss';
|
|
11
11
|
|
|
12
12
|
interface CancelAppointmentProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { screen, render } from '@testing-library/react';
|
|
4
|
-
import { mockMappedAppointmentsData } from '../../../../../../__mocks__/appointments.mock';
|
|
5
4
|
import { showNotification, showToast } from '@openmrs/esm-framework';
|
|
6
5
|
import { cancelAppointment } from '../forms.resource';
|
|
6
|
+
import { mockMappedAppointmentsData } from '__mocks__';
|
|
7
7
|
import CancelAppointment from './cancel-appointment.component';
|
|
8
8
|
|
|
9
9
|
const testProps = {
|
|
@@ -14,8 +14,8 @@ const mockShowToast = showToast as jest.Mock;
|
|
|
14
14
|
const mockCancelAppointment = cancelAppointment as jest.Mock;
|
|
15
15
|
const mockShowNotification = showNotification as jest.Mock;
|
|
16
16
|
|
|
17
|
-
jest.mock('../forms.resource
|
|
18
|
-
const originalModule = jest.requireActual('../forms.resource
|
|
17
|
+
jest.mock('../forms.resource', () => {
|
|
18
|
+
const originalModule = jest.requireActual('../forms.resource');
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
21
|
...originalModule,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
Toggle,
|
|
29
29
|
} from '@carbon/react';
|
|
30
30
|
import {
|
|
31
|
+
type ConfigObject,
|
|
31
32
|
ExtensionSlot,
|
|
32
33
|
showNotification,
|
|
33
34
|
showToast,
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
} from '@openmrs/esm-framework';
|
|
40
41
|
import { useAppointmentDate, convertTime12to24 } from '../../../helpers';
|
|
41
42
|
import { closeOverlay } from '../../../hooks/useOverlay';
|
|
42
|
-
import { MappedAppointment, AppointmentPayload } from '../../../types';
|
|
43
|
+
import { type MappedAppointment, type AppointmentPayload } from '../../../types';
|
|
43
44
|
import {
|
|
44
45
|
saveAppointment,
|
|
45
46
|
toAppointmentDateTime,
|
|
@@ -47,14 +48,13 @@ import {
|
|
|
47
48
|
useProviders,
|
|
48
49
|
useServices,
|
|
49
50
|
} from '../forms.resource';
|
|
50
|
-
import {
|
|
51
|
+
import { useAppointmentList } from '../../../hooks/useAppointmentList';
|
|
51
52
|
import { useCalendarDistribution } from '../workload-helper';
|
|
52
53
|
import { useDefaultLoginLocation } from '../../../hooks/useDefaultLocation';
|
|
54
|
+
import { useInitialAppointmentFormValue, type PatientAppointment } from '../useInitialFormValues';
|
|
53
55
|
import LocationSelectOption from '../../common-components/location-select-option.component';
|
|
54
56
|
import WorkloadCard from '../workload.component';
|
|
55
57
|
import styles from './appointments-form.scss';
|
|
56
|
-
import { useAppointmentList } from '../../../hooks/useAppointmentList';
|
|
57
|
-
import { ConfigObject } from '../../../config-schema';
|
|
58
58
|
|
|
59
59
|
interface AppointmentFormProps {
|
|
60
60
|
appointment?: MappedAppointment;
|
|
@@ -185,7 +185,7 @@ const AppointmentForm: React.FC<AppointmentFormProps> = ({ appointment, patientU
|
|
|
185
185
|
id="location"
|
|
186
186
|
invalidText="Required"
|
|
187
187
|
value={selectedLocation}
|
|
188
|
-
|
|
188
|
+
defaultValue={selectedLocation}
|
|
189
189
|
onChange={(event) => setSelectedLocation(event.target.value)}>
|
|
190
190
|
<LocationSelectOption
|
|
191
191
|
selectedLocation={selectedLocation}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen, within } from '@testing-library/react';
|
|
3
3
|
import { useConfig, usePatient } from '@openmrs/esm-framework';
|
|
4
|
-
import { mockPatient, mockServices, mockProviders } from '
|
|
5
|
-
import {
|
|
6
|
-
import { mockSession } from '../../../../../../__mocks__/session.mock';
|
|
7
|
-
import { MappedAppointment } from '../../../types';
|
|
4
|
+
import { mockLocations, mockSession, mockPatient, mockServices, mockProviders } from '__mocks__';
|
|
5
|
+
import { type MappedAppointment } from '../../../types';
|
|
8
6
|
import AppointmentForm from './appointments-form.component';
|
|
9
7
|
|
|
10
8
|
const mockedUseConfig = useConfig as jest.Mock;
|
|
@@ -14,8 +12,8 @@ function renderAppointmentsForm(context: string, patientUuid?: string, appointme
|
|
|
14
12
|
render(<AppointmentForm patientUuid={patientUuid} context={context} appointment={appointment} />);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
jest.mock('../forms.resource
|
|
18
|
-
const originalModule = jest.requireActual('../forms.resource
|
|
15
|
+
jest.mock('../forms.resource', () => {
|
|
16
|
+
const originalModule = jest.requireActual('../forms.resource');
|
|
19
17
|
|
|
20
18
|
return {
|
|
21
19
|
...originalModule,
|
|
@@ -43,6 +41,7 @@ const mockedConfig = {
|
|
|
43
41
|
|
|
44
42
|
describe('AppointmentForm', () => {
|
|
45
43
|
const patient = mockPatient;
|
|
44
|
+
|
|
46
45
|
beforeEach(() => {
|
|
47
46
|
mockedUseConfig.mockReturnValue(mockedConfig);
|
|
48
47
|
mockedUsePatient.mockReturnValue({
|
|
@@ -53,23 +52,29 @@ describe('AppointmentForm', () => {
|
|
|
53
52
|
});
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
it('renders details of the correct patient in the patient banner', () => {
|
|
55
|
+
it('renders details of the correct patient in the patient banner', async () => {
|
|
57
56
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
58
57
|
|
|
58
|
+
await screen.findByText(/date and time/i);
|
|
59
59
|
expect(screen.getByText(/Date and time/i)).toBeInTheDocument();
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
it('renders the form with all expected inputs in create mode', () => {
|
|
62
|
+
it('renders the form with all expected inputs in create mode', async () => {
|
|
63
63
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
64
64
|
|
|
65
|
+
await screen.findByLabelText(/select a location/i);
|
|
66
|
+
|
|
65
67
|
expect(screen.getByRole('combobox', { name: /select a location/i })).toBeInTheDocument();
|
|
66
68
|
expect(screen.getByRole('combobox', { name: /select a service/i })).toBeInTheDocument();
|
|
67
69
|
expect(screen.getByRole('combobox', { name: /select an appointment type/i })).toBeInTheDocument();
|
|
68
70
|
expect(screen.getByRole('combobox', { name: /select a provider/i })).toBeInTheDocument();
|
|
69
71
|
});
|
|
70
72
|
|
|
71
|
-
it('renders the expected appointment types', () => {
|
|
73
|
+
it('renders the expected appointment types', async () => {
|
|
72
74
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
75
|
+
|
|
76
|
+
await screen.findByLabelText(/select an appointment type/i);
|
|
77
|
+
|
|
73
78
|
const appointmentTypeSelect = screen.getByLabelText('Select an appointment type');
|
|
74
79
|
|
|
75
80
|
expect(within(appointmentTypeSelect).getAllByRole('option')).toHaveLength(3);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenmrsResource, useConfig, useSession } from '@openmrs/esm-framework';
|
|
1
|
+
import { type OpenmrsResource, useConfig, useSession } from '@openmrs/esm-framework';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import { amPm } from '../../helpers';
|
|
4
|
-
import { MappedAppointment } from '../../types';
|
|
3
|
+
import { type amPm } from '../../helpers';
|
|
4
|
+
import { type MappedAppointment } from '../../types';
|
|
5
5
|
import { ConfigObject } from '../../config-schema';
|
|
6
6
|
|
|
7
7
|
export interface PatientAppointment {
|
|
@@ -22,7 +22,7 @@ import { useUnscheduledAppointments } from '../../hooks/useUnscheduledAppointmen
|
|
|
22
22
|
import { downloadUnscheduledAppointments } from '../../helpers/excel';
|
|
23
23
|
import { EmptyState } from '../../empty-state/empty-state.component';
|
|
24
24
|
import { getPageSizes, useSearchResults } from '../utils';
|
|
25
|
-
import { ConfigObject } from '../../config-schema';
|
|
25
|
+
import { type ConfigObject } from '../../config-schema';
|
|
26
26
|
|
|
27
27
|
const UnscheduledAppointments: React.FC = () => {
|
|
28
28
|
const { t } = useTranslation();
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import DailyCalendarView from './daily/daily-calendar-view.component';
|
|
3
3
|
import MonthlyCalendarView from './monthly/monthly-calendar-view.component';
|
|
4
4
|
import WeeklyCalendarView from './weekly/weekly-calendar-view.component';
|
|
5
|
-
import { CalendarType } from '../types';
|
|
5
|
+
import { type CalendarType } from '../types';
|
|
6
6
|
|
|
7
7
|
const CalendarView: React.FC<{
|
|
8
8
|
calendarView: CalendarType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
3
3
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
4
4
|
import styles from './daily-calendar.scss';
|
|
5
|
-
import { CalendarType } from '../../types';
|
|
5
|
+
import { type CalendarType } from '../../types';
|
|
6
6
|
import { dailyHours } from '../../helpers';
|
|
7
7
|
import DailyHeader from './daily-header.component';
|
|
8
8
|
import DailyWorkloadView from './daily-view-workload.component';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Button } from '@carbon/react';
|
|
2
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { type CalendarType } from '../../types';
|
|
5
6
|
import styles from './daily-header.scss';
|
|
6
|
-
import { CalendarType } from '../../types';
|
|
7
7
|
|
|
8
8
|
const Format = {
|
|
9
9
|
monthly: 'month',
|
|
@@ -6,7 +6,7 @@ import { navigate, useLayoutType } from '@openmrs/esm-framework';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { spaBasePath } from '../../constants';
|
|
8
8
|
import { isSameMonth } from '../../helpers';
|
|
9
|
-
import { CalendarType } from '../../types';
|
|
9
|
+
import { type CalendarType } from '../../types';
|
|
10
10
|
|
|
11
11
|
interface WeeklyCellProps {
|
|
12
12
|
type: CalendarType;
|
|
@@ -30,8 +30,8 @@ const DailyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, currentD
|
|
|
30
30
|
type === 'daily'
|
|
31
31
|
? 'weekly-cell'
|
|
32
32
|
: isSameMonth(dateTime, currentDate)
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
? 'monthly-cell'
|
|
34
|
+
: 'monthly-cell-disabled'
|
|
35
35
|
]
|
|
36
36
|
}>
|
|
37
37
|
{type === 'daily' ? (
|
|
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
5
|
import { navigate } from '@openmrs/esm-framework';
|
|
6
6
|
import { spaBasePath } from '../../constants';
|
|
7
|
-
import { CalendarType } from '../../types';
|
|
7
|
+
import { type CalendarType } from '../../types';
|
|
8
8
|
import DailyWorkloadView from './daily-view-workload.component';
|
|
9
9
|
|
|
10
10
|
jest.mock('@openmrs/esm-framework', () => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
3
3
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
4
|
-
import { CalendarType } from '../../types';
|
|
4
|
+
import { type CalendarType } from '../../types';
|
|
5
5
|
import { monthDays } from '../../helpers/functions';
|
|
6
6
|
import MonthlyViewWorkload from './monthly-view-workload.component';
|
|
7
7
|
import MonthlyHeader from './monthly-header.module';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { type Dayjs } from 'dayjs';
|
|
3
3
|
import styles from './monthly-header.module.scss';
|
|
4
4
|
import { Button } from '@carbon/react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { CalendarType } from '../../types';
|
|
6
|
+
import { type CalendarType } from '../../types';
|
|
7
7
|
import DaysOfWeekCard from '../daily/days-of-week.component';
|
|
8
8
|
|
|
9
9
|
const Format = {
|
|
@@ -38,9 +38,7 @@ function MonthlyHeader({
|
|
|
38
38
|
</Button>
|
|
39
39
|
</div>
|
|
40
40
|
<div className={styles.workLoadCard}>
|
|
41
|
-
{daysInWeek?.map((day, i) =>
|
|
42
|
-
<DaysOfWeekCard key={`${day}-${i}`} dayOfWeek={day} />
|
|
43
|
-
))}
|
|
41
|
+
{daysInWeek?.map((day, i) => <DaysOfWeekCard key={`${day}-${i}`} dayOfWeek={day} />)}
|
|
44
42
|
</div>
|
|
45
43
|
</>
|
|
46
44
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
2
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
3
3
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
4
4
|
import styles from './weekly-calendar.scss';
|
|
5
|
-
import { CalendarType } from '../../types';
|
|
5
|
+
import { type CalendarType } from '../../types';
|
|
6
6
|
import { isSameMonth, weekAllDays, weekDays } from '../../helpers';
|
|
7
7
|
import WeeklyWorkloadView from './weekly-view-workload.component';
|
|
8
8
|
import WeeklyHeader from './weekly-header.component';
|
|
@@ -51,8 +51,8 @@ const WeeklyCalendarView: React.FC<WeeklyCalendarViewProps> = ({
|
|
|
51
51
|
type === 'weekly'
|
|
52
52
|
? 'weekly-cell'
|
|
53
53
|
: isSameMonth(dateTime, currentDate)
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
? 'monthly-cell'
|
|
55
|
+
: 'monthly-cell-disabled'
|
|
56
56
|
]
|
|
57
57
|
}>
|
|
58
58
|
{type === 'weekly' ? (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '@carbon/react';
|
|
3
|
-
import { Dayjs } from 'dayjs';
|
|
3
|
+
import { type Dayjs } from 'dayjs';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { weekDays } from '../../helpers';
|
|
6
6
|
import type { CalendarType } from '../../types';
|
|
@@ -37,10 +37,10 @@ function WeeklyHeader({
|
|
|
37
37
|
{type === 'monthly'
|
|
38
38
|
? currentDate.format(monthFormat)
|
|
39
39
|
: type === 'daily'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
? currentDate.format(dateFormat)
|
|
41
|
+
: `${currentDate.startOf('week').format(dateFormat)} - ${currentDate
|
|
42
|
+
.endOf('week')
|
|
43
|
+
.format(dateFormat)} , ${currentDate.format(yearFormat)}`}
|
|
44
44
|
</span>
|
|
45
45
|
<Button size="sm" onClick={() => setCurrentDate(currentDate.add(1, Format[type]))} kind="tertiary">
|
|
46
46
|
{t('next', 'Next')}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
3
|
+
import dayjs, { type Dayjs } from 'dayjs';
|
|
4
4
|
import { navigate, useLayoutType } from '@openmrs/esm-framework';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
import { spaBasePath } from '../../constants';
|
|
8
8
|
import { isSameMonth } from '../../helpers';
|
|
9
|
-
import { CalendarType } from '../../types';
|
|
9
|
+
import { type CalendarType } from '../../types';
|
|
10
10
|
import styles from './weekly-workload-module.scss';
|
|
11
11
|
|
|
12
12
|
interface WeeklyCellProps {
|
|
@@ -32,8 +32,8 @@ const WeeklyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, current
|
|
|
32
32
|
type === 'weekly'
|
|
33
33
|
? 'weekly-cell'
|
|
34
34
|
: isSameMonth(dateTime, currentDate)
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
? 'monthly-cell'
|
|
36
|
+
: 'monthly-cell-disabled'
|
|
37
37
|
]
|
|
38
38
|
}>
|
|
39
39
|
{type === 'weekly' ? (
|