mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 12:39:01 +00:00
Fix: Input Validation for minimum values for Search Index and Data insights (#21038)
* minimum field limit for config form * added negative number validation for form builder * localization file update * update minimum values for search config and data insights * update localization files * fix nested schema field validation for neggative numbers * revert nav-bar.less prettier changes * revert nav-bar.less file prettier changes * revert nav-bar.less prettier changes * minor code refactor * address sonar issue * address pr comments * minor code refactor * Update ingestionPipeline.ts * Update ingestionPipeline.ts
This commit is contained in:
parent
47c17180bd
commit
70aef3b104
@ -10,113 +10,112 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
@import (reference) '../../styles/variables.less';
|
||||
@import (reference) '../../styles/variables.less';
|
||||
|
||||
.navbar-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
> div {
|
||||
height: 40px;
|
||||
|
||||
.ant-input-wrapper.ant-input-group,
|
||||
.ant-input-affix-wrapper {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-container {
|
||||
width: 35vw;
|
||||
}
|
||||
|
||||
.app-user-icon {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
|
||||
.username {
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.domain-dropdown-menu {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.slide-in-top {
|
||||
animation: slide-in-top 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
||||
}
|
||||
|
||||
@keyframes slide-in-top {
|
||||
0% {
|
||||
transform: translate(-50%, 100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.ant-btn.domain-nav-btn {
|
||||
background-color: @white;
|
||||
border: 1px solid @grey-15;
|
||||
color: @text-color;
|
||||
height: 40px;
|
||||
|
||||
.domain-text {
|
||||
max-width: 15vw;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: @primary-button-background;
|
||||
border: 1px solid @alert-info-icon-bg-1;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
&.domain-active {
|
||||
color: @primary-color;
|
||||
border: 1px solid @primary-color;
|
||||
background-color: @primary-button-background;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-alert.ant-alert-info.refresh-alert {
|
||||
width: 470px;
|
||||
bottom: 30px;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.12);
|
||||
border-radius: 10px;
|
||||
border: 1px solid @text-color;
|
||||
background: @text-color;
|
||||
color: @white;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
.ant-alert-message {
|
||||
color: @white;
|
||||
}
|
||||
|
||||
.ant-alert-description {
|
||||
color: @grey-4;
|
||||
}
|
||||
|
||||
.ant-alert-content {
|
||||
border-right: 1px solid @white;
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
font-weight: 700;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
> div {
|
||||
height: 40px;
|
||||
|
||||
.ant-input-wrapper.ant-input-group,
|
||||
.ant-input-affix-wrapper {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-container {
|
||||
width: 35vw;
|
||||
}
|
||||
|
||||
.app-user-icon {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
|
||||
.username {
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.domain-dropdown-menu {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.slide-in-top {
|
||||
animation: slide-in-top 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
||||
}
|
||||
|
||||
@keyframes slide-in-top {
|
||||
0% {
|
||||
transform: translate(-50%, 100%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.ant-btn.domain-nav-btn {
|
||||
background-color: @white;
|
||||
border: 1px solid @grey-15;
|
||||
color: @text-color;
|
||||
height: 40px;
|
||||
|
||||
.domain-text {
|
||||
max-width: 15vw;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: @primary-button-background;
|
||||
border: 1px solid @alert-info-icon-bg-1;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
&.domain-active {
|
||||
color: @primary-color;
|
||||
border: 1px solid @primary-color;
|
||||
background-color: @primary-button-background;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-alert.ant-alert-info.refresh-alert {
|
||||
width: 470px;
|
||||
bottom: 30px;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.12);
|
||||
border-radius: 10px;
|
||||
border: 1px solid @text-color;
|
||||
background: @text-color;
|
||||
color: @white;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
.ant-alert-message {
|
||||
color: @white;
|
||||
}
|
||||
|
||||
.ant-alert-description {
|
||||
color: @grey-4;
|
||||
}
|
||||
|
||||
.ant-alert-content {
|
||||
border-right: 1px solid @white;
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
font-weight: 700;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Benutzer erfolgreich verifiziert",
|
||||
"valid-url-endpoint": "Endpunkte sollten gültige URLs sein",
|
||||
"validation-error-assets": "Bitte überprüfen Sie alle Assets, die hinzugefügt werden.",
|
||||
"value-must-be-greater-than": "{{field}} muss größer als {{minimum}} sein",
|
||||
"value-should-equal-to-value": "Der Wert sollte gleich {{value}} sein.",
|
||||
"value-should-not-equal-to-value": "Der Wert sollte nicht gleich {{value}} sein.",
|
||||
"version-released-try-now": "{{version}} Veröffentlicht <0>Sehen Sie, was es Neues gibt!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "User Verified Successfully",
|
||||
"valid-url-endpoint": "Endpoints should be valid URL",
|
||||
"validation-error-assets": "Please examine all your assets that are being added",
|
||||
"value-must-be-greater-than": "{{field}} must be greater than {{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} Released <0>See What's New!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Usuario verificado con éxito",
|
||||
"valid-url-endpoint": "Los terminales deben ser URL válidas",
|
||||
"validation-error-assets": "Por favor, examine todos sus activos que se están agregando",
|
||||
"value-must-be-greater-than": "{{field}} debe ser mayor que {{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} Lanzado <0>¡Mira qué hay de nuevo!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "L'utilisateur a été vérifié avec succès",
|
||||
"valid-url-endpoint": "Les points de terminaison doivent être une URL valide",
|
||||
"validation-error-assets": "Veuillez exmanier tous les actifs qui sont ajoutés",
|
||||
"value-must-be-greater-than": "{{field}} doit être supérieur à {{minimum}}",
|
||||
"value-should-equal-to-value": "La valeur devrait être égale à {{value}}.",
|
||||
"value-should-not-equal-to-value": "La valeur ne devrait pas être égale à {{value}}.",
|
||||
"version-released-try-now": "{{version}} publié essayez maintenant !",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Usuario verificado correctamente",
|
||||
"valid-url-endpoint": "Os endpoints deben ser unha URL válida",
|
||||
"validation-error-assets": "Examina todos os teus activos que están sendo engadidos",
|
||||
"value-must-be-greater-than": "{{field}} debe ser maior que {{minimum}}",
|
||||
"value-should-equal-to-value": "O valor debe ser igual a {{value}}.",
|
||||
"value-should-not-equal-to-value": "O valor non debe ser igual a {{value}}.",
|
||||
"version-released-try-now": "{{version}} Lançada <0>Vexa as Novidades!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "משתמש אומת בהצלחה",
|
||||
"valid-url-endpoint": "נקודות קצה צריכות להיות URL תקף",
|
||||
"validation-error-assets": "Please examine all your assets that are being added",
|
||||
"value-must-be-greater-than": "{{field}} חייב להיות גדול מ-{{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} שוחרר <0>ראה מה חדש!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "ユーザ認証に成功しました",
|
||||
"valid-url-endpoint": "エンドポイントは有効なURLでなければなりません",
|
||||
"validation-error-assets": "Please examine all your assets that are being added",
|
||||
"value-must-be-greater-than": "{{field}} は {{minimum}} より大きくなければなりません",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} Released <0>See What's New!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "사용자가 성공적으로 확인되었습니다",
|
||||
"valid-url-endpoint": "엔드포인트는 유효한 URL이어야 합니다",
|
||||
"validation-error-assets": "추가 중인 모든 자산을 검토하세요",
|
||||
"value-must-be-greater-than": "{{field}}는 {{minimum}}보다 커야 합니다",
|
||||
"value-should-equal-to-value": "값은 {{value}}와(과) 같아야 합니다.",
|
||||
"value-should-not-equal-to-value": "값은 {{value}}와(과) 같지 않아야 합니다.",
|
||||
"version-released-try-now": "{{version}} 출시됨 <0>새로운 기능 확인하기!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "वापरकर्ता यशस्वीरित्या सत्यापित केला",
|
||||
"valid-url-endpoint": "एंडपॉईंट्स वैध URL असावेत",
|
||||
"validation-error-assets": "कृपया तुम्ही जोडत असलेल्या सर्व ॲसेट्सची तपासणी करा",
|
||||
"value-must-be-greater-than": "{{field}} {{minimum}} पेक्षा मोठा असावा",
|
||||
"value-should-equal-to-value": "मूल्य {{value}} च्या बरोबरीचे असावे.",
|
||||
"value-should-not-equal-to-value": "मूल्य {{value}} च्या बरोबरीचे नसावे.",
|
||||
"version-released-try-now": "{{version}} रिलीझ झाले <0>नवीन काय आहे ते पहा!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Gebruiker succesvol geverifieerd",
|
||||
"valid-url-endpoint": "Eindpunten moeten geldige URL's zijn",
|
||||
"validation-error-assets": "Onderzoek al je assets die worden toegevoegd",
|
||||
"value-must-be-greater-than": "{{field}} moet groter zijn dan {{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} vrijgegeven <0>Zie wat er veranderd is!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "کاربر با موفقیت تأیید شد.",
|
||||
"valid-url-endpoint": "نقاط پایانی باید URL معتبر باشند.",
|
||||
"validation-error-assets": "لطفاً تمام داراییهایی که در حال اضافه کردن آنها هستید را بررسی کنید.",
|
||||
"value-must-be-greater-than": "{{field}} {{minimum}} से अधिक होना चाहिए",
|
||||
"value-should-equal-to-value": "مقدار باید برابر با {{value}} باشد.",
|
||||
"value-should-not-equal-to-value": "مقدار نباید برابر با {{value}} باشد.",
|
||||
"version-released-try-now": "{{version}} منتشر شد <0>مشاهده کنید چه خبر است!</0>",
|
||||
|
@ -2148,8 +2148,9 @@
|
||||
"user-verified-successfully": "Usuário verificado com sucesso",
|
||||
"valid-url-endpoint": "Os endpoints devem ser URLs válidas",
|
||||
"validation-error-assets": "Por favor, verifique todos os seus ativos que estão sendo adicionados",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"value-must-be-greater-than": "{{field}} deve ser maior que {{minimum}}",
|
||||
"value-should-equal-to-value": "O valor deve ser igual a {{value}}.",
|
||||
"value-should-not-equal-to-value": "O valor não deve ser igual a {{value}}.",
|
||||
"version-released-try-now": "{{version}} Lançada <0>Veja o que há de novo!</0>",
|
||||
"video-playback-not-supported": "Seu navegador não suporta a reprodução de vídeo.",
|
||||
"view-deleted-entity": "Visualize todos os {{entity}} excluídos, que fazem parte deste {{parent}}.",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Utilizador verificado com sucesso",
|
||||
"valid-url-endpoint": "Os endpoints devem ser URLs válidas",
|
||||
"validation-error-assets": "Por favor, verifique todos os seus ativos que estão sendo adicionados",
|
||||
"value-must-be-greater-than": "{{field}} deve ser superior a {{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "{{version}} Lançada <0>Veja o que há de novo!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "Пользователь успешно проверен",
|
||||
"valid-url-endpoint": "Конечные точки должны быть действительным URL",
|
||||
"validation-error-assets": "Please examine all your assets that are being added",
|
||||
"value-must-be-greater-than": "{{field}} должно быть больше чем {{minimum}}",
|
||||
"value-should-equal-to-value": "The value should be equal to {{value}}.",
|
||||
"value-should-not-equal-to-value": "The value should not be equal to {{value}}.",
|
||||
"version-released-try-now": "Выпущена {{версия}} <0>Посмотрите, что нового!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "ผู้ใช้ได้รับการตรวจสอบแล้วสำเร็จ",
|
||||
"valid-url-endpoint": "จุดสิ้นสุดต้องเป็น URL ที่ถูกต้อง",
|
||||
"validation-error-assets": "โปรดตรวจสอบสินทรัพย์ทั้งหมดที่กำลังถูกเพิ่ม",
|
||||
"value-must-be-greater-than": "{{field}} ต้องมากกว่า {{minimum}}",
|
||||
"value-should-equal-to-value": "ค่าต้องเท่ากับ {{value}}",
|
||||
"value-should-not-equal-to-value": "ค่าต้องไม่เท่ากับ {{value}}",
|
||||
"version-released-try-now": "{{version}} ได้ออกแล้ว <0>ดูสิ่งใหม่!</0>",
|
||||
|
@ -2148,6 +2148,7 @@
|
||||
"user-verified-successfully": "用户验证成功",
|
||||
"valid-url-endpoint": "端点应该是有效的 URL",
|
||||
"validation-error-assets": "请检查您正在添加的全部资产",
|
||||
"value-must-be-greater-than": "{{field}} 必须大于 {{minimum}}",
|
||||
"value-should-equal-to-value": "该值应等于{{value}}.",
|
||||
"value-should-not-equal-to-value": "该值不应等于{{value}}.",
|
||||
"version-released-try-now": "查看新版本 {{version}} 的新特性!",
|
||||
|
@ -137,3 +137,7 @@
|
||||
cursor: pointer;
|
||||
accent-color: @primary-color;
|
||||
}
|
||||
|
||||
.rjsf .has-error input {
|
||||
border-color: @error-color !important;
|
||||
}
|
||||
|
@ -75,7 +75,8 @@
|
||||
"title": "Data Retention (Days)",
|
||||
"description": "Defines the number of days the Data Assets Insights information will be kept. After it they will be deleted.",
|
||||
"type": "integer",
|
||||
"default": 7
|
||||
"default": 7,
|
||||
"minimum": 0
|
||||
},
|
||||
"serviceFilter": {
|
||||
"type": "object",
|
||||
@ -173,7 +174,8 @@
|
||||
"batchSize": {
|
||||
"description": "Maximum number of events processed at a time (Default 100).",
|
||||
"type": "integer",
|
||||
"default": 100
|
||||
"default": 100,
|
||||
"minimum": 0
|
||||
},
|
||||
"recreateDataAssetsIndex": {
|
||||
"title": "Recreate DataInsights DataAssets Index",
|
||||
|
@ -8,55 +8,64 @@
|
||||
"title": "Batch Size",
|
||||
"description": "Maximum number of events entities in a batch (Default 100).",
|
||||
"type": "integer",
|
||||
"default": 100
|
||||
"default": 100,
|
||||
"minimum": 1
|
||||
},
|
||||
"payLoadSize": {
|
||||
"title": "Payload Size",
|
||||
"description": "Maximum number of events entities in a batch (Default 100).",
|
||||
"type": "integer",
|
||||
"default": 104857600
|
||||
"default": 104857600,
|
||||
"minimum": 1
|
||||
},
|
||||
"producerThreads": {
|
||||
"title": "Number of Producer Threads",
|
||||
"description": "Number of threads to use for reindexing",
|
||||
"type": "integer",
|
||||
"default": 5
|
||||
"default": 5,
|
||||
"minimum": 1
|
||||
},
|
||||
"consumerThreads": {
|
||||
"title": "Number of Consumer Threads",
|
||||
"description": "Number of threads to use for reindexing",
|
||||
"type": "integer",
|
||||
"default": 1
|
||||
"default": 1,
|
||||
"minimum": 1
|
||||
},
|
||||
"queueSize": {
|
||||
"title": "Queue Size to use.",
|
||||
"description": "Queue Size to use internally for reindexing.",
|
||||
"type": "integer",
|
||||
"default": 100
|
||||
"default": 100,
|
||||
"minimum": 1
|
||||
},
|
||||
"maxConcurrentRequests": {
|
||||
"title": "Max Concurrent Requests",
|
||||
"description": "Maximum number of concurrent requests to the search index",
|
||||
"type": "integer",
|
||||
"default": 100
|
||||
"default": 100,
|
||||
"minimum": 1
|
||||
},
|
||||
"maxRetries": {
|
||||
"title": "Max Retries",
|
||||
"description": "Maximum number of retries for a failed request",
|
||||
"type": "integer",
|
||||
"default": 5
|
||||
"default": 5,
|
||||
"minimum": 0
|
||||
},
|
||||
"initialBackoff": {
|
||||
"title": "Initial Backoff Millis",
|
||||
"description": "Initial backoff time in milliseconds",
|
||||
"type": "integer",
|
||||
"default": 1000
|
||||
"default": 1000,
|
||||
"minimum": 0
|
||||
},
|
||||
"maxBackoff": {
|
||||
"title": "Max Backoff Millis",
|
||||
"description": "Maximum backoff time in milliseconds",
|
||||
"type": "integer",
|
||||
"default": 10000
|
||||
"default": 10000,
|
||||
"minimum": 0
|
||||
},
|
||||
"entities": {
|
||||
"title": "Entities",
|
||||
|
@ -278,7 +278,7 @@ export const generateFormFields = (fields: FieldProp[]) => {
|
||||
|
||||
export const transformErrors: ErrorTransformer = (errors) => {
|
||||
const errorRet = errors.map((error) => {
|
||||
const { property } = error;
|
||||
const { property, params, name } = error;
|
||||
|
||||
/**
|
||||
* For nested fields we have to check if it's property start with "."
|
||||
@ -290,12 +290,25 @@ export const transformErrors: ErrorTransformer = (errors) => {
|
||||
|
||||
// If element is not present in DOM, ignore error
|
||||
if (document.getElementById(id)) {
|
||||
const fieldName = error.params?.missingProperty;
|
||||
if (fieldName) {
|
||||
const customMessage = i18n.t('message.field-text-is-required', {
|
||||
fieldText: startCase(fieldName),
|
||||
});
|
||||
error.message = customMessage;
|
||||
const fieldName = startCase(property?.split('/').pop() ?? '');
|
||||
|
||||
const errorMessages = {
|
||||
required: () => ({
|
||||
message: i18n.t('message.field-text-is-required', {
|
||||
fieldText: startCase(params?.missingProperty),
|
||||
}),
|
||||
}),
|
||||
minimum: () => ({
|
||||
message: i18n.t('message.value-must-be-greater-than', {
|
||||
field: fieldName,
|
||||
minimum: params?.limit,
|
||||
}),
|
||||
}),
|
||||
};
|
||||
|
||||
const errorHandler = errorMessages[name as keyof typeof errorMessages];
|
||||
if (errorHandler && params) {
|
||||
error.message = errorHandler().message;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user