Skip to content

Commit 7d8d3d1

Browse files
John DarringtonGitHub Enterprise
John Darrington
authored and
GitHub Enterprise
committed
Merge pull request #584 from Digital-Engineering/development
Development
2 parents 1454151 + b7f63c8 commit 7d8d3d1

File tree

241 files changed

+15519
-17008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+15519
-17008
lines changed

.env-sample

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ TIMESCALEDB_ENABLED=false
4848
# this must be an absolute path to a RSA private key - if one is not provided it will be generated and saved for you at
4949
# the project root
5050
ENCRYPTION_KEY_PATH=
51+
# this must be an absolute path to a RSA public key - if one is not provided it will be generated and saved for you at
52+
# the project root in most cases. If you have an already existing private key, generate a public key from it
53+
ENCRYPTION_PUBLIC_KEY_PATH=
54+
5155
# plaintext secret used to generate secure session markers
5256
SESSION_SECRET=
5357

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ profile-logs
2222
/src/tests/test-data.json
2323
/src/tests/test-data.csv
2424
/src/tests/private-key.pem
25+
/src/tests/*_export.json
26+
/**/test-timeseries-datasource-graphql.json
2527
/NodeLibraries/dl-fast-load/target/
2628
/NodeLibraries/dl-fast-load/index.node
2729
/RedisLoader/target/
@@ -48,4 +50,6 @@ devenv.local.nix
4850
!.yarn/plugins
4951
!.yarn/releases
5052
!.yarn/sdks
51-
!.yarn/versions
53+
!.yarn/versions
54+
/public-key.pem
55+
/yarn-error.log

AdminWebApp/package-lock.json

+22-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AdminWebApp/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"is-svg": "^4.3.1",
4040
"json-2-csv": "^4.0.0",
4141
"jwt-decode": "^2.2.0",
42+
"lodash.debounce": "^4.0.8",
4243
"node-forge": "^1.0.0",
4344
"p-wait-for": "^5.0.0",
4445
"plotly.js-dist-min": "^2.12.0",
@@ -74,13 +75,14 @@
7475
"@mdi/font": "^7.2.96",
7576
"@types/codemirror": "^5.60.6",
7677
"@types/json2csv": "^5.0.3",
78+
"@types/lodash.debounce": "^4.0.8",
7779
"@types/plotly.js-dist-min": "^2.3.1",
7880
"@types/three": "^0.150.1",
7981
"@typescript-eslint/eslint-plugin": "^5.30.5",
8082
"@typescript-eslint/parser": "^5.30.5",
8183
"babel-loader": "^8.2.5",
8284
"material-design-icons-iconfont": "^6.7.0",
83-
"typescript": "~4.5.5",
85+
"typescript": "~4.7.2",
8486
"vue-template-babel-compiler": "^1.2.0",
8587
"webpack": "^5.0.0"
8688
}

AdminWebApp/src/api/client.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ export class Client {
302302
containerID: string,
303303
{
304304
name,
305-
description,
306305
ontologyVersion,
307306
metatypeID,
308307
originID,
@@ -319,7 +318,6 @@ export class Client {
319318
destinationName,
320319
}: {
321320
name?: string;
322-
description?: string;
323321
ontologyVersion?: string;
324322
metatypeID?: string;
325323
originID?: string;
@@ -339,7 +337,6 @@ export class Client {
339337
const query: {[key: string]: any} = {};
340338

341339
if (name) query.name = name;
342-
if (description) query.description = description;
343340
if (ontologyVersion) query.ontologyVersion = ontologyVersion;
344341
query.ontologyVersion = ontologyVersion;
345342
if (originID) query.originID = originID;
@@ -532,7 +529,7 @@ export class Client {
532529
const query: {[key: string]: any} = {};
533530

534531
if (name) query.name = name;
535-
if (description) query.description = name;
532+
if (description) query.description = description;
536533
if (ontologyVersion) query.ontologyVersion = ontologyVersion;
537534
if (limit) query.limit = limit;
538535
if (offset) query.offset = offset;
@@ -558,6 +555,13 @@ export class Client {
558555
return this.get<MetatypeRelationshipPairT>(`/containers/${containerID}/metatype_relationship_pairs/${metatypeRelationshipPairID}`);
559556
}
560557

558+
listMetatypeRelationshipPairsForMetatype(containerID: string, metatypeID: string, deleted = false): Promise<MetatypeRelationshipPairT[]> {
559+
const query: {[key: string]: any} = {};
560+
query.deleted = deleted;
561+
562+
return this.get<MetatypeRelationshipPairT[]>(`/containers/${containerID}/metatypes/${metatypeID}/metatype_relationship_pairs`, query);
563+
}
564+
561565
updateMetatypeRelationship(containerID: string, metatypeRelationshipID: string, metatypeRelationship: any): Promise<boolean> {
562566
return this.put<boolean>(`/containers/${containerID}/metatype_relationships/${metatypeRelationshipID}`, metatypeRelationship);
563567
}
@@ -988,9 +992,10 @@ export class Client {
988992
return this.delete(`/containers/${containerID}/import/imports/${importID}/data/${dataID}`);
989993
}
990994

991-
inviteUserToContainer(containerID: string, email: string): Promise<boolean> {
995+
inviteUserToContainer(containerID: string, email: string, role_name: string): Promise<boolean> {
992996
return this.postNoData(`/containers/${containerID}/users/invite`, {
993997
email,
998+
role_name,
994999
});
9951000
}
9961001

AdminWebApp/src/api/types.ts

+29-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type ContainerT = {
66
data_versioning_enabled: boolean;
77
ontology_versioning_enabled: boolean;
88
enabled_data_sources: string[];
9-
configured_data_sources?: {[key: string]: any}[];
9+
p6_preset_configs?: P6DataSourceConfig[];
1010
};
1111
created_at: string;
1212
modified_at: string;
@@ -35,9 +35,11 @@ export type MetatypeT = {
3535
modified_by?: string;
3636
deleted_at?: string;
3737
parent_id?: string;
38+
parent_name?: string;
3839
ontology_version?: string;
3940
old_id?: string;
4041
uuid?: string;
42+
relationships?: MetatypeRelationshipPairT[];
4143
};
4244

4345
export type MetatypeRelationshipT = {
@@ -76,11 +78,14 @@ export type MetatypeRelationshipPairT = {
7678
origin_metatype?: MetatypeT;
7779
destination_metatype?: MetatypeT;
7880
relationship?: MetatypeRelationshipT;
81+
metatype_id?: string;
82+
metatype_name?: string;
7983
};
8084

8185
export type MetatypeKeyT = {
8286
id?: string;
8387
metatype_id?: string;
88+
metatype_name?: string;
8489
container_id: string;
8590
name: string;
8691
property_name: string;
@@ -89,12 +94,12 @@ export type MetatypeKeyT = {
8994
data_type: 'number' | 'number64' | 'float' | 'float64' | 'date' | 'string' | 'boolean' | 'enumeration' | 'file';
9095
archived: boolean;
9196
validation:
92-
| {
93-
regex: string;
94-
min: number;
95-
max: number;
96-
}
97-
| undefined;
97+
| {
98+
regex: string;
99+
min: number;
100+
max: number;
101+
}
102+
| undefined;
98103
options: string[] | undefined;
99104
default_value: string | boolean | number | any[] | undefined;
100105
created_at?: string;
@@ -103,6 +108,7 @@ export type MetatypeKeyT = {
103108
modified_by?: string;
104109
deleted_at?: string;
105110
ontology_version?: string;
111+
uuid?: string;
106112
};
107113

108114
export type MetatypeRelationshipKeyT = {
@@ -127,6 +133,7 @@ export type MetatypeRelationshipKeyT = {
127133
created_by?: string;
128134
modified_by?: string;
129135
ontology_version?: string;
136+
uuid?: string;
130137
};
131138

132139
export type KeyPairT = {
@@ -179,6 +186,7 @@ export type NodeT = {
179186
import_data_id?: string;
180187
type_mapping_transformation_id?: string;
181188
data_staging_id?: string;
189+
created_by?: string;
182190
};
183191

184192
export type MetadataT = {
@@ -213,6 +221,7 @@ export type EdgeT = {
213221
data_staging_id: string;
214222
import_data_id: string;
215223
type_mapping_transformation_id: string;
224+
created_by?: string;
216225
};
217226

218227
export type PropertyT = {
@@ -228,13 +237,7 @@ export type DataSourceT = {
228237
adapter_type: string | undefined;
229238
active: boolean;
230239
archived?: boolean;
231-
config:
232-
| StandardDataSourceConfig
233-
| HttpDataSourceConfig
234-
| AvevaDataSourceConfig
235-
| TimeseriesDataSourceConfig
236-
| P6DataSourceConfig
237-
| undefined;
240+
config: StandardDataSourceConfig | HttpDataSourceConfig | AvevaDataSourceConfig | TimeseriesDataSourceConfig | P6DataSourceConfig | undefined;
238241
created_at?: string;
239242
modified_at?: string;
240243
created_by?: string;
@@ -328,10 +331,12 @@ export type AvevaDataSourceConfig = {
328331

329332
export type P6DataSourceConfig = {
330333
kind: 'p6';
334+
id?: string;
335+
name?: string;
331336
endpoint: string;
332337
projectID: string;
333-
username: string;
334-
password: string;
338+
username?: string;
339+
password?: string;
335340
stop_nodes?: string[];
336341
value_nodes?: string[];
337342
data_retention_days?: number;
@@ -479,6 +484,7 @@ export type TypeMappingTransformationT = {
479484
};
480485
metatype_id?: string;
481486
metatype_relationship_pair_id?: string;
487+
selected_relationship_pair_name?: string;
482488
origin_id_key?: string;
483489
origin_metatype_id?: string;
484490
origin_data_source_id?: string;
@@ -497,12 +503,14 @@ export type TypeMappingTransformationT = {
497503
destination_parameters?: EdgeConfigKeyT[];
498504
created_at_key?: string;
499505
created_at_format_string?: string;
506+
tags?: TypeMappingTransformationTagT[];
500507
};
501508

502509
export type TypeMappingTransformationPayloadT = {
503510
conditions?: TypeMappingTransformationCondition[];
504511
metatype_id?: string;
505512
metatype_relationship_pair_id?: string;
513+
selected_relationship_pair_name?: string;
506514
origin_id_key?: string;
507515
origin_metatype_id?: string;
508516
origin_data_source_id?: string;
@@ -648,6 +656,11 @@ export type TagT = {
648656
metadata?: object;
649657
};
650658

659+
export type TypeMappingTransformationTagT = {
660+
id: string;
661+
tag_name: string;
662+
};
663+
651664
export type TimeseriesRange = {
652665
start: string;
653666
end: string;

AdminWebApp/src/auth/authentication_service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ export async function LoginFromToken(token: string, state: string): Promise<bool
122122
return new Promise((resolve) => resolve(false));
123123
}
124124

125-
const decodedToken = jwt_decode(resp.data.value);
125+
const decodedToken = jwt_decode(resp.data.access_token);
126126

127127
// store as `user`
128128
localStorage.setItem('user', JSON.stringify(decodedToken));
129-
localStorage.setItem('user.token', resp.data.value);
129+
localStorage.setItem('user.token', resp.data.access_token);
130130
return new Promise((resolve) => resolve(true));
131131
}
132132

0 commit comments

Comments
 (0)