@translationstudio/translationstudio-strapi-extension 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ const admin = require("@strapi/strapi/admin");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const react = require("react");
8
- const index = require("./index-DkASHLO0.js");
8
+ const index = require("./index-C161VmZk.js");
9
9
  const apiService = {
10
10
  async loadLicense(get) {
11
11
  try {
@@ -3,7 +3,7 @@ import { getFetchClient, Page } from "@strapi/strapi/admin";
3
3
  import { Routes, Route } from "react-router-dom";
4
4
  import { Main, Box, Alert, Grid, Typography, TextInput, Switch, Button } from "@strapi/design-system";
5
5
  import { useState, useCallback, useEffect } from "react";
6
- import { T as TranslationstudioLogo } from "./index-DF5d8Feh.mjs";
6
+ import { T as TranslationstudioLogo } from "./index-DbnNvy-W.mjs";
7
7
  const apiService = {
8
8
  async loadLicense(get) {
9
9
  try {
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { Box, Typography, TextInput, Table, Thead, Tr, Tbody, Td, Badge, Th, Button, Radio, Checkbox, DatePicker, ProgressBar, Alert, Main, Grid, Flex } from "@strapi/design-system";
3
3
  import { useState, useEffect, useMemo } from "react";
4
4
  import { getFetchClient } from "@strapi/strapi/admin";
5
- import { g as groupHistoryData, f as formatDate, h as handleHistoryResponse, a as getThemeColors, u as useThemeMode, b as getStoredEmail, c as getSubmitLabel, s as setStoredEmail, v as validateDueDate, d as createEntryUid, e as determineEntryName, i as createTranslationPayload, j as createSuccessMessage, k as createErrorMessage, l as createGeneralErrorMessage, T as TranslationstudioLogo } from "./index-DF5d8Feh.mjs";
5
+ import { g as groupHistoryData, f as formatDate, h as handleHistoryResponse, a as getThemeColors, u as useThemeMode, b as getStoredEmail, c as getSubmitLabel, s as setStoredEmail, v as validateDueDate, d as createEntryUid, e as determineEntryName, i as createTranslationPayload, j as createSuccessMessage, k as createErrorMessage, l as createGeneralErrorMessage, T as TranslationstudioLogo } from "./index-DbnNvy-W.mjs";
6
6
  const getSearchableText = (item) => {
7
7
  return `${item["project-name"]} ${item["element-name"]} ${item["element-uid"]} ${item.targetLanguages.join(" ")} ${item.combinedStatus.text}`.toLowerCase();
8
8
  };
@@ -213,7 +213,7 @@ const LanguageSelector = ({
213
213
  tag: "label",
214
214
  paddingBottom: 2,
215
215
  style: { color: themeColors.primaryText },
216
- children: "Languages / Connectors"
216
+ children: "Translation Options"
217
217
  }
218
218
  ),
219
219
  languages.map((lang) => /* @__PURE__ */ jsx(Radio.Item, { value: lang.name, children: lang.name }, lang.id))
@@ -539,6 +539,7 @@ const BulkTranslationPanel = ({
539
539
  children: /* @__PURE__ */ jsx("path", { d: "M2,21L23,12L2,3V10L17,12L2,14V21Z", fill: "currentColor" })
540
540
  }
541
541
  ),
542
+ style: { height: "auto" },
542
543
  children: getSubmitLabel(selectedEntries.length, isUrgent, isMachineTranslation)
543
544
  }
544
545
  )
@@ -740,60 +741,13 @@ const EntriesTable = ({
740
741
  maxHeight: "fit-content",
741
742
  backgroundColor: themeColors.cardBackground
742
743
  },
743
- children: /* @__PURE__ */ jsxs(Table, { colCount: 6, rowCount: entries.length + 1, children: [
744
+ children: /* @__PURE__ */ jsxs(Table, { colCount: 5, children: [
744
745
  /* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
745
- /* @__PURE__ */ jsx(Th, { style: { width: "50px" }, children: /* @__PURE__ */ jsx(
746
- Checkbox,
747
- {
748
- checked: checkedType,
749
- onCheckedChange: onSelectAll
750
- }
751
- ) }),
752
- /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
753
- Typography,
754
- {
755
- variant: "sigma",
756
- fontWeight: "bold",
757
- style: { color: themeColors.primaryText },
758
- children: "Title"
759
- }
760
- ) }),
761
- /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
762
- Typography,
763
- {
764
- variant: "sigma",
765
- fontWeight: "bold",
766
- style: { color: themeColors.primaryText },
767
- children: "ID"
768
- }
769
- ) }),
770
- /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
771
- Typography,
772
- {
773
- variant: "sigma",
774
- fontWeight: "bold",
775
- style: { color: themeColors.primaryText },
776
- children: "Status"
777
- }
778
- ) }),
779
- /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
780
- Typography,
781
- {
782
- variant: "sigma",
783
- fontWeight: "bold",
784
- style: { color: themeColors.primaryText },
785
- children: "Target Language"
786
- }
787
- ) }),
788
- /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
789
- Typography,
790
- {
791
- variant: "sigma",
792
- fontWeight: "bold",
793
- style: { color: themeColors.primaryText },
794
- children: "Date"
795
- }
796
- ) })
746
+ /* @__PURE__ */ jsx(Th, { style: { width: "50px" }, children: /* @__PURE__ */ jsx(Checkbox, { checked: checkedType, onCheckedChange: onSelectAll }) }),
747
+ /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Title" }) }),
748
+ /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Status" }) }),
749
+ /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Target Language" }) }),
750
+ /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Date" }) })
797
751
  ] }) }),
798
752
  /* @__PURE__ */ jsx(Tbody, { children: entries.map((entry) => /* @__PURE__ */ jsx(
799
753
  EntryRow,
@@ -831,15 +785,11 @@ const EntryRow = ({
831
785
  onCheckedChange: (checked) => onEntrySelection(entryId, checked)
832
786
  }
833
787
  ) }),
834
- /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: getEntryTitle(entry) }) }),
835
- /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
836
- Typography,
837
- {
838
- variant: "omega",
839
- style: { fontFamily: "monospace", fontSize: "12px", color: themeColors.secondaryText },
840
- children: entryId
841
- }
842
- ) }),
788
+ /* @__PURE__ */ jsxs(Td, { children: [
789
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: getEntryTitle(entry) }),
790
+ /* @__PURE__ */ jsx("br", {}),
791
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { fontFamily: "monospace", fontSize: "12px", color: themeColors.secondaryText }, children: entryId })
792
+ ] }),
843
793
  /* @__PURE__ */ jsx(Td, { children: isLoadingHistory ? /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { color: themeColors.mutedText }, children: "Loading..." }) : /* @__PURE__ */ jsx(Badge, { variant: getStatusBadgeVariant(status), children: getStatusDisplayText(status) }) }),
844
794
  /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: targetLanguages.map((lang) => lang.toUpperCase()).join(", ") || "-" }) }),
845
795
  /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: date }) })
@@ -976,7 +926,7 @@ const BulkTranslationMenu = ({
976
926
  }
977
927
  ),
978
928
  /* @__PURE__ */ jsx(Box, { style: { width: "400px", flexShrink: 0, display: "flex", flexDirection: "column" }, children: selectedEntries.size > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
979
- /* @__PURE__ */ jsx(Typography, { variant: "omega", paddingBottom: 3, style: { fontWeight: "bold" }, children: "Translation Settings" }),
929
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", paddingBottom: 3, style: { fontWeight: "bold" }, children: "Translation Options" }),
980
930
  /* @__PURE__ */ jsx(Box, { style: { borderRadius: "4px", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
981
931
  BulkTranslationPanel,
982
932
  {
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const designSystem = require("@strapi/design-system");
5
5
  const react = require("react");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const index = require("./index-DkASHLO0.js");
7
+ const index = require("./index-C161VmZk.js");
8
8
  const getSearchableText = (item) => {
9
9
  return `${item["project-name"]} ${item["element-name"]} ${item["element-uid"]} ${item.targetLanguages.join(" ")} ${item.combinedStatus.text}`.toLowerCase();
10
10
  };
@@ -215,7 +215,7 @@ const LanguageSelector = ({
215
215
  tag: "label",
216
216
  paddingBottom: 2,
217
217
  style: { color: themeColors.primaryText },
218
- children: "Languages / Connectors"
218
+ children: "Translation Options"
219
219
  }
220
220
  ),
221
221
  languages.map((lang) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Radio.Item, { value: lang.name, children: lang.name }, lang.id))
@@ -541,6 +541,7 @@ const BulkTranslationPanel = ({
541
541
  children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2,21L23,12L2,3V10L17,12L2,14V21Z", fill: "currentColor" })
542
542
  }
543
543
  ),
544
+ style: { height: "auto" },
544
545
  children: index.getSubmitLabel(selectedEntries.length, isUrgent, isMachineTranslation)
545
546
  }
546
547
  )
@@ -742,60 +743,13 @@ const EntriesTable = ({
742
743
  maxHeight: "fit-content",
743
744
  backgroundColor: themeColors.cardBackground
744
745
  },
745
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 6, rowCount: entries.length + 1, children: [
746
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 5, children: [
746
747
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
747
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { width: "50px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
748
- designSystem.Checkbox,
749
- {
750
- checked: checkedType,
751
- onCheckedChange: onSelectAll
752
- }
753
- ) }),
754
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(
755
- designSystem.Typography,
756
- {
757
- variant: "sigma",
758
- fontWeight: "bold",
759
- style: { color: themeColors.primaryText },
760
- children: "Title"
761
- }
762
- ) }),
763
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(
764
- designSystem.Typography,
765
- {
766
- variant: "sigma",
767
- fontWeight: "bold",
768
- style: { color: themeColors.primaryText },
769
- children: "ID"
770
- }
771
- ) }),
772
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(
773
- designSystem.Typography,
774
- {
775
- variant: "sigma",
776
- fontWeight: "bold",
777
- style: { color: themeColors.primaryText },
778
- children: "Status"
779
- }
780
- ) }),
781
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(
782
- designSystem.Typography,
783
- {
784
- variant: "sigma",
785
- fontWeight: "bold",
786
- style: { color: themeColors.primaryText },
787
- children: "Target Language"
788
- }
789
- ) }),
790
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(
791
- designSystem.Typography,
792
- {
793
- variant: "sigma",
794
- fontWeight: "bold",
795
- style: { color: themeColors.primaryText },
796
- children: "Date"
797
- }
798
- ) })
748
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { style: { width: "50px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Checkbox, { checked: checkedType, onCheckedChange: onSelectAll }) }),
749
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Title" }) }),
750
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Status" }) }),
751
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Target Language" }) }),
752
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { color: themeColors.primaryText }, children: "Date" }) })
799
753
  ] }) }),
800
754
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: entries.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(
801
755
  EntryRow,
@@ -833,15 +787,11 @@ const EntryRow = ({
833
787
  onCheckedChange: (checked) => onEntrySelection(entryId, checked)
834
788
  }
835
789
  ) }),
836
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: getEntryTitle(entry) }) }),
837
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(
838
- designSystem.Typography,
839
- {
840
- variant: "omega",
841
- style: { fontFamily: "monospace", fontSize: "12px", color: themeColors.secondaryText },
842
- children: entryId
843
- }
844
- ) }),
790
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Td, { children: [
791
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: getEntryTitle(entry) }),
792
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
793
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { fontFamily: "monospace", fontSize: "12px", color: themeColors.secondaryText }, children: entryId })
794
+ ] }),
845
795
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: isLoadingHistory ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: themeColors.mutedText }, children: "Loading..." }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { variant: getStatusBadgeVariant(status), children: getStatusDisplayText(status) }) }),
846
796
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: targetLanguages.map((lang) => lang.toUpperCase()).join(", ") || "-" }) }),
847
797
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: themeColors.primaryText }, children: date }) })
@@ -978,7 +928,7 @@ const BulkTranslationMenu = ({
978
928
  }
979
929
  ),
980
930
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: "400px", flexShrink: 0, display: "flex", flexDirection: "column" }, children: selectedEntries.size > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
981
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", paddingBottom: 3, style: { fontWeight: "bold" }, children: "Translation Settings" }),
931
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", paddingBottom: 3, style: { fontWeight: "bold" }, children: "Translation Options" }),
982
932
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { borderRadius: "4px", overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
983
933
  BulkTranslationPanel,
984
934
  {
@@ -768,7 +768,7 @@ const index = {
768
768
  defaultMessage: "translationstudio Settings"
769
769
  },
770
770
  Component: async () => {
771
- const { App } = await Promise.resolve().then(() => require("./App-5ldte7Ku.js"));
771
+ const { App } = await Promise.resolve().then(() => require("./App-D1C56yXv.js"));
772
772
  return App;
773
773
  }
774
774
  });
@@ -780,7 +780,7 @@ const index = {
780
780
  defaultMessage: "translationstudio Dashboard"
781
781
  },
782
782
  Component: async () => {
783
- const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-C1EG7XIt.js"));
783
+ const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-CjYOTXJN.js"));
784
784
  return HistoryPage;
785
785
  }
786
786
  });
@@ -767,7 +767,7 @@ const index = {
767
767
  defaultMessage: "translationstudio Settings"
768
768
  },
769
769
  Component: async () => {
770
- const { App } = await import("./App-DQUxEmfa.mjs");
770
+ const { App } = await import("./App-DCd2etbn.mjs");
771
771
  return App;
772
772
  }
773
773
  });
@@ -779,7 +779,7 @@ const index = {
779
779
  defaultMessage: "translationstudio Dashboard"
780
780
  },
781
781
  Component: async () => {
782
- const { HistoryPage } = await import("./HistoryPage-Cwm3HJc9.mjs");
782
+ const { HistoryPage } = await import("./HistoryPage-C_aFSFSJ.mjs");
783
783
  return HistoryPage;
784
784
  }
785
785
  });
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-DkASHLO0.js");
2
+ const index = require("../_chunks/index-C161VmZk.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { m } from "../_chunks/index-DF5d8Feh.mjs";
1
+ import { m } from "../_chunks/index-DbnNvy-W.mjs";
2
2
  export {
3
3
  m as default
4
4
  };
@@ -337,7 +337,7 @@ function getContentType(contentTypeID) {
337
337
  entry: contentType,
338
338
  components: getComponentSchemata(contentType)
339
339
  };
340
- strapi.log.info("SChema loaded for " + contentTypeID + ". Component schemata loaded: " + Object.keys(res.components).length);
340
+ strapi.log.info("Schema loaded for " + contentTypeID + " - component schemata loaded: " + Object.keys(res.components).length);
341
341
  return res;
342
342
  }
343
343
  const parsePayload = (payload) => {
@@ -381,15 +381,17 @@ const getEntry = async (contentTypeID, entryID, locale, logError = true) => {
381
381
  documentId: entryID,
382
382
  populate: populateConfig
383
383
  };
384
- const entry = await strapi.documents(contentTypeID).findFirst(query);
384
+ const entry = await strapi.documents(contentTypeID).findOne(query);
385
385
  if (entry) {
386
- strapi.log.info("Obtained " + contentTypeID + "::" + entryID + " in " + locale);
386
+ if (entry.documentId !== entryID || entry.locale !== locale)
387
+ throw new Error("Document does not match. Ignoring this transation.");
388
+ strapi.log.info("Obtained " + contentTypeID + "/" + entryID + " in " + locale + " - result matches query.");
387
389
  return entry;
388
390
  }
389
391
  } catch (error) {
390
392
  strapi.log.error(error.message ?? error);
391
393
  }
392
- strapi.log.warn("Could not find entry " + entryID + " in locale " + locale);
394
+ strapi.log.warn("Could not find entry " + entryID + " of content type " + contentTypeID + " in locale " + locale);
393
395
  return null;
394
396
  };
395
397
  const transformResponse = function(data) {
@@ -1193,9 +1195,7 @@ const service = ({ strapi: strapi2 }) => {
1193
1195
  try {
1194
1196
  const sourceEntry = await getEntry(contentTypeID, entryID, sourceLocale);
1195
1197
  if (sourceEntry == null)
1196
- throw new Error(
1197
- "Cannot find source entry " + contentTypeID + "::" + entryID + " in " + sourceLocale
1198
- );
1198
+ throw new Error("Cannot find source entry " + contentTypeID + "::" + entryID + " in " + sourceLocale);
1199
1199
  const targetSchema = getContentType(contentTypeID);
1200
1200
  if (targetSchema === null || !IsLocalisableSchema(targetSchema.entry))
1201
1201
  throw new Error("Cannot find schema");
@@ -318,7 +318,7 @@ function getContentType(contentTypeID) {
318
318
  entry: contentType,
319
319
  components: getComponentSchemata(contentType)
320
320
  };
321
- strapi.log.info("SChema loaded for " + contentTypeID + ". Component schemata loaded: " + Object.keys(res.components).length);
321
+ strapi.log.info("Schema loaded for " + contentTypeID + " - component schemata loaded: " + Object.keys(res.components).length);
322
322
  return res;
323
323
  }
324
324
  const parsePayload = (payload) => {
@@ -362,15 +362,17 @@ const getEntry = async (contentTypeID, entryID, locale, logError = true) => {
362
362
  documentId: entryID,
363
363
  populate: populateConfig
364
364
  };
365
- const entry = await strapi.documents(contentTypeID).findFirst(query);
365
+ const entry = await strapi.documents(contentTypeID).findOne(query);
366
366
  if (entry) {
367
- strapi.log.info("Obtained " + contentTypeID + "::" + entryID + " in " + locale);
367
+ if (entry.documentId !== entryID || entry.locale !== locale)
368
+ throw new Error("Document does not match. Ignoring this transation.");
369
+ strapi.log.info("Obtained " + contentTypeID + "/" + entryID + " in " + locale + " - result matches query.");
368
370
  return entry;
369
371
  }
370
372
  } catch (error) {
371
373
  strapi.log.error(error.message ?? error);
372
374
  }
373
- strapi.log.warn("Could not find entry " + entryID + " in locale " + locale);
375
+ strapi.log.warn("Could not find entry " + entryID + " of content type " + contentTypeID + " in locale " + locale);
374
376
  return null;
375
377
  };
376
378
  const transformResponse = function(data) {
@@ -1174,9 +1176,7 @@ const service = ({ strapi: strapi2 }) => {
1174
1176
  try {
1175
1177
  const sourceEntry = await getEntry(contentTypeID, entryID, sourceLocale);
1176
1178
  if (sourceEntry == null)
1177
- throw new Error(
1178
- "Cannot find source entry " + contentTypeID + "::" + entryID + " in " + sourceLocale
1179
- );
1179
+ throw new Error("Cannot find source entry " + contentTypeID + "::" + entryID + " in " + sourceLocale);
1180
1180
  const targetSchema = getContentType(contentTypeID);
1181
1181
  if (targetSchema === null || !IsLocalisableSchema(targetSchema.entry))
1182
1182
  throw new Error("Cannot find schema");
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  }
11
11
  ],
12
12
  "homepage": "https://translationstudio.tech",
13
- "version": "4.1.0",
13
+ "version": "4.2.0",
14
14
  "keywords": [
15
15
  "translationstudio",
16
16
  "strapi",
@@ -50,34 +50,33 @@
50
50
  "test:ts:back": "run -T tsc -p server/tsconfig.json"
51
51
  },
52
52
  "dependencies": {
53
- "@strapi/design-system": "2.0.1",
54
- "@strapi/icons": "2.0.1",
55
- "react-intl": "7.1.10",
53
+ "@strapi/design-system": "^2.0.1",
54
+ "@strapi/icons": "^2.0.1",
55
+ "react-intl": "^7.1.10",
56
56
  "translationstudio-strapi-extension": "file:.yalc/translationstudio-strapi-extension"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/preset-typescript": "7.27.1",
60
- "@jest/globals": "30.0.0-beta.3",
61
- "@strapi/sdk-plugin": "5.4.0",
62
- "@strapi/strapi": "5.33.1",
63
- "@strapi/typescript-utils": "5.33.1",
59
+ "@babel/preset-typescript": "^7.27.1",
60
+ "@jest/globals": "^30.0.0-beta.3",
61
+ "@strapi/sdk-plugin": "^5.4.0",
62
+ "@strapi/strapi": "^5.33.1",
63
+ "@strapi/typescript-utils": "^5.33.1",
64
64
  "@types/jest": "^29.5.14",
65
- "@types/react": "18.3.20",
66
- "@types/react-dom": "18.3.6",
67
- "jest": "29.7.0",
68
- "prettier": "3.4.2",
69
- "ts-jest": "29.3.4",
70
- "typescript": "5.7.2",
71
- "@strapi/design-system": "2.0.1",
72
- "@strapi/icons": "2.0.1"
65
+ "@types/react": "^18.3.20",
66
+ "@types/react-dom": "^18.3.6",
67
+ "jest": "^29.7.0",
68
+ "prettier": "^3.4.2",
69
+ "ts-jest": "^29.3.4",
70
+ "typescript": "^5.7.2",
71
+ "@strapi/design-system": "^2.0.1"
73
72
  },
74
73
  "peerDependencies": {
75
- "@strapi/sdk-plugin": "5.4.0",
76
- "@strapi/strapi": "5.33.1",
77
- "react": "18.3.1",
78
- "react-dom": "18.3.1",
79
- "react-router-dom": "6.30.0",
80
- "styled-components": "6.1.13"
74
+ "@strapi/sdk-plugin": "^5.4.0",
75
+ "@strapi/strapi": "^5.33.1",
76
+ "react": "^18.3.1",
77
+ "react-dom": "^18.3.1",
78
+ "react-router-dom": "^6.30.0",
79
+ "styled-components": "^6.1.13"
81
80
  },
82
81
  "strapi": {
83
82
  "kind": "plugin",