From 3299f6bda2d35e8718c0d08446b89d677923cbcc Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Wed, 3 May 2023 11:39:52 +0530 Subject: [PATCH] chore(ui): add custom storage on UI (#11256) * chore(ui): add custom storage on UI * chore: change the custom storage icon * remove unused local key * chore: make custom service icon consistent. --- .../locales/en-US/Storage/CustomStorage.md | 1 + .../ui/src/assets/svg/ic-custom-database.svg | 29 +++++++++++++++++ .../ui/src/assets/svg/ic-custom-model.svg | 32 +++++++++++++++++++ .../ui/src/assets/svg/ic-custom-storage.svg | 23 +++++++++++++ .../ui/src/constants/Services.constant.ts | 7 ++-- .../ui/src/locale/languages/en-us.json | 3 +- .../ui/src/locale/languages/es-es.json | 3 +- .../ui/src/locale/languages/fr-fr.json | 3 +- .../ui/src/locale/languages/ja-jp.json | 3 +- .../ui/src/locale/languages/pt-br.json | 3 +- .../ui/src/locale/languages/zh-cn.json | 3 +- .../resources/ui/src/utils/ServiceUtils.tsx | 7 ++-- .../ui/src/utils/StorageServiceUtils.ts | 6 ++++ 13 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-database.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-model.svg create mode 100644 openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-storage.svg diff --git a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Storage/CustomStorage.md b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Storage/CustomStorage.md index ebd621f336b..884b8b52639 100644 --- a/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Storage/CustomStorage.md +++ b/openmetadata-ui/src/main/resources/ui/public/locales/en-US/Storage/CustomStorage.md @@ -14,6 +14,7 @@ $$section Source Python Class Name to instantiated by the ingestion workflow. Note that it should implement the `next_record` method so that the Workflow can keep reading and sending records to the OpenMetadata API. +$$ $$section ### Connection Options $(id="connectionOptions") diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-database.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-database.svg new file mode 100644 index 00000000000..cf8d4da1ae6 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-database.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-model.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-model.svg new file mode 100644 index 00000000000..b59d0875126 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-model.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-storage.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-storage.svg new file mode 100644 index 00000000000..63ab73f8144 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-custom-storage.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts index b9c279e2e3c..4de448f55a3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/Services.constant.ts @@ -39,7 +39,6 @@ import domo from '../assets/img/service-icon-domo.png'; import druid from '../assets/img/service-icon-druid.png'; import dynamodb from '../assets/img/service-icon-dynamodb.png'; import fivetran from '../assets/img/service-icon-fivetran.png'; -import databaseDefault from '../assets/img/service-icon-generic.png'; import glue from '../assets/img/service-icon-glue.png'; import hive from '../assets/img/service-icon-hive.png'; import ibmdb2 from '../assets/img/service-icon-ibmdb2.png'; @@ -77,6 +76,9 @@ import trino from '../assets/img/service-icon-trino.png'; import vertica from '../assets/img/service-icon-vertica.png'; import dashboardDefault from '../assets/svg/dashboard.svg'; import iconDefaultService from '../assets/svg/default-service-icon.svg'; +import databaseDefault from '../assets/svg/ic-custom-database.svg'; +import mlModelDefault from '../assets/svg/ic-custom-model.svg'; +import storageDefault from '../assets/svg/ic-custom-storage.svg'; import logo from '../assets/svg/logo-monogram.svg'; import pipelineDefault from '../assets/svg/pipeline.svg'; import plus from '../assets/svg/plus.svg'; @@ -153,7 +155,8 @@ export const DATABASE_DEFAULT = databaseDefault; export const TOPIC_DEFAULT = topicDefault; export const DASHBOARD_DEFAULT = dashboardDefault; export const PIPELINE_DEFAULT = pipelineDefault; -export const ML_MODEL_DEFAULT = mlflow; +export const ML_MODEL_DEFAULT = mlModelDefault; +export const CUSTOM_STORAGE_DEFAULT = storageDefault; export const NIFI = nifi; export const KINESIS = kinesis; export const QUICKSIGHT = quicksight; diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json index dee96be0c16..a3ff7d7587a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json @@ -1267,7 +1267,6 @@ "team-moved-success": "Team moved successfully!", "team-no-asset": "Your team does not have any assets.", "test-connection-cannot-be-triggered": "Test connection cannot be triggered.", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "The test connection is taking too long. Please try again.", "test-your-connection-before-creating-service": "Test your connections before creating the service", "testing-your-connection-may-take-two-minutes": "Testing your connections may take up-to 2 minutes", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}} updated successfully.", "you-have-not-action-anything-yet": "You have not {{action}} anything yet." } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json index f0495c48a2d..bfcbf2fff7d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/es-es.json @@ -1267,7 +1267,6 @@ "team-moved-success": "¡Equipo movido con éxito!", "team-no-asset": "Tu equipo no tiene ningún activo.", "test-connection-cannot-be-triggered": "No se puede iniciar la prueba de conexión.", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "La prueba de conexión está tardando demasiado. Por favor, inténtalo de nuevo.", "test-your-connection-before-creating-service": "Prueba la conexión antes de crear el servicio", "testing-your-connection-may-take-two-minutes": "Probar la conexión puede tardar hasta 2 minutos", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}} actualizado exitosamente.", "you-have-not-action-anything-yet": "Todavía no has {{action}} nada." } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json index d3d2fba9a33..35924f8bb46 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/fr-fr.json @@ -1267,7 +1267,6 @@ "team-moved-success": "L'équipe a été déplacée avec succès !", "team-no-asset": "Votre equipe n'a pas de resources de données", "test-connection-cannot-be-triggered": "Le test de connexion ne peut pas être déclenchée.", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "Le test de connexion prend trop de temps. Veuillez réessayer.", "test-your-connection-before-creating-service": "Tester la connexion avant de créer le service", "testing-your-connection-may-take-two-minutes": "Le test de votre connexion peut prendre jusqu'à 2 minutes", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}} mis à jour avec succès.", "you-have-not-action-anything-yet": "Vous n'avez encore rien {{action}}." } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json index a7a5d0eb0d2..d4817c82386 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/ja-jp.json @@ -1267,7 +1267,6 @@ "team-moved-success": "チームの移動が成功しました!", "team-no-asset": "あなたのチームはアセットを持っていません。", "test-connection-cannot-be-triggered": "Test connection cannot be triggered.", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "The test connection is taking too long. Please try again.", "test-your-connection-before-creating-service": "サービスを作成する前に接続テストをしてください。", "testing-your-connection-may-take-two-minutes": "Testing your connections may take up-to 2 minutes", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}}は正常に更新されました。", "you-have-not-action-anything-yet": "あなたが{{action}}のデータはありません。" } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json index f1d697ca4a0..b04d8941dd1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/pt-br.json @@ -1267,7 +1267,6 @@ "team-moved-success": "Time movido com sucesso!", "team-no-asset": "Seu time não possui nenhum ativo.", "test-connection-cannot-be-triggered": "Test connection cannot be triggered.", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "The test connection is taking too long. Please try again.", "test-your-connection-before-creating-service": "Teste suas conexões antes de criar o serviço", "testing-your-connection-may-take-two-minutes": "Testing your connections may take up-to 2 minutes", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}} atualizado com sucesso.", "you-have-not-action-anything-yet": "Você ainda não {{action}} nada." } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json index 9b70b1c041f..9b189385c7f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json +++ b/openmetadata-ui/src/main/resources/ui/src/locale/languages/zh-cn.json @@ -1267,7 +1267,6 @@ "team-moved-success": "团队移动成功", "team-no-asset": "您的团队没有任何资产", "test-connection-cannot-be-triggered": "连接测试无法被触发", - "test-connection-required-fields-error": "Please fill in all required fields before testing the connection", "test-connection-taking-too-long": "连接测试超时,请重新测试", "test-your-connection-before-creating-service": "在创建服务之前测试您的连接", "testing-your-connection-may-take-two-minutes": "连接测试可能最多需要2分钟", @@ -1382,4 +1381,4 @@ "update-entity-success": "{{entity}}已成功更新", "you-have-not-action-anything-yet": "您还没有{{action}}任何内容" } -} \ No newline at end of file +} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx index d7480188c55..4c209cfa273 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/ServiceUtils.tsx @@ -11,7 +11,6 @@ * limitations under the License. */ -import { ReactComponent as ContainerIcon } from 'assets/svg/ic-storage.svg'; import { AxiosError } from 'axios'; import { OperationPermission, @@ -48,6 +47,7 @@ import { AZURESQL, BIGQUERY, CLICKHOUSE, + CUSTOM_STORAGE_DEFAULT, DAGSTER, DASHBOARD_DEFAULT, DATABASE_DEFAULT, @@ -303,7 +303,7 @@ export const serviceTypeLogo = (type: string) => { } else if (serviceTypes.mlmodelServices.includes(type)) { logo = ML_MODEL_DEFAULT; } else if (serviceTypes.storageServices.includes(type)) { - logo = ContainerIcon; + logo = CUSTOM_STORAGE_DEFAULT; } else { logo = DEFAULT_SERVICE; } @@ -606,7 +606,8 @@ export const shouldTestConnection = (serviceType: string) => { serviceType !== MessagingServiceType.CustomMessaging && serviceType !== DashboardServiceType.CustomDashboard && serviceType !== MlModelServiceType.CustomMlModel && - serviceType !== PipelineServiceType.CustomPipeline + serviceType !== PipelineServiceType.CustomPipeline && + serviceType !== StorageServiceType.CustomStorage ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/StorageServiceUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/StorageServiceUtils.ts index 0f7de3d2294..93ead35ff10 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/StorageServiceUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/StorageServiceUtils.ts @@ -12,6 +12,7 @@ */ import { COMMON_UI_SCHEMA } from 'constants/Services.constant'; import { StorageServiceType } from 'generated/entity/data/container'; +import customConnection from 'jsons/connectionSchemas/connections/storage/customStorageConnection.json'; import s3Connection from 'jsons/connectionSchemas/connections/storage/s3Connection.json'; import { cloneDeep } from 'lodash'; @@ -22,6 +23,11 @@ export const getStorageServiceConfig = (type: StorageServiceType) => { case StorageServiceType.S3: { schema = s3Connection; + break; + } + case StorageServiceType.CustomStorage: { + schema = customConnection; + break; } }