@openmrs/esm-appointments-app 5.2.2-pre.2602 → 5.2.2-pre.2607

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.
Files changed (27) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/dist/530.js +1 -1
  3. package/dist/530.js.map +1 -1
  4. package/dist/636.js +1 -0
  5. package/dist/636.js.map +1 -0
  6. package/dist/main.js +1 -1
  7. package/dist/main.js.map +1 -1
  8. package/dist/openmrs-esm-appointments-app.js +1 -1
  9. package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +30 -30
  10. package/dist/routes.json +1 -1
  11. package/package.json +1 -1
  12. package/src/appointments-calendar/calendar-view.component.tsx +2 -2
  13. package/src/appointments-calendar/daily/daily-calendar-view.component.tsx +7 -5
  14. package/src/appointments-calendar/daily/daily-header.component.tsx +1 -4
  15. package/src/appointments-calendar/daily/{daily-view-workload.component.tsx → daily-workload-view.component.tsx} +8 -9
  16. package/src/appointments-calendar/daily/{daily-view-workload.test.tsx → daily-workload-view.test.tsx} +13 -11
  17. package/src/appointments-calendar/header/calendar-header.component.tsx +2 -20
  18. package/src/appointments-calendar/monthly/monthly-calendar-view.component.tsx +4 -4
  19. package/src/appointments-calendar/monthly/{monthly-view-workload.component.tsx → monthly-workload-view.component.tsx} +14 -8
  20. package/src/appointments-calendar/weekly/weekly-calendar-view.component.tsx +7 -6
  21. package/src/appointments-calendar/weekly/weekly-header.component.tsx +0 -3
  22. package/src/appointments-calendar/weekly/{weekly-view-workload.component.tsx → weekly-workload-view.component.tsx} +8 -9
  23. package/src/appointments-calendar/weekly/{weekly-view-workload.test.tsx → weekly-workload-view.test.tsx} +13 -11
  24. package/src/hooks/useAppointmentsCalendar.ts +28 -20
  25. package/src/types/index.ts +8 -0
  26. package/dist/799.js +0 -1
  27. package/dist/799.js.map +0 -1
@@ -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(530),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.3-pre.1347",(()=>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})();
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(530),t.e(268),t.e(325),t.e(636)]).then((()=>()=>t(8636)))},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.3-pre.1347",(()=>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],636:[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})();
@@ -21,7 +21,7 @@
21
21
  "auxiliaryFiles": [
22
22
  "80.js.map"
23
23
  ],
24
- "hash": "90b8e73b63c2dafe",
24
+ "hash": "88012bd213a54fa1",
25
25
  "childrenByOrder": {}
26
26
  },
27
27
  {
@@ -80,10 +80,10 @@
80
80
  "initial": true,
81
81
  "entry": true,
82
82
  "recorded": false,
83
- "size": 4539740,
83
+ "size": 4539202,
84
84
  "sizes": {
85
85
  "consume-shared": 252,
86
- "javascript": 4518818,
86
+ "javascript": 4518280,
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": "b7df301a4da6b1fe",
103
+ "hash": "06c6768e74541bd1",
104
104
  "childrenByOrder": {}
105
105
  },
106
106
  {
@@ -310,7 +310,7 @@
310
310
  "auxiliaryFiles": [
311
311
  "openmrs-esm-appointments-app.js.map"
312
312
  ],
313
- "hash": "281ae93cb00bc924",
313
+ "hash": "1d43838495e5d639",
314
314
  "childrenByOrder": {}
315
315
  },
316
316
  {
@@ -336,7 +336,7 @@
336
336
  "auxiliaryFiles": [
337
337
  "530.js.map"
338
338
  ],
339
- "hash": "6e79a40cee2d7d9a",
339
+ "hash": "eccc2f3f0d65c601",
340
340
  "childrenByOrder": {}
341
341
  },
342
342
  {
@@ -412,6 +412,30 @@
412
412
  "hash": "d711d096d0748a99",
413
413
  "childrenByOrder": {}
414
414
  },
415
+ {
416
+ "rendered": true,
417
+ "initial": false,
418
+ "entry": false,
419
+ "recorded": false,
420
+ "size": 480755,
421
+ "sizes": {
422
+ "javascript": 480587,
423
+ "consume-shared": 168
424
+ },
425
+ "names": [],
426
+ "idHints": [],
427
+ "runtime": [
428
+ "@openmrs/esm-appointments-app"
429
+ ],
430
+ "files": [
431
+ "636.js"
432
+ ],
433
+ "auxiliaryFiles": [
434
+ "636.js.map"
435
+ ],
436
+ "hash": "cfa6f492d19ba912",
437
+ "childrenByOrder": {}
438
+ },
415
439
  {
416
440
  "rendered": true,
417
441
  "initial": false,
@@ -529,30 +553,6 @@
529
553
  "hash": "8586d3ab3d3eed3b",
530
554
  "childrenByOrder": {}
531
555
  },
532
- {
533
- "rendered": true,
534
- "initial": false,
535
- "entry": false,
536
- "recorded": false,
537
- "size": 481293,
538
- "sizes": {
539
- "javascript": 481125,
540
- "consume-shared": 168
541
- },
542
- "names": [],
543
- "idHints": [],
544
- "runtime": [
545
- "@openmrs/esm-appointments-app"
546
- ],
547
- "files": [
548
- "799.js"
549
- ],
550
- "auxiliaryFiles": [
551
- "799.js.map"
552
- ],
553
- "hash": "c96afbde19255af5",
554
- "childrenByOrder": {}
555
- },
556
556
  {
557
557
  "rendered": true,
558
558
  "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.2602"}
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.2607"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-appointments-app",
3
- "version": "5.2.2-pre.2602",
3
+ "version": "5.2.2-pre.2607",
4
4
  "description": "Appointments front-end module for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-appointments-app.js",
6
6
  "main": "src/index.ts",
@@ -2,11 +2,11 @@ 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 { type CalendarType } from '../types';
5
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../types';
6
6
 
7
7
  const CalendarView: React.FC<{
8
8
  calendarView: CalendarType;
9
- events: any;
9
+ events: Array<DailyAppointmentsCountByService>;
10
10
  currentDate: any;
11
11
  setCurrentDate: any;
12
12
  }> = ({ calendarView, events, currentDate, setCurrentDate }) => {
@@ -2,15 +2,15 @@ import React from 'react';
2
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 { type CalendarType } from '../../types';
5
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
6
6
  import { dailyHours } from '../../helpers';
7
7
  import DailyHeader from './daily-header.component';
8
- import DailyWorkloadView from './daily-view-workload.component';
8
+ import DailyWorkloadView from './daily-workload-view.component';
9
9
  dayjs.extend(isBetween);
10
10
 
11
11
  interface DailyCalendarViewProps {
12
12
  type: CalendarType;
13
- events: { appointmentDate: string; service: Array<any>; [key: string]: any }[];
13
+ events: Array<DailyAppointmentsCountByService>;
14
14
  currentDate: Dayjs;
15
15
  setCurrentDate: (date) => void;
16
16
  }
@@ -23,7 +23,7 @@ const DailyCalendarView: React.FC<DailyCalendarViewProps> = ({
23
23
  }) => {
24
24
  return (
25
25
  <div className={styles.container}>
26
- <DailyHeader type={type} currentDate={currentDate} setCurrentDate={setCurrentDate} events={events} />
26
+ <DailyHeader type={type} currentDate={currentDate} setCurrentDate={setCurrentDate} />
27
27
  <div className={styles.wrapper}>
28
28
  <>
29
29
  <p className={styles['containerRow']}>
@@ -33,6 +33,8 @@ const DailyCalendarView: React.FC<DailyCalendarViewProps> = ({
33
33
  </p>
34
34
  </>
35
35
  </p>
36
+
37
+ {/* displays hours of day but commented out because showing the appts by hour is not currently implemented within this code
36
38
  <p className={styles['daily-calendar-all']}>
37
39
  {dailyHours(currentDate).map((dateTime, i) => (
38
40
  <>
@@ -44,7 +46,7 @@ const DailyCalendarView: React.FC<DailyCalendarViewProps> = ({
44
46
  </div>
45
47
  </>
46
48
  ))}
47
- </p>
49
+ </p>*/}
48
50
  </>
49
51
  </div>
50
52
  </div>
@@ -1,5 +1,5 @@
1
1
  import { Button } from '@carbon/react';
2
- import dayjs, { type Dayjs } from 'dayjs';
2
+ import { type Dayjs } from 'dayjs';
3
3
  import React from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { type CalendarType } from '../../types';
@@ -12,17 +12,14 @@ const Format = {
12
12
  } as const;
13
13
  const dateFormat = 'MMMM DD, YYYY';
14
14
  const yearFormat = 'YYYY';
15
- const now = dayjs();
16
15
  function DailyHeader({
17
16
  type,
18
17
  currentDate,
19
18
  setCurrentDate,
20
- events,
21
19
  }: {
22
20
  type: CalendarType;
23
21
  currentDate: Dayjs;
24
22
  setCurrentDate: (date: Dayjs) => void;
25
- events: { appointmentDate: string; service: Array<any>; [key: string]: any }[];
26
23
  }) {
27
24
  const { t } = useTranslation();
28
25
  return (
@@ -2,25 +2,24 @@ import dayjs, { type Dayjs } from 'dayjs';
2
2
  import classNames from 'classnames';
3
3
  import styles from './daily-workload-module.scss';
4
4
  import React from 'react';
5
- import { navigate, useLayoutType } from '@openmrs/esm-framework';
5
+ import { navigate } 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 { type CalendarType } from '../../types';
9
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
10
10
 
11
11
  interface WeeklyCellProps {
12
12
  type: CalendarType;
13
13
  dateTime: Dayjs;
14
14
  currentDate: Dayjs;
15
- events: Array<any>;
15
+ events: Array<DailyAppointmentsCountByService>;
16
16
  }
17
17
 
18
18
  const DailyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, currentDate, events }) => {
19
- const layout = useLayoutType();
20
19
  const currentData = events?.find(
21
20
  (event) => dayjs(event.appointmentDate).format('YYYY-MM-DD') === dayjs(dateTime).format('YYYY-MM-DD'),
22
21
  );
23
- const colorCoding = { HIV: 'red', 'Lab testing': 'purple', Refill: 'blue' };
22
+
24
23
  const { t } = useTranslation();
25
24
 
26
25
  return (
@@ -38,11 +37,11 @@ const DailyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, currentD
38
37
  <>
39
38
  <div className={styles.allDayComponent}>
40
39
  <small className={styles.allDay}>All Day</small>
41
- {currentData?.service && (
40
+ {currentData?.services && (
42
41
  <div className={styles.currentData}>
43
- {currentData?.service.map(({ serviceName, count, i }) => (
42
+ {currentData?.services.map(({ serviceName, count }) => (
44
43
  <div
45
- className={classNames(styles.serviceArea, styles[colorCoding[serviceName]])}
44
+ className={classNames(styles.serviceArea)}
46
45
  key={serviceName}
47
46
  role="button"
48
47
  tabIndex={0}
@@ -57,7 +56,7 @@ const DailyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, currentD
57
56
  tabIndex={0}
58
57
  onClick={() => navigate({ to: `${spaBasePath}/appointments/list/${dateTime}/Total` })}>
59
58
  <span>{t('total', 'Total')}</span>
60
- <span>{currentData?.service.reduce((sum, currentValue) => sum + currentValue?.count ?? 0, 0)}</span>
59
+ <span>{currentData?.services.reduce((sum, currentValue) => sum + currentValue?.count ?? 0, 0)}</span>
61
60
  </div>
62
61
  </div>
63
62
  )}
@@ -3,9 +3,9 @@ import dayjs from 'dayjs';
3
3
  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
+ import DailyWorkloadView from './daily-workload-view.component';
6
7
  import { spaBasePath } from '../../constants';
7
- import { type CalendarType } from '../../types';
8
- import DailyWorkloadView from './daily-view-workload.component';
8
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
9
9
 
10
10
  jest.mock('@openmrs/esm-framework', () => ({
11
11
  ...jest.requireActual('@openmrs/esm-framework'),
@@ -14,19 +14,21 @@ jest.mock('@openmrs/esm-framework', () => ({
14
14
  }));
15
15
 
16
16
  describe('DailyWorkloadView Component', () => {
17
+ const events: Array<DailyAppointmentsCountByService> = [
18
+ {
19
+ appointmentDate: '2023-08-18',
20
+ services: [
21
+ { serviceName: 'HIV', count: 2 },
22
+ { serviceName: 'Lab testing', count: 3 },
23
+ ],
24
+ },
25
+ ];
26
+
17
27
  const mockData = {
18
28
  type: 'daily' as CalendarType,
19
29
  dateTime: dayjs('2023-08-18'),
20
30
  currentDate: dayjs('2023-08-18'),
21
- events: [
22
- {
23
- appointmentDate: '2023-08-18',
24
- service: [
25
- { serviceName: 'HIV', count: 2 },
26
- { serviceName: 'Lab testing', count: 3 },
27
- ],
28
- },
29
- ],
31
+ events: events,
30
32
  };
31
33
 
32
34
  it('renders properly when type is "daily"', () => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button, ContentSwitcher, Switch } from '@carbon/react';
4
- import { ArrowRight, Filter, ArrowLeft } from '@carbon/react/icons';
4
+ import { ArrowLeft } from '@carbon/react/icons';
5
5
  import { navigate } from '@openmrs/esm-framework';
6
6
  import { spaBasePath } from '../../constants';
7
7
  import type { CalendarType } from '../../types';
@@ -18,23 +18,11 @@ interface CalendarHeaderProps {
18
18
  calendarView: CalendarType;
19
19
  }
20
20
 
21
- const CalendarHeader: React.FC<CalendarHeaderProps> = ({ onChangeView, calendarView }) => {
21
+ const CalendarHeader: React.FC<CalendarHeaderProps> = ({ onChangeView }) => {
22
22
  const { t } = useTranslation();
23
23
  const backButtonOnClick = () => {
24
24
  navigate({ to: `${spaBasePath}/appointments` });
25
25
  };
26
- const addNewClinicDayOnClick = () => {
27
- // add new clinic day functionality
28
- };
29
- const filterOnClick = () => {
30
- // filter functionality
31
- };
32
-
33
- const calendarViewObject = {
34
- daily: CalendarView.Daily,
35
- weekly: CalendarView.Weekly,
36
- monthly: CalendarView.Monthly,
37
- };
38
26
 
39
27
  return (
40
28
  <div className={styles.calendarHeaderContainer}>
@@ -48,14 +36,8 @@ const CalendarHeader: React.FC<CalendarHeaderProps> = ({ onChangeView, calendarV
48
36
  <span>{t('back', 'Back')}</span>
49
37
  </Button>
50
38
  <p>{t('calendar', 'Calendar')}</p>
51
- <Button size="md" kind="ghost" renderIcon={ArrowRight} onClick={addNewClinicDayOnClick}>
52
- {t('addNewClinicDay', 'Add new clinic day')}
53
- </Button>
54
39
  </div>
55
40
  <div className={styles.titleContent}>
56
- <Button size="md" renderIcon={Filter} kind="ghost" onClick={filterOnClick}>
57
- {t('filter', 'Filter')}
58
- </Button>
59
41
  <ContentSwitcher
60
42
  selectedIndex={2}
61
43
  size="md"
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import dayjs, { type Dayjs } from 'dayjs';
3
3
  import isBetween from 'dayjs/plugin/isBetween';
4
- import { type CalendarType } from '../../types';
5
- import { monthDays } from '../../helpers/functions';
6
- import MonthlyViewWorkload from './monthly-view-workload.component';
4
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
5
+ import { monthDays } from '../../helpers';
6
+ import MonthlyViewWorkload from './monthly-workload-view.component';
7
7
  import MonthlyHeader from './monthly-header.module';
8
8
  import styles from '../appointments-calendar-view-view.scss';
9
9
 
@@ -11,7 +11,7 @@ dayjs.extend(isBetween);
11
11
 
12
12
  interface MonthlyCalendarViewProps {
13
13
  type: CalendarType;
14
- events: { appointmentDate: string; service: Array<any>; [key: string]: any }[];
14
+ events: Array<DailyAppointmentsCountByService>;
15
15
  currentDate: Dayjs;
16
16
  setCurrentDate: (date) => void;
17
17
  }
@@ -1,15 +1,21 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
- import dayjs from 'dayjs';
3
+ import dayjs, { type Dayjs } from 'dayjs';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { navigate, useLayoutType } from '@openmrs/esm-framework';
6
6
  import { isSameMonth } from '../../helpers';
7
7
  import { spaBasePath } from '../../constants';
8
8
  import styles from './monthly-view-workload.scss';
9
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
9
10
 
10
- const colorCoding = { HIV: 'red', 'Lab testing': 'purple', Refill: 'blue' };
11
+ interface MonthlyWorkloadViewProps {
12
+ type: CalendarType;
13
+ events: Array<DailyAppointmentsCountByService>;
14
+ dateTime: Dayjs;
15
+ currentDate: Dayjs;
16
+ }
11
17
 
12
- const MonthlyWorkload = ({ type, dateTime, currentDate, events }) => {
18
+ const MonthlyWorkloadView: React.FC<MonthlyWorkloadViewProps> = ({ type, dateTime, currentDate, events }) => {
13
19
  const layout = useLayoutType();
14
20
  const { t } = useTranslation();
15
21
 
@@ -24,16 +30,16 @@ const MonthlyWorkload = ({ type, dateTime, currentDate, events }) => {
24
30
  return (
25
31
  <div
26
32
  className={classNames(styles[isSameMonth(dateTime, currentDate) ? 'monthly-cell' : 'monthly-cell-disabled'], {
27
- [styles.greyBackground]: currentData?.service,
33
+ [styles.greyBackground]: currentData?.services,
28
34
  [styles.smallDesktop]: layout === 'small-desktop',
29
35
  [styles.largeDesktop]: layout !== 'small-desktop',
30
36
  })}>
31
37
  {type === 'monthly' && isSameMonth(dateTime, currentDate) && (
32
38
  <p>
33
39
  <b className={styles.calendarDate}>{dateTime.format('D')}</b>
34
- {currentData?.service && (
40
+ {currentData?.services && (
35
41
  <div className={styles.currentData}>
36
- {currentData.service.map(({ serviceName, count, i }) => (
42
+ {currentData.services.map(({ serviceName, count }, i) => (
37
43
  <div
38
44
  key={`${serviceName}-${count}-${i}`}
39
45
  role="button"
@@ -50,7 +56,7 @@ const MonthlyWorkload = ({ type, dateTime, currentDate, events }) => {
50
56
  onClick={() => serviceAreaOnClick('Total')}
51
57
  className={classNames(styles.serviceArea, styles.green)}>
52
58
  <span>{t('total', 'Total')}</span>
53
- <span>{currentData?.service.reduce((sum, { count = 0 }) => sum + count, 0)}</span>
59
+ <span>{currentData?.services.reduce((sum, { count = 0 }) => sum + count, 0)}</span>
54
60
  </div>
55
61
  </div>
56
62
  )}
@@ -60,4 +66,4 @@ const MonthlyWorkload = ({ type, dateTime, currentDate, events }) => {
60
66
  );
61
67
  };
62
68
 
63
- export default MonthlyWorkload;
69
+ export default MonthlyWorkloadView;
@@ -2,15 +2,15 @@ import React from 'react';
2
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 { type CalendarType } from '../../types';
5
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
6
6
  import { isSameMonth, weekAllDays, weekDays } from '../../helpers';
7
- import WeeklyWorkloadView from './weekly-view-workload.component';
7
+ import WeeklyWorkloadView from './weekly-workload-view.component';
8
8
  import WeeklyHeader from './weekly-header.component';
9
9
  dayjs.extend(isBetween);
10
10
 
11
11
  interface WeeklyCalendarViewProps {
12
12
  type: CalendarType;
13
- events: { appointmentDate: string; service: Array<any>; [key: string]: any }[];
13
+ events: Array<DailyAppointmentsCountByService>;
14
14
  currentDate: Dayjs;
15
15
  setCurrentDate: (date) => void;
16
16
  }
@@ -23,7 +23,7 @@ const WeeklyCalendarView: React.FC<WeeklyCalendarViewProps> = ({
23
23
  }) => {
24
24
  return (
25
25
  <div className={styles.container}>
26
- <WeeklyHeader type={type} currentDate={currentDate} setCurrentDate={setCurrentDate} events={events} />
26
+ <WeeklyHeader type={type} currentDate={currentDate} setCurrentDate={setCurrentDate} />
27
27
  <div className={styles.wrapper}>
28
28
  <>
29
29
  <p className={styles['weekly-calendar']}>
@@ -42,7 +42,8 @@ const WeeklyCalendarView: React.FC<WeeklyCalendarViewProps> = ({
42
42
  );
43
43
  })}
44
44
  </p>
45
- <p className={styles['weekly-calendar-all']}>
45
+ {/* displays hours of day but commented out because showing the appts by hour is not currently implemented within this code
46
+ <p className={styles['weekly-calendar-all']}>
46
47
  {weekAllDays(currentDate).map((dateTime, i) => (
47
48
  <>
48
49
  <div
@@ -61,7 +62,7 @@ const WeeklyCalendarView: React.FC<WeeklyCalendarViewProps> = ({
61
62
  </div>
62
63
  </>
63
64
  ))}
64
- </p>
65
+ </p> */}
65
66
  </>
66
67
  </div>
67
68
  </div>
@@ -11,7 +11,6 @@ const Format = {
11
11
  weekly: 'week',
12
12
  daily: 'day',
13
13
  } as const;
14
- const daysInWeek = ['SUN', 'MON', 'TUE', 'WED', 'THUR', 'FRI', 'SAT'];
15
14
  const dateFormat = 'D MMM';
16
15
  const monthFormat = 'MMMM, YYYY';
17
16
  const yearFormat = 'YYYY';
@@ -19,12 +18,10 @@ function WeeklyHeader({
19
18
  type,
20
19
  currentDate,
21
20
  setCurrentDate,
22
- events,
23
21
  }: {
24
22
  type: CalendarType;
25
23
  currentDate: Dayjs;
26
24
  setCurrentDate: (date: Dayjs) => void;
27
- events: { appointmentDate: string; service: Array<any>; [key: string]: any }[];
28
25
  }) {
29
26
  const { t } = useTranslation();
30
27
  return (
@@ -1,28 +1,27 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import dayjs, { type Dayjs } from 'dayjs';
4
- import { navigate, useLayoutType } from '@openmrs/esm-framework';
4
+ import { navigate } 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 { type CalendarType } from '../../types';
9
+ import { type CalendarType, type DailyAppointmentsCountByService } from '../../types';
10
10
  import styles from './weekly-workload-module.scss';
11
11
 
12
12
  interface WeeklyCellProps {
13
13
  type: CalendarType;
14
14
  dateTime: Dayjs;
15
15
  currentDate: Dayjs;
16
- events: Array<any>;
16
+ events: Array<DailyAppointmentsCountByService>;
17
17
  index?: number;
18
18
  }
19
19
 
20
20
  const WeeklyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, currentDate, events, index }) => {
21
- const layout = useLayoutType();
22
21
  const currentData = events?.find(
23
22
  (event) => dayjs(event.appointmentDate).format('YYYY-MM-DD') === dayjs(dateTime).format('YYYY-MM-DD'),
24
23
  );
25
- const colorCoding = { HIV: 'red', 'Lab testing': 'purple', Refill: 'blue' };
24
+
26
25
  const { t } = useTranslation();
27
26
 
28
27
  return (
@@ -40,11 +39,11 @@ const WeeklyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, current
40
39
  <>
41
40
  <div className={styles.allDayComponent}>
42
41
  <small className={styles.allDay}>All Day</small>
43
- {index !== 0 && currentData?.service && (
42
+ {index !== 0 && currentData?.services && (
44
43
  <div className={styles.currentData}>
45
- {currentData?.service.map(({ serviceName, count }, index) => (
44
+ {currentData?.services.map(({ serviceName, count }) => (
46
45
  <div
47
- className={classNames(styles.serviceArea, styles[colorCoding[serviceName]])}
46
+ className={classNames(styles.serviceArea)}
48
47
  role="button"
49
48
  tabIndex={0}
50
49
  onClick={() => navigate({ to: `${spaBasePath}/appointments/list/${dateTime}/${serviceName}` })}
@@ -59,7 +58,7 @@ const WeeklyWorkloadView: React.FC<WeeklyCellProps> = ({ type, dateTime, current
59
58
  tabIndex={0}
60
59
  onClick={() => navigate({ to: `${spaBasePath}/appointments/list/${dateTime}/Total` })}>
61
60
  <span>{t('total', 'Total')}</span>
62
- <span>{currentData?.service.reduce((sum, currentValue) => sum + currentValue?.count ?? 0, 0)}</span>
61
+ <span>{currentData?.services.reduce((sum, currentValue) => sum + currentValue?.count ?? 0, 0)}</span>
63
62
  </div>
64
63
  </div>
65
64
  )}