climb-onyx-gui 0.14.4 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ export declare enum Themes {
2
+ LIGHT = "light",
3
+ DARK = "dark"
4
+ }
5
+ export declare enum DarkModeColours {
6
+ BS_BODY_COLOR = "#dee2e6",// Bootstrap body text color for dark mode
7
+ BS_BODY_BG = "#121212",// Bootstrap body background color for dark mode
8
+ BS_GRAY_600 = "#6c757d",// Bootstrap gray-600 for dark mode
9
+ BS_GRAY_900 = "#212529"
10
+ }
1
11
  export declare enum OnyxTabKeys {
2
12
  USER = "user-tab",
3
13
  SITE = "site-tab",
@@ -41,14 +51,52 @@ export declare enum ExportStatus {
41
51
  CANCELLED = 4,
42
52
  ERROR = 5
43
53
  }
54
+ export type TabState = {
55
+ tabKey: OnyxTabKeys;
56
+ recordTabKey: RecordTabKeys;
57
+ recordDetailTabKey: RecordDetailTabKeys;
58
+ recordDataPanelTabKey: DataPanelTabKeys;
59
+ recordID: string;
60
+ analysisTabKey: AnalysisTabKeys;
61
+ analysisDetailTabKey: AnalysisDetailTabKeys;
62
+ analysisDataPanelTabKey: DataPanelTabKeys;
63
+ analysisID: string;
64
+ };
65
+ export type RecentlyViewed = {
66
+ ID: string;
67
+ timestamp: Date;
68
+ handleShowID: (id: string) => void;
69
+ };
44
70
  export type FieldType = "text" | "choice" | "integer" | "decimal" | "date" | "datetime" | "bool" | "relation" | "array" | "structure" | "";
45
71
  export type GraphType = "line" | "bar" | "pie" | "";
46
- export type ProjectField = {
72
+ export type Profile = {
73
+ username: string;
74
+ site: string;
75
+ email: string;
76
+ };
77
+ export type Project = {
78
+ code: string;
79
+ name: string;
80
+ };
81
+ export type ProjectPermissionGroup = {
82
+ project: string;
83
+ name: string;
84
+ scope: string;
85
+ actions: string[];
86
+ };
87
+ export type Field = {
47
88
  type: FieldType;
89
+ code: string;
48
90
  description: string;
49
91
  actions: string[];
50
92
  values?: string[];
51
- fields?: Record<string, ProjectField>;
93
+ fields?: Record<string, Field>;
94
+ };
95
+ export type Fields = {
96
+ name: string;
97
+ description: string;
98
+ fields: Record<string, Field>;
99
+ default_fields?: string[];
52
100
  };
53
101
  export type FilterConfig = {
54
102
  key: string;
@@ -70,7 +118,7 @@ export type TypeObject = {
70
118
  type: FieldType;
71
119
  lookups: string[];
72
120
  };
73
- export type LookupObject = {
121
+ export type Lookup = {
74
122
  lookup: string;
75
123
  description: string;
76
124
  };
@@ -78,42 +126,37 @@ export type ChoiceDescription = {
78
126
  description: string;
79
127
  is_active: boolean;
80
128
  };
81
- export type OptionType = {
129
+ export type Choices = Record<string, ChoiceDescription>;
130
+ export type SelectOption = {
82
131
  label: string;
83
132
  value: string;
84
133
  };
85
- export type ErrorType = Record<string, string | string[]>;
86
134
  export type RecordType = Record<string, string | number | boolean | object | null | RecordType[]>;
87
- export type SummaryType = Record<"count", number> & Record<string, string | number | boolean | object | null>;
88
- export type ProjectPermissionType = {
89
- project: string;
90
- scope: string;
91
- actions: string[];
135
+ export type HistoricalEntry = {
136
+ username?: string;
137
+ timestamp: string;
138
+ action: "add" | "change" | "delete";
139
+ changes: RecordType[];
140
+ };
141
+ export type HistoricalEntries = {
142
+ history: HistoricalEntry[];
92
143
  };
144
+ export type Summary = Record<"count", number> & Record<string, string | number | boolean | object | null>;
145
+ export type ErrorMessages = Record<string, string | string[]>;
93
146
  export interface ErrorResponse {
94
147
  status: "fail" | "error";
95
148
  code: number;
96
- messages: ErrorType;
149
+ messages: ErrorMessages;
97
150
  }
98
151
  export interface SuccessResponse {
99
152
  status: "success";
100
153
  code: number;
101
154
  }
102
- export interface ListResponse extends SuccessResponse {
103
- data: RecordType[];
155
+ export interface ListResponse<T> extends SuccessResponse {
156
+ data: T[];
104
157
  next: string | null;
105
158
  previous: string | null;
106
159
  }
107
- export interface DetailResponse extends SuccessResponse {
108
- data: RecordType;
109
- }
110
- export interface FieldsResponse extends SuccessResponse {
111
- data: {
112
- name: string;
113
- description: string;
114
- fields: Record<string, ProjectField>;
115
- };
116
- }
117
- export interface ChoicesResponse extends SuccessResponse {
118
- data: Record<string, ChoiceDescription>;
160
+ export interface DetailResponse<T> extends SuccessResponse {
161
+ data: T;
119
162
  }
@@ -1,12 +1,12 @@
1
1
  import { ExportHandlerProps, OnyxProps } from '../interfaces';
2
- import { DetailResponse, ErrorResponse, FilterConfig } from '../types';
2
+ import { RecordType, DetailResponse, ErrorResponse, FilterConfig } from '../types';
3
3
 
4
4
  /** Returns a random hexadecimal string. */
5
5
  declare function generateKey(): string;
6
6
  /** Generate a default file name prefix based on the project code and search parameters. */
7
7
  declare function getDefaultFileNamePrefix(project: string, searchParameters: string): string;
8
8
  interface DetailResponseProps extends OnyxProps {
9
- response: DetailResponse | ErrorResponse | undefined;
9
+ response: DetailResponse<RecordType> | ErrorResponse | undefined;
10
10
  }
11
11
  /** Handler for converting JSON data to a string for file export. */
12
12
  declare function handleJSONExport(props: DetailResponseProps): (exportProps: ExportHandlerProps) => void;
@@ -14,4 +14,5 @@ declare function handleJSONExport(props: DetailResponseProps): (exportProps: Exp
14
14
  declare function formatFilters(filters: FilterConfig[]): string[][];
15
15
  /** Takes a Response object and returns its status code, formatted as a string. */
16
16
  declare function formatResponseStatus(response: Response): string;
17
+ export declare function formatTimeAgo(timestamp: Date): string;
17
18
  export { formatFilters, formatResponseStatus, generateKey, getDefaultFileNamePrefix, handleJSONExport, };
@@ -1,3 +1,4 @@
1
- declare const useDebouncedValue: (inputValue: string, delay: number) => string;
2
- declare const useQueryRefresh: (refresh: number | null, dataUpdatedAt: number, errorUpdatedAt: number, refetch: () => void, setLastUpdated: (lastUpdated: string | null) => void) => void;
3
- export { useDebouncedValue, useQueryRefresh };
1
+ export declare const useDebouncedValue: (inputValue: string, delay: number) => string;
2
+ export declare const useDelayedValue: (delay?: number) => boolean;
3
+ export declare const useCyclicValue: (start: number, end: number, pause?: number) => number;
4
+ export declare const useQueryRefresh: (refresh: number | null, dataUpdatedAt: number, errorUpdatedAt: number, refetch: () => void, setLastUpdated: (lastUpdated: string | null) => void) => void;
@@ -1,21 +1,6 @@
1
1
  import { StylesConfig } from 'react-select';
2
+ import { Template } from 'plotly.js-basic-dist';
2
3
 
3
4
  declare const selectStyles: StylesConfig;
4
- declare const graphStyles: {
5
- layout: {
6
- font: {
7
- color: string;
8
- };
9
- paper_bgcolor: string;
10
- plot_bgcolor: string;
11
- xaxis: {
12
- gridcolor: string;
13
- zerolinecolor: string;
14
- };
15
- yaxis: {
16
- gridcolor: string;
17
- zerolinecolor: string;
18
- };
19
- };
20
- };
5
+ declare const graphStyles: Template;
21
6
  export { graphStyles, selectStyles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climb-onyx-gui",
3
- "version": "0.14.4",
3
+ "version": "0.15.1",
4
4
  "description": "Onyx Graphical User Interface",
5
5
  "keywords": [
6
6
  "gui",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/CLIMB-TRE/onyx-gui.git"
39
+ "url": "git+https://github.com/CLIMB-TRE/onyx-gui.git"
40
40
  },
41
41
  "sideEffects": [
42
42
  "**/*.css"
@@ -1,9 +0,0 @@
1
- import { PageProps } from '../interfaces';
2
-
3
- interface HistoryProps extends PageProps {
4
- name?: string;
5
- searchPath: string;
6
- ID: string;
7
- }
8
- declare function History(props: HistoryProps): import("react/jsx-runtime").JSX.Element;
9
- export default History;
@@ -1,12 +0,0 @@
1
- import { DataProps } from '../interfaces';
2
-
3
- interface TransformsProps extends DataProps {
4
- transform: string;
5
- transformList: string[];
6
- setTransformList: (value: string[]) => void;
7
- filterFieldOptions: string[];
8
- listFieldOptions: string[];
9
- setEditMode: (value: boolean) => void;
10
- }
11
- declare function Transforms(props: TransformsProps): import("react/jsx-runtime").JSX.Element;
12
- export default Transforms;
@@ -1,12 +0,0 @@
1
- import { DataProps } from '../interfaces';
2
-
3
- interface TransformsPanelProps extends DataProps {
4
- transform: string;
5
- setTransform: (value: string) => void;
6
- transformList: string[];
7
- setTransformList: (value: string[]) => void;
8
- filterFieldOptions: string[];
9
- listFieldOptions: string[];
10
- }
11
- declare function TransformsPanel(props: TransformsPanelProps): import("react/jsx-runtime").JSX.Element;
12
- export default TransformsPanel;