Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit 7c11a1f

Browse files
fix/compilation fix, view configs with version
1 parent e6a4ce3 commit 7c11a1f

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

lib/src/api/view/view.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from "@nestjs/common";
22
import { ApiResponse } from "../../common/types/dto/response.dto";
33
import { EnvType, ViewConfigData } from "@traceo/types";
44
import { EntityManager } from "typeorm";
5-
import { SESSION_NAME } from "../../common/helpers/constants";
5+
import { SESSION_NAME, VERSION } from "../../common/helpers/constants";
66
import { Session } from "../../db/entities/session.entity";
77
import { UserQueryService } from "../user/user-query/user-query.service";
88
import { Request } from "express";
@@ -33,6 +33,7 @@ export class ViewService {
3333

3434
settings.env = process.env.NODE_ENV as EnvType;
3535
settings.demoMode = isDemo;
36+
settings.version = VERSION;
3637

3738
return new ApiResponse("success", undefined, settings);
3839
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
export const ADMIN_EMAIL = "admin@localhost";
22
export const ADMIN_NAME = "admin";
33

4-
export const VERSION = "1.2.3";
4+
export const VERSION = "1.2.4-2023.8.3";
55

66
export const SESSION_NAME = "traceo_session";
77
export const SESSION_EXPIRY_TIME = 60 * 1000 * 60 * 24; //24h
88

99
export const INTERNAL_SERVER_ERROR = "Error. Please try again later.";
10-
export const REMOVED_MESSAGE_TEXT = "This message has been removed.";

public/packages/app/src/core/contexts/ConfigsContextProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import React, { useContext, useEffect, useState } from "react";
66
const initialConfigs: ViewConfigData = {
77
demoMode: false,
88
user: {},
9-
env: "development"
9+
env: "development",
10+
version: undefined
1011
};
1112

1213
export const ConfigContext = React.createContext<ViewConfigData>(initialConfigs);

public/packages/app/src/core/utils/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export const VERSION = "1.2.3";
2-
31
export const GH_REPO_LINK = "https://github.com/traceo-dev/traceo";
42
export const GH_REPO_ISSUE_LINK = "https://github.com/traceo-dev/traceo/issues/new";
53
export const GH_SDK_REPO_LINK = "https://github.com/traceo-dev/traceo-node";

public/packages/app/src/features/admin/InstancePage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
import { useConfig } from "src/core/contexts/ConfigsContextProvider";
12
import { DescriptionRow, Descriptions } from "../../core/components/Descriptions";
2-
import { VERSION } from "../../core/utils/constants";
33
import dateUtils from "../../core/utils/date";
44
import { DashboardPageWrapper } from "./components/DashboardPageWrapper";
55
import { Card } from "@traceo/ui";
66

77
const InstancePage = () => {
8+
const { version } = useConfig();
89
return (
910
<DashboardPageWrapper>
1011
<Card title="Basic Informations">
1112
<Descriptions>
1213
<DescriptionRow label="Name">
1314
© {new Date().getFullYear()} Traceo Platform
1415
</DescriptionRow>
15-
<DescriptionRow label="Version">{VERSION}</DescriptionRow>
16+
<DescriptionRow label="Version">{version}</DescriptionRow>
1617
<DescriptionRow label="Timezone">{dateUtils.guessTz()}</DescriptionRow>
1718
</Descriptions>
1819
</Card>

public/packages/app/src/features/project/overview/components/Panels/PlotPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import api from "../../../../../core/lib/api";
1010
import { ApiResponse, VISUALIZATION_TYPE, isEmpty } from "@traceo/types";
1111
import dateUtils from "../../../../../core/utils/date";
1212
import { conditionClass, joinClasses } from "@traceo/ui";
13-
import { areArraysEqual } from "src/core/utils/arrays";
13+
import { areArraysEqual } from "../../../../../core/utils/arrays";
1414

1515
export interface State {
1616
data: QueryResponseType;

public/packages/app/src/features/project/settings/SettingsDetailsPage.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ import { useRef, useState } from "react";
1313
import { useNavigate } from "react-router-dom";
1414
import { updateAplication } from "../state/project/actions";
1515
import { BaseProjectViewType } from "../../../core/types/hoc";
16-
import { useUser } from "src/core/hooks/useUser";
1716

1817
export const SettingsDetailsPage = ({ project, permission }: BaseProjectViewType) => {
1918
const navigate = useNavigate();
2019
const dispatch = useAppDispatch();
2120

2221
const isDemo = useDemo();
23-
const { isAdmin } = useUser();
2422
const ref = useRef<HTMLInputElement>();
2523

2624
const [loadingDelete, setLoadingDelete] = useState<boolean>(false);

public/packages/shared/traceo-types/src/types/configs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export interface ViewConfigData {
66
user: Partial<IUser>;
77
demoMode: boolean;
88
env: EnvType;
9+
version: string;
910
}

0 commit comments

Comments
 (0)