Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7aa83ee
fix(TestManagementConfigMenu-page): restController init
adityadeshlahre Aug 1, 2024
1987045
fix(TestManagementConfigMenu-page): non recursive pages init
adityadeshlahre Aug 1, 2024
49bb1d7
fix(TestManagementConfigMenu-page): recursive pages init (with subpages)
adityadeshlahre Aug 2, 2024
398c0a9
fix(TestManagementConfigMenu-page): other likewise RestController added
adityadeshlahre Aug 2, 2024
00af99b
fix(TestManagementConfigMenu-page): initalization(Test organization) …
adityadeshlahre Aug 2, 2024
0078210
fix(TestManagementConfigMenu-page): Renaming pages left-over INIT
adityadeshlahre Aug 3, 2024
5b4b18d
fix(TestNotificationConfigMenu): left-over controllers + TestRenameEn…
adityadeshlahre Aug 10, 2024
70d4d15
fix(TestManagementConfigMenu-page): reusable component + PanelRenameP…
adityadeshlahre Aug 14, 2024
5cc212e
fix(TestManagementConfigMenu-page): [remaning]RenamePages done
adityadeshlahre Aug 14, 2024
9698292
fix(TestManagementConfigMenuPage): selectListRenameEntry bug fix + te…
adityadeshlahre Aug 17, 2024
4bccdcb
fix(TestManagementConfigMenuPage): UI implementation existing.test.se…
adityadeshlahre Aug 21, 2024
255e14d
fix(fucntion): added onHandleFuntions
adityadeshlahre Aug 24, 2024
05a2e0d
fix(redndering): rendering selected sampleType
adityadeshlahre Aug 25, 2024
089a9a3
fix(redndering): range[ELEMENTS] rendering fixed
adityadeshlahre Aug 26, 2024
56f47c9
fix:onClick routing
adityadeshlahre Dec 6, 2024
98031a9
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
mozzy11 Dec 16, 2024
d6f0845
minor fix
mozzy11 Dec 16, 2024
7ba1f99
fix(testManagementRoute):pointed onclick to old jsp pages
adityadeshlahre Dec 16, 2024
2d52209
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Dec 16, 2024
be75ad2
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Dec 16, 2024
fcc30df
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
mozzy11 Dec 19, 2024
fad2dfa
fix(testManagementConfigMenu):404 call fixed && undefined data fix
adityadeshlahre Dec 22, 2024
2686c1a
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
mozzy11 Dec 23, 2024
e10395e
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Dec 23, 2024
a718a00
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 8, 2025
59d6156
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 9, 2025
2f75384
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 9, 2025
38d867a
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
mozzy11 Jan 13, 2025
a635f03
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 16, 2025
4e842d8
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 17, 2025
80fd5f2
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 17, 2025
87eed7f
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 21, 2025
960938f
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 23, 2025
9daad1d
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 26, 2025
d76d936
fix(frontend): loading edge case on empty input box fix
adityadeshlahre Jan 26, 2025
1af64dd
fix(frontend): formatting fixes
adityadeshlahre Jan 26, 2025
d799666
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
adityadeshlahre Jan 29, 2025
9d7bf93
fix Test management componenets
mozzy11 Jan 29, 2025
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
Prev Previous commit
Next Next commit
fix(TestManagementConfigMenu-page): [remaning]RenamePages done
  • Loading branch information
adityadeshlahre committed Nov 17, 2024
commit 5cc212e9816fc55c2a9460d070871c8873b222da
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
import React, { useContext, useState, useEffect, useRef } from "react";
import {
Form,
Heading,
Button,
Loading,
Grid,
Column,
Section,
DataTable,
Table,
TableHead,
TableRow,
TableBody,
TableHeader,
TableCell,
TableSelectRow,
TableSelectAll,
TableContainer,
Pagination,
Search,
Select,
SelectItem,
Stack,
UnorderedList,
ListItem,
} from "@carbon/react";
import { Heading, Button, Grid, Column, Section } from "@carbon/react";
import {
getFromOpenElisServer,
postToOpenElisServer,
postToOpenElisServerFormData,
postToOpenElisServerFullResponse,
postToOpenElisServerJsonResponse,
} from "../../utils/Utils.js";
import { NotificationContext } from "../../layout/Layout.js";
Expand All @@ -39,8 +11,7 @@ import {
} from "../../common/CustomNotification.js";
import { FormattedMessage, injectIntl, useIntl } from "react-intl";
import PageBreadCrumb from "../../common/PageBreadCrumb.js";
import CustomCheckBox from "../../common/CustomCheckBox.js";
import ActionPaginationButtonType from "../../common/ActionPaginationButtonType.js";
import RenameModelBox from "./renameModel/RenameModelBox.js";

let breadcrumbs = [
{ label: "home.label", link: "/" },
Expand All @@ -62,31 +33,198 @@ function MethodRenameEntry() {
const intl = useIntl();

const componentMounted = useRef(false);
const modalHeading = intl.formatMessage({
id: "method.browse.title",
});

const [isLoading, setIsLoading] = useState(false);
const [finished, setFinished] = useState(true);
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
const [confirmationStep, setConfirmationStep] = useState(false);
const [inputError, setInputError] = useState(false);
const [methodRename, setMethodRename] = useState({});
const [methodListShow, setMethodListShow] = useState([]);
const [methodRenamePost, setMethodRenamePost] = useState({});
const [entityNamesProvider, setEntityNamesProvider] = useState({});
const [entityNamesProviderPost, setEntityNamesProviderPost] = useState({});
const [entityId, setEntityId] = useState();
const [entityName, setEntityName] = useState("method");
const [selectedItem, setSelectedItem] = useState({});

useEffect(() => {
componentMounted.current = true;
getFromOpenElisServer("/rest/MethodRenameEntry", handleMethodRename);
return () => {
componentMounted.current = false;
};
}, []);

const handleMethodRename = (res) => {
if (!res) {
setIsLoading(true);
} else {
setMethodRename(res);
setMethodRenamePost(res);
setMethodListShow(res.methodList);
}
};

useEffect(() => {
getFromOpenElisServer(
`/rest/EntityNamesProvider?entityId=${entityId}&entityName=${entityName}`,
handelEntityNamesProvider,
);
}, [entityId]);

const handelEntityNamesProvider = (res) => {
if (!res) {
setIsLoading(true);
} else {
setEntityNamesProvider(res);
setEntityNamesProviderPost(res);
}
};

function methodRenameUpdatePost() {
setIsLoading(true);
if (confirmationStep) {
postToOpenElisServerJsonResponse(
`/rest/MethodRenameEntry`,
JSON.stringify(methodRenamePost),
(res) => {
methodRenameUpdatePostCallback(res);
},
);
} else {
setConfirmationStep(true);
}
}

function methodRenameUpdatePostCallback(res) {
if (res) {
setIsLoading(false);
setFinished(false);
addNotification({
title: intl.formatMessage({
id: "notification.title",
}),
message: intl.formatMessage({
id: "notification.user.post.save.success",
}),
kind: NotificationKinds.success,
});
setNotificationVisible(true);
setIsAddModalOpen(false);
} else {
addNotification({
kind: NotificationKinds.error,
title: intl.formatMessage({ id: "notification.title" }),
message: intl.formatMessage({ id: "server.error.msg" }),
});
setNotificationVisible(true);
setTimeout(() => {
window.location.reload();
}, 200);
}
}

const openAppModle = (item) => {
setConfirmationStep(false);
setIsAddModalOpen(true);
setEntityId(item.id);
// setEntityName(test.value);
setSelectedItem(item);
};

const onInputChangeEn = (e) => {
const englishName = e.target.value;
setEntityNamesProviderPost((prev) => ({
name: {
...prev.name,
english: englishName,
},
}));
setInputError(false);
};

const onInputChangeFr = (e) => {
const frenchName = e.target.value;
setEntityNamesProviderPost((prev) => ({
name: {
...prev.name,
french: frenchName,
},
}));
setInputError(false);
};

useEffect(() => {
if (entityId && entityNamesProviderPost && entityNamesProviderPost.name) {
setMethodRenamePost((prev) => ({
...prev,
methodId: entityId,
nameEnglish: entityNamesProviderPost.name.english,
nameFrench: entityNamesProviderPost.name.french,
}));
}
}, [entityNamesProviderPost, entityId]);

const closeAddModal = () => {
setIsAddModalOpen(false);
};

return (
<>
{notificationVisible === true ? <AlertDialog /> : ""}
<div className="adminPageContent">
<PageBreadCrumb breadcrumbs={breadcrumbs} />
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<Section>
<Heading>
<FormattedMessage id="configuration.type.rename" />
</Heading>
</Section>
</Column>
</Grid>
<br />
<hr />
<br />
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<Button type="tertiary">
<FormattedMessage id="label.button.finished" />
</Button>
</Column>
</Grid>
<div className="orderLegendBody">
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<Section>
<Heading>
<FormattedMessage id="configuration.type.rename" />
</Heading>
</Section>
</Column>
</Grid>
<br />
<hr />
<br />
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<Button
disabled={finished}
id="finishdButton"
type="button"
onClick={() => {
window.location.reload();
}}
>
<FormattedMessage id="label.button.finished" />
</Button>
</Column>
</Grid>
<br />
<RenameModelBox
data={methodListShow}
isModalOpen={isAddModalOpen}
openModel={openAppModle}
closeModel={closeAddModal}
onSubmit={methodRenameUpdatePost}
onInputChangeEn={onInputChangeEn}
onInputChangeFr={onInputChangeFr}
isLoading={isLoading}
modalHeading={modalHeading}
heading="banner.menu.patientEdit"
mainLabel="method.methodName"
confirmationStep={confirmationStep}
inputError={inputError}
lang={entityNamesProvider}
langPost={entityNamesProviderPost}
selectedItem={selectedItem}
/>
</div>
</div>
</>
);
Expand Down
Loading