@openmrs/esm-stock-management-app 1.0.1-pre.361 → 1.0.1-pre.366

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,15 @@
2
2
  @use '@carbon/styles/scss/type';
3
3
  @import '~@openmrs/esm-styleguide/src/vars';
4
4
 
5
- .section {
6
- // margin: spacing.$spacing-03;
5
+ .reportContainer {
6
+ min-height: 15rem;
7
+ display: flex;
8
+ flex-direction: column;
9
+ row-gap: 1rem;
10
+ padding: 1rem;
11
+ }
12
+ .reportButton {
13
+ padding: 1rem
7
14
  }
8
15
 
9
16
  .sectionTitle {
@@ -17,6 +17,7 @@ import {
17
17
  TableToolbarSearch,
18
18
  Tile,
19
19
  Button,
20
+ InlineLoading,
20
21
  } from "@carbon/react";
21
22
  import { isDesktop } from "@openmrs/esm-framework";
22
23
  import NewReportActionButton from "./new-report-button.component";
@@ -30,7 +31,6 @@ import {
30
31
  BatchJobStatusExpired,
31
32
  BatchJobStatusFailed,
32
33
  BatchJobStatusPending,
33
- BatchJobStatusRunning,
34
34
  } from "../../core/api/types/BatchJob";
35
35
  import {
36
36
  CheckmarkOutline,
@@ -118,6 +118,13 @@ const StockReports: React.FC = () => {
118
118
  )),
119
119
  status: (
120
120
  <>
121
+ {batchJob.status === BatchJobStatusPending && (
122
+ <InlineLoading
123
+ status="active"
124
+ iconDescription="Loading"
125
+ description="Generating report..."
126
+ />
127
+ )}
121
128
  {batchJob.status === BatchJobStatusFailed && (
122
129
  <WarningAltFilled
123
130
  className="report-failed"
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+
3
+ export const reportSchema = z.object({
4
+ startDate: z.coerce.date().refine((date) => date !== undefined, {
5
+ message: "Start Date is required",
6
+ }),
7
+ endDate: z.coerce.date().refine((date) => date !== undefined, {
8
+ message: "End Date is required",
9
+ }),
10
+ location: z.string({ required_error: "Location Required" }).min(1, {
11
+ message: "Location Required",
12
+ }),
13
+ reportName: z.string({ required_error: "Report Name Required" }).min(1, {
14
+ message: "Report Name Required",
15
+ }),
16
+ stockReportItemCategory: z.string().optional(),
17
+ mostLeastMoving: z.string().optional(),
18
+ mostLeastMovingName: z.string().optional(),
19
+ stockItemUuid: z.string().optional(),
20
+ stockItemName: z.string().optional(),
21
+ patientUuid: z.string().optional(),
22
+ patientName: z.string().optional(),
23
+ locationUuid: z.string().optional(),
24
+ childLocations: z.boolean().optional(),
25
+ stockSourceUuid: z.string().optional(),
26
+ stockSource: z.string().optional(),
27
+ stockSourceDestinationUuid: z.string().optional(),
28
+ stockSourceDestination: z.string().optional(),
29
+ inventoryGroupBy: z.string().optional(),
30
+ inventoryGroupByName: z.string().optional(),
31
+ stockItemCategoryConceptUuid: z.string().optional(),
32
+ reportSystemName: z.string().optional(),
33
+ stockItemCategory: z.string().optional(),
34
+ maxReorderLevelRatio: z.number().optional(),
35
+ fullFillment: z.string().array().optional(),
36
+ limit: z.string().optional(),
37
+ date: z.date().optional(),
38
+ });
39
+
40
+ export type StockReportSchema = z.infer<typeof reportSchema>;
package/tsconfig.json CHANGED
@@ -14,7 +14,8 @@
14
14
  "es2015.promise",
15
15
  "es2016.array.include",
16
16
  "es2018",
17
- "es2020"
17
+ "es2020",
18
+ "es2021"
18
19
  ],
19
20
  "resolveJsonModule": true,
20
21
  "noEmit": true,