Skip to content

Commit

Permalink
DHFPROD-9976: Display HubCentral Version
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulvudutala authored and MarkLogic Builder committed Mar 15, 2023
1 parent 410af67 commit 416444a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ task updateVersion {
"marklogic-data-hub/src/main/java/com/marklogic/hub/impl/VersionInfo.java",
"marklogic-data-hub/src/main/resources/hub-internal-config/security/roles/data-hub-admin.json",
"marklogic-data-hub-central/ui/e2e/hc-qa-project/build.gradle",
"marklogic-data-hub-central/src/main/resources/application.properties",
"examples/README.md",
"examples/dh-5-example/build.gradle",
"examples/dhf5-custom-hook/build.gradle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public SystemInfo getSystemInfo(HttpSession session) {
SystemInfo info = new SystemInfo();
info.serviceName = versionInfo.getClusterName();
info.dataHubVersion = versionInfo.getHubVersion();
info.hubCentralVersion = environment.getProperty("hubCentralVersion");
info.marklogicVersion = versionInfo.getMarkLogicVersion();
info.host = hubCentral.getHost();
info.stagingDb = versionInfo.getStagingDbName();
Expand All @@ -115,6 +116,7 @@ public static class SystemInfo {
public String serviceName;
public String dataHubVersion;
public String marklogicVersion;
public String hubCentralVersion;
public String host;
public String stagingDb;
public String finalDb;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ log.path=./logs
# Uncomment below to show details for all health indicators
#management.endpoint.health.show-details=always
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
hubCentralVersion=6.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void getSystemInfo() {
assertEquals(versionInfo.getStagingDbName(), actualSystemInfo.stagingDb);
assertEquals(versionInfo.getFinalDbName(), actualSystemInfo.finalDb);
assertEquals(versionInfo.getJobsDbName(), actualSystemInfo.jobsDb);
assertEquals(environment.getProperty("hubCentralVersion"), actualSystemInfo.hubCentralVersion);

assertEquals(versionInfo.getClusterName(), actualSystemInfo.serviceName,
"clusterName is called 'serviceName' in the HC context to provide an abstraction over where the " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Define any properties in here that are likely to change between environments where tests are run.
# The TestConfig class should then be used to access these properties.
hubCentralVersion=6.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const environment = {
"serviceName": "test-service",
"dataHubVersion": "5.3",
"hubCentralVersion": "6.0",
"marklogicVersion": "10.0",
"sessionTimeout": "300",
"sessionToken": "mySessionToken",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ const Header: React.FC<Props> = props => {
<div aria-label="info-text">
Data Hub Version: <strong>{props.environment.dataHubVersion}</strong>
<br />
Hub Central Version: <strong>{props.environment.hubCentralVersion}</strong>
<br />
MarkLogic Version: <strong>{props.environment.marklogicVersion}</strong>
<br />
Service Name: <strong>{props.environment.serviceName}</strong>
Expand Down Expand Up @@ -402,6 +404,7 @@ const Header: React.FC<Props> = props => {
serviceName={props.environment.serviceName}
dataHubVersion={props.environment.dataHubVersion}
marklogicVersion={props.environment.marklogicVersion}
hubCentralVersion={props.environment.hubCentralVersion}
systemInfoVisible={systemInfoVisible}
setSystemInfoVisible={setSystemInfoVisible}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe("Update data load settings component", () => {
expect(getByText("Data Hub Version:")).toBeInTheDocument();
expect(getByText(data.environment.dataHubVersion)).toBeInTheDocument();
expect(getByText("MarkLogic Version:")).toBeInTheDocument();
expect(getByText(data.environment.hubCentralVersion)).toBeInTheDocument();
expect(getByText("Hub Central Version:")).toBeInTheDocument();
expect(getByText(data.environment.marklogicVersion)).toBeInTheDocument();
expect(getByText("Download Hub Central Files")).toBeInTheDocument();
expect(getByText("Download Project Files")).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SystemInfo = props => {
const serviceName = props.serviceName || "";
const dataHubVersion = props.dataHubVersion || "";
const marklogicVersion = props.marklogicVersion || "";
const hubCentralVersion = props.hubCentralVersion || "";

const {user} = useContext(UserContext);

Expand Down Expand Up @@ -381,6 +382,10 @@ const SystemInfo = props => {
<div className={styles.label}>Data Hub Version:</div>
<div className={styles.value}>{dataHubVersion}</div>
</div>
<div className={styles.version}>
<div className={styles.label}>Hub Central Version:</div>
<div className={styles.value}>{hubCentralVersion}</div>
</div>
<div className={styles.version}>
<div className={styles.label}>MarkLogic Version:</div>
<div className={styles.value}>{marklogicVersion}</div>
Expand Down
1 change: 1 addition & 0 deletions marklogic-data-hub-central/ui/src/util/environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const defaultEnv = {
serviceName: "",
dataHubVersion: "",
markLogicVersion: "",
hubCentralVersion: "",
};

export function getEnvironment(): any {
Expand Down

0 comments on commit 416444a

Please sign in to comment.