Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving User Dashboard to Health Exchnage #14

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,16 @@
"jest-cli": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"openmrs": "next",
"plotly.js": "^2.24.3",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-grid-layout": "^1.4.1",
"react-i18next": "^11.18.6",
"react-pivottable": "^0.11.0",
"react-plotly.js": "^2.0.0",
"react-router-dom": "^6.14.1",
"rxjs": "^6.6.7",
"swc-loader": "^0.2.3",
Expand All @@ -107,4 +112,4 @@
"webpack-cli": "^5.1.4"
},
"packageManager": "[email protected]"
}
}
47 changes: 47 additions & 0 deletions src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
urlUserName?: string;
urlPassword?: string;
links?: Array<link>;
actions: any;

Check warning on line 39 in src/declarations.d.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
};

declare type exchangeProfile = {
Expand Down Expand Up @@ -81,7 +81,7 @@
statusCode?: string;
dateCreated?: string;
comment?: string;
actions?: any;

Check warning on line 84 in src/declarations.d.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
patientUuid?: string;
};

Expand Down Expand Up @@ -110,3 +110,50 @@
group: string;
value: number;
}>;

declare type Report = {
id: string;
label: string;
};

declare type ReportProps = {
categoryName: string;
reports: Array<Report>;
};

declare type Indicator = {
id: string;
label: string;
type?: string;
attributes?: Array<IndicatorItem>;
};

declare type IndicatorItem = {
id: string;
label: string;
type?: string;
};

declare type ReportParamItem = {
label: string;
type?: string;
expression: string;
};

type savedReport = {
id: string;
label: string;
description: string;
type: string;
columns: string;
rows: string;
aggregator: string;
report_request_object: string;
};

type savedDashboard = {
uuid: string;
name: string;
description: string;
items: any;

Check warning on line 158 in src/declarations.d.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
};
5 changes: 5 additions & 0 deletions src/facility-metrics/helper-components/tab-builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HIEDashboard from "../hie-metrics/hie-dashboard.component";
import styles from "./tab-builder.scss";
import FacilityPerformance from "../performance/performance.component";
import EntryStatistics from "../data-entry-statistics/data-entry-statistics.component";
import UserDashboard from "../user-dashboard/user-dashboard.component";

interface TabItem {
name: string;
Expand All @@ -19,6 +20,10 @@ const TabBuilder: React.FC = () => {
name: t("hie", "HIE Metrics"),
component: <HIEDashboard />,
},
{
name: t("userDashboard", "User Dashboard"),
component: <UserDashboard />,
},
{
name: t("performance", "Performance"),
component: <FacilityPerformance />,
Expand Down
137 changes: 137 additions & 0 deletions src/facility-metrics/user-dashboard/user-dasboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/colors';
@import '../../root.scss';
@import '~@openmrs/esm-styleguide/src/vars';
.createIcon {
padding: 1.0rem;
margin-right: 60px;
}

.iconButton {
width: 45px;
height: 40px;
background: lightgrey;
font-size: 60px;
display: flex;
justify-content: center;
align-items: center;
padding-right: 30px;
}

.searchField {
width: 100%;
border: 0 !important;
}

.searchBox {
padding: 1.0rem;
width: 100%;
display: flex;
justify-content: left;
margin-left: 30px;
}

.cardContainer {
background-color: $ui-background;
display: flex;
justify-content: space-between;
padding: spacing.$spacing-05;
}

.sectionTitle {
@include type.type-style('heading-compact-02');
margin-bottom: spacing.$spacing-04;
}

.dashboardModal,
.dashboardTabs {
:global(.cds--modal-container) {
min-width: 80%;
min-height: 80%;
}
:global(.pvtAxisContainer),
:global(.pvtRenderers),
:global(.pvtVals),
:global(.modebar-container) {
display: none;
}
}

.modalInput {
margin-bottom: spacing.$spacing-06;
}

.dashboardSection {
width: 80%;
}

.dashboardTabs {
:global(.cds--tabs) {
padding-left: 2rem;
}
:global(.cds--tab-content) {
padding-left: 1.5rem;
}
}

.layer {
display: flex;
justify-content: center;
align-items: center;
padding: spacing.$spacing-05;
margin: 2rem 1rem;
text-align: center;
border: 1px solid colors.$gray-20;
}

.tile {
margin: auto;
}

.content {
@include type.type-style("heading-compact-02");
color: colors.$gray-70;
margin-top: spacing.$spacing-05;
margin-bottom: spacing.$spacing-03;
}

.explainer {
@include type.type-style('body-compact-01');
color: colors.$gray-70;
}

.dropdownContainer {
margin: 2rem 0 2rem 0;
}

.dashboardChartContainer {
width: fit-content;
height: auto;
border: 1px solid #8080801f;
box-shadow: 0 0 1px 0 #999999fc;
margin-bottom: spacing.$spacing-06;
cursor: all-scroll;
}

.tabLabelWrapper {
display: flex;
align-items: center;
:global(.cds--btn--ghost) {
background-color: transparent;
}
}

.tabOverFlowMenu {
margin-left: -20px;
}

.tabHeaderText {
overflow-x: hidden;
text-overflow: ellipsis;
}

.dashboardItemTrash {
text-align: right;
margin: 5px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";

const UserIllustration: React.FC = () => {
return (
<svg
width="100"
height="72"
viewBox="0 0 250 250"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<g>
<g>
<path
fill="#7BBCB9"
data-title="Layer 0"
d="M24.1,116.2v106.2h89.7h89.7V116.2V10h-89.7H24.1V116.2L24.1,116.2z M137.1,44.7c3.7,1.9,5.7,3.8,7.6,7.3c1.7,2.9,1.8,3.6,1.8,8.9v5.7l5.8,3.5l5.8,3.5l2.7-1.6c2.4-1.3,3.5-1.5,7.8-1.5c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>
</g>
</svg>
);
};

export default UserIllustration;
Loading
Loading