From 41bc47c53393e60371bd2636b50360b672e8c75c Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Wed, 14 Aug 2024 21:22:10 +0200 Subject: [PATCH 1/6] feat(#3141): Add option to configure production sites --- .../model/configuration/LocationConfig.java | 25 +++++ .../configuration/SpCoreConfiguration.java | 10 ++ .../streampipes/rest/ResetManagement.java | 42 +++++-- .../admin/LocationConfigurationResource.java | 53 +++++++++ .../utils/configuration/ConfigurationUtils.ts | 31 ++++++ .../support/utils/configuration/SiteUtils.ts | 65 +++++++++++ .../tests/assetManagement/createAsset.spec.ts | 2 +- .../sites/sites-geo-features.spec.ts | 41 +++++++ .../tests/configuration/sites/sites.spec.ts | 64 +++++++++++ .../src/lib/apis/datalake-rest.service.ts | 32 +----- .../src/lib/apis/location-config.service.ts | 50 +++++++++ .../src/lib/model/assets/asset.model.ts | 24 +++- .../src/lib/model/gen/streampipes-model.ts | 69 ++++-------- .../platform-services/src/public-api.ts | 1 + .../basic-field-description.component.html | 3 +- ui/src/app/assets/assets.module.ts | 4 + .../asset-details-basics.component.html | 15 +++ .../asset-details-basics.component.ts | 36 ++++-- .../asset-details-site.component.html | 39 +++++++ .../asset-details-site.component.scss | 0 .../asset-details-site.component.ts | 62 +++++++++++ .../asset-location.component.html | 0 .../asset-location.component.scss | 0 .../asset-location.component.ts | 25 +++++ .../asset-details-panel.component.html | 2 + .../asset-details-panel.component.ts | 8 +- .../asset-details.component.html | 4 +- .../asset-details/asset-details.component.ts | 45 +++++--- .../asset-selection-panel.component.html | 4 +- .../asset-selection-panel.component.ts | 8 +- .../app/assets/constants/asset.constants.ts | 1 + .../app/configuration/configuration-tabs.ts | 5 + .../app/configuration/configuration.module.ts | 18 +++ .../app/configuration/configuration.routes.ts | 1 - .../edit-location-area.component.html | 68 ++++++++++++ .../edit-location-area.component.scss} | 15 ++- .../edit-location-area.component.ts | 40 +++++++ .../edit-location.component.html | 44 ++++++++ .../edit-location.component.scss | 0 .../edit-location/edit-location.component.ts | 30 +++++ .../manage-site-dialog.component.html | 31 ++++++ .../manage-site-dialog.component.scss | 35 ++++++ .../manage-site-dialog.component.ts | 80 +++++++++++++ ...tion-features-configuration.component.html | 67 +++++++++++ ...cation-features-configuration.component.ts | 105 ++++++++++++++++++ .../site-area-configuration.component.html | 80 +++++++++++++ .../site-area-configuration.component.ts | 83 ++++++++++++++ .../sites-configuration.component.html | 23 ++++ .../sites-configuration.component.scss | 0 .../sites-configuration.component.ts | 29 +++++ 50 files changed, 1386 insertions(+), 133 deletions(-) create mode 100644 streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java create mode 100644 streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/LocationConfigurationResource.java create mode 100644 ui/cypress/support/utils/configuration/ConfigurationUtils.ts create mode 100644 ui/cypress/support/utils/configuration/SiteUtils.ts create mode 100644 ui/cypress/tests/configuration/sites/sites-geo-features.spec.ts create mode 100644 ui/cypress/tests/configuration/sites/sites.spec.ts create mode 100644 ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss create mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts create mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.html rename ui/{cypress/support/utils/configuration/ConfigutationUtils.ts => src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss} (83%) create mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.ts create mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html create mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss create mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts create mode 100644 ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html create mode 100644 ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.scss create mode 100644 ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts create mode 100644 ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html create mode 100644 ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts create mode 100644 ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.html create mode 100644 ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts create mode 100644 ui/src/app/configuration/sites-configuration/sites-configuration.component.html create mode 100644 ui/src/app/configuration/sites-configuration/sites-configuration.component.scss create mode 100644 ui/src/app/configuration/sites-configuration/sites-configuration.component.ts diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java new file mode 100644 index 0000000000..fe7bc35c60 --- /dev/null +++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java @@ -0,0 +1,25 @@ +/* + * 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. + * + */ + +package org.apache.streampipes.model.configuration; + +import org.apache.streampipes.model.shared.annotation.TsModel; + +@TsModel +public record LocationConfig(boolean locationEnabled, + String tileServerUrl) {} diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java index 6aad62a172..5c04e6b1c7 100644 --- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java +++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java @@ -32,6 +32,7 @@ public class SpCoreConfiguration { private EmailConfig emailConfig; private EmailTemplateConfig emailTemplateConfig; private GeneralConfig generalConfig; + private LocationConfig locationConfig; private boolean isConfigured; private SpCoreConfigurationStatus serviceStatus; @@ -40,6 +41,7 @@ public class SpCoreConfiguration { private String filesDir; public SpCoreConfiguration() { + this.locationConfig = new LocationConfig(false, ""); } public String getRev() { @@ -129,4 +131,12 @@ public SpCoreConfigurationStatus getServiceStatus() { public void setServiceStatus(SpCoreConfigurationStatus serviceStatus) { this.serviceStatus = serviceStatus; } + + public LocationConfig getLocationConfig() { + return locationConfig; + } + + public void setLocationConfig(LocationConfig locationConfig) { + this.locationConfig = locationConfig; + } } diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java index 5bce889136..caca0dac6c 100644 --- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java +++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java @@ -83,6 +83,8 @@ public static void reset(String username) { removeAllPipelineTemplates(); + clearGenericStorage(); + logger.info("Resetting the system was completed"); } @@ -106,7 +108,7 @@ private static void stopAndDeleteAllPipelines() { private static void stopAndDeleteAllAdapters() { AdapterMasterManagement adapterMasterManagement = new AdapterMasterManagement( StorageDispatcher.INSTANCE.getNoSqlStore() - .getAdapterInstanceStorage(), + .getAdapterInstanceStorage(), new SpResourceManager().manageAdapters(), new SpResourceManager().manageDataStreams(), AdapterMetricsManager.INSTANCE.getAdapterMetrics() @@ -152,37 +154,37 @@ private static void removeAllDataInDataLake() { private static void removeAllDataViewWidgets() { var widgetStorage = StorageDispatcher.INSTANCE.getNoSqlStore() - .getDataExplorerWidgetStorage(); + .getDataExplorerWidgetStorage(); widgetStorage.findAll() - .forEach(widget -> widgetStorage.deleteElementById(widget.getElementId())); + .forEach(widget -> widgetStorage.deleteElementById(widget.getElementId())); } private static void removeAllDataViews() { var dataLakeDashboardStorage = StorageDispatcher.INSTANCE.getNoSqlStore() - .getDataExplorerDashboardStorage(); + .getDataExplorerDashboardStorage(); dataLakeDashboardStorage.findAll() - .forEach(dashboard -> dataLakeDashboardStorage.deleteElementById(dashboard.getElementId())); + .forEach(dashboard -> dataLakeDashboardStorage.deleteElementById(dashboard.getElementId())); } private static void removeAllDashboardWidgets() { var dashboardWidgetStorage = StorageDispatcher.INSTANCE.getNoSqlStore() - .getDashboardWidgetStorage(); + .getDashboardWidgetStorage(); dashboardWidgetStorage.findAll() - .forEach(widget -> dashboardWidgetStorage.deleteElementById(widget.getElementId())); + .forEach(widget -> dashboardWidgetStorage.deleteElementById(widget.getElementId())); } private static void removeAllDashboards() { var dashboardStorage = StorageDispatcher.INSTANCE.getNoSqlStore() - .getDashboardStorage(); + .getDashboardStorage(); dashboardStorage.findAll() - .forEach(dashboard -> dashboardStorage.deleteElementById(dashboard.getElementId())); + .forEach(dashboard -> dashboardStorage.deleteElementById(dashboard.getElementId())); } private static void removeAllAssets(String username) { IGenericStorage genericStorage = StorageDispatcher.INSTANCE.getNoSqlStore() - .getGenericStorage(); + .getGenericStorage(); try { for (Map asset : genericStorage.findAll("asset-management")) { genericStorage.delete((String) asset.get("_id"), (String) asset.get("_rev")); @@ -203,4 +205,24 @@ private static void removeAllPipelineTemplates() { .forEach(pipelineElementTemplateStorage::deleteElement); } + + private static void clearGenericStorage() { + var appDocTypesToDelete = List.of( + "asset-management", + "asset-sites" + ); + var genericStorage = StorageDispatcher.INSTANCE.getNoSqlStore().getGenericStorage(); + + appDocTypesToDelete.forEach(docType -> { + try { + var allDocs = genericStorage.findAll(docType); + for (var doc : allDocs) { + genericStorage.delete(doc.get("_id").toString(), doc.get("_rev").toString()); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + + } } diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/LocationConfigurationResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/LocationConfigurationResource.java new file mode 100644 index 0000000000..7872efed0b --- /dev/null +++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/LocationConfigurationResource.java @@ -0,0 +1,53 @@ +/* + * 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. + * + */ + +package org.apache.streampipes.rest.impl.admin; + +import org.apache.streampipes.model.configuration.LocationConfig; +import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource; +import org.apache.streampipes.rest.security.AuthConstants; + +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/v2/admin/location-config") +public class LocationConfigurationResource extends AbstractAuthGuardedRestResource { + + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public LocationConfig getLocationConfig() { + return getSpCoreConfigurationStorage().get().getLocationConfig(); + } + + @PutMapping(consumes = MediaType.APPLICATION_JSON_VALUE) + @PreAuthorize(AuthConstants.IS_ADMIN_ROLE) + public ResponseEntity updateGeneralConfiguration(@RequestBody LocationConfig config) { + var storage = getSpCoreConfigurationStorage(); + var cfg = storage.get(); + cfg.setLocationConfig(config); + storage.updateElement(cfg); + + return ok(); + } +} diff --git a/ui/cypress/support/utils/configuration/ConfigurationUtils.ts b/ui/cypress/support/utils/configuration/ConfigurationUtils.ts new file mode 100644 index 0000000000..f8148033e5 --- /dev/null +++ b/ui/cypress/support/utils/configuration/ConfigurationUtils.ts @@ -0,0 +1,31 @@ +/* + * 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. + * + */ + +export class ConfigurationUtils { + public static goToConfigurationExport() { + cy.visit('#/configuration/export'); + } + + public static goToSitesConfiguration() { + cy.visit('#/configuration/sites'); + } + + public static goToGeneralConfiguration() { + cy.visit('#/configuration/general'); + } +} diff --git a/ui/cypress/support/utils/configuration/SiteUtils.ts b/ui/cypress/support/utils/configuration/SiteUtils.ts new file mode 100644 index 0000000000..59bbf0900e --- /dev/null +++ b/ui/cypress/support/utils/configuration/SiteUtils.ts @@ -0,0 +1,65 @@ +/* + * 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. + * + */ + +export class SiteUtils { + public static CHECKBOX_ENABLE_LOCATION_FEATURES = + 'sites-enable-location-features-checkbox'; + public static INPUT_TILE_SERVER_URL = 'sites-location-config-tile-server'; + + public static BUTTON_MANAGE_SITES = 'sites-manage-sites-button'; + public static BUTTON_EDIT_SITE = 'sites-edit-button'; + public static BUTTON_DELETE_SITE = 'sites-delete-button'; + public static BUTTON_SITE_DIALOG_SAVE = 'sites-dialog-save-button'; + public static BUTTON_SITE_DIALOG_CANCEL = 'sites-dialog-cancel-button'; + public static BUTTON_SITE_DIALOG_REMOVE_AREA = + 'sites-dialog-remove-area-button'; + public static BUTTON_SITE_DIALOG_ADD_AREA = 'sites-dialog-add-area-button'; + + public static INPUT_SITE_DIALOG_SITE_INPUT = 'sites-dialog-site-input'; + public static INPUT_SITE_DIALOG_NEW_AREA_INPUT = + 'sites-dialog-new-area-input'; + + public static LABEL_TABLE_NAME = 'site-table-row-label'; + public static LABEL_TABLE_AREA = 'site-table-row-areas'; + + public static enableGeoFeatures(tileServerUrl: string): void { + cy.dataCy(SiteUtils.CHECKBOX_ENABLE_LOCATION_FEATURES).click(); + cy.dataCy(SiteUtils.INPUT_TILE_SERVER_URL).clear().type(tileServerUrl); + cy.dataCy('sites-location-features-button').click(); + } + + public static createNewSite(name: string, areas: string[]): void { + cy.dataCy(SiteUtils.BUTTON_MANAGE_SITES).click(); + cy.dataCy(SiteUtils.INPUT_SITE_DIALOG_SITE_INPUT, { timeout: 2000 }) + .clear() + .type(name); + + areas.forEach(area => { + cy.dataCy(SiteUtils.INPUT_SITE_DIALOG_NEW_AREA_INPUT) + .clear() + .type(area); + cy.dataCy(SiteUtils.BUTTON_SITE_DIALOG_ADD_AREA).click(); + }); + + cy.dataCy(this.BUTTON_SITE_DIALOG_SAVE).click(); + } + + public static openEditSiteDialog() { + cy.dataCy(SiteUtils.BUTTON_EDIT_SITE).first().click(); + } +} diff --git a/ui/cypress/tests/assetManagement/createAsset.spec.ts b/ui/cypress/tests/assetManagement/createAsset.spec.ts index e52d7b500c..7f5171631a 100644 --- a/ui/cypress/tests/assetManagement/createAsset.spec.ts +++ b/ui/cypress/tests/assetManagement/createAsset.spec.ts @@ -20,7 +20,7 @@ import { AdapterBuilder } from '../../support/builder/AdapterBuilder'; import { ConnectUtils } from '../../support/utils/connect/ConnectUtils'; import { AssetUtils } from '../../support/utils/asset/AssetUtils'; import { DashboardUtils } from '../../support/utils/DashboardUtils'; -import { ConfigurationUtils } from '../../support/utils/configuration/ConfigutationUtils'; +import { ConfigurationUtils } from '../../support/utils/configuration/ConfigurationUtils'; describe('Creates a new adapter, add to assets and export assets', () => { beforeEach('Setup Test', () => { diff --git a/ui/cypress/tests/configuration/sites/sites-geo-features.spec.ts b/ui/cypress/tests/configuration/sites/sites-geo-features.spec.ts new file mode 100644 index 0000000000..4f8649f8e0 --- /dev/null +++ b/ui/cypress/tests/configuration/sites/sites-geo-features.spec.ts @@ -0,0 +1,41 @@ +/* + * 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 { SiteUtils } from '../../../support/utils/configuration/SiteUtils'; +import { ConfigurationUtils } from '../../../support/utils/configuration/ConfigurationUtils'; + +describe('Test geo features settings', () => { + beforeEach('Setup Test', () => { + cy.initStreamPipesTest(); + }); + + it('Perform Test', () => { + // enable geo features + ConfigurationUtils.goToSitesConfiguration(); + SiteUtils.enableGeoFeatures('url'); + + ConfigurationUtils.goToGeneralConfiguration(); + ConfigurationUtils.goToSitesConfiguration(); + + cy.dataCy(SiteUtils.CHECKBOX_ENABLE_LOCATION_FEATURES) + .find('input') + .should('be.checked'); + + cy.dataCy(SiteUtils.INPUT_TILE_SERVER_URL).should('have.value', 'url'); + }); +}); diff --git a/ui/cypress/tests/configuration/sites/sites.spec.ts b/ui/cypress/tests/configuration/sites/sites.spec.ts new file mode 100644 index 0000000000..5b0fb8b861 --- /dev/null +++ b/ui/cypress/tests/configuration/sites/sites.spec.ts @@ -0,0 +1,64 @@ +/* + * 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 { SiteUtils } from '../../../support/utils/configuration/SiteUtils'; +import { ConfigurationUtils } from '../../../support/utils/configuration/ConfigurationUtils'; + +describe('Test configuration of sites', () => { + beforeEach('Setup Test', () => { + cy.initStreamPipesTest(); + }); + + it('Perform Test', () => { + const site = 'My Site'; + const newSite = 'My modified Site'; + const areas = ['Area A', 'Area B']; + ConfigurationUtils.goToSitesConfiguration(); + SiteUtils.createNewSite(site, areas); + + cy.dataCy(SiteUtils.LABEL_TABLE_NAME).should('have.length', 1); + + cy.dataCy(SiteUtils.LABEL_TABLE_NAME) + .first() + .should('contain.text', site); + cy.dataCy(SiteUtils.LABEL_TABLE_AREA) + .first() + .should('contains.text', areas.toString()); + + SiteUtils.openEditSiteDialog(); + + cy.dataCy(SiteUtils.INPUT_SITE_DIALOG_SITE_INPUT, { timeout: 2000 }) + .clear() + .type(newSite); + + cy.dataCy(SiteUtils.BUTTON_SITE_DIALOG_REMOVE_AREA + '_Area_A').click(); + cy.dataCy(SiteUtils.BUTTON_SITE_DIALOG_SAVE).click(); + + cy.dataCy(SiteUtils.LABEL_TABLE_NAME).should('have.length', 1); + + cy.dataCy(SiteUtils.LABEL_TABLE_NAME) + .first() + .should('contain.text', newSite); + cy.dataCy(SiteUtils.LABEL_TABLE_AREA) + .first() + .should('have.text', ' Area B '); + + cy.dataCy(SiteUtils.BUTTON_DELETE_SITE + '-My_modified_Site').click(); + cy.dataCy(SiteUtils.LABEL_TABLE_NAME).should('have.length', 0); + }); +}); diff --git a/ui/projects/streampipes/platform-services/src/lib/apis/datalake-rest.service.ts b/ui/projects/streampipes/platform-services/src/lib/apis/datalake-rest.service.ts index a8e8c8928f..a2cb61594b 100644 --- a/ui/projects/streampipes/platform-services/src/lib/apis/datalake-rest.service.ts +++ b/ui/projects/streampipes/platform-services/src/lib/apis/datalake-rest.service.ts @@ -19,11 +19,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'; import { Observable, of } from 'rxjs'; -import { - DataLakeMeasure, - PageResult, - SpQueryResult, -} from '../model/gen/streampipes-model'; +import { DataLakeMeasure, SpQueryResult } from '../model/gen/streampipes-model'; import { map } from 'rxjs/operators'; import { DatalakeQueryParameters } from '../model/datalake/DatalakeQueryParameters'; @@ -103,32 +99,6 @@ export class DatalakeRestService { } } - getPagedData( - index: string, - itemsPerPage: number, - page: number, - columns?: string, - order?: string, - ): Observable { - const url = this.dataLakeUrl + '/measurements/' + index; - - const queryParams: DatalakeQueryParameters = this.getQueryParameters( - columns, - undefined, - undefined, - page, - itemsPerPage, - undefined, - undefined, - order, - undefined, - undefined, - ); - - // @ts-ignore - return this.http.get(url, { params: queryParams }); - } - getTagValues( index: string, fieldNames: string[], diff --git a/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts b/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts new file mode 100644 index 0000000000..f69cf16f64 --- /dev/null +++ b/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts @@ -0,0 +1,50 @@ +/* + * 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 { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { + LocationConfig, + PlatformServicesCommons, +} from '@streampipes/platform-services'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root', +}) +export class LocationConfigService { + constructor( + private http: HttpClient, + private platformServicesCommons: PlatformServicesCommons, + ) {} + + getLocationConfig(): Observable { + return this.http + .get(this.locationConfigPath) + .pipe(map(response => response as LocationConfig)); + } + + updateLocationConfig(config: LocationConfig): Observable { + return this.http.put(this.locationConfigPath, config); + } + + private get locationConfigPath() { + return `${this.platformServicesCommons.apiBasePath}/admin/location-config`; + } +} diff --git a/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts b/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts index c1872f5f31..1f353ed9c2 100644 --- a/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts +++ b/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts @@ -48,15 +48,35 @@ export interface Isa95TypeDesc { type: Isa95Type; } +export interface AssetSiteDesc { + _id: string; + _rev?: string; + appDocType: string; + label: string; + location: LatLng; + areas: string[]; +} + +export interface LatLng { + latitude: number; + longitude: number; +} + +export interface AssetLocation { + siteId: string; + area: string; + exactLocation?: LatLng; + zoom?: number; +} + export interface SpAsset { assetId: string; assetName: string; assetDescription: string; - assetType: AssetType; labelIds?: string[]; assetLinks: AssetLink[]; - + assetLocation?: AssetLocation; assets: SpAsset[]; } diff --git a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts index 29b7a7f837..b48be6e884 100644 --- a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts +++ b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts @@ -20,11 +20,10 @@ /* tslint:disable */ /* eslint-disable */ // @ts-nocheck -// Generated using typescript-generator version 3.2.1263 on 2024-07-29 21:03:44. +// Generated using typescript-generator version 3.2.1263 on 2024-08-14 12:45:11. export class NamedStreamPipesEntity implements Storable { '@class': - | 'org.apache.streampipes.model.connect.grounding.ProtocolDescription' | 'org.apache.streampipes.model.template.PipelineTemplateDescription' | 'org.apache.streampipes.model.SpDataStream' | 'org.apache.streampipes.model.base.VersionedNamedStreamPipesEntity' @@ -2137,6 +2136,24 @@ export class ListOutputStrategy extends OutputStrategy { } } +export class LocationConfig { + locationEnabled: boolean; + tileServerUrl: string; + + static fromData( + data: LocationConfig, + target?: LocationConfig, + ): LocationConfig { + if (!data) { + return data; + } + const instance = target || new LocationConfig(); + instance.locationEnabled = data.locationEnabled; + instance.tileServerUrl = data.tileServerUrl; + return instance; + } +} + export class MappingProperty extends StaticProperty { '@class': | 'org.apache.streampipes.model.staticproperty.MappingProperty' @@ -2430,25 +2447,6 @@ export class Option { } } -/** - * @deprecated since 0.92.0, for removal - */ -export class PageResult extends DataSeries { - page: number; - pageSum: number; - - static fromData(data: PageResult, target?: PageResult): PageResult { - if (!data) { - return data; - } - const instance = target || new PageResult(); - super.fromData(data, instance); - instance.page = data.page; - instance.pageSum = data.pageSum; - return instance; - } -} - export class Pipeline implements Storable { _id: string; _rev: string; @@ -3054,35 +3052,6 @@ export class PropertyValueSpecification { } } -/** - * @deprecated since 0.93.0, for removal - */ -export class ProtocolDescription extends NamedStreamPipesEntity { - '@class': 'org.apache.streampipes.model.connect.grounding.ProtocolDescription'; - 'category': string[]; - 'config': StaticPropertyUnion[]; - 'sourceType': string; - - static 'fromData'( - data: ProtocolDescription, - target?: ProtocolDescription, - ): ProtocolDescription { - if (!data) { - return data; - } - const instance = target || new ProtocolDescription(); - super.fromData(data, instance); - instance.category = __getCopyArrayFn(__identity())( - data.category, - ); - instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)( - data.config, - ); - instance.sourceType = data.sourceType; - return instance; - } -} - export class PulsarTransportProtocol extends TransportProtocol { '@class': 'org.apache.streampipes.model.grounding.PulsarTransportProtocol'; diff --git a/ui/projects/streampipes/platform-services/src/public-api.ts b/ui/projects/streampipes/platform-services/src/public-api.ts index ce377827b3..8e0d2d428c 100644 --- a/ui/projects/streampipes/platform-services/src/public-api.ts +++ b/ui/projects/streampipes/platform-services/src/public-api.ts @@ -34,6 +34,7 @@ export * from './lib/apis/functions.service'; export * from './lib/apis/general-config.service'; export * from './lib/apis/generic-storage.service'; export * from './lib/apis/labels.service'; +export * from './lib/apis/location-config.service'; export * from './lib/apis/mail-config.service'; export * from './lib/apis/measurement-units.service'; export * from './lib/apis/permissions.service'; diff --git a/ui/projects/streampipes/shared-ui/src/lib/components/basic-field-description/basic-field-description.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/basic-field-description/basic-field-description.component.html index 83115501f2..a33844fb7d 100644 --- a/ui/projects/streampipes/shared-ui/src/lib/components/basic-field-description/basic-field-description.component.html +++ b/ui/projects/streampipes/shared-ui/src/lib/components/basic-field-description/basic-field-description.component.html @@ -19,7 +19,8 @@
diff --git a/ui/src/app/assets/assets.module.ts b/ui/src/app/assets/assets.module.ts index c8adc3fa06..fc81b953f7 100644 --- a/ui/src/app/assets/assets.module.ts +++ b/ui/src/app/assets/assets.module.ts @@ -57,6 +57,8 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { AssetDetailsLabelsComponent } from './components/asset-details/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component'; import { MatChipGrid, MatChipsModule } from '@angular/material/chips'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { AssetDetailsSiteComponent } from './components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component'; +import { AssetLocationComponent } from './components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component'; @NgModule({ imports: [ @@ -112,7 +114,9 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete'; AssetDetailsBasicsComponent, AssetDetailsLabelsComponent, AssetDetailsLinksComponent, + AssetDetailsSiteComponent, AssetLinkSectionComponent, + AssetLocationComponent, AssetUploadDialogComponent, EditAssetLinkDialogComponent, SpAssetDetailsComponent, diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html index 71f9b00b9c..9d427ea958 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html @@ -107,6 +107,21 @@ > + + + +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts index f84ef1fd3b..beb0405276 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts @@ -16,8 +16,15 @@ * */ -import { Component, Input, OnInit } from '@angular/core'; import { + Component, + Input, + OnChanges, + OnInit, + SimpleChanges, +} from '@angular/core'; +import { + AssetSiteDesc, Isa95TypeDesc, Isa95TypeService, SpAsset, @@ -28,25 +35,36 @@ import { templateUrl: './asset-details-basics.component.html', styleUrls: ['./asset-details-basics.component.scss'], }) -export class AssetDetailsBasicsComponent implements OnInit { +export class AssetDetailsBasicsComponent implements OnInit, OnChanges { @Input() asset: SpAsset; @Input() editMode: boolean; + @Input() + rootNode: boolean; + + @Input() + locations: AssetSiteDesc[]; + isa95Types: Isa95TypeDesc[] = []; constructor(private isa95TypeService: Isa95TypeService) {} ngOnInit() { - this.asset.assetType ??= { - assetIcon: undefined, - assetIconColor: undefined, - assetTypeCategory: undefined, - assetTypeLabel: undefined, - isa95AssetType: 'OTHER', - }; this.isa95Types = this.isa95TypeService.getTypeDescriptions(); } + + ngOnChanges(changes: SimpleChanges) { + if (changes['asset']) { + this.asset.assetType ??= { + assetIcon: undefined, + assetIconColor: undefined, + assetTypeCategory: undefined, + assetTypeLabel: undefined, + isa95AssetType: 'OTHER', + }; + } + } } diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html new file mode 100644 index 0000000000..37fc98499a --- /dev/null +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html @@ -0,0 +1,39 @@ + + +
+ + Site + + + {{ site.label }} + + + + + Area + + + {{ area }} + + + +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts new file mode 100644 index 0000000000..085bbb2d42 --- /dev/null +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.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 { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { AssetSiteDesc, SpAsset } from '@streampipes/platform-services'; +import { MatSelectChange } from '@angular/material/select'; + +@Component({ + selector: 'sp-asset-details-site-component', + templateUrl: './asset-details-site.component.html', +}) +export class AssetDetailsSiteComponent implements OnChanges { + @Input() + asset: SpAsset; + + @Input() + editMode: boolean; + + @Input() + allSites: AssetSiteDesc[]; + + currentSite: AssetSiteDesc; + + constructor() {} + + ngOnChanges(changes: SimpleChanges) { + if (changes['asset']) { + this.asset.assetLocation ??= { + area: undefined, + siteId: undefined, + }; + if (this.allSites.length > 0) { + if (this.asset.assetLocation.siteId !== undefined) { + this.selectCurrentSite(this.asset.assetLocation.siteId); + } + } + } + } + + handleLocationChange(event: MatSelectChange) { + this.selectCurrentSite(event.value); + } + + selectCurrentSite(siteId: string): void { + this.currentSite = this.allSites.find(loc => loc._id === siteId); + } +} diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts new file mode 100644 index 0000000000..51e0050bae --- /dev/null +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts @@ -0,0 +1,25 @@ +/* + * 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 { Component } from '@angular/core'; + +@Component({ + selector: 'sp-asset-location-component', + templateUrl: './asset-location.component.html', +}) +export class AssetLocationComponent {} diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html index 9b9157f43c..589babcbfb 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html @@ -21,6 +21,8 @@ diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts index e61b6d379b..e25a3c1afe 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts @@ -17,7 +17,7 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { SpAsset } from '@streampipes/platform-services'; +import { AssetSiteDesc, SpAsset } from '@streampipes/platform-services'; @Component({ selector: 'sp-asset-details-panel-component', @@ -31,6 +31,12 @@ export class SpAssetDetailsPanelComponent { @Input() editMode: boolean; + @Input() + rootNode: boolean; + + @Input() + locations: AssetSiteDesc[]; + @Output() updateAssetEmitter: EventEmitter = new EventEmitter(); } diff --git a/ui/src/app/assets/components/asset-details/asset-details.component.html b/ui/src/app/assets/components/asset-details/asset-details.component.html index e99f362281..02d4ab506a 100644 --- a/ui/src/app/assets/components/asset-details/asset-details.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details.component.html @@ -55,7 +55,7 @@ [editMode]="editMode" [assetModel]="asset" [selectedAsset]="selectedAsset" - (selectedAssetEmitter)="selectedAsset = $event" + (selectedAssetEmitter)="applySelectedAsset($event)" > @@ -64,6 +64,8 @@ { - this.asset = asset; - if (!this.selectedAsset) { - this.selectedAsset = this.asset; - } - this.breadcrumbService.updateBreadcrumb([ - SpAssetRoutes.BASE, - { label: this.asset.assetName }, - ]); - }); + loadResources(): void { + const assetReq = this.genericStorageService.getDocument( + AssetConstants.ASSET_APP_DOC_NAME, + this.assetModelId, + ); + const locationsReq = this.genericStorageService.getAllDocuments( + AssetConstants.ASSET_SITES_APP_DOC_NAME, + ); + zip([assetReq, locationsReq]).subscribe(res => { + this.asset = res[0]; + this.locations = res[1]; + if (!this.selectedAsset) { + this.selectedAsset = this.asset; + } + this.breadcrumbService.updateBreadcrumb([ + SpAssetRoutes.BASE, + { label: this.asset.assetName }, + ]); + }); + } + + applySelectedAsset(event: { asset: SpAsset; rootNode: boolean }): void { + this.selectedAsset = event.asset; + this.rootNode = event.rootNode; } updateAsset() { @@ -76,7 +91,7 @@ export class SpAssetDetailsComponent implements OnInit { this.genericStorageService .updateDocument(AssetConstants.ASSET_APP_DOC_NAME, this.asset) .subscribe(res => { - this.loadAsset(); + this.loadResources(); this.editMode = false; }); } diff --git a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.html b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.html index 851c39ef78..bf93eed73a 100644 --- a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.html +++ b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.html @@ -45,7 +45,7 @@

Asset Browser

" fxLayout="row" fxFlex="100" - (click)="selectNode(node)" + (click)="selectNode(node, false)" > {{ node.assetName @@ -94,7 +94,7 @@

Asset Browser

" fxLayout="row" fxFlex="100" - (click)="selectNode(node)" + (click)="selectNode(node, true)" > {{ node.assetName diff --git a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts index b69e8566aa..14fe8d1511 100644 --- a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts @@ -17,7 +17,6 @@ */ import { - AfterViewInit, Component, EventEmitter, Input, @@ -45,7 +44,8 @@ export class SpAssetSelectionPanelComponent implements OnInit { editMode: boolean; @Output() - selectedAssetEmitter: EventEmitter = new EventEmitter(); + selectedAssetEmitter: EventEmitter<{ asset: SpAsset; rootNode: boolean }> = + new EventEmitter<{ asset: SpAsset; rootNode: boolean }>(); treeControl = new NestedTreeControl(node => node.assets); dataSource = new MatTreeNestedDataSource(); @@ -63,8 +63,8 @@ export class SpAssetSelectionPanelComponent implements OnInit { this.treeControl.expandAll(); } - selectNode(asset: SpAsset) { - this.selectedAssetEmitter.emit(asset); + selectNode(asset: SpAsset, rootNode: boolean) { + this.selectedAssetEmitter.emit({ asset, rootNode }); } addAsset(node: SpAsset) { diff --git a/ui/src/app/assets/constants/asset.constants.ts b/ui/src/app/assets/constants/asset.constants.ts index 9d99800ca1..879e1a1243 100644 --- a/ui/src/app/assets/constants/asset.constants.ts +++ b/ui/src/app/assets/constants/asset.constants.ts @@ -18,5 +18,6 @@ export class AssetConstants { public static ASSET_APP_DOC_NAME = 'asset-management'; + public static ASSET_SITES_APP_DOC_NAME = 'asset-sites'; public static ASSET_LINK_TYPES_DOC_NAME = 'asset-link-type'; } diff --git a/ui/src/app/configuration/configuration-tabs.ts b/ui/src/app/configuration/configuration-tabs.ts index f897f212a5..e3359dd72f 100644 --- a/ui/src/app/configuration/configuration-tabs.ts +++ b/ui/src/app/configuration/configuration-tabs.ts @@ -66,6 +66,11 @@ export class SpConfigurationTabs { itemTitle: 'Security', itemLink: ['configuration', 'security'], }, + { + itemId: 'sites', + itemTitle: 'Sites', + itemLink: ['configuration', 'sites'], + }, ]; } } diff --git a/ui/src/app/configuration/configuration.module.ts b/ui/src/app/configuration/configuration.module.ts index 305a667d6d..3d781332a1 100644 --- a/ui/src/app/configuration/configuration.module.ts +++ b/ui/src/app/configuration/configuration.module.ts @@ -79,6 +79,13 @@ import { EndpointItemComponent } from './extensions-installation/endpoint-item/e import { SpExtensionsInstallationComponent } from './extensions-installation/extensions-installation.component'; import { MatMenuModule } from '@angular/material/menu'; import { SpConfigurationLinkSettingsComponent } from './general-configuration/link-settings/link-settings.component'; +import { SitesConfigurationComponent } from './sites-configuration/sites-configuration.component'; +import { LocationFeaturesConfigurationComponent } from './sites-configuration/location-features-configuration/location-features-configuration.component'; +import { SiteAreaConfigurationComponent } from './sites-configuration/site-area-configuration/site-area-configuration.component'; +import { MatSort } from '@angular/material/sort'; +import { ManageSiteDialogComponent } from './dialog/manage-site/manage-site-dialog.component'; +import { EditAssetLocationComponent } from './dialog/manage-site/edit-location/edit-location.component'; +import { EditAssetLocationAreaComponent } from './dialog/manage-site/edit-location/edit-location-area/edit-location-area.component'; @NgModule({ imports: [ @@ -148,12 +155,17 @@ import { SpConfigurationLinkSettingsComponent } from './general-configuration/li path: 'security', component: SecurityConfigurationComponent, }, + { + path: 'sites', + component: SitesConfigurationComponent, + }, ], }, ]), SharedUiModule, ColorPickerModule, CodemirrorModule, + MatSort, ], declarations: [ ServiceConfigsComponent, @@ -162,16 +174,22 @@ import { SpConfigurationLinkSettingsComponent } from './general-configuration/li ServiceConfigsBooleanComponent, ServiceConfigsNumberComponent, DeleteDatalakeIndexComponent, + EditAssetLocationComponent, + EditAssetLocationAreaComponent, EditUserDialogComponent, EditGroupDialogComponent, EmailConfigurationComponent, GeneralConfigurationComponent, ExtensionsServiceManagementComponent, + LocationFeaturesConfigurationComponent, + ManageSiteDialogComponent, + SitesConfigurationComponent, SecurityAuthenticationConfigurationComponent, SecurityConfigurationComponent, SecurityUserConfigComponent, SecurityUserGroupConfigComponent, SecurityServiceConfigComponent, + SiteAreaConfigurationComponent, MessagingConfigurationComponent, DatalakeConfigurationComponent, SpConfigurationLinkSettingsComponent, diff --git a/ui/src/app/configuration/configuration.routes.ts b/ui/src/app/configuration/configuration.routes.ts index 14ac644c49..83500ea14d 100644 --- a/ui/src/app/configuration/configuration.routes.ts +++ b/ui/src/app/configuration/configuration.routes.ts @@ -19,6 +19,5 @@ import { SpBreadcrumbItem } from '@streampipes/shared-ui'; export class SpConfigurationRoutes { - static CONFIGURATION_BASE_LINK = 'configuration'; static BASE: SpBreadcrumbItem = { label: 'Configuration' }; } diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.html b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.html new file mode 100644 index 0000000000..ad0392c3e0 --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.html @@ -0,0 +1,68 @@ + + +
+
+
{{ area }}
+
+ +
+
+
+
No areas defined yet.
+
+
+
+ + + +
+
+ +
+
+
diff --git a/ui/cypress/support/utils/configuration/ConfigutationUtils.ts b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss similarity index 83% rename from ui/cypress/support/utils/configuration/ConfigutationUtils.ts rename to ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss index 44731e6e4f..ccbab50832 100644 --- a/ui/cypress/support/utils/configuration/ConfigutationUtils.ts +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss @@ -1,4 +1,4 @@ -/* +/*! * 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. @@ -16,8 +16,13 @@ * */ -export class ConfigurationUtils { - public static goToConfigurationExport() { - cy.visit('#/configuration/export'); - } +.no-areas-defined { + margin-top: 5px; + margin-bottom: 5px; + font-size: smaller; +} + +.area { + padding: 5px; + border: 1px solid var(--color-bg-2); } diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.ts b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.ts new file mode 100644 index 0000000000..ddd7baab40 --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.ts @@ -0,0 +1,40 @@ +/* + * 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 { Component, Input } from '@angular/core'; +import { AssetSiteDesc } from '@streampipes/platform-services'; + +@Component({ + selector: 'sp-edit-asset-location-area-component', + templateUrl: './edit-location-area.component.html', + styleUrls: ['./edit-location-area.component.scss'], +}) +export class EditAssetLocationAreaComponent { + @Input() + site: AssetSiteDesc; + + newArea: string = ''; + + addNewArea(): void { + this.site.areas.push(this.newArea); + } + + removeArea(area: string): void { + this.site.areas.splice(this.site.areas.indexOf(area), 1); + } +} diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html new file mode 100644 index 0000000000..c4e7a5f9cb --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html @@ -0,0 +1,44 @@ + + +
+ + + + + + + + + +
diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts new file mode 100644 index 0000000000..750eabd46b --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts @@ -0,0 +1,30 @@ +/* + * 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 { Component, Input } from '@angular/core'; +import { AssetSiteDesc } from '@streampipes/platform-services'; + +@Component({ + selector: 'sp-edit-asset-location-component', + templateUrl: './edit-location.component.html', + styleUrls: ['./edit-location.component.scss'], +}) +export class EditAssetLocationComponent { + @Input() + site: AssetSiteDesc; +} diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html new file mode 100644 index 0000000000..2fc0c2e110 --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html @@ -0,0 +1,31 @@ +
+
+
+ + +
+
+ +
+ + +
+
diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.scss b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.scss new file mode 100644 index 0000000000..18577c0d5e --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.scss @@ -0,0 +1,35 @@ +/*! + * 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. + * + */ + +.location-selection-panel { + border-right: 1px solid var(--color-bg-2); +} + +.location { + padding: 15px; + border-bottom: 1px solid var(--color-bg-2); +} + +.location:hover { + background: var(--color-bg-2); + cursor: pointer; +} + +.add-location-button { + border-bottom: 1px solid var(--color-bg-3); +} diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts new file mode 100644 index 0000000000..c15d8e01cf --- /dev/null +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts @@ -0,0 +1,80 @@ +/* + * 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 { Component, Input, OnInit } from '@angular/core'; +import { DialogRef } from '@streampipes/shared-ui'; +import { + AssetSiteDesc, + GenericStorageService, +} from '@streampipes/platform-services'; +import { AssetConstants } from '../../../assets/constants/asset.constants'; + +@Component({ + selector: 'sp-manage-site-dialog-component', + templateUrl: './manage-site-dialog.component.html', + styleUrls: ['./manage-site-dialog.component.scss'], +}) +export class ManageSiteDialogComponent implements OnInit { + @Input() + site: AssetSiteDesc; + + clonedSite: AssetSiteDesc; + createMode = false; + + constructor( + private dialogRef: DialogRef, + private genericStorageService: GenericStorageService, + ) {} + + ngOnInit(): void { + if (this.site !== undefined) { + this.clonedSite = JSON.parse(JSON.stringify(this.site)); + } else { + this.initializeNewSite(); + } + } + + close(emitReload = false): void { + this.dialogRef.close(emitReload); + } + + initializeNewSite(): void { + this.clonedSite = { + appDocType: AssetConstants.ASSET_SITES_APP_DOC_NAME, + _id: undefined, + label: 'New site', + location: { latitude: 0, longitude: 0 }, + areas: [], + }; + this.createMode = true; + } + + store(): void { + console.log(this.clonedSite); + const observable = this.createMode + ? this.genericStorageService.createDocument( + AssetConstants.ASSET_SITES_APP_DOC_NAME, + this.clonedSite, + ) + : this.genericStorageService.updateDocument( + AssetConstants.ASSET_SITES_APP_DOC_NAME, + this.clonedSite, + ); + observable.subscribe(res => this.close(true)); + } +} diff --git a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html new file mode 100644 index 0000000000..1ea40f2869 --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html @@ -0,0 +1,67 @@ + + +
+
+ + Enable geo features + +
+
+ Tile server URL (use placeholders for x, y +
+ + + +
+
+ +
+ +
+
+
+
diff --git a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts new file mode 100644 index 0000000000..7acfaeb750 --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts @@ -0,0 +1,105 @@ +/* + * 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 { Component, OnDestroy, OnInit } from '@angular/core'; +import { + UntypedFormBuilder, + UntypedFormControl, + UntypedFormGroup, + Validators, +} from '@angular/forms'; +import { + LocationConfig, + LocationConfigService, +} from '@streampipes/platform-services'; +import { Subscription } from 'rxjs'; +import { MatSnackBar } from '@angular/material/snack-bar'; + +@Component({ + selector: 'sp-location-features-configuration', + templateUrl: './location-features-configuration.component.html', +}) +export class LocationFeaturesConfigurationComponent + implements OnInit, OnDestroy +{ + locationConfig: LocationConfig; + + parentForm: UntypedFormGroup; + formSubscription: Subscription; + showTileUrlInput = false; + + constructor( + private fb: UntypedFormBuilder, + private snackBar: MatSnackBar, + private locationConfigService: LocationConfigService, + ) {} + + ngOnInit(): void { + this.parentForm = this.fb.group({}); + this.locationConfigService.getLocationConfig().subscribe(res => { + this.locationConfig = res; + this.showTileUrlInput = res.locationEnabled; + this.parentForm.addControl( + 'locationFeaturesEnabled', + new UntypedFormControl(this.locationConfig.locationEnabled), + ); + this.parentForm.addControl( + 'tileServerUrl', + new UntypedFormControl( + this.locationConfig.tileServerUrl, + this.showTileUrlInput ? Validators.required : [], + ), + ); + this.formSubscription = this.parentForm + .get('locationFeaturesEnabled') + .valueChanges.subscribe(checked => { + this.showTileUrlInput = checked; + if (checked) { + this.parentForm.controls.tileServerUrl.setValidators( + Validators.required, + ); + } else { + this.parentForm.controls.tileServerUrl.setValidators( + [], + ); + } + }); + }); + } + + save(): void { + this.locationConfig.locationEnabled = this.parentForm.get( + 'locationFeaturesEnabled', + ).value; + if (this.locationConfig.locationEnabled) { + this.locationConfig.tileServerUrl = + this.parentForm.get('tileServerUrl').value; + } + this.locationConfigService + .updateLocationConfig(this.locationConfig) + .subscribe(() => { + this.snackBar.open('Location configuration updated', 'Ok', { + duration: 3000, + }); + }); + } + + ngOnDestroy() { + this.formSubscription?.unsubscribe(); + } +} diff --git a/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.html b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.html new file mode 100644 index 0000000000..c7705c3c93 --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.html @@ -0,0 +1,80 @@ + + + +
+ +
+ + + Site + + {{ site.label }} + + + + Areas + + {{ site.areas.toString() }} + + + + + +
+ + +
+ +
+
+
diff --git a/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts new file mode 100644 index 0000000000..fdecc2259f --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts @@ -0,0 +1,83 @@ +/* + * 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 { Component, OnInit } from '@angular/core'; +import { + AssetSiteDesc, + GenericStorageService, +} from '@streampipes/platform-services'; +import { AssetConstants } from '../../../assets/constants/asset.constants'; +import { MatTableDataSource } from '@angular/material/table'; +import { ManageSiteDialogComponent } from '../../dialog/manage-site/manage-site-dialog.component'; +import { DialogService, PanelType } from '@streampipes/shared-ui'; + +@Component({ + selector: 'sp-site-area-configuration', + templateUrl: './site-area-configuration.component.html', +}) +export class SiteAreaConfigurationComponent implements OnInit { + allSites: AssetSiteDesc[] = []; + dataSource: MatTableDataSource = + new MatTableDataSource(); + displayedColumns = ['name', 'areas', 'actions']; + + constructor( + private genericStorageService: GenericStorageService, + private dialogService: DialogService, + ) {} + + ngOnInit() { + this.loadSites(); + } + + loadSites(): void { + this.genericStorageService + .getAllDocuments(AssetConstants.ASSET_SITES_APP_DOC_NAME) + .subscribe(res => { + this.allSites = res; + this.dataSource.data = this.allSites; + }); + } + + deleteSite(site: AssetSiteDesc): void { + this.genericStorageService + .deleteDocument( + AssetConstants.ASSET_SITES_APP_DOC_NAME, + site._id, + site._rev, + ) + .subscribe(() => this.loadSites()); + } + + openManageSitesDialog(site: AssetSiteDesc): void { + const dialogRef = this.dialogService.open(ManageSiteDialogComponent, { + panelType: PanelType.SLIDE_IN_PANEL, + title: 'Manage site', + width: '50vw', + data: { + site, + }, + }); + + dialogRef.afterClosed().subscribe(reload => { + if (reload) { + this.loadSites(); + } + }); + } +} diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.html b/ui/src/app/configuration/sites-configuration/sites-configuration.component.html new file mode 100644 index 0000000000..05a204d305 --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/sites-configuration.component.html @@ -0,0 +1,23 @@ + + + + + + + diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.scss b/ui/src/app/configuration/sites-configuration/sites-configuration.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts new file mode 100644 index 0000000000..7254d234e1 --- /dev/null +++ b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts @@ -0,0 +1,29 @@ +/* + * 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 { Component } from '@angular/core'; +import { SpConfigurationTabs } from '../configuration-tabs'; + +@Component({ + selector: 'sp-sites-configuration', + templateUrl: './sites-configuration.component.html', + styleUrls: ['./sites-configuration.component.scss'], +}) +export class SitesConfigurationComponent { + tabs = SpConfigurationTabs.getTabs(); +} From a5a44f2a4a19dd4a686a8f2f6978699d71ed748a Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Wed, 14 Aug 2024 21:29:08 +0200 Subject: [PATCH 2/6] Add headers --- .../asset-details-site.component.scss | 17 +++++++++++++++++ .../asset-location.component.html | 17 +++++++++++++++++ .../asset-location.component.scss | 17 +++++++++++++++++ .../edit-location/edit-location.component.scss | 0 .../edit-location/edit-location.component.ts | 1 - .../manage-site-dialog.component.html | 18 ++++++++++++++++++ .../sites-configuration.component.scss | 0 .../sites-configuration.component.ts | 1 - 8 files changed, 69 insertions(+), 2 deletions(-) delete mode 100644 ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss delete mode 100644 ui/src/app/configuration/sites-configuration/sites-configuration.component.scss diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss index e69de29bb2..e280dd74d5 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss @@ -0,0 +1,17 @@ +/*! + * 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. + * + */ diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html index e69de29bb2..fb99b649e5 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html @@ -0,0 +1,17 @@ + diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss index e69de29bb2..e280dd74d5 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss @@ -0,0 +1,17 @@ +/*! + * 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. + * + */ diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts index 750eabd46b..0d6b872567 100644 --- a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts @@ -22,7 +22,6 @@ import { AssetSiteDesc } from '@streampipes/platform-services'; @Component({ selector: 'sp-edit-asset-location-component', templateUrl: './edit-location.component.html', - styleUrls: ['./edit-location.component.scss'], }) export class EditAssetLocationComponent { @Input() diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html index 2fc0c2e110..f18719228b 100644 --- a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html @@ -1,3 +1,21 @@ + +
diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.scss b/ui/src/app/configuration/sites-configuration/sites-configuration.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts index 7254d234e1..4cd37541e4 100644 --- a/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts +++ b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts @@ -22,7 +22,6 @@ import { SpConfigurationTabs } from '../configuration-tabs'; @Component({ selector: 'sp-sites-configuration', templateUrl: './sites-configuration.component.html', - styleUrls: ['./sites-configuration.component.scss'], }) export class SitesConfigurationComponent { tabs = SpConfigurationTabs.getTabs(); From e0774710f926e3c21fa7a345f31c94ec3188b6ae Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Wed, 14 Aug 2024 21:37:12 +0200 Subject: [PATCH 3/6] Fix import --- .../src/lib/apis/location-config.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts b/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts index f69cf16f64..d07e8b8e13 100644 --- a/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts +++ b/ui/projects/streampipes/platform-services/src/lib/apis/location-config.service.ts @@ -18,12 +18,10 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { - LocationConfig, - PlatformServicesCommons, -} from '@streampipes/platform-services'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { PlatformServicesCommons } from './commons.service'; +import { LocationConfig } from '../model/gen/streampipes-model'; @Injectable({ providedIn: 'root', From c8e56b9353deeadd98fa79f66fc1ed53310fc45d Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Fri, 16 Aug 2024 08:59:48 +0200 Subject: [PATCH 4/6] feat: Show asset location on map --- .../model/configuration/LocationConfig.java | 3 +- .../configuration/SpCoreConfiguration.java | 2 +- .../src/lib/model/assets/asset.model.ts | 15 +- .../src/lib/model/gen/streampipes-model.ts | 4 +- .../asset-details-basics.component.html | 10 +- .../asset-details-basics.component.ts | 4 +- .../asset-details-labels.component.ts | 2 +- .../asset-details-site.component.html | 13 +- .../asset-details-site.component.scss | 17 --- .../asset-details-site.component.ts | 15 +- .../asset-location.component.html | 17 +++ .../asset-location.component.scss | 17 --- .../asset-location.component.ts | 34 ++++- .../asset-details-links.component.html | 4 +- .../asset-details-links.component.ts | 2 +- .../asset-link-item.component.ts | 2 +- .../asset-link-section.component.html | 4 +- .../asset-link-section.component.ts | 2 +- .../asset-details-panel.component.html | 10 +- .../asset-details-panel.component.ts | 4 +- .../asset-details.component.html | 10 +- .../asset-details/asset-details.component.ts | 6 +- .../asset-selection-panel.component.ts | 2 +- .../asset-overview.component.ts | 2 +- .../edit-location-area.component.scss | 2 +- .../edit-location.component.html | 15 ++ .../edit-location/edit-location.component.ts | 5 +- .../manage-site-dialog.component.html | 5 +- .../manage-site-dialog.component.ts | 7 +- ...tion-features-configuration.component.html | 24 +++- ...cation-features-configuration.component.ts | 72 +++++----- .../site-area-configuration.component.ts | 7 +- .../sites-configuration.component.html | 8 +- .../sites-configuration.component.ts | 18 ++- ui/src/app/core-ui/core-ui.module.ts | 5 + .../single-marker-map.component.html | 29 ++++ .../single-marker-map.component.scss | 0 .../single-marker-map.component.ts | 130 ++++++++++++++++++ 38 files changed, 392 insertions(+), 136 deletions(-) delete mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss delete mode 100644 ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss create mode 100644 ui/src/app/core-ui/single-marker-map/single-marker-map.component.html create mode 100644 ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss create mode 100644 ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java index fe7bc35c60..573e9abe70 100644 --- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java +++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/LocationConfig.java @@ -22,4 +22,5 @@ @TsModel public record LocationConfig(boolean locationEnabled, - String tileServerUrl) {} + String tileServerUrl, + String attributionText) {} diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java index 5c04e6b1c7..b5766bd3f6 100644 --- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java +++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java @@ -41,7 +41,7 @@ public class SpCoreConfiguration { private String filesDir; public SpCoreConfiguration() { - this.locationConfig = new LocationConfig(false, ""); + this.locationConfig = new LocationConfig(false, "", ""); } public String getRev() { diff --git a/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts b/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts index 1f353ed9c2..084b874214 100644 --- a/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts +++ b/ui/projects/streampipes/platform-services/src/lib/model/assets/asset.model.ts @@ -48,12 +48,17 @@ export interface Isa95TypeDesc { type: Isa95Type; } +export interface AssetLocation { + coordinates: LatLng; + zoom?: number; +} + export interface AssetSiteDesc { _id: string; _rev?: string; appDocType: string; label: string; - location: LatLng; + location?: AssetLocation; areas: string[]; } @@ -62,11 +67,11 @@ export interface LatLng { longitude: number; } -export interface AssetLocation { +export interface AssetSite { siteId: string; area: string; - exactLocation?: LatLng; - zoom?: number; + hasExactLocation: boolean; + location?: AssetLocation; } export interface SpAsset { @@ -76,7 +81,7 @@ export interface SpAsset { assetType: AssetType; labelIds?: string[]; assetLinks: AssetLink[]; - assetLocation?: AssetLocation; + assetSite?: AssetSite; assets: SpAsset[]; } diff --git a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts index b48be6e884..59568c24a9 100644 --- a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts +++ b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts @@ -20,7 +20,7 @@ /* tslint:disable */ /* eslint-disable */ // @ts-nocheck -// Generated using typescript-generator version 3.2.1263 on 2024-08-14 12:45:11. +// Generated using typescript-generator version 3.2.1263 on 2024-08-15 17:36:05. export class NamedStreamPipesEntity implements Storable { '@class': @@ -2137,6 +2137,7 @@ export class ListOutputStrategy extends OutputStrategy { } export class LocationConfig { + attributionText: string; locationEnabled: boolean; tileServerUrl: string; @@ -2148,6 +2149,7 @@ export class LocationConfig { return data; } const instance = target || new LocationConfig(); + instance.attributionText = data.attributionText; instance.locationEnabled = data.locationEnabled; instance.tileServerUrl = data.tileServerUrl; return instance; diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html index 9d427ea958..0cc81d4e70 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.html @@ -100,12 +100,12 @@ label="Labels" description="Assign additional labels to better discover your assets" > - - + - - +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts index beb0405276..7315d5e4c4 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-basics.component.ts @@ -31,7 +31,7 @@ import { } from '@streampipes/platform-services'; @Component({ - selector: 'sp-asset-details-basics-component', + selector: 'sp-asset-details-basics', templateUrl: './asset-details-basics.component.html', styleUrls: ['./asset-details-basics.component.scss'], }) @@ -46,7 +46,7 @@ export class AssetDetailsBasicsComponent implements OnInit, OnChanges { rootNode: boolean; @Input() - locations: AssetSiteDesc[]; + sites: AssetSiteDesc[]; isa95Types: Isa95TypeDesc[] = []; diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts index 445072cf5d..b26fbcde6a 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts @@ -39,7 +39,7 @@ import { map, startWith } from 'rxjs/operators'; import { SpColorizationService } from '@streampipes/shared-ui'; @Component({ - selector: 'sp-asset-details-labels-component', + selector: 'sp-asset-details-labels', templateUrl: './asset-details-labels.component.html', }) export class AssetDetailsLabelsComponent implements OnInit, OnChanges { diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html index 37fc98499a..5b0c819560 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.html @@ -20,20 +20,27 @@ Site - + {{ site.label }} Area - + {{ area }} + +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss deleted file mode 100644 index e280dd74d5..0000000000 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.scss +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * 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. - * - */ diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts index 085bbb2d42..50988ff75a 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-details-site.component.ts @@ -21,7 +21,7 @@ import { AssetSiteDesc, SpAsset } from '@streampipes/platform-services'; import { MatSelectChange } from '@angular/material/select'; @Component({ - selector: 'sp-asset-details-site-component', + selector: 'sp-asset-details-site', templateUrl: './asset-details-site.component.html', }) export class AssetDetailsSiteComponent implements OnChanges { @@ -32,7 +32,7 @@ export class AssetDetailsSiteComponent implements OnChanges { editMode: boolean; @Input() - allSites: AssetSiteDesc[]; + sites: AssetSiteDesc[]; currentSite: AssetSiteDesc; @@ -40,13 +40,14 @@ export class AssetDetailsSiteComponent implements OnChanges { ngOnChanges(changes: SimpleChanges) { if (changes['asset']) { - this.asset.assetLocation ??= { + this.asset.assetSite ??= { area: undefined, siteId: undefined, + hasExactLocation: false, }; - if (this.allSites.length > 0) { - if (this.asset.assetLocation.siteId !== undefined) { - this.selectCurrentSite(this.asset.assetLocation.siteId); + if (this.sites.length > 0) { + if (this.asset.assetSite.siteId !== undefined) { + this.selectCurrentSite(this.asset.assetSite.siteId); } } } @@ -57,6 +58,6 @@ export class AssetDetailsSiteComponent implements OnChanges { } selectCurrentSite(siteId: string): void { - this.currentSite = this.allSites.find(loc => loc._id === siteId); + this.currentSite = this.sites.find(loc => loc._id === siteId); } } diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html index fb99b649e5..64443f8483 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.html @@ -15,3 +15,20 @@ ~ limitations under the License. ~ --> + +
+ + Add exact location + +
+ + +
+
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss deleted file mode 100644 index e280dd74d5..0000000000 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.scss +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * 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. - * - */ diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts index 51e0050bae..f0a7f7efe3 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-basics/asset-details-site/asset-location/asset-location.component.ts @@ -16,10 +16,38 @@ * */ -import { Component } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { + LocationConfig, + LocationConfigService, + SpAsset, +} from '@streampipes/platform-services'; @Component({ - selector: 'sp-asset-location-component', + selector: 'sp-asset-location', templateUrl: './asset-location.component.html', }) -export class AssetLocationComponent {} +export class AssetLocationComponent implements OnInit { + @Input() + asset: SpAsset; + + @Input() + editMode: boolean; + + locationConfig: LocationConfig; + + constructor(private locationConfigService: LocationConfigService) {} + + ngOnInit() { + this.asset.assetSite.location ??= { + coordinates: { + latitude: 0, + longitude: 0, + }, + zoom: 1, + }; + this.locationConfigService + .getLocationConfig() + .subscribe(res => (this.locationConfig = res)); + } +} diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.html index 10795c7ac6..bb5d58a2bc 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.html @@ -50,7 +50,7 @@ class="mt-10" >
- - +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.ts index c56cf74786..b9baa36975 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-details-links.component.ts @@ -29,7 +29,7 @@ import { EditAssetLinkDialogComponent } from '../../../../dialog/edit-asset-link import { AssetConstants } from '../../../../constants/asset.constants'; @Component({ - selector: 'sp-asset-details-links-component', + selector: 'sp-asset-details-links', templateUrl: './asset-details-links.component.html', }) export class AssetDetailsLinksComponent implements OnInit { diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts index 34825aba31..46eda1e238 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-item/asset-link-item.component.ts @@ -21,7 +21,7 @@ import { AssetLink, AssetLinkType } from '@streampipes/platform-services'; import { Router } from '@angular/router'; @Component({ - selector: 'sp-asset-link-item-component', + selector: 'sp-asset-link-item', templateUrl: './asset-link-item.component.html', styleUrls: ['./asset-link-item.component.scss'], }) diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.html index d5e20ef909..8d936f3f62 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.html @@ -27,7 +27,7 @@ | assetTypeFilter: assetLinkType.linkType " > - - + diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.ts index ebfe1055ff..f92f3a6287 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-links/asset-link-section/asset-link-section.component.ts @@ -24,7 +24,7 @@ import { } from '@streampipes/platform-services'; @Component({ - selector: 'sp-asset-link-section-component', + selector: 'sp-asset-link-section', templateUrl: './asset-link-section.component.html', styleUrls: ['./asset-link-section.component.scss'], }) diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html index 589babcbfb..0e95be38a9 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.html @@ -19,21 +19,21 @@
- - + - - +
diff --git a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts index e25a3c1afe..c4a7a55fc2 100644 --- a/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details-panel/asset-details-panel.component.ts @@ -20,7 +20,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { AssetSiteDesc, SpAsset } from '@streampipes/platform-services'; @Component({ - selector: 'sp-asset-details-panel-component', + selector: 'sp-asset-details-panel', templateUrl: './asset-details-panel.component.html', styleUrls: ['./asset-details-panel.component.scss'], }) @@ -35,7 +35,7 @@ export class SpAssetDetailsPanelComponent { rootNode: boolean; @Input() - locations: AssetSiteDesc[]; + sites: AssetSiteDesc[]; @Output() updateAssetEmitter: EventEmitter = new EventEmitter(); diff --git a/ui/src/app/assets/components/asset-details/asset-details.component.html b/ui/src/app/assets/components/asset-details/asset-details.component.html index 02d4ab506a..2e0928fd96 100644 --- a/ui/src/app/assets/components/asset-details/asset-details.component.html +++ b/ui/src/app/assets/components/asset-details/asset-details.component.html @@ -51,27 +51,27 @@ class="asset-tree-panel" >
- - +
- - + diff --git a/ui/src/app/assets/components/asset-details/asset-details.component.ts b/ui/src/app/assets/components/asset-details/asset-details.component.ts index b0c8a1682d..cbb53dc398 100644 --- a/ui/src/app/assets/components/asset-details/asset-details.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-details.component.ts @@ -30,13 +30,13 @@ import { SpAssetRoutes } from '../../assets.routes'; import { zip } from 'rxjs'; @Component({ - selector: 'sp-asset-details-component', + selector: 'sp-asset-details', templateUrl: './asset-details.component.html', styleUrls: ['./asset-details.component.scss'], }) export class SpAssetDetailsComponent implements OnInit { asset: SpAssetModel; - locations: AssetSiteDesc[] = []; + sites: AssetSiteDesc[] = []; selectedAsset: SpAsset; rootNode = true; @@ -67,7 +67,7 @@ export class SpAssetDetailsComponent implements OnInit { ); zip([assetReq, locationsReq]).subscribe(res => { this.asset = res[0]; - this.locations = res[1]; + this.sites = res[1]; if (!this.selectedAsset) { this.selectedAsset = this.asset; } diff --git a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts index 14fe8d1511..80674a89ed 100644 --- a/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts +++ b/ui/src/app/assets/components/asset-details/asset-selection-panel/asset-selection-panel.component.ts @@ -29,7 +29,7 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { MatTreeNestedDataSource } from '@angular/material/tree'; @Component({ - selector: 'sp-asset-selection-panel-component', + selector: 'sp-asset-selection-panel', templateUrl: './asset-selection-panel.component.html', styleUrls: ['./asset-selection-panel.component.scss'], }) diff --git a/ui/src/app/assets/components/asset-overview/asset-overview.component.ts b/ui/src/app/assets/components/asset-overview/asset-overview.component.ts index ba13abcf04..956c37fb0a 100644 --- a/ui/src/app/assets/components/asset-overview/asset-overview.component.ts +++ b/ui/src/app/assets/components/asset-overview/asset-overview.component.ts @@ -38,7 +38,7 @@ import { saveAs } from 'file-saver'; import { IdGeneratorService } from '../../../core-services/id-generator/id-generator.service'; @Component({ - selector: 'sp-asset-overview-component', + selector: 'sp-asset-overview', templateUrl: './asset-overview.component.html', styleUrls: ['./asset-overview.component.scss'], }) diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss index ccbab50832..d1743a813a 100644 --- a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location-area/edit-location-area.component.scss @@ -24,5 +24,5 @@ .area { padding: 5px; - border: 1px solid var(--color-bg-2); + font-weight: bold; } diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html index c4e7a5f9cb..0c24fba58f 100644 --- a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.html @@ -41,4 +41,19 @@ + + + + diff --git a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts index 0d6b872567..9b1bc554c9 100644 --- a/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts +++ b/ui/src/app/configuration/dialog/manage-site/edit-location/edit-location.component.ts @@ -17,7 +17,7 @@ */ import { Component, Input } from '@angular/core'; -import { AssetSiteDesc } from '@streampipes/platform-services'; +import { AssetSiteDesc, LocationConfig } from '@streampipes/platform-services'; @Component({ selector: 'sp-edit-asset-location-component', @@ -26,4 +26,7 @@ import { AssetSiteDesc } from '@streampipes/platform-services'; export class EditAssetLocationComponent { @Input() site: AssetSiteDesc; + + @Input() + locationConfig: LocationConfig; } diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html index f18719228b..5cff55e084 100644 --- a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.html @@ -19,7 +19,10 @@
- +
diff --git a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts index c15d8e01cf..0c69f44770 100644 --- a/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts +++ b/ui/src/app/configuration/dialog/manage-site/manage-site-dialog.component.ts @@ -21,6 +21,7 @@ import { DialogRef } from '@streampipes/shared-ui'; import { AssetSiteDesc, GenericStorageService, + LocationConfig, } from '@streampipes/platform-services'; import { AssetConstants } from '../../../assets/constants/asset.constants'; @@ -33,6 +34,9 @@ export class ManageSiteDialogComponent implements OnInit { @Input() site: AssetSiteDesc; + @Input() + locationConfig: LocationConfig; + clonedSite: AssetSiteDesc; createMode = false; @@ -58,14 +62,13 @@ export class ManageSiteDialogComponent implements OnInit { appDocType: AssetConstants.ASSET_SITES_APP_DOC_NAME, _id: undefined, label: 'New site', - location: { latitude: 0, longitude: 0 }, + location: { coordinates: { latitude: 0, longitude: 0 } }, areas: [], }; this.createMode = true; } store(): void { - console.log(this.clonedSite); const observable = this.createMode ? this.genericStorageService.createDocument( AssetConstants.ASSET_SITES_APP_DOC_NAME, diff --git a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html index 1ea40f2869..eb6e28df23 100644 --- a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html +++ b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.html @@ -18,7 +18,7 @@
Enable geo features -
+
- Tile server URL (use placeholders for x, y + Tile server URL (use placeholders for x, y and z + coordinates)
+
+ Attribution text if required by the tile server +
+ + +
@@ -56,7 +72,7 @@ mat-raised-button color="accent" data-cy="sites-location-features-button" - [disabled]="!parentForm.valid" + [disabled]="!locationForm.valid" (click)="save()" > Save diff --git a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts index 7acfaeb750..9e878f9a30 100644 --- a/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts +++ b/ui/src/app/configuration/sites-configuration/location-features-configuration/location-features-configuration.component.ts @@ -16,7 +16,7 @@ * */ -import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { UntypedFormBuilder, UntypedFormControl, @@ -37,11 +37,12 @@ import { MatSnackBar } from '@angular/material/snack-bar'; export class LocationFeaturesConfigurationComponent implements OnInit, OnDestroy { + @Input() locationConfig: LocationConfig; - parentForm: UntypedFormGroup; + locationForm: UntypedFormGroup; formSubscription: Subscription; - showTileUrlInput = false; + showLocationDetails = false; constructor( private fb: UntypedFormBuilder, @@ -50,45 +51,46 @@ export class LocationFeaturesConfigurationComponent ) {} ngOnInit(): void { - this.parentForm = this.fb.group({}); - this.locationConfigService.getLocationConfig().subscribe(res => { - this.locationConfig = res; - this.showTileUrlInput = res.locationEnabled; - this.parentForm.addControl( - 'locationFeaturesEnabled', - new UntypedFormControl(this.locationConfig.locationEnabled), - ); - this.parentForm.addControl( - 'tileServerUrl', - new UntypedFormControl( - this.locationConfig.tileServerUrl, - this.showTileUrlInput ? Validators.required : [], - ), - ); - this.formSubscription = this.parentForm - .get('locationFeaturesEnabled') - .valueChanges.subscribe(checked => { - this.showTileUrlInput = checked; - if (checked) { - this.parentForm.controls.tileServerUrl.setValidators( - Validators.required, - ); - } else { - this.parentForm.controls.tileServerUrl.setValidators( - [], - ); - } - }); - }); + this.locationForm = this.fb.group({}); + this.showLocationDetails = this.locationConfig.locationEnabled; + this.locationForm.addControl( + 'locationFeaturesEnabled', + new UntypedFormControl(this.locationConfig.locationEnabled), + ); + this.locationForm.addControl( + 'tileServerUrl', + new UntypedFormControl( + this.locationConfig.tileServerUrl, + this.showLocationDetails ? Validators.required : [], + ), + ); + this.locationForm.addControl( + 'attributionText', + new UntypedFormControl(this.locationConfig.attributionText || ''), + ); + this.formSubscription = this.locationForm + .get('locationFeaturesEnabled') + .valueChanges.subscribe(checked => { + this.showLocationDetails = checked; + if (checked) { + this.locationForm.controls.tileServerUrl.setValidators( + Validators.required, + ); + } else { + this.locationForm.controls.tileServerUrl.setValidators([]); + } + }); } save(): void { - this.locationConfig.locationEnabled = this.parentForm.get( + this.locationConfig.locationEnabled = this.locationForm.get( 'locationFeaturesEnabled', ).value; if (this.locationConfig.locationEnabled) { this.locationConfig.tileServerUrl = - this.parentForm.get('tileServerUrl').value; + this.locationForm.get('tileServerUrl').value; + this.locationConfig.attributionText = + this.locationForm.get('attributionText').value; } this.locationConfigService .updateLocationConfig(this.locationConfig) diff --git a/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts index fdecc2259f..d0de6e25e9 100644 --- a/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts +++ b/ui/src/app/configuration/sites-configuration/site-area-configuration/site-area-configuration.component.ts @@ -16,10 +16,11 @@ * */ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { AssetSiteDesc, GenericStorageService, + LocationConfig, } from '@streampipes/platform-services'; import { AssetConstants } from '../../../assets/constants/asset.constants'; import { MatTableDataSource } from '@angular/material/table'; @@ -31,6 +32,9 @@ import { DialogService, PanelType } from '@streampipes/shared-ui'; templateUrl: './site-area-configuration.component.html', }) export class SiteAreaConfigurationComponent implements OnInit { + @Input() + locationConfig: LocationConfig; + allSites: AssetSiteDesc[] = []; dataSource: MatTableDataSource = new MatTableDataSource(); @@ -71,6 +75,7 @@ export class SiteAreaConfigurationComponent implements OnInit { width: '50vw', data: { site, + locationConfig: this.locationConfig, }, }); diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.html b/ui/src/app/configuration/sites-configuration/sites-configuration.component.html index 05a204d305..939208cfb5 100644 --- a/ui/src/app/configuration/sites-configuration/sites-configuration.component.html +++ b/ui/src/app/configuration/sites-configuration/sites-configuration.component.html @@ -17,7 +17,11 @@ --> - +
+ + - + + +
diff --git a/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts index 4cd37541e4..2f26fe2b32 100644 --- a/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts +++ b/ui/src/app/configuration/sites-configuration/sites-configuration.component.ts @@ -16,13 +16,27 @@ * */ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { SpConfigurationTabs } from '../configuration-tabs'; +import { + LocationConfig, + LocationConfigService, +} from '@streampipes/platform-services'; @Component({ selector: 'sp-sites-configuration', templateUrl: './sites-configuration.component.html', }) -export class SitesConfigurationComponent { +export class SitesConfigurationComponent implements OnInit { tabs = SpConfigurationTabs.getTabs(); + + locationConfig: LocationConfig; + + constructor(private locationConfigService: LocationConfigService) {} + + ngOnInit() { + this.locationConfigService.getLocationConfig().subscribe(res => { + this.locationConfig = res; + }); + } } diff --git a/ui/src/app/core-ui/core-ui.module.ts b/ui/src/app/core-ui/core-ui.module.ts index 8b589c4b18..c981d2f32b 100644 --- a/ui/src/app/core-ui/core-ui.module.ts +++ b/ui/src/app/core-ui/core-ui.module.ts @@ -113,6 +113,8 @@ import { StaticTreeInputButtonMenuComponent } from './static-properties/static-r import { StaticTreeInputSelectedNodesComponent } from './static-properties/static-runtime-resolvable-tree-input/static-tree-input-selected-nodes/static-tree-input-selected-nodes.component'; import { StaticTreeInputBrowseNodesComponent } from './static-properties/static-runtime-resolvable-tree-input/static-tree-input-browse-nodes/static-tree-input-browse-nodes.component'; import { StaticTreeInputNodeDetailsComponent } from './static-properties/static-runtime-resolvable-tree-input/static-tree-input-node-details/static-tree-input-node-details.component'; +import { SingleMarkerMapComponent } from './single-marker-map/single-marker-map.component'; +import { LeafletModule } from '@asymmetrik/ngx-leaflet'; @NgModule({ imports: [ @@ -162,6 +164,7 @@ import { StaticTreeInputNodeDetailsComponent } from './static-properties/static- QuillModule.forRoot(), MatTreeModule, MarkdownModule.forRoot(), + LeafletModule, ], declarations: [ DataDownloadDialogComponent, @@ -195,6 +198,7 @@ import { StaticTreeInputNodeDetailsComponent } from './static-properties/static- StaticTreeInputBrowseNodesComponent, StaticTreeInputNodeDetailsComponent, StaticSlideToggleComponent, + SingleMarkerMapComponent, ErrorHintComponent, AddToCollectionComponent, PipelineStartedStatusComponent, @@ -248,6 +252,7 @@ import { StaticTreeInputNodeDetailsComponent } from './static-properties/static- StatusIndicatorComponent, MultiStepStatusIndicatorComponent, PipelineOperationStatusComponent, + SingleMarkerMapComponent, ], }) export class CoreUiModule {} diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.html b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.html new file mode 100644 index 0000000000..921d108a40 --- /dev/null +++ b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.html @@ -0,0 +1,29 @@ + + +
+
+
diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts new file mode 100644 index 0000000000..f29f527443 --- /dev/null +++ b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts @@ -0,0 +1,130 @@ +/* + * 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 { Component, Input, OnInit } from '@angular/core'; +import { + icon, + Layer, + LeafletMouseEvent, + Map, + MapOptions, + marker, + Marker, + tileLayer, +} from 'leaflet'; +import { + AssetLocation, + LatLng, + LocationConfig, +} from '@streampipes/platform-services'; + +@Component({ + selector: 'sp-single-marker-map', + templateUrl: './single-marker-map.component.html', + styleUrls: ['./single-marker-map.component.scss'], +}) +export class SingleMarkerMapComponent implements OnInit { + @Input() + locationConfig: LocationConfig; + + @Input() + assetLocation: AssetLocation; + + @Input() + mapHeight: number = 400; + + @Input() + readonly = false; + + map: Map; + mapOptions: MapOptions; + layers: Layer[]; + marker: Marker; + + ngOnInit() { + this.assetLocation ??= { + coordinates: { + latitude: 0, + longitude: 0, + }, + zoom: 1, + }; + this.mapOptions = { + layers: [ + tileLayer(this.locationConfig.tileServerUrl, { + maxZoom: 18, + attribution: this.locationConfig.attributionText, + }), + ], + zoom: this.assetLocation.zoom || 1, + center: { + lat: this.assetLocation.coordinates.latitude, + lng: this.assetLocation.coordinates.longitude, + }, + }; + } + + makeMarker(location: LatLng): Marker { + return marker( + { lat: location.latitude, lng: location.longitude }, + { + icon: icon({ + iconSize: [25, 41], + iconAnchor: [13, 41], + iconUrl: 'assets/img/marker-icon.png', + shadowUrl: 'assets/img/marker-shadow.png', + }), + }, + ); + } + + onMapReady(map: Map) { + this.map = map; + this.map.attributionControl.setPrefix(''); + this.map.invalidateSize(); + this.addMarker(this.assetLocation.coordinates); + } + + onZoomChange(zoom: number): void { + this.assetLocation.zoom = zoom; + } + + onMarkerAdded(e: LeafletMouseEvent) { + if (!this.readonly) { + this.addMarker({ + latitude: e.latlng.lat, + longitude: e.latlng.lng, + }); + } + } + + addMarker(location: LatLng): void { + if (location) { + if (!this.marker) { + this.marker = this.makeMarker(location); + this.marker.addTo(this.map); + } else { + this.marker.setLatLng({ + lat: location.latitude, + lng: location.longitude, + }); + } + this.assetLocation.coordinates = location; + } + } +} From 70ab6f96e5782b765207ce179914e68a46fc18ce Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Fri, 16 Aug 2024 09:04:46 +0200 Subject: [PATCH 5/6] Remove scss --- .../core-ui/single-marker-map/single-marker-map.component.scss | 0 .../core-ui/single-marker-map/single-marker-map.component.ts | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts index f29f527443..734c0e0a7a 100644 --- a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts +++ b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts @@ -35,8 +35,7 @@ import { @Component({ selector: 'sp-single-marker-map', - templateUrl: './single-marker-map.component.html', - styleUrls: ['./single-marker-map.component.scss'], + templateUrl: './single-marker-map.component.html' }) export class SingleMarkerMapComponent implements OnInit { @Input() From 635418779aed2c31b4cc6884e5a159367201d387 Mon Sep 17 00:00:00 2001 From: Dominik Riemer Date: Fri, 16 Aug 2024 09:15:39 +0200 Subject: [PATCH 6/6] Fix formatting --- .../core-ui/single-marker-map/single-marker-map.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts index 734c0e0a7a..ffeb12657b 100644 --- a/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts +++ b/ui/src/app/core-ui/single-marker-map/single-marker-map.component.ts @@ -35,7 +35,7 @@ import { @Component({ selector: 'sp-single-marker-map', - templateUrl: './single-marker-map.component.html' + templateUrl: './single-marker-map.component.html', }) export class SingleMarkerMapComponent implements OnInit { @Input()