Skip to content

Commit

Permalink
Merge pull request #336 from ertush/hotfix
Browse files Browse the repository at this point in the history
Fixed issues in facility and updated UI
  • Loading branch information
ertush authored Mar 6, 2024
2 parents 81b8bc1 + bec7595 commit 7ec19ac
Show file tree
Hide file tree
Showing 63 changed files with 707 additions and 790 deletions.
2 changes: 1 addition & 1 deletion components/BarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const BarChart = props => {
<div className="flex flex-col items-center justify-center w-full p-2 bg-transparent" style={{ minHeight: '350px' }}>
<div className="w-full p-0">
{props.data.length <= 0 ? (
<div className="p-2 bg-blue-200 border rounded border-blue-600 shadow-sm">
<div className="p-2 bg-blue-200 border rounded border-gray-600 shadow-sm">
<p className="text-gray-800 text-base font-medium">Loading&hellip;</p>
</div>
) : (
Expand Down
10 changes: 7 additions & 3 deletions components/CommunityUnitSideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export default function CommunityUnitSideMenu({ _pathId, filters, qf }) {
const [currentQuickFilter, setCurrentQuickFilter] = useState(qf);




const [chuPendingApproval, setCHUPendingApproval] = useState(false);


Expand Down Expand Up @@ -141,6 +139,8 @@ export default function CommunityUnitSideMenu({ _pathId, filters, qf }) {
backgroundColor: (allCHUSelected || pathId === 'all') && '#1d4ed8',
color: (allCHUSelected || pathId === 'all') && '#ffff',
borderBottom: 'solid 1px rgba(156, 163, 175, 1)',
borderTopLeftRadius: '4px',
borderTopRightRadius: '4px',
"&:hover": {
backgroundColor: "rgba(37, 99, 235, 1)",
color: "white"
Expand All @@ -161,7 +161,7 @@ export default function CommunityUnitSideMenu({ _pathId, filters, qf }) {
return {
backgroundColor: (newCHUSelected || pathId === 'new_pending_approval') && '#1d4ed8',
color: (newCHUSelected || pathId === 'new_pending_approval') && '#ffff',
borderBottom: 'solid 1px rgba(156, 163, 175, 1)',
borderBottom: 'solid 1px rgba(156, 163, 175, 1)',
"&:hover": {
backgroundColor: "rgba(37, 99, 235, 1)",
color: "white"
Expand All @@ -186,12 +186,14 @@ export default function CommunityUnitSideMenu({ _pathId, filters, qf }) {
"&:hover": {
backgroundColor: "rgba(37, 99, 235, 1)",
color: "white"

}
}

}
})()}
name="rt"

onClick={(evt) => {
switch (qf.name) {
case 'All Community Health Units':
Expand Down Expand Up @@ -280,6 +282,8 @@ export default function CommunityUnitSideMenu({ _pathId, filters, qf }) {
}
});

console.log({robj})

router.push(robj);
}}
>
Expand Down
30 changes: 15 additions & 15 deletions components/FacilityDetailsTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function FacilityDetailsTabs({ facility }) {
className="w-full flex flex-col flex-wrap tab-root"
defaultValue="overview"
>
<Tabs.List className="list-none flex justify-evenly flex-wrap gap-2 md:gap-3 px-4 uppercase leading-none tab-list font-semibold border-b border-blue-600">
<Tabs.List className="list-none flex justify-evenly flex-wrap gap-2 md:gap-3 px-4 uppercase leading-none tab-list font-semibold border-b border-gray-600">
<Tabs.Tab
id={1}
value="overview"
Expand Down Expand Up @@ -67,7 +67,7 @@ function FacilityDetailsTabs({ facility }) {
Closed on {new Date(facility?.closed_date).toLocaleDateString() || ""}
</span>
) : (
<span className="bg-blue-200 text-blue-900 p-1 px-2 leading-none text-sm whitespace-nowrap cursor-default flex items-center gap-x-1">
<span className="bg-blue-200 text-gray-900 p-1 px-2 leading-none text-sm whitespace-nowrap cursor-default flex items-center gap-x-1">
Not closed
</span>
)}
Expand All @@ -90,7 +90,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.reporting_in_dhis ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -108,7 +108,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.nhif_accreditation ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -126,7 +126,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.open_normal_day ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -144,7 +144,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.open_weekends ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -162,7 +162,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.open_late_night ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -180,7 +180,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.is_classified ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -196,7 +196,7 @@ function FacilityDetailsTabs({ facility }) {
<label className=" text-gray-600">Published</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.is_published ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand Down Expand Up @@ -268,7 +268,7 @@ function FacilityDetailsTabs({ facility }) {
</label>
<p className="text-black font-medium col-start-3 text-base flex">
{facility?.regulated ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand Down Expand Up @@ -579,7 +579,7 @@ function FacilityDetailsTabs({ facility }) {
<div className="bg-gray-50 w-full px-2 my-4">
{/* <h3 className="text-2xl w-full flex flex-wrap justify-between items-center leading-tight tracking-tight"> */}
{/* <span className="font-semibold">Services</span> */}
{/* {user && user?.id ? <a href={"/facility/edit/"+facility?.id+"#services"} className="text-base text-blue-700 font-medium hover:text-black focus:text-black active:text-black">Edit services</a> : ""} */}
{/* {user && user?.id ? <a href={"/facility/edit/"+facility?.id+"#services"} className="text-base text-gray-700 font-medium hover:text-black focus:text-black active:text-black">Edit services</a> : ""} */}
{/* </h3> */}
<ul>
{facility?.facility_services &&
Expand Down Expand Up @@ -609,7 +609,7 @@ function FacilityDetailsTabs({ facility }) {
</small>
</div>
<label className="text-sm text-gray-600 flex gap-1 items-center">
<CheckCircleIcon className="h-6 w-6 text-blue-500" />
<CheckCircleIcon className="h-6 w-6 text-gray-500" />
<span>Active</span>
</label>
</li>
Expand Down Expand Up @@ -645,7 +645,7 @@ function FacilityDetailsTabs({ facility }) {
{/* <small className="text-xs text-gray-500">{infra.id || ''}</small> */}
</div>
<div className="flex flex-row gap-1 items-center">
{/* <CheckCircleIcon className="h-4 w-4 text-blue-500" /> */}
{/* <CheckCircleIcon className="h-4 w-4 text-gray-500" /> */}
<label className="text-lg text-gray-800 font-semibold">
{infra.count || 0}
</label>
Expand Down Expand Up @@ -687,7 +687,7 @@ function FacilityDetailsTabs({ facility }) {
{/* <small className="text-xs text-gray-500">{hr.id || ''}</small> */}
</div>
<div className="flex flex-row gap-1 items-center">
{/* <CheckCircleIcon className="h-4 w-4 text-blue-500" /> */}
{/* <CheckCircleIcon className="h-4 w-4 text-gray-500" /> */}
<label className="text-lg font-semibold text-gray-800">
{hr.count || 0}
</label>
Expand Down Expand Up @@ -728,7 +728,7 @@ function FacilityDetailsTabs({ facility }) {
</small>
</div>
<div className="flex flex-row gap-1 items-center">
<CheckCircleIcon className="h-6 w-6 text-blue-500" />
<CheckCircleIcon className="h-6 w-6 text-gray-500" />
<label className="text-sm text-gray-600">
Active
</label>
Expand Down
12 changes: 6 additions & 6 deletions components/FacilityDetailsTabsPublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function FacilityDetailsTabsPulic({ facility }) {
className="w-full flex flex-col tab-root"
defaultValue="overview"
>
<Tabs.List className="list-none w-full flex justify-around border-b border-blue-600 flex-wrap gap-2 md:gap-3 px-4 uppercase leading-none tab-list font-semibold ">
<Tabs.List className="list-none w-full flex justify-around border-b border-gray-600 flex-wrap gap-2 md:gap-3 px-4 uppercase leading-none tab-list font-semibold ">
<Tabs.Tab
id={1}
value="overview"
Expand Down Expand Up @@ -153,7 +153,7 @@ function FacilityDetailsTabsPulic({ facility }) {

<p className="text-black col-start-4 font-medium text-base flex">
{facility?.open_normal_day ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand All @@ -178,7 +178,7 @@ function FacilityDetailsTabsPulic({ facility }) {

<p className="col-start-4 text-black font-medium text-base flex">
{facility?.regulated ? (
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-blue-900 flex gap-x-1 items-center cursor-default">
<span className="leading-none whitespace-nowrap text-sm py-1 px-2 bg-blue-200 text-gray-900 flex gap-x-1 items-center cursor-default">
<CheckCircleIcon className="h-4 w-4" />
Yes
</span>
Expand Down Expand Up @@ -461,7 +461,7 @@ function FacilityDetailsTabsPulic({ facility }) {
<span><b>Category: </b></span>{service.category_name || ""}
</small>
<label className="text-sm text-gray-600 flex gap-1 items-center">
<CheckCircleIcon className="h-6 w-6 text-blue-500" />
<CheckCircleIcon className="h-6 w-6 text-gray-500" />
<span>Active</span>
</label>
<div className="flex justify-between">
Expand Down Expand Up @@ -562,7 +562,7 @@ function FacilityDetailsTabsPulic({ facility }) {
<div className="w-full p-4 ">
<h3 className="text-2xl w-full flex flex-wrap justify-between items-center leading-tight tracking-tight">
<span className="font-semibold">Facility units</span>
{/* {user && user?.id ? <a href={"/facility/edit/"+facility?.id+"#units"} className="text-base text-blue-700 font-medium hover:text-black focus:text-black active:text-black">Edit facility units</a> : ""} */}
{/* {user && user?.id ? <a href={"/facility/edit/"+facility?.id+"#units"} className="text-base text-gray-700 font-medium hover:text-black focus:text-black active:text-black">Edit facility units</a> : ""} */}
</h3>
<ul>
{facility?.facility_units &&
Expand All @@ -581,7 +581,7 @@ function FacilityDetailsTabsPulic({ facility }) {
</small>
</div>
<div className="flex flex-row gap-1 items-center">
<CheckCircleIcon className="h-6 w-6 text-blue-500" />
<CheckCircleIcon className="h-6 w-6 text-gray-500" />
<label className="text-sm text-gray-600">
Active
</label>
Expand Down
2 changes: 1 addition & 1 deletion components/FacilityUpgradeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function FacilityUpgradeModal({ subject, facilityId }) {
}
}>
<span className="flex gap-2 items-center">
<InformationCircleIcon className="w-24 h-24 text-blue-600" />
<InformationCircleIcon className="w-24 h-24 text-gray-600" />
<Typography id="transition-modal-title" variant="h6" >
Would you like to upgrade/downgrade or save edited facility {subject}?
</Typography>
Expand Down
12 changes: 6 additions & 6 deletions components/Forms/BasicDetailsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ export function BasicDeatilsForm({ editMode }) {

{/* Armed Forces Facilities */}
<div className=' w-full flex flex-col items-start justify-start p-3 border border-gray-400 rounded bg-transaprent h-auto'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 rounded w-full mb-4 font-semibold text-blue-900'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 w-full mb-4 font-semibold text-gray-900'>
Armed Forces Facilities
</h4>
<div className='w-full flex flex-row items-center px-2 justify-start gap-1 gap-x-3 mb-3'>
Expand All @@ -1275,7 +1275,7 @@ export function BasicDeatilsForm({ editMode }) {

{/* Hours/Days of Operation */}
<div className=' w-full flex flex-col items-start justify-start p-3 border border-gray-400 rounded bg-transaprent h-auto'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 rounded w-full mb-4 font-semibold text-blue-900'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 w-full mb-4 font-semibold text-gray-900'>
Hours/Days of Operation
</h4>
<div className='w-full flex flex-row items-center px-2 gap-1 gap-x-3 mb-3'>
Expand Down Expand Up @@ -1363,7 +1363,7 @@ export function BasicDeatilsForm({ editMode }) {

{/* Location Details */}
<div className=' w-full flex flex-col items-start justify-start p-3 border border-gray-400 rounded bg-transaprent h-auto'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 w-full mb-4 font-semibold text-blue-900'>
<h4 className='text-lg uppercase pb-2 border-b border-gray-400 w-full mb-4 font-semibold text-gray-900'>
Location Details
</h4>
<div className='grid md:grid-cols-4 grid-cols-1 place-content-start gap-3 w-full'>
Expand Down Expand Up @@ -1621,9 +1621,9 @@ export function BasicDeatilsForm({ editMode }) {
:

<div className='flex justify-between items-center w-full'>
<button className='flex items-center justify-start space-x-2 p-1 border border-blue-900 px-2'>
<ChevronDoubleLeftIcon className='w-4 h-4 text-blue-900' />
<span className='text-medium font-semibold text-blue-900 '>
<button className='flex items-center justify-start space-x-2 p-1 border border-gray-900 px-2'>
<ChevronDoubleLeftIcon className='w-4 h-4 text-gray-900' />
<span className='text-medium font-semibold text-gray-900 '>
Cancel
</span>
</button>
Expand Down
Loading

0 comments on commit 7ec19ac

Please sign in to comment.