You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2024/03/21 15:17:52 UTC
(streampipes) branch 2606-hamonize-random-id-generation-in-ui updated: refactor(#2606): Remove angular2-uuid from ui
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 2606-hamonize-random-id-generation-in-ui
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/2606-hamonize-random-id-generation-in-ui by this push:
new 3c22942dc5 refactor(#2606): Remove angular2-uuid from ui
3c22942dc5 is described below
commit 3c22942dc51697bb1a2ad367c4770beb84fefbea
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Thu Mar 21 16:17:33 2024 +0100
refactor(#2606): Remove angular2-uuid from ui
---
ui/package-lock.json | 11 -----------
ui/package.json | 1 -
.../event-property-row/event-property-row.component.ts | 6 +++---
.../schema-editor/event-schema/event-schema.component.ts | 11 +++++------
4 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/ui/package-lock.json b/ui/package-lock.json
index b9d85fb624..1d1f4dae37 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -32,7 +32,6 @@
"@panzoom/panzoom": "^4.5.1",
"@swimlane/ngx-charts": "^20.4.1",
"angular-gridster2": "^16.0.0",
- "angular2-uuid": "1.1.1",
"codemirror": "^5.65.11",
"console-browserify": "^1.2.0",
"d3-array": "^3.2.4",
@@ -8216,11 +8215,6 @@
"rxjs": "^7.0.0"
}
},
- "node_modules/angular2-uuid": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/angular2-uuid/-/angular2-uuid-1.1.1.tgz",
- "integrity": "sha512-6AXPyii9q8KBFGagybLNVmdGJLPcVZAhmv3odNGSJIA18LuJ3xOe6uN9GvjlQsGfdmYeuxlsGnFEUu7gPhkc+g=="
- },
"node_modules/ansi-colors": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
@@ -31358,11 +31352,6 @@
"tslib": "^2.4.0"
}
},
- "angular2-uuid": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/angular2-uuid/-/angular2-uuid-1.1.1.tgz",
- "integrity": "sha512-6AXPyii9q8KBFGagybLNVmdGJLPcVZAhmv3odNGSJIA18LuJ3xOe6uN9GvjlQsGfdmYeuxlsGnFEUu7gPhkc+g=="
- },
"ansi-colors": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
diff --git a/ui/package.json b/ui/package.json
index 108d9190be..5b79b8c570 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -54,7 +54,6 @@
"@panzoom/panzoom": "^4.5.1",
"@swimlane/ngx-charts": "^20.4.1",
"angular-gridster2": "^16.0.0",
- "angular2-uuid": "1.1.1",
"codemirror": "^5.65.11",
"console-browserify": "^1.2.0",
"d3-array": "^3.2.4",
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
index 9846cf2d0b..0231f50d4c 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-property-row/event-property-row.component.ts
@@ -17,7 +17,6 @@
*/
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { UUID } from 'angular2-uuid';
import { TreeNode } from '@ali-hm/angular-tree-component';
import {
EventProperty,
@@ -27,13 +26,13 @@ import {
EventPropertyUnion,
EventSchema,
FieldStatusInfo,
- TransformationRuleDescription,
} from '@streampipes/platform-services';
import { EditEventPropertyComponent } from '../../../../dialog/edit-event-property/edit-event-property.component';
import { DialogService, PanelType } from '@streampipes/shared-ui';
import { StaticValueTransformService } from '../../../../services/static-value-transform.service';
import { EventPropertyUtilsService } from '../../../../services/event-property-utils.service';
import { ShepherdService } from '../../../../../services/tour/shepherd.service';
+import { IdGeneratorService } from '../../../../../core-services/id-generator/id-generator.service';
@Component({
selector: 'sp-event-property-row',
@@ -74,6 +73,7 @@ export class EventPropertyRowComponent implements OnInit {
private dialogService: DialogService,
private epUtils: EventPropertyUtilsService,
private shepherdService: ShepherdService,
+ private idGeneratorService: IdGeneratorService,
) {}
ngOnInit() {
@@ -251,7 +251,7 @@ export class EventPropertyRowComponent implements OnInit {
}
public addNestedProperty(eventProperty: EventPropertyNested): void {
- const uuid: string = UUID.UUID();
+ const uuid: string = this.idGeneratorService.generate(25);
if (!eventProperty.eventProperties) {
eventProperty.eventProperties = new Array<EventPropertyUnion>();
}
diff --git a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
index c693c77fc2..5ce707bf20 100644
--- a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema/event-schema.component.ts
@@ -27,11 +27,9 @@ import {
} from '@angular/core';
import { RestService } from '../../../../services/rest.service';
import { ITreeOptions, TreeComponent } from '@ali-hm/angular-tree-component';
-import { UUID } from 'angular2-uuid';
import { DataTypesService } from '../../../../services/data-type.service';
import {
AdapterDescription,
- CorrectionValueTransformationRuleDescription,
EventPropertyNested,
EventPropertyPrimitive,
EventPropertyUnion,
@@ -44,7 +42,7 @@ import { MatStepper } from '@angular/material/stepper';
import { UserErrorMessage } from '../../../../../core-model/base/UserErrorMessage';
import { TransformationRuleService } from '../../../../services/transformation-rule.service';
import { StaticValueTransformService } from '../../../../services/static-value-transform.service';
-import { EventPropertyUtilsService } from '../../../../services/event-property-utils.service';
+import { IdGeneratorService } from '../../../../../core-services/id-generator/id-generator.service';
@Component({
selector: 'sp-event-schema',
@@ -57,7 +55,7 @@ export class EventSchemaComponent implements OnChanges {
private dataTypesService: DataTypesService,
private transformationRuleService: TransformationRuleService,
private staticValueTransformService: StaticValueTransformService,
- private epUtilsService: EventPropertyUtilsService,
+ private idGeneratorService: IdGeneratorService,
) {}
@Input()
@@ -189,7 +187,7 @@ export class EventSchemaComponent implements OnChanges {
}
public addNestedProperty(eventProperty?: EventPropertyNested): void {
- const uuid: string = UUID.UUID();
+ const uuid: string = this.idGeneratorService.generate(25);
const nested: EventPropertyNested = new EventPropertyNested();
nested['@class'] =
'org.apache.streampipes.model.schema.EventPropertyNested';
@@ -244,7 +242,8 @@ export class EventSchemaComponent implements OnChanges {
eventProperty['@class'] =
'org.apache.streampipes.model.schema.EventPropertyPrimitive';
eventProperty.elementId =
- 'http://eventProperty.de/timestamp/' + UUID.UUID();
+ 'http://eventProperty.de/timestamp/' +
+ this.idGeneratorService.generate(25);
eventProperty.runtimeName = 'timestamp';
eventProperty.label = 'Timestamp';