This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new aaf6018ae3 2337 cant access connect with user role connect admin
(#2566)
aaf6018ae3 is described below
commit aaf6018ae395abd82d59cbe2f2cdcd5e5f84d0b9
Author: Philipp Zehnder <[email protected]>
AuthorDate: Fri Mar 15 14:42:45 2024 +0100
2337 cant access connect with user role connect admin (#2566)
* test(#2337): e2e test to validate that a user can access only the connect
view
* fix(#2337): Change routing from to app-routing.module
* fix(#2337): Fix checkstyle in PipelineElementTemplateResource
---
.../ps/PipelineElementTemplateResource.java | 166 +++++++++++----------
.../userManagement/testUserRoleConnect.spec.ts | 62 ++++++++
ui/deployment/app-routing.module.mst | 2 +-
ui/src/app/_guards/page-auth.can-active.guard.ts | 7 +-
ui/src/app/add/add.module.ts | 2 +-
ui/src/app/app-overview/app-overview.module.ts | 2 +-
ui/src/app/assets/assets.module.ts | 2 +-
ui/src/app/configuration/configuration.module.ts | 2 +-
.../existing-adapters.component.html | 1 +
.../existing-adapters.component.ts | 2 +-
ui/src/app/connect/connect.module.ts | 8 +-
ui/src/app/core-ui/core-ui.module.ts | 11 ++
.../dialog => core-ui}/help/help.component.html | 0
.../dialog => core-ui}/help/help.component.scss | 2 +-
.../dialog => core-ui}/help/help.component.ts | 9 +-
.../pipeline-element-documentation.component.html | 0
.../pipeline-element-documentation.component.scss | 0
.../pipeline-element-documentation.component.ts | 0
.../pipeline-element-runtime-info.component.html | 0
.../pipeline-element-runtime-info.component.scss | 0
.../pipeline-element-runtime-info.component.ts | 2 +-
ui/src/app/dashboard/dashboard.module.ts | 2 +-
ui/src/app/data-explorer/data-explorer.module.ts | 2 +-
ui/src/app/editor/editor.module.ts | 9 --
ui/src/app/editor/services/editor.service.ts | 2 +-
ui/src/app/files/files.module.ts | 2 +-
ui/src/app/pipelines/pipelines.module.ts | 2 +-
27 files changed, 180 insertions(+), 119 deletions(-)
diff --git
a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
index 1b9e52c854..db7d63fab9 100644
---
a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
+++
b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
@@ -52,17 +52,18 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Get a list of all pipeline element templates",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- array = @ArraySchema(schema = @Schema(implementation =
PipelineElementTemplate.class)))
- })
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ array = @ArraySchema(schema = @Schema(implementation
= PipelineElementTemplate.class)))
+ })
+ })
public ResponseEntity<List<PipelineElementTemplate>> getAll(
@Parameter(description = "Filter all templates by this appId")
- @RequestParam("appId") String appId) {
+ @RequestParam("appId") String appId
+ ) {
if (appId == null) {
return ok(getPipelineElementTemplateStorage().getAll());
} else {
@@ -72,17 +73,19 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@GetMapping(path = "{id}", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Get a single pipeline element template by a given id",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- schema = @Schema(implementation =
PipelineElementTemplate.class))
- }),
- @ApiResponse(responseCode = "400", description = "Template with
given id not found")
- })
- public ResponseEntity<?> getById(@Parameter(description = "The id of the
pipeline element template", required = true)
- @PathVariable("id") String s) {
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation =
PipelineElementTemplate.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Template
with given id not found")
+ })
+ public ResponseEntity<?> getById(
+ @Parameter(description = "The id of the pipeline element template",
required = true)
+ @PathVariable("id") String s
+ ) {
try {
return ok(getPipelineElementTemplateStorage().getElementById(s));
} catch (RuntimeException e) {
@@ -92,32 +95,35 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Store a new pipeline element template",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(responseCode = "200", description = "Template
successfully stored")
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Template
successfully stored")
+ })
public ResponseEntity<Void> create(
@RequestBody(description = "The pipeline element template to be stored",
- content = @Content(schema = @Schema(implementation =
PipelineElementTemplate.class)))
- @org.springframework.web.bind.annotation.RequestBody
PipelineElementTemplate entity) {
+ content = @Content(schema = @Schema(implementation =
PipelineElementTemplate.class)))
+ @org.springframework.web.bind.annotation.RequestBody
PipelineElementTemplate entity
+ ) {
getPipelineElementTemplateStorage().createElement(entity);
return ok();
}
@PutMapping(path = "{id}", produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Update a pipeline element template",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- schema = @Schema(implementation =
PipelineElementTemplate.class))
- }, responseCode = "200", description = "Template successfully
updated"),
- @ApiResponse(responseCode = "400", description = "Template with
given id not found")
- })
- public ResponseEntity<?> update(@Parameter(description = "The id of the
pipeline element template", required = true)
- @PathVariable("id") String id,
- @RequestBody PipelineElementTemplate entity)
{
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation =
PipelineElementTemplate.class))
+ }, responseCode = "200", description = "Template successfully
updated"),
+ @ApiResponse(responseCode = "400", description = "Template
with given id not found")
+ })
+ public ResponseEntity<?> update(
+ @Parameter(description = "The id of the pipeline element template",
required = true)
+ @PathVariable("id") String id,
+ @RequestBody PipelineElementTemplate entity
+ ) {
try {
if (id.equals(entity.getCouchDbId())) {
return ok(getPipelineElementTemplateStorage().updateElement(entity));
@@ -131,14 +137,15 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@DeleteMapping(path = "{id}")
@Operation(summary = "Delete a pipeline element template by a given id",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(responseCode = "200", description = "Pipeline element
template successfully deleted"),
- @ApiResponse(responseCode = "400", description = "Template with
given id not found")
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Pipeline
element template successfully deleted"),
+ @ApiResponse(responseCode = "400", description = "Template
with given id not found")
+ })
public ResponseEntity<Void> delete(
@Parameter(description = "The id of the pipeline element template",
required = true)
- @PathVariable("id") String s) {
+ @PathVariable("id") String s
+ ) {
PipelineElementTemplate template =
getPipelineElementTemplateStorage().getElementById(s);
getPipelineElementTemplateStorage().deleteElement(template);
return ok();
@@ -149,14 +156,14 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Configure a data sink with a pipeline element
template.",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- schema = @Schema(implementation = DataSinkInvocation.class))
- }, responseCode = "200", description = "The configured data sink
invocation model"),
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation =
DataSinkInvocation.class))
+ }, responseCode = "200", description = "The configured data
sink invocation model"),
+ })
public ResponseEntity<DataSinkInvocation> getPipelineElementForTemplate(
@Parameter(description = "The id of the pipeline element template",
required = true)
@PathVariable("id") String id,
@@ -164,14 +171,15 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@Parameter(
description = "Overwrite the name and description of the pipeline
element"
+ "with the labels given in the pipeline element template")
- @RequestParam("overwriteNames") String overwriteNameAndDescription,
-
+ @RequestParam(value = "overwriteNames", defaultValue = "false", required
= false)
+ String overwriteNameAndDescription,
@RequestBody(description = "The data sink invocation that should be
configured with the template contents",
- content = @Content(schema = @Schema(implementation =
DataSinkInvocation.class)))
- @org.springframework.web.bind.annotation.RequestBody DataSinkInvocation
invocation) {
+ content = @Content(schema = @Schema(implementation =
DataSinkInvocation.class)))
+ @org.springframework.web.bind.annotation.RequestBody DataSinkInvocation
invocation
+ ) {
PipelineElementTemplate template =
getPipelineElementTemplateStorage().getElementById(id);
return ok(new DataSinkTemplateHandler(template, invocation,
Boolean.parseBoolean(overwriteNameAndDescription))
- .applyTemplateOnPipelineElement());
+ .applyTemplateOnPipelineElement());
}
@PostMapping(
@@ -179,14 +187,14 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Configure a data processor with a pipeline element
template.",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- schema = @Schema(implementation =
DataProcessorInvocation.class))
- }, responseCode = "200", description = "The configured data
processor invocation model"),
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation =
DataProcessorInvocation.class))
+ }, responseCode = "200", description = "The configured data
processor invocation model"),
+ })
public ResponseEntity<DataProcessorInvocation> getPipelineElementForTemplate(
@Parameter(description = "The id of the pipeline element template",
required = true)
@PathVariable("id") String id,
@@ -196,11 +204,12 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@RequestParam("overwriteNames") String overwriteNameAndDescription,
@RequestBody(description = "The data processor invocation that should be
configured with the template contents",
- content = @Content(schema = @Schema(implementation =
DataProcessorInvocation.class)))
- @org.springframework.web.bind.annotation.RequestBody
DataProcessorInvocation invocation) {
+ content = @Content(schema = @Schema(implementation =
DataProcessorInvocation.class)))
+ @org.springframework.web.bind.annotation.RequestBody
DataProcessorInvocation invocation
+ ) {
PipelineElementTemplate template =
getPipelineElementTemplateStorage().getElementById(id);
return ok(new DataProcessorTemplateHandler(template, invocation,
Boolean.parseBoolean(overwriteNameAndDescription))
- .applyTemplateOnPipelineElement());
+ .applyTemplateOnPipelineElement());
}
@PostMapping(
@@ -208,14 +217,14 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Configure an adapter with a pipeline element
template.",
- tags = {"Pipeline Element Templates"},
- responses = {
- @ApiResponse(content = {
- @Content(
- mediaType = "application/json",
- schema = @Schema(implementation = AdapterDescription.class))
- }, responseCode = "200", description = "The configured adapter
model"),
- })
+ tags = {"Pipeline Element Templates"},
+ responses = {
+ @ApiResponse(content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation =
AdapterDescription.class))
+ }, responseCode = "200", description = "The configured
adapter model"),
+ })
public ResponseEntity<AdapterDescription> getPipelineElementForTemplate(
@Parameter(description = "The id of the pipeline element template",
required = true)
@PathVariable("id") String id,
@@ -225,8 +234,9 @@ public class PipelineElementTemplateResource extends
AbstractRestResource {
@RequestParam("overwriteNames") String overwriteNameAndDescription,
@RequestBody(description = "The adapter that should be configured with
the template contents",
- content = @Content(schema = @Schema(implementation =
AdapterDescription.class)))
- @org.springframework.web.bind.annotation.RequestBody AdapterDescription
adapterDescription) {
+ content = @Content(schema = @Schema(implementation =
AdapterDescription.class)))
+ @org.springframework.web.bind.annotation.RequestBody AdapterDescription
adapterDescription
+ ) {
PipelineElementTemplate template =
getPipelineElementTemplateStorage().getElementById(id);
var desc =
new AdapterTemplateHandler(template, adapterDescription,
Boolean.parseBoolean(overwriteNameAndDescription))
diff --git a/ui/cypress/tests/userManagement/testUserRoleConnect.spec.ts
b/ui/cypress/tests/userManagement/testUserRoleConnect.spec.ts
new file mode 100644
index 0000000000..ce7f66a3cc
--- /dev/null
+++ b/ui/cypress/tests/userManagement/testUserRoleConnect.spec.ts
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+import { UserBuilder } from '../../support/builder/UserBuilder';
+import { UserRole } from '../../../src/app/_enums/user-role.enum';
+import { UserUtils } from '../../support/utils/UserUtils';
+import { ConnectUtils } from '../../support/utils/connect/ConnectUtils';
+import { ConnectBtns } from '../../support/utils/connect/ConnectBtns';
+
+describe('Test User Roles for Connect', () => {
+ beforeEach('Setup Test', () => {
+ cy.initStreamPipesTest();
+ ConnectUtils.addMachineDataSimulator('simulator');
+ });
+
+ it('Perform Test', () => {
+ // Add connect admin user
+ const connect_admin = UserBuilder.create('[email protected]')
+ .setName('connect_admin')
+ .setPassword('password')
+ .addRole(UserRole.ROLE_CONNECT_ADMIN)
+ .build();
+ UserUtils.addUser(connect_admin);
+
+ // Login as user and check if connect is visible to user
+ cy.switchUser(connect_admin);
+
+ cy.dataCy('navigation-icon', { timeout: 10000 }).should(
+ 'have.length',
+ 3,
+ );
+
+ ConnectUtils.goToConnect();
+ cy.dataCy('all-adapters-table', { timeout: 10000 }).should(
+ 'have.length',
+ 1,
+ );
+ cy.dataCy('all-adapters-table', { timeout: 10000 }).should(
+ 'contain',
+ 'simulator',
+ );
+
+ // validate that adapter can be stopped and edited
+ ConnectBtns.stopAdapter().click();
+ ConnectBtns.editAdapter().should('not.be.disabled');
+ ConnectBtns.editAdapter().click();
+ });
+});
diff --git a/ui/deployment/app-routing.module.mst
b/ui/deployment/app-routing.module.mst
index 093d7a5153..8b02986f2e 100644
--- a/ui/deployment/app-routing.module.mst
+++ b/ui/deployment/app-routing.module.mst
@@ -63,7 +63,7 @@ const routes: Routes = [
{ path: '{{{link}}}', component: {{{ng5_component}}}, data: {
authPageNames: [{{{pageNames}}}]}},
{{/componentImport}}
{{^componentImport}}
- { path: '', data: { authPageNames: [{{{pageNames}}}]}, loadChildren: ()
=> import('{{{path}}}').then(m => m.{{{ng5_moduleName}}})},
+ { path: '{{{link}}}', data: { authPageNames: [{{{pageNames}}}]},
loadChildren: () => import('{{{path}}}').then(m => m.{{{ng5_moduleName}}})},
{{/componentImport}}
{{/modulesActive}}
diff --git a/ui/src/app/_guards/page-auth.can-active.guard.ts
b/ui/src/app/_guards/page-auth.can-active.guard.ts
index 6adedcfe07..fab5cecf00 100644
--- a/ui/src/app/_guards/page-auth.can-active.guard.ts
+++ b/ui/src/app/_guards/page-auth.can-active.guard.ts
@@ -16,17 +16,14 @@
*
*/
-import { ActivatedRouteSnapshot, Router } from '@angular/router';
+import { ActivatedRouteSnapshot } from '@angular/router';
import { AuthService } from '../services/auth.service';
import { PageName } from '../_enums/page-name.enum';
import { Injectable } from '@angular/core';
@Injectable()
export class PageAuthGuard {
- constructor(
- private router: Router,
- private authService: AuthService,
- ) {}
+ constructor(private authService: AuthService) {}
canActivateChild(activatedRouteSnapshot: ActivatedRouteSnapshot): boolean {
const pageNames: PageName[] =
activatedRouteSnapshot.data.authPageNames;
diff --git a/ui/src/app/add/add.module.ts b/ui/src/app/add/add.module.ts
index 4ec4b3cede..edcc92a1f4 100644
--- a/ui/src/app/add/add.module.ts
+++ b/ui/src/app/add/add.module.ts
@@ -47,7 +47,7 @@ import { SharedUiModule } from
'../../../projects/streampipes/shared-ui/src/lib/
MatProgressSpinnerModule,
RouterModule.forChild([
{
- path: 'add',
+ path: '',
children: [
{
path: '',
diff --git a/ui/src/app/app-overview/app-overview.module.ts
b/ui/src/app/app-overview/app-overview.module.ts
index 8be703b01c..37cd31ba84 100644
--- a/ui/src/app/app-overview/app-overview.module.ts
+++ b/ui/src/app/app-overview/app-overview.module.ts
@@ -45,7 +45,7 @@ import { SharedUiModule } from '@streampipes/shared-ui';
SharedUiModule,
RouterModule.forChild([
{
- path: 'apps',
+ path: '',
children: [
{ path: '', component: AppOverviewComponent },
...(AvailableAppsService.apps.map(app => {
diff --git a/ui/src/app/assets/assets.module.ts
b/ui/src/app/assets/assets.module.ts
index b3804affa2..dac8bb2412 100644
--- a/ui/src/app/assets/assets.module.ts
+++ b/ui/src/app/assets/assets.module.ts
@@ -65,7 +65,7 @@ import { SpManageAssetLinksDialogComponent } from
'./dialog/manage-asset-links/m
PlatformServicesModule,
RouterModule.forChild([
{
- path: 'assets',
+ path: '',
children: [
{
path: '',
diff --git a/ui/src/app/configuration/configuration.module.ts
b/ui/src/app/configuration/configuration.module.ts
index 05efe24c59..98a2989906 100644
--- a/ui/src/app/configuration/configuration.module.ts
+++ b/ui/src/app/configuration/configuration.module.ts
@@ -88,7 +88,7 @@ import { CodemirrorModule } from '@ctrl/ngx-codemirror';
PlatformServicesModule,
RouterModule.forChild([
{
- path: 'configuration',
+ path: '',
children: [
{
path: '',
diff --git
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
index 4e5cfefc8b..495961296c 100644
---
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
+++
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
@@ -109,6 +109,7 @@
mat-table
[dataSource]="dataSource"
style="width: 100%"
+ data-cy="all-adapters-table"
matSort
>
<ng-container matColumnDef="start">
diff --git
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
index c10f7729f0..99022ad582 100644
---
a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
+++
b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.ts
@@ -40,7 +40,6 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { ObjectPermissionDialogComponent } from
'../../../core-ui/object-permission-dialog/object-permission-dialog.component';
import { UserRole } from '../../../_enums/user-role.enum';
-import { HelpComponent } from '../../../editor/dialog/help/help.component';
import { Router } from '@angular/router';
import { AdapterFilterSettingsModel } from
'../../model/adapter-filter-settings.model';
import { AdapterFilterPipe } from '../../filter/adapter-filter.pipe';
@@ -48,6 +47,7 @@ import { SpConnectRoutes } from '../../connect.routes';
import { Subscription, zip } from 'rxjs';
import { RestApi } from '../../../services/rest-api.service';
import { ShepherdService } from '../../../services/tour/shepherd.service';
+import { HelpComponent } from '../../../core-ui/help/help.component';
@Component({
selector: 'sp-existing-adapters',
diff --git a/ui/src/app/connect/connect.module.ts
b/ui/src/app/connect/connect.module.ts
index 22202016e7..828f03cfa9 100644
--- a/ui/src/app/connect/connect.module.ts
+++ b/ui/src/app/connect/connect.module.ts
@@ -50,7 +50,6 @@ import { EditDataTypeComponent } from
'./dialog/edit-event-property/components/e
import { EditTimestampPropertyComponent } from
'./dialog/edit-event-property/components/edit-value-transformation/edit-timestamp-property/edit-timestamp-property.component';
import { EditUnitTransformationComponent } from
'./dialog/edit-event-property/components/edit-unit-transformation/edit-unit-transformation.component';
import { EditEventPropertyComponent } from
'./dialog/edit-event-property/edit-event-property.component';
-import { PipelineElementRuntimeInfoComponent } from
'./components/runtime-info/pipeline-element-runtime-info.component';
import { EventPropertyRowComponent } from
'./components/adapter-configuration/schema-editor/event-property-row/event-property-row.component';
import { EventSchemaPreviewComponent } from
'./components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component';
import { CoreUiModule } from '../core-ui/core-ui.module';
@@ -107,16 +106,14 @@ import { MatDividerModule } from
'@angular/material/divider';
MatSliderModule,
MatSnackBarModule,
PlatformServicesModule,
- CoreUiModule,
TreeModule,
RouterModule.forChild([
{
- path: 'connect',
+ path: '',
children: [
{
path: '',
component: ExistingAdaptersComponent,
- pathMatch: 'full',
},
{
path: 'create',
@@ -147,7 +144,7 @@ import { MatDividerModule } from
'@angular/material/divider';
]),
SharedUiModule,
],
- exports: [PipelineElementRuntimeInfoComponent, ErrorMessageComponent],
+ exports: [ErrorMessageComponent],
declarations: [
AdapterConfigurationHeaderComponent,
AdapterConfigurationComponent,
@@ -169,7 +166,6 @@ import { MatDividerModule } from
'@angular/material/divider';
AdapterFilterPipe,
JsonPrettyPrintPipe,
AdapterConfigurationComponent,
- PipelineElementRuntimeInfoComponent,
TimestampPipe,
EditCorrectionValueComponent,
AdapterConfigurationComponent,
diff --git a/ui/src/app/core-ui/core-ui.module.ts
b/ui/src/app/core-ui/core-ui.module.ts
index 724e6d808f..df1787ba2e 100644
--- a/ui/src/app/core-ui/core-ui.module.ts
+++ b/ui/src/app/core-ui/core-ui.module.ts
@@ -76,6 +76,10 @@ import { StatusWidgetComponent } from
'./status/status-widget.component';
import { SpSimpleMetricsComponent } from
'./monitoring/simple-metrics/simple-metrics.component';
import { SpSimpleLogsComponent } from
'./monitoring/simple-logs/simple-logs.component';
import { DateInputComponent } from './date-input/date-input.component';
+import { HelpComponent } from './help/help.component';
+import { PipelineElementRuntimeInfoComponent } from
'./pipeline-element-runtime-info/pipeline-element-runtime-info.component';
+import { PipelineElementDocumentationComponent } from
'./pipeline-element-documentation/pipeline-element-documentation.component';
+import { MarkdownModule } from 'ngx-markdown';
@NgModule({
imports: [
@@ -103,6 +107,7 @@ import { DateInputComponent } from
'./date-input/date-input.component';
OverlayModule,
QuillModule.forRoot(),
MatTreeModule,
+ MarkdownModule.forRoot(),
],
declarations: [
DataDownloadDialogComponent,
@@ -111,6 +116,9 @@ import { DateInputComponent } from
'./date-input/date-input.component';
ObjectPermissionDialogComponent,
PipelineElementTemplateConfigComponent,
PipelineElementTemplatePipe,
+ PipelineElementRuntimeInfoComponent,
+ PipelineElementDocumentationComponent,
+ HelpComponent,
StaticAnyInputComponent,
StaticPropertyComponent,
StaticFreeInputComponent,
@@ -149,6 +157,9 @@ import { DateInputComponent } from
'./date-input/date-input.component';
DataDownloadDialogComponent,
DateInputComponent,
PipelineElementTemplateConfigComponent,
+ PipelineElementRuntimeInfoComponent,
+ PipelineElementDocumentationComponent,
+ HelpComponent,
StaticAnyInputComponent,
StaticPropertyComponent,
StaticFreeInputComponent,
diff --git a/ui/src/app/editor/dialog/help/help.component.html
b/ui/src/app/core-ui/help/help.component.html
similarity index 100%
rename from ui/src/app/editor/dialog/help/help.component.html
rename to ui/src/app/core-ui/help/help.component.html
diff --git a/ui/src/app/editor/dialog/help/help.component.scss
b/ui/src/app/core-ui/help/help.component.scss
similarity index 95%
rename from ui/src/app/editor/dialog/help/help.component.scss
rename to ui/src/app/core-ui/help/help.component.scss
index 3e7522f22d..c95de1b0e5 100644
--- a/ui/src/app/editor/dialog/help/help.component.scss
+++ b/ui/src/app/core-ui/help/help.component.scss
@@ -16,7 +16,7 @@
*
*/
-@import '../../../../scss/sp/sp-dialog.scss';
+@import '../../../scss/sp/sp-dialog.scss';
.preview-row,
.preview-table {
diff --git a/ui/src/app/editor/dialog/help/help.component.ts
b/ui/src/app/core-ui/help/help.component.ts
similarity index 89%
rename from ui/src/app/editor/dialog/help/help.component.ts
rename to ui/src/app/core-ui/help/help.component.ts
index c713ad4362..5b7ff21d04 100644
--- a/ui/src/app/editor/dialog/help/help.component.ts
+++ b/ui/src/app/core-ui/help/help.component.ts
@@ -17,13 +17,12 @@
*/
import { Component, Input, OnInit } from '@angular/core';
-import { PipelineElementUnion } from '../../model/editor.model';
import {
PipelineElementService,
SpDataStream,
} from '@streampipes/platform-services';
import { DialogRef } from '@streampipes/shared-ui';
-import { PipelineElementTypeUtils } from '../../utils/editor.utils';
+import { PipelineElementUnion } from '../../editor/model/editor.model';
@Component({
selector: 'sp-pipeline-element-help',
@@ -107,10 +106,4 @@ export class HelpComponent implements OnInit {
this.dialogRef.close();
});
}
-
- filterTab(tab) {
- const type = PipelineElementTypeUtils.fromType(this.pipelineElement);
- const cssShortHand = PipelineElementTypeUtils.toCssShortHand(type);
- return tab.targets.indexOf(cssShortHand) !== -1;
- }
}
diff --git
a/ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.html
b/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.html
similarity index 100%
rename from
ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.html
rename to
ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.html
diff --git
a/ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.scss
b/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.scss
similarity index 100%
rename from
ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.scss
rename to
ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.scss
diff --git
a/ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.ts
b/ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.ts
similarity index 100%
rename from
ui/src/app/editor/components/pipeline-element-documentation/pipeline-element-documentation.component.ts
rename to
ui/src/app/core-ui/pipeline-element-documentation/pipeline-element-documentation.component.ts
diff --git
a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
b/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html
similarity index 100%
rename from
ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.html
rename to
ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.html
diff --git
a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss
b/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss
similarity index 100%
rename from
ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.scss
rename to
ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.scss
diff --git
a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
b/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts
similarity index 98%
rename from
ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
rename to
ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts
index 01e07422b0..db068fd067 100644
---
a/ui/src/app/connect/components/runtime-info/pipeline-element-runtime-info.component.ts
+++
b/ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-runtime-info.component.ts
@@ -21,7 +21,7 @@ import {
EventPropertyUnion,
SpDataStream,
} from '@streampipes/platform-services';
-import { RestService } from '../../services/rest.service';
+import { RestService } from '../../connect/services/rest.service';
@Component({
selector: 'sp-pipeline-element-runtime-info',
diff --git a/ui/src/app/dashboard/dashboard.module.ts
b/ui/src/app/dashboard/dashboard.module.ts
index 24d969b4b1..c2648a5f96 100644
--- a/ui/src/app/dashboard/dashboard.module.ts
+++ b/ui/src/app/dashboard/dashboard.module.ts
@@ -89,7 +89,7 @@ import { DashboardPanelCanDeactivateGuard } from
'./dashboard.can-deactivate.gua
SharedUiModule,
RouterModule.forChild([
{
- path: 'dashboard',
+ path: '',
children: [
{
path: '',
diff --git a/ui/src/app/data-explorer/data-explorer.module.ts
b/ui/src/app/data-explorer/data-explorer.module.ts
index 1f459b0a28..4f19079e8d 100644
--- a/ui/src/app/data-explorer/data-explorer.module.ts
+++ b/ui/src/app/data-explorer/data-explorer.module.ts
@@ -116,7 +116,7 @@ import { SpVisualizationConfigOuterComponent } from
'./components/widgets/utils/
NgxEchartsModule.forChild(),
RouterModule.forChild([
{
- path: 'dataexplorer',
+ path: '',
children: [
{
path: '',
diff --git a/ui/src/app/editor/editor.module.ts
b/ui/src/app/editor/editor.module.ts
index 104da07dcd..afcc37f430 100644
--- a/ui/src/app/editor/editor.module.ts
+++ b/ui/src/app/editor/editor.module.ts
@@ -37,8 +37,6 @@ import { SavePipelineComponent } from
'./dialog/save-pipeline/save-pipeline.comp
import { PipelineElementRecommendationComponent } from
'./components/pipeline-element-recommendation/pipeline-element-recommendation.component';
import { CompatibleElementsComponent } from
'./dialog/compatible-elements/compatible-elements.component';
import { MatListModule } from '@angular/material/list';
-import { HelpComponent } from './dialog/help/help.component';
-import { PipelineElementDocumentationComponent } from
'./components/pipeline-element-documentation/pipeline-element-documentation.component';
import { SafeCss } from './utils/style-sanitizer';
import { MatchingErrorComponent } from
'./dialog/matching-error/matching-error.component';
import { MissingElementsForTutorialComponent } from
'./dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component';
@@ -46,7 +44,6 @@ import { OutputStrategyComponent } from
'./components/output-strategy/output-str
import { CustomOutputStrategyComponent } from
'./components/output-strategy/custom-output/custom-output-strategy.component';
import { PropertySelectionComponent } from
'./components/output-strategy/property-selection/property-selection.component';
import { UserDefinedOutputStrategyComponent } from
'./components/output-strategy/user-defined-output/user-defined-output.component';
-import { ConnectModule } from '../connect/connect.module';
import { EnabledPipelineElementFilter } from
'./filter/enabled-pipeline-element.filter';
import { PipelineElementPreviewComponent } from
'./components/pipeline-element-preview/pipeline-element-preview.component';
import { PipelineElementDiscoveryComponent } from
'./dialog/pipeline-element-discovery/pipeline-element-discovery.component';
@@ -55,16 +52,13 @@ import { PipelineElementIconStandRowComponent } from
'./components/pipeline-elem
import { PipelineElementTypeFilterPipe } from
'./services/pipeline-element-type-filter.pipe';
import { PipelineElementNameFilterPipe } from
'./services/pipeline-element-name-filter.pipe';
import { PipelineElementGroupFilterPipe } from
'./services/pipeline-element-group-filter.pipe';
-import { MarkdownModule } from 'ngx-markdown';
@NgModule({
imports: [
CoreUiModule,
CommonModule,
- ConnectModule,
MatTabsModule,
MatListModule,
- FlexLayoutModule,
GridsterModule,
FlexLayoutModule,
CustomMaterialModule,
@@ -72,7 +66,6 @@ import { MarkdownModule } from 'ngx-markdown';
MatProgressSpinnerModule,
ReactiveFormsModule,
PlatformServicesModule,
- MarkdownModule.forRoot(),
],
declarations: [
CompatibleElementsComponent,
@@ -80,7 +73,6 @@ import { MarkdownModule } from 'ngx-markdown';
CustomOutputStrategyComponent,
EditorComponent,
EnabledPipelineElementFilter,
- HelpComponent,
MatchingErrorComponent,
MissingElementsForTutorialComponent,
OutputStrategyComponent,
@@ -88,7 +80,6 @@ import { MarkdownModule } from 'ngx-markdown';
PipelineAssemblyComponent,
PipelineElementComponent,
PipelineElementDiscoveryComponent,
- PipelineElementDocumentationComponent,
PipelineElementIconStandComponent,
PipelineElementIconStandRowComponent,
PipelineElementGroupFilterPipe,
diff --git a/ui/src/app/editor/services/editor.service.ts
b/ui/src/app/editor/services/editor.service.ts
index f14a81f938..a07f6bbee9 100644
--- a/ui/src/app/editor/services/editor.service.ts
+++ b/ui/src/app/editor/services/editor.service.ts
@@ -37,9 +37,9 @@ import {
PipelineElementUnion,
} from '../model/editor.model';
import { DialogService, PanelType } from '@streampipes/shared-ui';
-import { HelpComponent } from '../dialog/help/help.component';
import { map } from 'rxjs/operators';
import { NGX_LOADING_BAR_IGNORED } from '@ngx-loading-bar/http-client';
+import { HelpComponent } from '../../core-ui/help/help.component';
@Injectable({ providedIn: 'root' })
export class EditorService {
diff --git a/ui/src/app/files/files.module.ts b/ui/src/app/files/files.module.ts
index a93ce71716..20794c27cb 100644
--- a/ui/src/app/files/files.module.ts
+++ b/ui/src/app/files/files.module.ts
@@ -69,7 +69,7 @@ import { MatDialogModule } from '@angular/material/dialog';
SharedUiModule,
RouterModule.forChild([
{
- path: 'files',
+ path: '',
children: [
{
path: '',
diff --git a/ui/src/app/pipelines/pipelines.module.ts
b/ui/src/app/pipelines/pipelines.module.ts
index 79b34d02b4..c59ec1bc24 100644
--- a/ui/src/app/pipelines/pipelines.module.ts
+++ b/ui/src/app/pipelines/pipelines.module.ts
@@ -70,7 +70,7 @@ import { SpFunctionsLogsComponent } from
'./components/functions-overview/functi
SharedUiModule,
RouterModule.forChild([
{
- path: 'pipelines',
+ path: '',
children: [
{
path: '',