Skip to content

Commit 906c1b5

Browse files
[WEB-5624] chore: added webhook translations #8312
1 parent 8e51896 commit 906c1b5

File tree

20 files changed

+159
-58
lines changed

20 files changed

+159
-58
lines changed

apps/web/core/components/exporter/export-form.tsx

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ import { useState } from "react";
22
import { intersection } from "lodash-es";
33
import { observer } from "mobx-react";
44
import { Controller, useForm } from "react-hook-form";
5-
import { Info } from "lucide-react";
5+
// import { Info } from "lucide-react";
66
import {
77
EUserPermissions,
88
EUserPermissionsLevel,
99
EXPORTERS_LIST,
10-
ISSUE_DISPLAY_FILTERS_BY_PAGE,
10+
// ISSUE_DISPLAY_FILTERS_BY_PAGE,
1111
WORKSPACE_SETTINGS_TRACKER_EVENTS,
1212
WORKSPACE_SETTINGS_TRACKER_ELEMENTS,
1313
} from "@plane/constants";
1414
import { useTranslation } from "@plane/i18n";
1515
import { Button } from "@plane/propel/button";
1616
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
17-
import { Tooltip } from "@plane/propel/tooltip";
18-
import { EIssuesStoreType } from "@plane/types";
17+
// import { Tooltip } from "@plane/propel/tooltip";
18+
// import { EIssuesStoreType } from "@plane/types";
1919
import type { TWorkItemFilterExpression } from "@plane/types";
2020
import { CustomSearchSelect, CustomSelect } from "@plane/ui";
21-
import { WorkspaceLevelWorkItemFiltersHOC } from "@/components/work-item-filters/filters-hoc/workspace-level";
22-
import { WorkItemFiltersRow } from "@/components/work-item-filters/filters-row";
21+
// import { WorkspaceLevelWorkItemFiltersHOC } from "@/components/work-item-filters/filters-hoc/workspace-level";
22+
// import { WorkItemFiltersRow } from "@/components/work-item-filters/filters-row";
2323
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
2424
import { useProject } from "@/hooks/store/use-project";
2525
import { useUser, useUserPermissions } from "@/hooks/store/user";
@@ -37,15 +37,15 @@ type FormData = {
3737
filters: TWorkItemFilterExpression;
3838
};
3939

40-
const initialWorkItemFilters = {
41-
richFilters: {},
42-
displayFilters: {},
43-
displayProperties: {},
44-
kanbanFilters: {
45-
group_by: [],
46-
sub_group_by: [],
47-
},
48-
};
40+
// const initialWorkItemFilters = {
41+
// richFilters: {},
42+
// displayFilters: {},
43+
// displayProperties: {},
44+
// kanbanFilters: {
45+
// group_by: [],
46+
// sub_group_by: [],
47+
// },
48+
// };
4949

5050
const projectExportService = new ProjectExportService();
5151

@@ -101,52 +101,57 @@ export const ExportForm = observer(function ExportForm(props: Props) {
101101
multiple: formData.project.length > 1,
102102
rich_filters: formData.filters,
103103
};
104-
await projectExportService
105-
.csvExport(workspaceSlug, payload)
106-
.then(() => {
107-
mutateServices();
108-
setExportLoading(false);
109-
captureSuccess({
110-
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
111-
payload: {
112-
provider: formData.provider.provider,
113-
},
114-
});
115-
setToast({
116-
type: TOAST_TYPE.SUCCESS,
117-
title: t("workspace_settings.settings.exports.modal.toasts.success.title"),
118-
message: t("workspace_settings.settings.exports.modal.toasts.success.message", {
119-
entity:
120-
formData.provider.provider === "csv"
121-
? "CSV"
122-
: formData.provider.provider === "xlsx"
123-
? "Excel"
124-
: formData.provider.provider === "json"
125-
? "JSON"
126-
: "",
127-
}),
128-
});
129-
})
130-
.catch((error) => {
131-
setExportLoading(false);
132-
captureError({
133-
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
134-
payload: {
135-
provider: formData.provider.provider,
136-
},
137-
error: error as Error,
138-
});
139-
setToast({
140-
type: TOAST_TYPE.ERROR,
141-
title: t("error"),
142-
message: t("workspace_settings.settings.exports.modal.toasts.error.message"),
143-
});
104+
try {
105+
await projectExportService.csvExport(workspaceSlug, payload);
106+
mutateServices();
107+
setExportLoading(false);
108+
captureSuccess({
109+
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
110+
payload: {
111+
provider: formData.provider.provider,
112+
},
113+
});
114+
setToast({
115+
type: TOAST_TYPE.SUCCESS,
116+
title: t("workspace_settings.settings.exports.modal.toasts.success.title"),
117+
message: t("workspace_settings.settings.exports.modal.toasts.success.message", {
118+
entity:
119+
formData.provider.provider === "csv"
120+
? "CSV"
121+
: formData.provider.provider === "xlsx"
122+
? "Excel"
123+
: formData.provider.provider === "json"
124+
? "JSON"
125+
: "",
126+
}),
127+
});
128+
} catch (error) {
129+
setExportLoading(false);
130+
captureError({
131+
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
132+
payload: {
133+
provider: formData.provider.provider,
134+
},
135+
error: error as Error,
144136
});
137+
setToast({
138+
type: TOAST_TYPE.ERROR,
139+
title: t("error"),
140+
message: t("workspace_settings.settings.exports.modal.toasts.error.message"),
141+
});
142+
}
143+
} else {
144+
setExportLoading(false);
145145
}
146146
}
147147

148148
return (
149-
<form onSubmit={handleSubmit(ExportCSVToMail)} className="flex flex-col gap-4 mt-4">
149+
<form
150+
onSubmit={(e) => {
151+
void handleSubmit(ExportCSVToMail)(e);
152+
}}
153+
className="flex flex-col gap-4 mt-4"
154+
>
150155
<div className="flex gap-4">
151156
{/* Project Selector */}
152157
<div className="w-1/2">
@@ -210,7 +215,7 @@ export const ExportForm = observer(function ExportForm(props: Props) {
210215
</div>
211216
</div>
212217
{/* Rich Filters */}
213-
<div className="w-full">
218+
{/* <div className="w-full">
214219
<div className="flex items-center gap-2 mb-2">
215220
<div className="text-sm font-medium text-custom-text-200 leading-tight">{t("common.filters")}</div>
216221
<Tooltip
@@ -251,7 +256,7 @@ export const ExportForm = observer(function ExportForm(props: Props) {
251256
</WorkspaceLevelWorkItemFiltersHOC>
252257
)}
253258
/>
254-
</div>
259+
</div> */}
255260
<div className="flex items-center justify-between">
256261
<Button
257262
variant="primary"

packages/i18n/src/locales/cs/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,10 @@ export default {
188188
"Generujte bezpečné API tokeny pro připojení vašeho pracovního prostoru s externími systémy a aplikacemi.",
189189
cta_primary: "Přidat API token",
190190
},
191+
webhooks: {
192+
title: "Zatím nebyl přidán žádný Webhook",
193+
description: "Automatizujte oznámení externím službám při výskytu událostí projektu.",
194+
cta_primary: "Přidat webhook",
195+
},
191196
},
192197
} as const;

packages/i18n/src/locales/de/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,10 @@ export default {
198198
"Generieren Sie sichere API-Tokens, um Ihren Workspace mit externen Systemen und Anwendungen zu verbinden.",
199199
cta_primary: "API-Token hinzufügen",
200200
},
201+
webhooks: {
202+
title: "Noch kein Webhook hinzugefügt",
203+
description: "Automatisieren Sie Benachrichtigungen an externe Dienste, wenn Projektereignisse auftreten.",
204+
cta_primary: "Webhook hinzufügen",
205+
},
201206
},
202207
} as const;

packages/i18n/src/locales/en/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,10 @@ export default {
183183
description: "Generate secure API tokens to connect your workspace with external systems and applications.",
184184
cta_primary: "Add API token",
185185
},
186+
webhooks: {
187+
title: "No Webhook added yet",
188+
description: "Automate notifications to external services when project events occur.",
189+
cta_primary: "Add webhook",
190+
},
186191
},
187192
} as const;

packages/i18n/src/locales/es/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,10 @@ export default {
192192
"Genera tokens API seguros para conectar tu espacio de trabajo con sistemas y aplicaciones externos.",
193193
cta_primary: "Agregar token API",
194194
},
195+
webhooks: {
196+
title: "Aún no se ha agregado ningún Webhook",
197+
description: "Automatiza las notificaciones a servicios externos cuando ocurran eventos del proyecto.",
198+
cta_primary: "Agregar webhook",
199+
},
195200
},
196201
} as const;

packages/i18n/src/locales/fr/empty-state.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,11 @@ export default {
195195
"Générez des jetons API sécurisés pour connecter votre espace de travail avec des systèmes et applications externes.",
196196
cta_primary: "Ajouter un jeton API",
197197
},
198+
webhooks: {
199+
title: "Aucun Webhook ajouté pour le moment",
200+
description:
201+
"Automatisez les notifications vers des services externes lorsque des événements de projet se produisent.",
202+
cta_primary: "Ajouter un webhook",
203+
},
198204
},
199205
} as const;

packages/i18n/src/locales/id/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,10 @@ export default {
192192
"Hasilkan token API yang aman untuk menghubungkan ruang kerja Anda dengan sistem dan aplikasi eksternal.",
193193
cta_primary: "Tambahkan token API",
194194
},
195+
webhooks: {
196+
title: "Belum ada Webhook yang ditambahkan",
197+
description: "Otomatisasi notifikasi ke layanan eksternal ketika peristiwa proyek terjadi.",
198+
cta_primary: "Tambahkan webhook",
199+
},
195200
},
196201
} as const;

packages/i18n/src/locales/it/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,10 @@ export default {
192192
description: "Genera token API sicuri per connettere il tuo workspace con sistemi e applicazioni esterne.",
193193
cta_primary: "Aggiungi token API",
194194
},
195+
webhooks: {
196+
title: "Nessun Webhook aggiunto ancora",
197+
description: "Automatizza le notifiche a servizi esterni quando si verificano eventi del progetto.",
198+
cta_primary: "Aggiungi webhook",
199+
},
195200
},
196201
} as const;

packages/i18n/src/locales/ja/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,10 @@ export default {
182182
description: "ワークスペースを外部システムおよびアプリケーションと接続するための安全なAPIトークンを生成します。",
183183
cta_primary: "APIトークンを追加",
184184
},
185+
webhooks: {
186+
title: "まだWebhookが追加されていません",
187+
description: "プロジェクトイベントが発生したときに外部サービスへの通知を自動化します。",
188+
cta_primary: "Webhookを追加",
189+
},
185190
},
186191
} as const;

packages/i18n/src/locales/ko/empty-state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,10 @@ export default {
181181
description: "작업 공간을 외부 시스템 및 애플리케이션과 연결하기 위한 보안 API 토큰을 생성하세요.",
182182
cta_primary: "API 토큰 추가",
183183
},
184+
webhooks: {
185+
title: "아직 웹훅이 추가되지 않았습니다",
186+
description: "프로젝트 이벤트가 발생할 때 외부 서비스에 대한 알림을 자동화하세요.",
187+
cta_primary: "웹훅 추가",
188+
},
184189
},
185190
} as const;

0 commit comments

Comments
 (0)