climb-onyx-gui 0.13.0 → 0.14.0-dev.10

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.
Files changed (44) hide show
  1. package/LICENSE +674 -0
  2. package/dist/api/hooks.d.ts +11 -0
  3. package/dist/api/index.d.ts +64 -0
  4. package/dist/climb-onyx-gui.js +52253 -50383
  5. package/dist/components/Badges.d.ts +2 -0
  6. package/dist/components/Buttons.d.ts +9 -0
  7. package/dist/components/CellRenderers.d.ts +20 -0
  8. package/dist/components/DataField.d.ts +7 -0
  9. package/dist/components/DataPanel.d.ts +11 -0
  10. package/dist/components/Details.d.ts +9 -0
  11. package/dist/components/Dropdowns.d.ts +3 -5
  12. package/dist/components/ExportModal.d.ts +2 -2
  13. package/dist/components/Filter.d.ts +4 -3
  14. package/dist/components/FilterPanel.d.ts +4 -3
  15. package/dist/components/Graphs.d.ts +8 -6
  16. package/dist/components/Header.d.ts +7 -5
  17. package/dist/components/History.d.ts +9 -0
  18. package/dist/components/Inputs.d.ts +7 -1
  19. package/dist/components/JsonSearch.d.ts +9 -0
  20. package/dist/components/PageTitle.d.ts +6 -0
  21. package/dist/components/QueryHandler.d.ts +4 -3
  22. package/dist/components/ResultsPanel.d.ts +8 -7
  23. package/dist/components/SearchBar.d.ts +2 -3
  24. package/dist/components/Table.d.ts +14 -5
  25. package/dist/interfaces.d.ts +25 -11
  26. package/dist/pages/Analysis.d.ts +4 -0
  27. package/dist/pages/Graphs.d.ts +4 -0
  28. package/dist/pages/ProjectRecord.d.ts +4 -0
  29. package/dist/pages/Results.d.ts +4 -0
  30. package/dist/pages/Site.d.ts +4 -0
  31. package/dist/pages/User.d.ts +4 -0
  32. package/dist/style.css +2 -2
  33. package/dist/types.d.ts +83 -29
  34. package/dist/utils/functions.d.ts +17 -0
  35. package/dist/utils/hooks.d.ts +3 -0
  36. package/dist/utils/messages.d.ts +4 -0
  37. package/dist/utils/{graphStyles.d.ts → styles.d.ts} +4 -1
  38. package/package.json +4 -1
  39. package/dist/components/RecordModal.d.ts +0 -9
  40. package/dist/pages/Data.d.ts +0 -4
  41. package/dist/pages/Stats.d.ts +0 -4
  42. package/dist/utils/errorMessages.d.ts +0 -1
  43. package/dist/utils/generateKey.d.ts +0 -2
  44. package/dist/utils/selectStyles.d.ts +0 -4
package/dist/types.d.ts CHANGED
@@ -1,45 +1,99 @@
1
- type ProjectField = {
2
- type: string;
1
+ export declare enum RecordTabKeys {
2
+ Data = "record-data-tab",
3
+ History = "record-history-tab",
4
+ Analyses = "record-analyses-tab"
5
+ }
6
+ export declare enum AnalysisTabKeys {
7
+ Data = "analysis-data-tab",
8
+ History = "analysis-history-tab",
9
+ Records = "analysis-records-tab",
10
+ Upstream = "analysis-upstream-tab",
11
+ Downstream = "analysis-downstream-tab"
12
+ }
13
+ export declare enum DataPanelTabKeys {
14
+ Details = "data-panel-details"
15
+ }
16
+ export declare enum ExportStatus {
17
+ READY = 0,
18
+ RUNNING = 1,
19
+ WRITING = 2,
20
+ FINISHED = 3,
21
+ CANCELLED = 4,
22
+ ERROR = 5
23
+ }
24
+ export type FieldType = "text" | "choice" | "integer" | "decimal" | "date" | "datetime" | "bool" | "relation" | "array" | "structure" | "";
25
+ export type GraphType = "line" | "bar" | "pie" | "";
26
+ export type ProjectField = {
27
+ type: FieldType;
3
28
  description: string;
4
29
  actions: string[];
5
30
  values?: string[];
6
31
  fields?: Record<string, ProjectField>;
7
32
  };
8
- type FilterField = {
33
+ export type FilterConfig = {
9
34
  key: string;
35
+ type: FieldType;
10
36
  field: string;
11
37
  lookup: string;
12
38
  value: string;
13
39
  };
14
- type OptionType = {
15
- label: string;
16
- value: string;
17
- };
18
- type ResultType = Record<string, string | number | boolean | object | null>;
19
- type ErrorType = Record<string, string | string[]>;
20
- type ResultData = {
21
- status: string;
22
- code: number;
23
- next?: string;
24
- previous?: string;
25
- data?: ResultType[];
26
- messages?: ErrorType;
27
- };
28
- declare enum ExportStatus {
29
- READY = 0,
30
- RUNNING = 1,
31
- WRITING = 2,
32
- FINISHED = 3,
33
- CANCELLED = 4,
34
- ERROR = 5
35
- }
36
- type GraphConfig = {
40
+ export type GraphConfig = {
37
41
  key: string;
38
- type: string;
42
+ type: GraphType;
39
43
  field: string;
40
44
  groupBy: string;
41
45
  groupMode: string;
46
+ filters: FilterConfig[];
42
47
  yAxisType: string;
43
48
  };
44
- export type { ProjectField, FilterField, OptionType, ResultType, ErrorType, ResultData, GraphConfig, };
45
- export { ExportStatus };
49
+ export type TypeObject = {
50
+ type: FieldType;
51
+ lookups: string[];
52
+ };
53
+ export type LookupObject = {
54
+ lookup: string;
55
+ description: string;
56
+ };
57
+ export type ChoiceDescription = {
58
+ description: string;
59
+ is_active: boolean;
60
+ };
61
+ export type OptionType = {
62
+ label: string;
63
+ value: string;
64
+ };
65
+ export type ErrorType = Record<string, string | string[]>;
66
+ export type RecordType = Record<string, string | number | boolean | object | null | RecordType[]>;
67
+ export type SummaryType = Record<"count", number> & Record<string, string | number | boolean | object | null>;
68
+ export type ProjectPermissionType = {
69
+ project: string;
70
+ scope: string;
71
+ actions: string[];
72
+ };
73
+ export interface ErrorResponse {
74
+ status: "fail" | "error";
75
+ code: number;
76
+ messages: ErrorType;
77
+ }
78
+ export interface SuccessResponse {
79
+ status: "success";
80
+ code: number;
81
+ }
82
+ export interface ListResponse extends SuccessResponse {
83
+ data: RecordType[];
84
+ next: string | null;
85
+ previous: string | null;
86
+ }
87
+ export interface DetailResponse extends SuccessResponse {
88
+ data: RecordType;
89
+ }
90
+ export interface FieldsResponse extends SuccessResponse {
91
+ data: {
92
+ name: string;
93
+ description: string;
94
+ fields: Record<string, ProjectField>;
95
+ };
96
+ }
97
+ export interface ChoicesResponse extends SuccessResponse {
98
+ data: Record<string, ChoiceDescription>;
99
+ }
@@ -0,0 +1,17 @@
1
+ import { ExportHandlerProps, OnyxProps } from '../interfaces';
2
+ import { DetailResponse, ErrorResponse, FilterConfig } from '../types';
3
+
4
+ /** Returns a random hexadecimal string. */
5
+ declare function generateKey(): string;
6
+ /** Generate a default file name prefix based on the project code and search parameters. */
7
+ declare function getDefaultFileNamePrefix(project: string, searchParameters: string): string;
8
+ interface DetailResponseProps extends OnyxProps {
9
+ response: DetailResponse | ErrorResponse | undefined;
10
+ }
11
+ /** Handler for converting JSON data to a string for file export. */
12
+ declare function handleJSONExport(props: DetailResponseProps): (exportProps: ExportHandlerProps) => void;
13
+ /** Takes an array of FilterConfig objects and formats into an array of field (+lookup), value pairs. */
14
+ declare function formatFilters(filters: FilterConfig[]): string[][];
15
+ /** Takes a Response object and returns its status code, formatted as a string. */
16
+ declare function formatResponseStatus(response: Response): string;
17
+ export { formatFilters, formatResponseStatus, generateKey, getDefaultFileNamePrefix, handleJSONExport, };
@@ -0,0 +1,3 @@
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 };
@@ -0,0 +1,4 @@
1
+ export declare const s3BucketsMessage = "If you haven't already, please make sure you have clicked the 'Get Started With S3 Buckets' button under the 'S3 Buckets' tab on BRYN.";
2
+ export declare const recentActivityMessage = "Your most recent API requests will be listed here. If you see anything suspicious, please contact CLIMB-TRE support immediately.";
3
+ export declare const errorModalMessage = "Please try again or contact CLIMB-TRE support if the problem persists.";
4
+ export declare const defaultExportProgressMessage = "Fetching items...";
@@ -1,3 +1,6 @@
1
+ import { StylesConfig } from 'react-select';
2
+
3
+ declare const selectStyles: StylesConfig;
1
4
  declare const graphStyles: {
2
5
  layout: {
3
6
  font: {
@@ -15,4 +18,4 @@ declare const graphStyles: {
15
18
  };
16
19
  };
17
20
  };
18
- export default graphStyles;
21
+ export { graphStyles, selectStyles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climb-onyx-gui",
3
- "version": "0.13.0",
3
+ "version": "0.14.0-dev.10",
4
4
  "type": "module",
5
5
  "main": "dist/climb-onyx-gui.js",
6
6
  "types": "dist/main.d.ts",
@@ -23,8 +23,11 @@
23
23
  "@ag-grid-community/csv-export": "^32.2.0",
24
24
  "@ag-grid-community/react": "^32.2.0",
25
25
  "@ag-grid-community/styles": "^32.2.0",
26
+ "@fontsource/ibm-plex-sans": "^5.1.1",
26
27
  "@tanstack/react-query": "^4.36.1",
27
28
  "export-to-csv": "^1.3.0",
29
+ "http-status-codes": "^2.3.0",
30
+ "json-edit-react": "^1.22.6",
28
31
  "plotly.js-basic-dist": "^2.33.0",
29
32
  "react-bootstrap": "^2.10.2",
30
33
  "react-icons": "^5.3.0",
@@ -1,9 +0,0 @@
1
- import { DataProps } from '../interfaces';
2
-
3
- interface RecordModalProps extends DataProps {
4
- recordID: string;
5
- show: boolean;
6
- onHide: () => void;
7
- }
8
- declare function RecordModal(props: RecordModalProps): import("react/jsx-runtime").JSX.Element;
9
- export default RecordModal;
@@ -1,4 +0,0 @@
1
- import { DataProps } from '../interfaces';
2
-
3
- declare function Data(props: DataProps): import("react/jsx-runtime").JSX.Element;
4
- export default Data;
@@ -1,4 +0,0 @@
1
- import { StatsProps } from '../interfaces';
2
-
3
- declare function Stats(props: StatsProps): import("react/jsx-runtime").JSX.Element;
4
- export default Stats;
@@ -1 +0,0 @@
1
- export declare const s3BucketsMessage = "If you haven't already, please make sure you have clicked the 'Get Started With S3 Buckets' button under the 'S3 Buckets' tab on BRYN.";
@@ -1,2 +0,0 @@
1
- declare function generateKey(): string;
2
- export default generateKey;
@@ -1,4 +0,0 @@
1
- import { StylesConfig } from 'react-select';
2
-
3
- declare const selectStyles: StylesConfig;
4
- export default selectStyles;