Skip to content

Commit

Permalink
Merge branch 'develop' into feature/1339
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush6194 authored Dec 17, 2024
2 parents de5d9df + 2677579 commit 7a752ec
Show file tree
Hide file tree
Showing 17 changed files with 1,263 additions and 70 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
- name: check formatting
run: mvn spotless:check

- name: Initialize and build submodules
run: |
cd dataexport
mvn clean install
cd ..
# - name: Initialize and build submodules
# run: |
# cd dataexport
# mvn clean install
# cd ..

- name: Build OpenELIS-Global2
run: mvn clean install -Dspotless.check.skip=true
Expand Down
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ RUN ./install/createDefaultPassword.sh -c -p ${DEFAULT_PW}
##
# Build DataExport
#
COPY ./dataexport /build/dataexport
WORKDIR /build/dataexport/dataexport-core
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn dependency:go-offline
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn clean install -DskipTests
WORKDIR /build/dataexport/
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn dependency:go-offline
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn clean install -DskipTests
# COPY ./dataexport /build/dataexport
# WORKDIR /build/dataexport/dataexport-core
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn dependency:go-offline
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn clean install -DskipTests
# WORKDIR /build/dataexport/
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn dependency:go-offline
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn clean install -DskipTests

##
# Build the Project
#
WORKDIR /build

COPY ./pom.xml /build/pom.xml
Expand Down
25 changes: 14 additions & 11 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
ADD ./pom.xml /build/pom.xml
ADD ./tools /build/tools
ADD ./src /build/src
ADD ./dataexport /build/dataexport
# ADD ./dataexport /build/dataexport

WORKDIR /build

Expand All @@ -28,17 +28,20 @@ RUN ./install/createDefaultPassword.sh -c -p ${DEFAULT_PW}
##
# Build DataExport
#
WORKDIR /build/dataexport/dataexport-core
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn dependency:go-offline
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn clean install -DskipTests
WORKDIR /build/dataexport/
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn dependency:go-offline
RUN --mount=type=cache,target=/root/.m2,sharing=locked \
mvn clean install -DskipTests
# WORKDIR /build/dataexport/dataexport-core
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn dependency:go-offline
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn clean install -DskipTests
# WORKDIR /build/dataexport/
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn dependency:go-offline
# RUN --mount=type=cache,target=/root/.m2,sharing=locked \
# mvn clean install -DskipTests

##
# Build the Project
#
WORKDIR /build

RUN --mount=type=cache,target=/root/.m2,sharing=locked \
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/admin/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
User,
BatchJob,
Popup,
Search,
} from "@carbon/icons-react";
import PathRoute from "../utils/PathRoute";
import CalculatedValue from "./calculatedValue/CalculatedValueForm";
Expand Down Expand Up @@ -57,6 +58,7 @@ import ManageMethod from "./testManagement/ManageMethod.js";
import BatchTestReassignmentAndCancelation from "./BatchTestReassignmentAndCancellation/BatchTestReassignmentAndCancelation.js";
import TestNotificationConfigMenu from "./testNotificationConfigMenu/TestNotificationConfigMenu.js";
import TestNotificationConfigEdit from "./testNotificationConfigMenu/TestNotificationConfigEdit.js";
import SearchIndexManagement from "./searchIndexManagement/SearchIndexManagement";

function Admin() {
const intl = useIntl();
Expand Down Expand Up @@ -200,6 +202,9 @@ function Admin() {
<SideNavLink href="#NotifyUser" renderIcon={Bullhorn}>
<FormattedMessage id="Notify User" />
</SideNavLink>
<SideNavLink href="#SearchIndexManagement" renderIcon={Search}>
<FormattedMessage id="searchindexmanagement.label" />
</SideNavLink>
<SideNavLink
renderIcon={Catalog}
target="_blank"
Expand Down Expand Up @@ -343,6 +348,9 @@ function Admin() {
<PathRoute path="#PluginFile">
<PluginList />
</PathRoute>
<PathRoute path="#SearchIndexManagement">
<SearchIndexManagement />
</PathRoute>
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React, { useState, useContext } from "react";
import { Button, Loading, Grid, Column, Section, Heading } from "@carbon/react";
import { FormattedMessage, useIntl, injectIntl } from "react-intl";
import { getFromOpenElisServer } from "../../utils/Utils";
import PageBreadCrumb from "../../common/PageBreadCrumb";
import { NotificationContext } from "../../layout/Layout";
import {
AlertDialog,
NotificationKinds,
} from "../../common/CustomNotification";

function SearchIndexManagement() {
const [loading, setLoading] = useState(false);
const { notificationVisible, setNotificationVisible, addNotification } =
useContext(NotificationContext);
const intl = useIntl();
const rebuildIndex = async (res) => {
setNotificationVisible(true);
if (res) {
addNotification({
kind: NotificationKinds.success,
title: intl.formatMessage({ id: "notification.title" }),
message: intl.formatMessage({
id: "searchindexmanagement.reindex.success",
}),
});
} else {
addNotification({
kind: NotificationKinds.error,
title: intl.formatMessage({ id: "notification.title" }),
message: intl.formatMessage({
id: "searchindexmanagement.reindex.error",
}),
});
}
setLoading(false);
};
const handleReindexClick = async () => {
setLoading(true);
getFromOpenElisServer("/rest/reindex", rebuildIndex);
};

const breadcrumbs = [
{ label: "home.label", link: "/" },
{
label: "breadcrums.admin.managment",
link: "/MasterListsPage",
},
{
label: "searchindexmanagement.label",
link: "/MasterListsPage#SearchIndexManagement",
},
];

return (
<>
{notificationVisible === true ? <AlertDialog /> : ""}
{loading && <Loading />}
<div className="adminPageContent">
<PageBreadCrumb breadcrumbs={breadcrumbs} />
<Grid fullWidth={true}>
<Column lg={16} md={8} sm={4}>
<Section>
<Heading>
<FormattedMessage id="searchindexmanagement.label" />
</Heading>
</Section>
</Column>
</Grid>
<div className="orderLegendBody">
<Grid>
<Column lg={16} md={8} sm={4}>
<Section>
<Section>
<Heading>
<FormattedMessage id="searchindexmanagement.reindex" />
</Heading>
</Section>
</Section>
<br />
<Section>
<FormattedMessage id="searchindexmanagement.description" />
</Section>
<br />
<Button onClick={handleReindexClick} disabled={loading}>
<FormattedMessage id="searchindexmanagement.reindex" />
</Button>
</Column>
</Grid>
</div>
</div>
</>
);
}

export default injectIntl(SearchIndexManagement);
7 changes: 6 additions & 1 deletion frontend/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1271,5 +1271,10 @@
"testnotification.testdefault.template": "Default Message for Test",
"testnotification.testdefault.editIcon": "Edit Test Notification",
"testnotification.bcc": "BCC",
"column.name.testId": "Test Id"
"column.name.testId": "Test Id",
"searchindexmanagement.label": "Search Index Management",
"searchindexmanagement.reindex.success": "Reindexing completed successfully",
"searchindexmanagement.reindex.error": "Reindexing failed",
"searchindexmanagement.description": "The search index updates automatically when data is added or modified. If you need to manually update the search index, click the Start Reindexing button. This may take some time.",
"searchindexmanagement.reindex": "Start Reindexing"
}
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pl.pragmatists</groupId>
<artifactId>JUnitParams</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ public class MassIndexerRestController {
MassIndexerService massIndexerService;

@GetMapping("/reindex")
public ResponseEntity<String> reindex() {
public ResponseEntity<Boolean> reindex() {
try {
massIndexerService.reindex();
return ResponseEntity.ok("Reindexing completed successfully.");
return ResponseEntity.ok(true);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Error occurred during reindexing: " + e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public PatientType readPatientType(String idString) {
public List<PatientType> getPatientTypes(String description) throws LIMSRuntimeException {
List<PatientType> list = new Vector<>();
try {
String sql = "from patientType l where upper(l.description) like upper(:param) order by"
String sql = "from PatientType l where upper(l.description) like upper(:param) order by"
+ " upper(l.description)";
org.hibernate.query.Query query = entityManager.unwrap(Session.class).createQuery(sql);
query.setParameter("param", description + "%");
Expand Down
Loading

0 comments on commit 7a752ec

Please sign in to comment.