From 3f6fb528ea57004e1fc79c7035b1c7044fb9da42 Mon Sep 17 00:00:00 2001 From: vamsikrishnamathala Date: Tue, 1 Apr 2025 20:24:20 +0530 Subject: [PATCH 1/2] * chore: refactored estimates components. * chore: added translations for estimates components. --- .../i18n/src/locales/cs/translations.json | 60 +++++++++++++++++- .../i18n/src/locales/de/translations.json | 62 ++++++++++++++++++- .../i18n/src/locales/en/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/es/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/fr/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/id/translations.json | 60 +++++++++++++++++- .../i18n/src/locales/it/translations.json | 62 ++++++++++++++++++- .../i18n/src/locales/ja/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/ko/translations.json | 60 +++++++++++++++++- .../i18n/src/locales/pl/translations.json | 62 ++++++++++++++++++- .../i18n/src/locales/pt-BR/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/ro/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/ru/translations.json | 60 +++++++++++++++++- .../i18n/src/locales/sk/translations.json | 60 +++++++++++++++++- .../i18n/src/locales/ua/translations.json | 62 ++++++++++++++++++- .../i18n/src/locales/vi-VN/translations.json | 58 ++++++++++++++++- .../i18n/src/locales/zh-CN/translations.json | 49 ++++++++++++++- .../i18n/src/locales/zh-TW/translations.json | 60 +++++++++++++++++- packages/ui/src/dropdown/common/options.tsx | 3 +- packages/ui/src/dropdown/dropdown.d.ts | 17 ++++- web/ce/components/estimates/helper.tsx | 13 ++++ web/ce/components/estimates/index.ts | 1 + web/ce/components/estimates/inputs/index.ts | 1 + .../estimates/inputs/time-input.tsx | 8 +++ web/ce/components/estimates/points/delete.tsx | 6 +- web/ce/constants/estimates.ts | 2 +- web/core/components/dropdowns/estimate.tsx | 37 ++++++++--- .../components/estimates/create/stage-one.tsx | 43 ++++++++----- .../estimates/estimate-disable-switch.tsx | 17 +++-- .../estimates/estimate-list-item.tsx | 13 +++- web/core/components/estimates/inputs/index.ts | 3 + .../estimates/inputs/number-input.tsx | 24 +++++++ web/core/components/estimates/inputs/root.tsx | 37 +++++++++++ .../estimates/inputs/text-input.tsx | 24 +++++++ .../components/estimates/points/create.tsx | 54 ++++++++-------- .../components/estimates/points/preview.tsx | 18 ++++-- .../components/estimates/points/update.tsx | 56 ++++++++--------- 37 files changed, 1308 insertions(+), 132 deletions(-) create mode 100644 web/ce/components/estimates/helper.tsx create mode 100644 web/ce/components/estimates/inputs/index.ts create mode 100644 web/ce/components/estimates/inputs/time-input.tsx create mode 100644 web/core/components/estimates/inputs/index.ts create mode 100644 web/core/components/estimates/inputs/number-input.tsx create mode 100644 web/core/components/estimates/inputs/root.tsx create mode 100644 web/core/components/estimates/inputs/text-input.tsx diff --git a/packages/i18n/src/locales/cs/translations.json b/packages/i18n/src/locales/cs/translations.json index 51c0aa0e3f8..51218cd6c73 100644 --- a/packages/i18n/src/locales/cs/translations.json +++ b/packages/i18n/src/locales/cs/translations.json @@ -1734,8 +1734,64 @@ } }, "estimates": { - "title": "Povolit odhady v projektu", - "description": "Pomáhají komunikovat složitost a vytížení týmu." + "label": "Odhady", + "title": "Povolit odhady pro můj projekt", + "description": "Pomáhají komunikovat složitost a vytížení týmu.", + "no_estimate": "Bez odhadu", + "create": { + "custom": "Vlastní", + "start_from_scratch": "Začít od začátku", + "choose_template": "Vybrat šablonu", + "choose_estimate_system": "Vybrat systém odhadů", + "enter_estimate_point": "Zadejte bod odhadu" + }, + "toasts": { + "created": { + "success": { + "title": "Bod odhadu vytvořen", + "message": "Bod odhadu byl úspěšně vytvořen" + }, + "error": { + "title": "Vytvoření bodu odhadu se nezdařilo", + "message": "Nepodařilo se vytvořit nový bod odhadu, zkuste to prosím znovu." + } + }, + "updated": { + "success": { + "title": "Odhad upraven", + "message": "Bod odhadu byl aktualizován ve vašem projektu." + }, + "error": { + "title": "Úprava odhadu se nezdařila", + "message": "Nepodařilo se upravit odhad, zkuste to prosím znovu" + } + }, + "enabled": { + "success": { + "title": "Úspěch!", + "message": "Odhady byly povoleny." + } + }, + "disabled": { + "success": { + "title": "Úspěch!", + "message": "Odhady byly zakázány." + }, + "error": { + "title": "Chyba!", + "message": "Odhad nelze zakázat. Zkuste to prosím znovu" + } + } + }, + "validation": { + "min_length": "Bod odhadu musí být větší než 0.", + "unable_to_process": "Váš požadavek nelze zpracovat, zkuste to prosím znovu.", + "numeric": "Bod odhadu musí být číselná hodnota.", + "character": "Bod odhadu musí být znakovou hodnotou.", + "empty": "Hodnota odhadu nemůže být prázdná.", + "already_exists": "Hodnota odhadu již existuje.", + "unsaved_changes": "Máte neuložené změny. Před kliknutím na hotovo je prosím uložte" + } }, "automations": { "label": "Automatizace", diff --git a/packages/i18n/src/locales/de/translations.json b/packages/i18n/src/locales/de/translations.json index 77ab4251505..cec7e178146 100644 --- a/packages/i18n/src/locales/de/translations.json +++ b/packages/i18n/src/locales/de/translations.json @@ -500,7 +500,7 @@ "export": "Exportieren", "member": "{count, plural, one{# Mitglied} few{# Mitglieder} other{# Mitglieder}}", "new_password_must_be_different_from_old_password": "Das neue Passwort muss von dem alten Passwort abweichen", - + "project_view": { "sort_by": { "created_at": "Erstellt am", @@ -1710,8 +1710,64 @@ } }, "estimates": { - "title": "Schätzungen im Projekt aktivieren", - "description": "Hilft, die Komplexität und Auslastung für das Team zu kommunizieren." + "label": "Schätzungen", + "title": "Schätzungen für mein Projekt aktivieren", + "description": "Sie helfen bei der Kommunikation von Komplexität und Arbeitsbelastung des Teams.", + "no_estimate": "Keine Schätzung", + "create": { + "custom": "Benutzerdefiniert", + "start_from_scratch": "Von vorne beginnen", + "choose_template": "Vorlage auswählen", + "choose_estimate_system": "Schätzungssystem auswählen", + "enter_estimate_point": "Schätzungspunkt eingeben" + }, + "toasts": { + "created": { + "success": { + "title": "Schätzungspunkt erstellt", + "message": "Der Schätzungspunkt wurde erfolgreich erstellt" + }, + "error": { + "title": "Erstellung des Schätzungspunkts fehlgeschlagen", + "message": "Der neue Schätzungspunkt konnte nicht erstellt werden, bitte versuchen Sie es erneut." + } + }, + "updated": { + "success": { + "title": "Schätzung geändert", + "message": "Der Schätzungspunkt wurde in Ihrem Projekt aktualisiert." + }, + "error": { + "title": "Änderung der Schätzung fehlgeschlagen", + "message": "Die Schätzung konnte nicht geändert werden, bitte versuchen Sie es erneut" + } + }, + "enabled": { + "success": { + "title": "Erfolg!", + "message": "Schätzungen wurden aktiviert." + } + }, + "disabled": { + "success": { + "title": "Erfolg!", + "message": "Schätzungen wurden deaktiviert." + }, + "error": { + "title": "Fehler!", + "message": "Schätzung konnte nicht deaktiviert werden. Bitte versuchen Sie es erneut" + } + } + }, + "validation": { + "min_length": "Schätzungspunkt muss größer als 0 sein.", + "unable_to_process": "Ihre Anfrage konnte nicht verarbeitet werden, bitte versuchen Sie es erneut.", + "numeric": "Schätzungspunkt muss ein numerischer Wert sein.", + "character": "Schätzungspunkt muss ein Zeichenwert sein.", + "empty": "Schätzungswert darf nicht leer sein.", + "already_exists": "Schätzungswert existiert bereits.", + "unsaved_changes": "Sie haben ungespeicherte Änderungen. Bitte speichern Sie diese, bevor Sie auf Fertig klicken" + } }, "automations": { "label": "Automatisierung", diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 0be5219bef7..74cd5281b9d 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -1568,8 +1568,64 @@ } }, "estimates": { + "label": "Estimates", "title": "Enable estimates for my project", - "description": "They help you in communicating complexity and workload of the team." + "description": "They help you in communicating complexity and workload of the team.", + "no_estimate": "No estimate", + "create": { + "custom": "Custom", + "start_from_scratch": "Start from scratch", + "choose_template": "Choose a template", + "choose_estimate_system": "Choose an estimate system", + "enter_estimate_point": "Enter estimate point" + }, + "toasts": { + "created": { + "success": { + "title": "Estimate point created", + "message": "The estimate point has been created successfully" + }, + "error": { + "title": "Estimate point creation failed", + "message": "We were unable to create the new estimate point, please try again." + } + }, + "updated": { + "success": { + "title": "Estimate modified", + "message": "The estimate point has been updated in your project." + }, + "error": { + "title": "Estimate modification failed", + "message": "We were unable to modify the estimate, please try again" + } + }, + "enabled": { + "success": { + "title": "Success!", + "message": "Estimates have been enabled." + } + }, + "disabled": { + "success": { + "title": "Success!", + "message": "Estimates have been disabled." + }, + "error": { + "title": "Error!", + "message": "Estimate could not be disabled. Please try again" + } + } + }, + "validation": { + "min_length": "Estimate point needs to be greater than 0.", + "unable_to_process": "We are unable to process your request, please try again.", + "numeric": "Estimate point needs to be a numeric value.", + "character": "Estimate point needs to be a character value.", + "empty": "Estimate value cannot be empty.", + "already_exists": "Estimate value already exists.", + "unsaved_changes": "You have some unsaved changes, Please save them before clicking on done" + } }, "automations": { "label": "Automations", diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index d3a0c1f6c1b..f2bcb2c83dd 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -1738,8 +1738,64 @@ } }, "estimates": { + "label": "Estimaciones", "title": "Habilitar estimaciones para mi proyecto", - "description": "Ayudan a comunicar la complejidad y la carga de trabajo del equipo." + "description": "Ayudan a comunicar la complejidad y la carga de trabajo del equipo.", + "no_estimate": "Sin estimación", + "create": { + "custom": "Personalizado", + "start_from_scratch": "Empezar desde cero", + "choose_template": "Elegir una plantilla", + "choose_estimate_system": "Elegir un sistema de estimación", + "enter_estimate_point": "Ingresar punto de estimación" + }, + "toasts": { + "created": { + "success": { + "title": "Punto de estimación creado", + "message": "El punto de estimación se ha creado exitosamente" + }, + "error": { + "title": "Error al crear punto de estimación", + "message": "No pudimos crear el nuevo punto de estimación, por favor intenta de nuevo." + } + }, + "updated": { + "success": { + "title": "Estimación modificada", + "message": "El punto de estimación ha sido actualizado en tu proyecto." + }, + "error": { + "title": "Error al modificar estimación", + "message": "No pudimos modificar la estimación, por favor intenta de nuevo" + } + }, + "enabled": { + "success": { + "title": "¡Éxito!", + "message": "Las estimaciones han sido habilitadas." + } + }, + "disabled": { + "success": { + "title": "¡Éxito!", + "message": "Las estimaciones han sido deshabilitadas." + }, + "error": { + "title": "¡Error!", + "message": "No se pudo deshabilitar la estimación. Por favor intenta de nuevo" + } + } + }, + "validation": { + "min_length": "El punto de estimación debe ser mayor que 0.", + "unable_to_process": "No podemos procesar tu solicitud, por favor intenta de nuevo.", + "numeric": "El punto de estimación debe ser un valor numérico.", + "character": "El punto de estimación debe ser un valor de carácter.", + "empty": "El valor de estimación no puede estar vacío.", + "already_exists": "El valor de estimación ya existe.", + "unsaved_changes": "Tienes cambios sin guardar. Por favor guárdalos antes de hacer clic en listo" + } }, "automations": { "label": "Automatizaciones", diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index 0cda7965623..bba429e318f 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -1736,8 +1736,64 @@ } }, "estimates": { + "label": "Estimations", "title": "Activer les estimations pour mon projet", - "description": "Elles vous aident à communiquer la complexité et la charge de travail de l'équipe." + "description": "Elles vous aident à communiquer la complexité et la charge de travail de l'équipe.", + "no_estimate": "Aucune estimation", + "create": { + "custom": "Personnalisé", + "start_from_scratch": "Commencer de zéro", + "choose_template": "Choisir un modèle", + "choose_estimate_system": "Choisir un système d'estimation", + "enter_estimate_point": "Saisir un point d'estimation" + }, + "toasts": { + "created": { + "success": { + "title": "Point d'estimation créé", + "message": "Le point d'estimation a été créé avec succès" + }, + "error": { + "title": "Échec de la création du point d'estimation", + "message": "Nous n'avons pas pu créer le nouveau point d'estimation, veuillez réessayer." + } + }, + "updated": { + "success": { + "title": "Estimation modifiée", + "message": "Le point d'estimation a été mis à jour dans votre projet." + }, + "error": { + "title": "Échec de la modification de l'estimation", + "message": "Nous n'avons pas pu modifier l'estimation, veuillez réessayer" + } + }, + "enabled": { + "success": { + "title": "Succès !", + "message": "Les estimations ont été activées." + } + }, + "disabled": { + "success": { + "title": "Succès !", + "message": "Les estimations ont été désactivées." + }, + "error": { + "title": "Erreur !", + "message": "L'estimation n'a pas pu être désactivée. Veuillez réessayer" + } + } + }, + "validation": { + "min_length": "Le point d'estimation doit être supérieur à 0.", + "unable_to_process": "Nous ne pouvons pas traiter votre demande, veuillez réessayer.", + "numeric": "Le point d'estimation doit être une valeur numérique.", + "character": "Le point d'estimation doit être une valeur caractère.", + "empty": "La valeur d'estimation ne peut pas être vide.", + "already_exists": "La valeur d'estimation existe déjà.", + "unsaved_changes": "Vous avez des modifications non enregistrées, veuillez les sauvegarder avant de cliquer sur terminé" + } }, "automations": { "label": "Automatisations", diff --git a/packages/i18n/src/locales/id/translations.json b/packages/i18n/src/locales/id/translations.json index 64338a04f3b..ef074f91e26 100644 --- a/packages/i18n/src/locales/id/translations.json +++ b/packages/i18n/src/locales/id/translations.json @@ -1736,8 +1736,64 @@ } }, "estimates": { - "title": "Aktifkan estimasi untuk proyek saya", - "description": "Mereka membantu Anda dalam mengkomunikasikan kompleksitas dan beban kerja tim." + "label": "Perkiraan", + "title": "Aktifkan perkiraan untuk proyek saya", + "description": "Mereka membantu Anda dalam mengkomunikasikan kompleksitas dan beban kerja tim.", + "no_estimate": "Tidak ada perkiraan", + "create": { + "custom": "Kustom", + "start_from_scratch": "Mulai dari awal", + "choose_template": "Pilih template", + "choose_estimate_system": "Pilih sistem perkiraan", + "enter_estimate_point": "Masukkan poin perkiraan" + }, + "toasts": { + "created": { + "success": { + "title": "Poin perkiraan dibuat", + "message": "Poin perkiraan telah berhasil dibuat" + }, + "error": { + "title": "Pembuatan poin perkiraan gagal", + "message": "Kami tidak dapat membuat poin perkiraan baru, silakan coba lagi." + } + }, + "updated": { + "success": { + "title": "Perkiraan dimodifikasi", + "message": "Poin perkiraan telah diperbarui dalam proyek Anda." + }, + "error": { + "title": "Modifikasi perkiraan gagal", + "message": "Kami tidak dapat memodifikasi perkiraan, silakan coba lagi" + } + }, + "enabled": { + "success": { + "title": "Sukses!", + "message": "Perkiraan telah diaktifkan." + } + }, + "disabled": { + "success": { + "title": "Sukses!", + "message": "Perkiraan telah dinonaktifkan." + }, + "error": { + "title": "Kesalahan!", + "message": "Perkiraan tidak dapat dinonaktifkan. Silakan coba lagi" + } + } + }, + "validation": { + "min_length": "Poin perkiraan harus lebih besar dari 0.", + "unable_to_process": "Kami tidak dapat memproses permintaan Anda, silakan coba lagi.", + "numeric": "Poin perkiraan harus berupa nilai numerik.", + "character": "Poin perkiraan harus berupa nilai karakter.", + "empty": "Nilai perkiraan tidak boleh kosong.", + "already_exists": "Nilai perkiraan sudah ada.", + "unsaved_changes": "Anda memiliki beberapa perubahan yang belum disimpan, Silakan simpan sebelum mengklik selesai" + } }, "automations": { "label": "Otomatisasi", diff --git a/packages/i18n/src/locales/it/translations.json b/packages/i18n/src/locales/it/translations.json index 352d7fce499..9043d836e81 100644 --- a/packages/i18n/src/locales/it/translations.json +++ b/packages/i18n/src/locales/it/translations.json @@ -501,7 +501,7 @@ "export": "Esporta", "member": "{count, plural, one {# membro} other {# membri}}", "new_password_must_be_different_from_old_password": "La nuova password deve essere diversa dalla password precedente", - + "edited": "Modificato", "bot": "Bot", @@ -1735,8 +1735,64 @@ } }, "estimates": { - "title": "Abilita le stime per il mio progetto", - "description": "Aiutano a comunicare la complessità e il carico di lavoro del team." + "label": "Stime", + "title": "Abilita stime per il mio progetto", + "description": "Aiutano a comunicare la complessità e il carico di lavoro del team.", + "no_estimate": "Nessuna stima", + "create": { + "custom": "Personalizzato", + "start_from_scratch": "Inizia da zero", + "choose_template": "Scegli un modello", + "choose_estimate_system": "Scegli un sistema di stime", + "enter_estimate_point": "Inserisci punto di stima" + }, + "toasts": { + "created": { + "success": { + "title": "Punto di stima creato", + "message": "Il punto di stima è stato creato con successo" + }, + "error": { + "title": "Creazione del punto di stima fallita", + "message": "Non siamo riusciti a creare il nuovo punto di stima, per favore riprova." + } + }, + "updated": { + "success": { + "title": "Stima modificata", + "message": "Il punto di stima è stato aggiornato nel tuo progetto." + }, + "error": { + "title": "Modifica della stima fallita", + "message": "Non siamo riusciti a modificare la stima, per favore riprova" + } + }, + "enabled": { + "success": { + "title": "Successo!", + "message": "Le stime sono state abilitate." + } + }, + "disabled": { + "success": { + "title": "Successo!", + "message": "Le stime sono state disabilitate." + }, + "error": { + "title": "Errore!", + "message": "Non è stato possibile disabilitare la stima. Per favore riprova" + } + } + }, + "validation": { + "min_length": "Il punto di stima deve essere maggiore di 0.", + "unable_to_process": "Non siamo in grado di elaborare la tua richiesta, per favore riprova.", + "numeric": "Il punto di stima deve essere un valore numerico.", + "character": "Il punto di stima deve essere un valore carattere.", + "empty": "Il valore della stima non può essere vuoto.", + "already_exists": "Il valore della stima esiste già.", + "unsaved_changes": "Hai delle modifiche non salvate, salvale prima di cliccare su fatto" + } }, "automations": { "label": "Automazioni", diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index 7d0d09175fd..f18576fa0ad 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -1736,8 +1736,64 @@ } }, "estimates": { + "label": "見積もり", "title": "プロジェクトの見積もりを有効にする", - "description": "チームの複雑さと作業負荷を伝えるのに役立ちます。" + "description": "チームの複雑さと作業負荷を伝えるのに役立ちます。", + "no_estimate": "見積もりなし", + "create": { + "custom": "カスタム", + "start_from_scratch": "最初から作成", + "choose_template": "テンプレートを選択", + "choose_estimate_system": "見積もりシステムを選択", + "enter_estimate_point": "見積もりポイントを入力" + }, + "toasts": { + "created": { + "success": { + "title": "見積もりポイントが作成されました", + "message": "見積もりポイントが正常に作成されました" + }, + "error": { + "title": "見積もりポイントの作成に失敗しました", + "message": "新しい見積もりポイントを作成できませんでした。もう一度お試しください。" + } + }, + "updated": { + "success": { + "title": "見積もりが変更されました", + "message": "プロジェクトの見積もりポイントが更新されました。" + }, + "error": { + "title": "見積もりの変更に失敗しました", + "message": "見積もりを変更できませんでした。もう一度お試しください。" + } + }, + "enabled": { + "success": { + "title": "成功!", + "message": "見積もりが有効になりました。" + } + }, + "disabled": { + "success": { + "title": "成功!", + "message": "見積もりが無効になりました。" + }, + "error": { + "title": "エラー!", + "message": "見積もりを無効にできませんでした。もう一度お試しください。" + } + } + }, + "validation": { + "min_length": "見積もりポイントは0より大きい必要があります。", + "unable_to_process": "リクエストを処理できません。もう一度お試しください。", + "numeric": "見積もりポイントは数値である必要があります。", + "character": "見積もりポイントは文字である必要があります。", + "empty": "見積もり値を空にすることはできません。", + "already_exists": "見積もり値は既に存在します。", + "unsaved_changes": "保存されていない変更があります。完了をクリックする前に保存してください。" + } }, "automations": { "label": "自動化", diff --git a/packages/i18n/src/locales/ko/translations.json b/packages/i18n/src/locales/ko/translations.json index d6b88df276b..074eff72985 100644 --- a/packages/i18n/src/locales/ko/translations.json +++ b/packages/i18n/src/locales/ko/translations.json @@ -1738,8 +1738,64 @@ } }, "estimates": { - "title": "프로젝트에 대한 추정 활성화", - "description": "팀의 복잡성과 작업량을 전달하는 데 도움이 됩니다." + "label": "추정", + "title": "내 프로젝트에 추정 활성화", + "description": "팀의 복잡성과 업무량을 전달하는 데 도움이 됩니다.", + "no_estimate": "추정 없음", + "create": { + "custom": "사용자 정의", + "start_from_scratch": "처음부터 시작", + "choose_template": "템플릿 선택", + "choose_estimate_system": "추정 시스템 선택", + "enter_estimate_point": "추정 포인트 입력" + }, + "toasts": { + "created": { + "success": { + "title": "추정 포인트 생성됨", + "message": "추정 포인트가 성공적으로 생성되었습니다" + }, + "error": { + "title": "추정 포인트 생성 실패", + "message": "새 추정 포인트를 생성할 수 없습니다. 다시 시도해주세요." + } + }, + "updated": { + "success": { + "title": "추정 수정됨", + "message": "프로젝트의 추정 포인트가 업데이트되었습니다." + }, + "error": { + "title": "추정 수정 실패", + "message": "추정을 수정할 수 없습니다. 다시 시도해주세요" + } + }, + "enabled": { + "success": { + "title": "성공!", + "message": "추정이 활성화되었습니다." + } + }, + "disabled": { + "success": { + "title": "성공!", + "message": "추정이 비활성화되었습니다." + }, + "error": { + "title": "오류!", + "message": "추정을 비활성화할 수 없습니다. 다시 시도해주세요" + } + } + }, + "validation": { + "min_length": "추정 포인트는 0보다 커야 합니다.", + "unable_to_process": "요청을 처리할 수 없습니다. 다시 시도해주세요.", + "numeric": "추정 포인트는 숫자여야 합니다.", + "character": "추정 포인트는 문자여야 합니다.", + "empty": "추정 값은 비워둘 수 없습니다.", + "already_exists": "추정 값이 이미 존재합니다.", + "unsaved_changes": "저장되지 않은 변경사항이 있습니다. 완료를 클릭하기 전에 저장해주세요" + } }, "automations": { "label": "자동화", diff --git a/packages/i18n/src/locales/pl/translations.json b/packages/i18n/src/locales/pl/translations.json index 08543fcde0a..c61bc1169bd 100644 --- a/packages/i18n/src/locales/pl/translations.json +++ b/packages/i18n/src/locales/pl/translations.json @@ -500,7 +500,7 @@ "export": "Eksportuj", "member": "{count, plural, one{# członek} few{# członkowie} other{# członków}}", "new_password_must_be_different_from_old_password": "Nowe hasło musi być innym niż stare hasło", - + "edited": "Edytowano", "bot": "Bot", @@ -1713,8 +1713,64 @@ } }, "estimates": { - "title": "Włącz szacowania w projekcie", - "description": "Pomaga komunikować złożoność i obciążenie zespołu." + "label": "Szacunki", + "title": "Włącz szacunki dla mojego projektu", + "description": "Pomagają w komunikowaniu złożoności i obciążenia zespołu.", + "no_estimate": "Brak szacunku", + "create": { + "custom": "Własne", + "start_from_scratch": "Zacznij od zera", + "choose_template": "Wybierz szablon", + "choose_estimate_system": "Wybierz system szacowania", + "enter_estimate_point": "Wprowadź punkt szacunkowy" + }, + "toasts": { + "created": { + "success": { + "title": "Utworzono punkt szacunkowy", + "message": "Punkt szacunkowy został pomyślnie utworzony" + }, + "error": { + "title": "Nie udało się utworzyć punktu szacunkowego", + "message": "Nie mogliśmy utworzyć nowego punktu szacunkowego, spróbuj ponownie." + } + }, + "updated": { + "success": { + "title": "Zmodyfikowano szacunek", + "message": "Punkt szacunkowy został zaktualizowany w Twoim projekcie." + }, + "error": { + "title": "Modyfikacja szacunku nie powiodła się", + "message": "Nie mogliśmy zmodyfikować szacunku, spróbuj ponownie" + } + }, + "enabled": { + "success": { + "title": "Sukces!", + "message": "Szacunki zostały włączone." + } + }, + "disabled": { + "success": { + "title": "Sukces!", + "message": "Szacunki zostały wyłączone." + }, + "error": { + "title": "Błąd!", + "message": "Nie można było wyłączyć szacunku. Spróbuj ponownie" + } + } + }, + "validation": { + "min_length": "Punkt szacunkowy musi być większy niż 0.", + "unable_to_process": "Nie możemy przetworzyć Twojego żądania, spróbuj ponownie.", + "numeric": "Punkt szacunkowy musi być wartością liczbową.", + "character": "Punkt szacunkowy musi być znakiem.", + "empty": "Wartość szacunku nie może być pusta.", + "already_exists": "Wartość szacunku już istnieje.", + "unsaved_changes": "Masz niezapisane zmiany. Zapisz je przed kliknięciem 'gotowe'" + } }, "automations": { "label": "Automatyzacje", diff --git a/packages/i18n/src/locales/pt-BR/translations.json b/packages/i18n/src/locales/pt-BR/translations.json index bfb8fe6014e..9d137f27210 100644 --- a/packages/i18n/src/locales/pt-BR/translations.json +++ b/packages/i18n/src/locales/pt-BR/translations.json @@ -1738,8 +1738,64 @@ } }, "estimates": { + "label": "Estimativas", "title": "Habilitar estimativas para meu projeto", - "description": "Elas ajudam você a comunicar a complexidade e a carga de trabalho da equipe." + "description": "Elas ajudam você a comunicar a complexidade e a carga de trabalho da equipe.", + "no_estimate": "Sem estimativa", + "create": { + "custom": "Personalizado", + "start_from_scratch": "Começar do zero", + "choose_template": "Escolher um modelo", + "choose_estimate_system": "Escolher um sistema de estimativa", + "enter_estimate_point": "Inserir ponto de estimativa" + }, + "toasts": { + "created": { + "success": { + "title": "Ponto de estimativa criado", + "message": "O ponto de estimativa foi criado com sucesso" + }, + "error": { + "title": "Falha na criação do ponto de estimativa", + "message": "Não foi possível criar o novo ponto de estimativa, por favor tente novamente." + } + }, + "updated": { + "success": { + "title": "Estimativa modificada", + "message": "O ponto de estimativa foi atualizado em seu projeto." + }, + "error": { + "title": "Falha na modificação da estimativa", + "message": "Não foi possível modificar a estimativa, por favor tente novamente" + } + }, + "enabled": { + "success": { + "title": "Sucesso!", + "message": "As estimativas foram habilitadas." + } + }, + "disabled": { + "success": { + "title": "Sucesso!", + "message": "As estimativas foram desabilitadas." + }, + "error": { + "title": "Erro!", + "message": "Não foi possível desabilitar a estimativa. Por favor, tente novamente" + } + } + }, + "validation": { + "min_length": "O ponto de estimativa precisa ser maior que 0.", + "unable_to_process": "Não foi possível processar sua solicitação, por favor tente novamente.", + "numeric": "O ponto de estimativa precisa ser um valor numérico.", + "character": "O ponto de estimativa precisa ser um caractere.", + "empty": "O valor da estimativa não pode estar vazio.", + "already_exists": "O valor da estimativa já existe.", + "unsaved_changes": "Você tem algumas alterações não salvas. Por favor, salve-as antes de clicar em concluir" + } }, "automations": { "label": "Automações", diff --git a/packages/i18n/src/locales/ro/translations.json b/packages/i18n/src/locales/ro/translations.json index 67a642292ac..a7c46070291 100644 --- a/packages/i18n/src/locales/ro/translations.json +++ b/packages/i18n/src/locales/ro/translations.json @@ -1736,8 +1736,64 @@ } }, "estimates": { + "label": "Estimări", "title": "Activează estimările pentru proiectul meu", - "description": "Acestea te ajută să comunici complexitatea și volumul de muncă al echipei." + "description": "Acestea te ajută să comunici complexitatea și volumul de muncă al echipei.", + "no_estimate": "Fără estimare", + "create": { + "custom": "Personalizat", + "start_from_scratch": "Începe de la zero", + "choose_template": "Alege un șablon", + "choose_estimate_system": "Alege un sistem de estimare", + "enter_estimate_point": "Introdu punctul de estimare" + }, + "toasts": { + "created": { + "success": { + "title": "Punct de estimare creat", + "message": "Punctul de estimare a fost creat cu succes" + }, + "error": { + "title": "Crearea punctului de estimare a eșuat", + "message": "Nu s-a putut crea noul punct de estimare, te rugăm să încerci din nou." + } + }, + "updated": { + "success": { + "title": "Estimare modificată", + "message": "Punctul de estimare a fost actualizat în proiectul tău." + }, + "error": { + "title": "Modificarea estimării a eșuat", + "message": "Nu s-a putut modifica estimarea, te rugăm să încerci din nou" + } + }, + "enabled": { + "success": { + "title": "Succes!", + "message": "Estimările au fost activate." + } + }, + "disabled": { + "success": { + "title": "Succes!", + "message": "Estimările au fost dezactivate." + }, + "error": { + "title": "Eroare!", + "message": "Nu s-a putut dezactiva estimarea. Te rugăm să încerci din nou" + } + } + }, + "validation": { + "min_length": "Punctul de estimare trebuie să fie mai mare decât 0.", + "unable_to_process": "Nu s-a putut procesa cererea ta, te rugăm să încerci din nou.", + "numeric": "Punctul de estimare trebuie să fie o valoare numerică.", + "character": "Punctul de estimare trebuie să fie un caracter.", + "empty": "Valoarea estimării nu poate fi goală.", + "already_exists": "Valoarea estimării există deja.", + "unsaved_changes": "Ai modificări nesalvate. Te rugăm să le salvezi înainte de a apăsa finalizare" + } }, "automations": { "label": "Automatizări", diff --git a/packages/i18n/src/locales/ru/translations.json b/packages/i18n/src/locales/ru/translations.json index 753d82cd9d4..2d7322667f7 100644 --- a/packages/i18n/src/locales/ru/translations.json +++ b/packages/i18n/src/locales/ru/translations.json @@ -1736,8 +1736,64 @@ } }, "estimates": { - "title": "Включить оценку для проекта", - "description": "Помогают оценивать сложность и загрузку команды." + "label": "Оценки", + "title": "Включить оценки для моего проекта", + "description": "Они помогают в оценке сложности и нагрузки команды.", + "no_estimate": "Без оценки", + "create": { + "custom": "Пользовательская", + "start_from_scratch": "Начать с нуля", + "choose_template": "Выбрать шаблон", + "choose_estimate_system": "Выбрать систему оценки", + "enter_estimate_point": "Введите значение оценки" + }, + "toasts": { + "created": { + "success": { + "title": "Значение оценки создано", + "message": "Значение оценки успешно создано" + }, + "error": { + "title": "Ошибка создания значения оценки", + "message": "Не удалось создать новое значение оценки, попробуйте снова." + } + }, + "updated": { + "success": { + "title": "Оценка изменена", + "message": "Значение оценки обновлено в вашем проекте." + }, + "error": { + "title": "Ошибка изменения оценки", + "message": "Не удалось изменить оценку, попробуйте снова" + } + }, + "enabled": { + "success": { + "title": "Успешно!", + "message": "Оценки включены." + } + }, + "disabled": { + "success": { + "title": "Успешно!", + "message": "Оценки отключены." + }, + "error": { + "title": "Ошибка!", + "message": "Не удалось отключить оценки. Попробуйте снова" + } + } + }, + "validation": { + "min_length": "Значение оценки должно быть больше 0.", + "unable_to_process": "Не удалось обработать ваш запрос, попробуйте снова.", + "numeric": "Значение оценки должно быть числом.", + "character": "Значение оценки должно быть символом.", + "empty": "Значение оценки не может быть пустым.", + "already_exists": "Такое значение оценки уже существует.", + "unsaved_changes": "У вас есть несохранённые изменения. Сохраните их перед тем, как нажать 'Готово'" + } }, "automations": { "label": "Автоматизация", diff --git a/packages/i18n/src/locales/sk/translations.json b/packages/i18n/src/locales/sk/translations.json index 5964af5f414..2add9fdb289 100644 --- a/packages/i18n/src/locales/sk/translations.json +++ b/packages/i18n/src/locales/sk/translations.json @@ -1735,8 +1735,64 @@ } }, "estimates": { - "title": "Povoliť odhady v projekte", - "description": "Pomáhajú komunikovať zložitosť a vyťaženie tímu." + "label": "Odhady", + "title": "Povoliť odhady pre môj projekt", + "description": "Pomáhajú vám komunikovať zložitosť a pracovné zaťaženie tímu.", + "no_estimate": "Bez odhadu", + "create": { + "custom": "Vlastné", + "start_from_scratch": "Začať od nuly", + "choose_template": "Vybrať šablónu", + "choose_estimate_system": "Vybrať systém odhadov", + "enter_estimate_point": "Zadať bod odhadu" + }, + "toasts": { + "created": { + "success": { + "title": "Bod odhadu vytvorený", + "message": "Bod odhadu bol úspešne vytvorený" + }, + "error": { + "title": "Vytvorenie bodu odhadu zlyhalo", + "message": "Nepodarilo sa vytvoriť nový bod odhadu, skúste to prosím znova." + } + }, + "updated": { + "success": { + "title": "Odhad upravený", + "message": "Bod odhadu bol aktualizovaný vo vašom projekte." + }, + "error": { + "title": "Úprava odhadu zlyhala", + "message": "Nepodarilo sa upraviť odhad, skúste to prosím znova" + } + }, + "enabled": { + "success": { + "title": "Úspech!", + "message": "Odhady boli povolené." + } + }, + "disabled": { + "success": { + "title": "Úspech!", + "message": "Odhady boli zakázané." + }, + "error": { + "title": "Chyba!", + "message": "Odhad sa nepodarilo zakázať. Skúste to prosím znova" + } + } + }, + "validation": { + "min_length": "Bod odhadu musí byť väčší ako 0.", + "unable_to_process": "Nemôžeme spracovať vašu požiadavku, skúste to prosím znova.", + "numeric": "Bod odhadu musí byť číselná hodnota.", + "character": "Bod odhadu musí byť znakovou hodnotou.", + "empty": "Hodnota odhadu nemôže byť prázdna.", + "already_exists": "Hodnota odhadu už existuje.", + "unsaved_changes": "Máte neuložené zmeny. Prosím, uložte ich pred kliknutím na hotovo" + } }, "automations": { "label": "Automatizácie", diff --git a/packages/i18n/src/locales/ua/translations.json b/packages/i18n/src/locales/ua/translations.json index 3d4048612ef..1349be4b745 100644 --- a/packages/i18n/src/locales/ua/translations.json +++ b/packages/i18n/src/locales/ua/translations.json @@ -502,7 +502,7 @@ "new_password_must_be_different_from_old_password": "Новий пароль повинен бути відмінним від старого пароля", "edited": "Редагувано", "bot": "Бот", - + "project_view": { "sort_by": { "created_at": "Створено", @@ -1712,8 +1712,64 @@ } }, "estimates": { - "title": "Увімкнути оцінки в проєкті", - "description": "Вони допомагають відображати складність і навантаження на команду." + "label": "Оцінки", + "title": "Увімкнути оцінки для мого проєкту", + "description": "Вони допомагають вам у комунікації складності та навантаження команди.", + "no_estimate": "Без оцінки", + "create": { + "custom": "Власний", + "start_from_scratch": "Почати з нуля", + "choose_template": "Вибрати шаблон", + "choose_estimate_system": "Вибрати систему оцінок", + "enter_estimate_point": "Введіть бал оцінки" + }, + "toasts": { + "created": { + "success": { + "title": "Бал оцінки створено", + "message": "Бал оцінки успішно створено" + }, + "error": { + "title": "Не вдалося створити бал оцінки", + "message": "Не вдалося створити новий бал оцінки, спробуйте ще раз." + } + }, + "updated": { + "success": { + "title": "Оцінку змінено", + "message": "Бал оцінки оновлено у вашому проєкті." + }, + "error": { + "title": "Не вдалося змінити оцінку", + "message": "Не вдалося змінити оцінку, спробуйте ще раз" + } + }, + "enabled": { + "success": { + "title": "Успіх!", + "message": "Оцінки увімкнено." + } + }, + "disabled": { + "success": { + "title": "Успіх!", + "message": "Оцінки вимкнено." + }, + "error": { + "title": "Помилка!", + "message": "Не вдалося вимкнути оцінку. Спробуйте ще раз" + } + } + }, + "validation": { + "min_length": "Бал оцінки має бути більшим за 0.", + "unable_to_process": "Не вдалося обробити ваш запит, спробуйте ще раз.", + "numeric": "Бал оцінки має бути числовим значенням.", + "character": "Бал оцінки має бути символьним значенням.", + "empty": "Значення оцінки не може бути порожнім.", + "already_exists": "Таке значення оцінки вже існує.", + "unsaved_changes": "У вас є незбережені зміни. Збережіть їх перед тим, як натиснути 'готово'" + } }, "automations": { "label": "Автоматизація", diff --git a/packages/i18n/src/locales/vi-VN/translations.json b/packages/i18n/src/locales/vi-VN/translations.json index 7aa8af5dd10..b26e9fab329 100644 --- a/packages/i18n/src/locales/vi-VN/translations.json +++ b/packages/i18n/src/locales/vi-VN/translations.json @@ -1711,8 +1711,64 @@ } }, "estimates": { + "label": "Ước tính", "title": "Bật ước tính cho dự án của tôi", - "description": "Chúng giúp bạn truyền đạt độ phức tạp và khối lượng công việc của nhóm." + "description": "Chúng giúp bạn truyền đạt độ phức tạp và khối lượng công việc của nhóm.", + "no_estimate": "Không có ước tính", + "create": { + "custom": "Tùy chỉnh", + "start_from_scratch": "Bắt đầu từ đầu", + "choose_template": "Chọn mẫu", + "choose_estimate_system": "Chọn hệ thống ước tính", + "enter_estimate_point": "Nhập điểm ước tính" + }, + "toasts": { + "created": { + "success": { + "title": "Đã tạo điểm ước tính", + "message": "Điểm ước tính đã được tạo thành công" + }, + "error": { + "title": "Không thể tạo điểm ước tính", + "message": "Không thể tạo điểm ước tính mới, vui lòng thử lại" + } + }, + "updated": { + "success": { + "title": "Đã cập nhật ước tính", + "message": "Điểm ước tính đã được cập nhật trong dự án của bạn" + }, + "error": { + "title": "Không thể cập nhật ước tính", + "message": "Không thể cập nhật ước tính, vui lòng thử lại" + } + }, + "enabled": { + "success": { + "title": "Thành công!", + "message": "Đã bật ước tính" + } + }, + "disabled": { + "success": { + "title": "Thành công!", + "message": "Đã tắt ước tính" + }, + "error": { + "title": "Lỗi!", + "message": "Không thể tắt ước tính. Vui lòng thử lại" + } + } + }, + "validation": { + "min_length": "Điểm ước tính phải lớn hơn 0", + "unable_to_process": "Không thể xử lý yêu cầu của bạn, vui lòng thử lại", + "numeric": "Điểm ước tính phải là số", + "character": "Điểm ước tính phải là ký tự", + "empty": "Giá trị ước tính không được để trống", + "already_exists": "Giá trị ước tính này đã tồn tại", + "unsaved_changes": "Bạn có thay đổi chưa lưu. Vui lòng lưu trước khi nhấn 'xong'" + } }, "automations": { "label": "Tự động hóa", diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 536c5eb9b85..4eb1e6c54eb 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -1736,8 +1736,55 @@ } }, "estimates": { + "label": "估算", "title": "为我的项目启用估算", - "description": "它们有助于您传达团队的复杂性和工作量。" + "description": "它们有助于您传达团队的复杂性和工作量。", + "no_estimate": "无估算", + "create": { + "custom": "自定义", + "start_from_scratch": "从头开始", + "choose_template": "选择模板", + "choose_estimate_system": "选择估算系统", + "enter_estimate_point": "输入估算点数" + }, + "toasts": { + "created": { + "success": { + "title": "已创建估算点数", + "message": "估算点数创建成功" + }, + "error": { + "title": "无法创建估算点数", + "message": "无法创建新的估算点数,请重试" + } + }, + "updated": { + "success": { + "title": "已更新估算", + "message": "您项目中的估算点数已更新" + }, + "error": { + "title": "无法更新估算", + "message": "无法更新估算,请重试" + } + }, + "enabled": { + "success": { + "title": "成功!", + "message": "已启用估算" + } + }, + "disabled": { + "success": { + "title": "成功!", + "message": "已禁用估算" + }, + "error": { + "title": "错误!", + "message": "无法禁用估算。请重试" + } + } + } }, "automations": { "label": "自动化", diff --git a/packages/i18n/src/locales/zh-TW/translations.json b/packages/i18n/src/locales/zh-TW/translations.json index c78ad813838..1f57b54c2a1 100644 --- a/packages/i18n/src/locales/zh-TW/translations.json +++ b/packages/i18n/src/locales/zh-TW/translations.json @@ -1738,8 +1738,64 @@ } }, "estimates": { - "title": "為我的專案啟用評估", - "description": "它們可以協助您傳達團隊的複雜度和工作量。" + "label": "估算", + "title": "为我的项目启用估算", + "description": "它们有助于您传达团队的复杂性和工作量。", + "no_estimate": "无估算", + "create": { + "custom": "自定义", + "start_from_scratch": "从头开始", + "choose_template": "选择模板", + "choose_estimate_system": "选择估算系统", + "enter_estimate_point": "输入估算点数" + }, + "toasts": { + "created": { + "success": { + "title": "已创建估算点数", + "message": "估算点数创建成功" + }, + "error": { + "title": "无法创建估算点数", + "message": "无法创建新的估算点数,请重试" + } + }, + "updated": { + "success": { + "title": "已更新估算", + "message": "您项目中的估算点数已更新" + }, + "error": { + "title": "无法更新估算", + "message": "无法更新估算,请重试" + } + }, + "enabled": { + "success": { + "title": "成功!", + "message": "已启用估算" + } + }, + "disabled": { + "success": { + "title": "成功!", + "message": "已禁用估算" + }, + "error": { + "title": "错误!", + "message": "无法禁用估算。请重试" + } + } + }, + "validation": { + "min_length": "估算点数需要大于0。", + "unable_to_process": "我们无法处理您的请求,请重试。", + "numeric": "估算点数需要是数值。", + "character": "估算点数需要是字符值。", + "empty": "估算值不能为空。", + "already_exists": "估算值已存在。", + "unsaved_changes": "您有未保存的更改,请在点击完成前保存它们" + } }, "automations": { "label": "自動化", diff --git a/packages/ui/src/dropdown/common/options.tsx b/packages/ui/src/dropdown/common/options.tsx index ae006a842de..0657ff0c5ba 100644 --- a/packages/ui/src/dropdown/common/options.tsx +++ b/packages/ui/src/dropdown/common/options.tsx @@ -50,6 +50,7 @@ export const DropdownOptions: React.FC cn( "flex w-full cursor-pointer select-none items-center justify-between gap-2 truncate rounded px-1 py-1.5", @@ -66,7 +67,7 @@ export const DropdownOptions: React.FC ( <> {renderItem ? ( - <>{renderItem({ value: keyExtractor(option), selected })} + <>{renderItem({ value: keyExtractor(option), selected, disabled: option.disabled })} ) : ( <> {option.value} diff --git a/packages/ui/src/dropdown/dropdown.d.ts b/packages/ui/src/dropdown/dropdown.d.ts index 74cd0e45d9d..dd441d0a861 100644 --- a/packages/ui/src/dropdown/dropdown.d.ts +++ b/packages/ui/src/dropdown/dropdown.d.ts @@ -27,7 +27,15 @@ export interface IDropdown { queryArray?: string[]; sortByKey?: string; firstItem?: (optionValue: string) => boolean; - renderItem?: ({ value, selected }: { value: string; selected: boolean }) => React.ReactNode; + renderItem?: ({ + value, + selected, + disabled, + }: { + value: string; + selected: boolean; + disabled?: boolean; + }) => React.ReactNode; loader?: React.ReactNode; disableSorting?: boolean; } @@ -35,7 +43,8 @@ export interface IDropdown { export interface TDropdownOption { data: any; value: string; - className?: ({ active, selected }: { active: boolean; selected: boolean }) => string; + className?: ({ active, selected }: { active: boolean; selected?: boolean }) => string; + disabled?: boolean; } export interface IMultiSelectDropdown extends IDropdown { @@ -82,7 +91,9 @@ export interface IDropdownOptions { handleClose?: () => void; keyExtractor: (option: TDropdownOption) => string; - renderItem: (({ value, selected }: { value: string; selected: boolean }) => React.ReactNode) | undefined; + renderItem: + | (({ value, selected, disabled }: { value: string; selected: boolean; disabled?: boolean }) => React.ReactNode) + | undefined; options: TDropdownOption[] | undefined; loader?: React.ReactNode; isMobile?: boolean; diff --git a/web/ce/components/estimates/helper.tsx b/web/ce/components/estimates/helper.tsx new file mode 100644 index 00000000000..4d219652798 --- /dev/null +++ b/web/ce/components/estimates/helper.tsx @@ -0,0 +1,13 @@ +import { TEstimateSystemKeys } from "@plane/types"; +import { EEstimateSystem } from "@plane/types/src/enums"; + +export const isEstimateSystemEnabled = (key: TEstimateSystemKeys) => { + switch (key) { + case EEstimateSystem.POINTS: + return true; + case EEstimateSystem.CATEGORIES: + return true; + default: + return false; + } +}; diff --git a/web/ce/components/estimates/index.ts b/web/ce/components/estimates/index.ts index 918b72d8d7c..4852874e249 100644 --- a/web/ce/components/estimates/index.ts +++ b/web/ce/components/estimates/index.ts @@ -1,3 +1,4 @@ export * from "./estimate-list-item-buttons"; export * from "./update"; export * from "./points"; +export * from "./helper"; diff --git a/web/ce/components/estimates/inputs/index.ts b/web/ce/components/estimates/inputs/index.ts new file mode 100644 index 00000000000..49b9c68c44e --- /dev/null +++ b/web/ce/components/estimates/inputs/index.ts @@ -0,0 +1 @@ +export * from "./time-input"; diff --git a/web/ce/components/estimates/inputs/time-input.tsx b/web/ce/components/estimates/inputs/time-input.tsx new file mode 100644 index 00000000000..0e5156cb6a6 --- /dev/null +++ b/web/ce/components/estimates/inputs/time-input.tsx @@ -0,0 +1,8 @@ +import { FC } from "react"; + +export type TEstimateTimeInputProps = { + value?: number; + handleEstimateInputValue: (value: string) => void; +}; + +export const EstimateTimeInput: FC = () => <>; diff --git a/web/ce/components/estimates/points/delete.tsx b/web/ce/components/estimates/points/delete.tsx index 08dd605e437..84791392bbc 100644 --- a/web/ce/components/estimates/points/delete.tsx +++ b/web/ce/components/estimates/points/delete.tsx @@ -2,16 +2,18 @@ import { FC } from "react"; -import { TEstimateTypeErrorObject } from "@plane/types"; +import { TEstimatePointsObject, TEstimateSystemKeys, TEstimateTypeErrorObject } from "@plane/types"; -type TEstimatePointDelete = { +export type TEstimatePointDelete = { workspaceSlug: string; projectId: string; estimateId: string; estimatePointId: string; + estimatePoints: TEstimatePointsObject[]; callback: () => void; estimatePointError?: TEstimateTypeErrorObject | undefined; handleEstimatePointError?: (newValue: string, message: string | undefined, mode?: "add" | "delete") => void; + estimateSystem: TEstimateSystemKeys; }; export const EstimatePointDelete: FC = () => <>; diff --git a/web/ce/constants/estimates.ts b/web/ce/constants/estimates.ts index 7ffe761a8b1..6692c8cbdb8 100644 --- a/web/ce/constants/estimates.ts +++ b/web/ce/constants/estimates.ts @@ -119,7 +119,7 @@ export const ESTIMATE_SYSTEMS: TEstimateSystems = { ], }, }, - is_available: false, + is_available: true, is_ee: true, }, }; diff --git a/web/core/components/dropdowns/estimate.tsx b/web/core/components/dropdowns/estimate.tsx index f049adf74c5..fc3b59be0c3 100644 --- a/web/core/components/dropdowns/estimate.tsx +++ b/web/core/components/dropdowns/estimate.tsx @@ -5,8 +5,11 @@ import { usePopper } from "react-popper"; import { Check, ChevronDown, Search, Triangle } from "lucide-react"; import { Combobox } from "@headlessui/react"; // ui +import { useTranslation } from "@plane/i18n"; +import { EEstimateSystem } from "@plane/types/src/enums"; import { ComboDropDown } from "@plane/ui"; // helpers +import { convertMinutesToHoursMinutesString } from "@plane/utils"; import { cn } from "@/helpers/common.helper"; // hooks import { @@ -61,6 +64,8 @@ export const EstimateDropdown: React.FC = observer((props) => { value, renderByDefault = true, } = props; + // i18n + const { t } = useTranslation(); // states const [query, setQuery] = useState(""); const [isOpen, setIsOpen] = useState(false); @@ -85,7 +90,7 @@ export const EstimateDropdown: React.FC = observer((props) => { // router const { workspaceSlug } = useParams(); // store hooks - const { currentActiveEstimateIdByProjectId, getProjectEstimates } = useProjectEstimates(); + const { currentActiveEstimateIdByProjectId, getProjectEstimates, currentActiveEstimate } = useProjectEstimates(); const { estimatePointIds, estimatePointById } = useEstimate( projectId ? currentActiveEstimateIdByProjectId(projectId) : undefined ); @@ -102,7 +107,11 @@ export const EstimateDropdown: React.FC = observer((props) => { content: (
- {currentEstimatePoint.value} + + {currentActiveEstimate?.type === EEstimateSystem.TIME + ? convertMinutesToHoursMinutesString(Number(currentEstimatePoint.value)) + : currentEstimatePoint.value} +
), }; @@ -111,11 +120,11 @@ export const EstimateDropdown: React.FC = observer((props) => { .filter((estimatePointDropdownOption) => estimatePointDropdownOption != undefined) as DropdownOptions; options?.unshift({ value: null, - query: "No estimate", + query: t("project_settings.estimates.no_estimate"), content: (
- No estimate + {t("project_settings.estimates.no_estimate")}
), }); @@ -176,7 +185,7 @@ export const EstimateDropdown: React.FC = observer((props) => { = observer((props) => { > {!hideIcon && } {(selectedEstimate || placeholder) && BUTTON_VARIANTS_WITH_TEXT.includes(buttonVariant) && ( - {selectedEstimate ? selectedEstimate?.value : placeholder} + + {selectedEstimate + ? currentActiveEstimate?.type === EEstimateSystem.TIME + ? convertMinutesToHoursMinutesString(Number(selectedEstimate.value)) + : selectedEstimate.value + : placeholder} + )} {dropdownArrow && (