Skip to content

Commit

Permalink
Updated on stock operations WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
patryllus authored and donaldkibet committed Jan 12, 2024
1 parent eb92332 commit 31928b2
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 85 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: UgandaEMR CI
name: KenyaEMR CI

on:
workflow_dispatch:
Expand All @@ -11,8 +11,8 @@ on:
- created

env:
ESM_NAME: "@ugandaemr/esm-stock-management-app"
JS_NAME: "esm-ugandaemr-stock-management-app.js"
ESM_NAME: "@kenyaemr/esm-stock-management-app"
JS_NAME: "esm-kenyaemr-stock-management-app.js"

jobs:
build:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Build
run: yarn turbo build --color --concurrency=5

- run: git config user.email "<>" && git config user.name "UgandaEMR CI"
- run: git config user.email "<>" && git config user.name "KenyaEMR CI"
- run: git add . && git commit -m "Prerelease version" --no-verify

- name: Pre-release
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@ugandaemr/esm-stock-management-app",
"name": "@kenyaemr/esm-stock-management-app",
"version": "3.0.0",
"license": "MPL-2.0",
"description": "A frontend module that handles stock management in UgandaEMR+",
"browser": "dist/esm-ugandaemr-stock-management-app.js",
"description": "A frontend module that handles stock management in kenyaemr+",
"browser": "dist/esm-kenyaemr-stock-management-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
setSelectedIndex(1);
},
onComplete: async (model) => {
console.log("Model",model);
// TODO: Update
await addOrEditStockOperation(
model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
setIsSaving(false);
}
};

return (
<div style={{ margin: "10px" }}>
<form
Expand Down Expand Up @@ -198,14 +197,14 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
/>
)}

{canEdit && !lockSource && operation?.hasSource && (
{!canEdit && !lockSource && operation?.hasSource && (
<PartySelector
controllerName="sourceUuid"
name="sourceUuid"
control={control}
title={
operation?.hasDestination
? t("from:", "From:")
? t("from:", "From1:")
: t("location:", "Location:")
}
placeholder={
Expand All @@ -219,12 +218,12 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
/>
)}

{(!canEdit || lockSource) && operation?.hasSource && (
{(canEdit || lockSource) && operation?.hasSource && (
<TextInput
id="sourceUuidLbl"
value={model?.sourceName ?? ""}
readOnly={true}
labelText={operation?.hasDestination ? "From:" : "Location:"}
labelText={operation?.hasDestination ? "From2:" : "Location:"}
/>
)}

Expand Down Expand Up @@ -256,7 +255,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
/>
)}

{canEdit && (
{!canEdit && (
<UsersSelector
controllerName="responsiblePersonUuid"
name="responsiblePersonUuid"
Expand Down Expand Up @@ -295,7 +294,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
/>
)}

{!canEdit && (
{canEdit && (
<TextInput
id="responsiblePersonLbl"
value={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const StockItemsAddition: React.FC<StockItemsAdditionProps> = ({
canUpdateItemsBatchInformation: canUpdateBatchInformation,
itemUoM,
},
canEdit,
canEdit = true,
model,
onSave,
}) => {
Expand Down Expand Up @@ -76,7 +76,7 @@ const StockItemsAddition: React.FC<StockItemsAdditionProps> = ({
formState: { errors },
} = useForm({
resolver: zodResolver(stockOperationItemsSchema),
defaultValues: { stockItems: model.stockOperationItems },
defaultValues: { stockItems: stockOperationItems },
mode: "onSubmit",
});

Expand Down
1 change: 0 additions & 1 deletion src/stock-operations/stock-operations.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export function createStockOperation(item: StockOperationDTO) {

// updateStockOperation
export function updateStockOperation(item: StockOperationDTO) {
console.log("Item")
const apiUrl = `ws/rest/v1/stockmanagement/stockoperation/${item.uuid}`;
const abortController = new AbortController();
return openmrsFetch(apiUrl, {
Expand Down
134 changes: 67 additions & 67 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4866,6 +4866,73 @@ __metadata:
languageName: node
linkType: hard

"@kenyaemr/esm-stock-management-app@workspace:.":
version: 0.0.0-use.local
resolution: "@kenyaemr/esm-stock-management-app@workspace:."
dependencies:
"@carbon/react": ^1.33.1
"@hookform/resolvers": ^3.3.0
"@openmrs/esm-framework": next
"@openmrs/esm-styleguide": next
"@swc/cli": ^0.1.62
"@swc/core": ^1.3.68
"@swc/jest": ^0.2.26
"@testing-library/dom": ^8.20.1
"@testing-library/jest-dom": ^5.16.5
"@testing-library/react": ^13.4.0
"@testing-library/user-event": ^14.4.3
"@types/file-saver": ^2.0.5
"@types/jest": ^28.1.8
"@types/react": ^18.2.14
"@types/react-dom": ^18.2.6
"@types/react-router": ^5.1.20
"@types/react-router-dom": ^5.3.3
"@types/webpack-env": ^1.18.1
"@typescript-eslint/eslint-plugin": ^5.61.0
"@typescript-eslint/parser": ^5.61.0
css-loader: ^6.8.1
dayjs: ^1.11.9
eslint: ^8.44.0
eslint-config-prettier: ^8.8.0
eslint-config-ts-react-important-stuff: ^3.0.0
eslint-plugin-prettier: ^4.2.1
file-saver: ^2.0.5
husky: ^8.0.0
i18next: ^23.2.8
i18next-parser: ^8.0.0
identity-obj-proxy: ^3.0.0
jest: ^28.1.3
jest-cli: ^28.1.3
jest-environment-jsdom: ^28.1.3
lodash-es: ^4.17.21
openmrs: next
prettier: ^2.8.8
pretty-quick: ^3.1.3
react: ^18.2.0
react-dom: ^18.2.0
react-hook-form: ^7.45.4
react-i18next: ^11.18.6
react-image-annotate: ^1.8.0
react-router-dom: ^6.14.1
rxjs: ^6.6.7
swc-loader: ^0.2.3
swr: ^2.2.1
turbo: ^1.10.7
typescript: ^4.9.5
webpack: ^5.88.1
webpack-cli: ^5.1.4
yup: ^1.2.0
zod: ^3.22.2
peerDependencies:
"@openmrs/esm-framework": 5.x
dayjs: 1.x
react: 18.x
react-i18next: 11.x
react-router-dom: 6.x
rxjs: 6.x
languageName: unknown
linkType: soft

"@leichtgewicht/ip-codec@npm:^2.0.1":
version: 2.0.4
resolution: "@leichtgewicht/ip-codec@npm:2.0.4"
Expand Down Expand Up @@ -8243,73 +8310,6 @@ __metadata:
languageName: node
linkType: hard

"@ugandaemr/esm-stock-management-app@workspace:.":
version: 0.0.0-use.local
resolution: "@ugandaemr/esm-stock-management-app@workspace:."
dependencies:
"@carbon/react": ^1.33.1
"@hookform/resolvers": ^3.3.0
"@openmrs/esm-framework": next
"@openmrs/esm-styleguide": next
"@swc/cli": ^0.1.62
"@swc/core": ^1.3.68
"@swc/jest": ^0.2.26
"@testing-library/dom": ^8.20.1
"@testing-library/jest-dom": ^5.16.5
"@testing-library/react": ^13.4.0
"@testing-library/user-event": ^14.4.3
"@types/file-saver": ^2.0.5
"@types/jest": ^28.1.8
"@types/react": ^18.2.14
"@types/react-dom": ^18.2.6
"@types/react-router": ^5.1.20
"@types/react-router-dom": ^5.3.3
"@types/webpack-env": ^1.18.1
"@typescript-eslint/eslint-plugin": ^5.61.0
"@typescript-eslint/parser": ^5.61.0
css-loader: ^6.8.1
dayjs: ^1.11.9
eslint: ^8.44.0
eslint-config-prettier: ^8.8.0
eslint-config-ts-react-important-stuff: ^3.0.0
eslint-plugin-prettier: ^4.2.1
file-saver: ^2.0.5
husky: ^8.0.0
i18next: ^23.2.8
i18next-parser: ^8.0.0
identity-obj-proxy: ^3.0.0
jest: ^28.1.3
jest-cli: ^28.1.3
jest-environment-jsdom: ^28.1.3
lodash-es: ^4.17.21
openmrs: next
prettier: ^2.8.8
pretty-quick: ^3.1.3
react: ^18.2.0
react-dom: ^18.2.0
react-hook-form: ^7.45.4
react-i18next: ^11.18.6
react-image-annotate: ^1.8.0
react-router-dom: ^6.14.1
rxjs: ^6.6.7
swc-loader: ^0.2.3
swr: ^2.2.1
turbo: ^1.10.7
typescript: ^4.9.5
webpack: ^5.88.1
webpack-cli: ^5.1.4
yup: ^1.2.0
zod: ^3.22.2
peerDependencies:
"@openmrs/esm-framework": 5.x
dayjs: 1.x
react: 18.x
react-i18next: 11.x
react-router-dom: 6.x
rxjs: 6.x
languageName: unknown
linkType: soft

"@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5":
version: 1.11.6
resolution: "@webassemblyjs/ast@npm:1.11.6"
Expand Down

0 comments on commit 31928b2

Please sign in to comment.