@translationstudio/translationstudio-strapi-extension 4.3.0 → 5.0.1

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.
@@ -174,6 +174,8 @@ function GetStatusText(input) {
174
174
  return "translated";
175
175
  case "intranslation":
176
176
  return "in translated";
177
+ case "queued":
178
+ return "queued";
177
179
  default:
178
180
  return "";
179
181
  }
@@ -540,8 +542,7 @@ const TranslationMenu = () => {
540
542
  setIsLoadingMappings(true);
541
543
  setMappingsError(false);
542
544
  get("/translationstudio/getLicense").then((response) => {
543
- if (typeof response.data.license !== "string") return false;
544
- return response.data.license !== "";
545
+ return response.status === 204;
545
546
  }).then((hasLicense) => {
546
547
  setLicenseValid(hasLicense);
547
548
  if (!hasLicense) throw new Error("No license set");
@@ -693,17 +694,7 @@ const TranslationMenu = () => {
693
694
  fullWidth: true,
694
695
  onClick: handleTranslationRequest,
695
696
  disabled: !selectedOption,
696
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(
697
- "svg",
698
- {
699
- width: "20",
700
- height: "20",
701
- viewBox: "0 0 24 24",
702
- fill: "none",
703
- xmlns: "http://www.w3.org/2000/svg",
704
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2,21L23,12L2,3V10L17,12L2,14V21Z", fill: "currentColor" })
705
- }
706
- ),
697
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.PaperPlane, {}),
707
698
  children: getSubmitLabel(1, isUrgent, isMachineTranslation)
708
699
  }
709
700
  )
@@ -759,7 +750,7 @@ const index = {
759
750
  defaultMessage: "translationstudio Settings"
760
751
  },
761
752
  Component: async () => {
762
- const { App } = await Promise.resolve().then(() => require("./App-C2A-alX9.js"));
753
+ const { App } = await Promise.resolve().then(() => require("./App-CDI8iUHL.js"));
763
754
  return App;
764
755
  }
765
756
  });
@@ -771,7 +762,7 @@ const index = {
771
762
  defaultMessage: "translationstudio Dashboard"
772
763
  },
773
764
  Component: async () => {
774
- const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-C77OaOGZ.js"));
765
+ const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-VqkbaIHn.js"));
775
766
  return HistoryPage;
776
767
  }
777
768
  });
@@ -816,7 +807,6 @@ exports.createSuccessMessage = createSuccessMessage;
816
807
  exports.createTranslationPayload = createTranslationPayload;
817
808
  exports.determineEntryName = determineEntryName$1;
818
809
  exports.formatDate = formatDate;
819
- exports.getElementStatus = getElementStatus;
820
810
  exports.getStoredEmail = getStoredEmail;
821
811
  exports.getSubmitLabel = getSubmitLabel;
822
812
  exports.getThemeColors = getThemeColors;
@@ -824,5 +814,4 @@ exports.groupHistoryData = groupHistoryData;
824
814
  exports.handleHistoryResponse = handleHistoryResponse;
825
815
  exports.index = index;
826
816
  exports.setStoredEmail = setStoredEmail;
827
- exports.useThemeMode = useThemeMode;
828
817
  exports.validateDueDate = validateDueDate;
@@ -1,6 +1,6 @@
1
1
  import { useRef, useEffect, useState, useMemo } from "react";
2
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
- import { Cog, ChevronUp, ChevronDown, NumberList } from "@strapi/icons";
3
+ import { Cog, ChevronUp, ChevronDown, PaperPlane, NumberList } from "@strapi/icons";
4
4
  import { Box, Button, Typography, Table, Thead, Tr, Th, Tbody, Td, Alert, Radio, Checkbox, TextInput, DatePicker } from "@strapi/design-system";
5
5
  import { getFetchClient, unstable_useContentManagerContext } from "@strapi/strapi/admin";
6
6
  const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
@@ -173,6 +173,8 @@ function GetStatusText(input) {
173
173
  return "translated";
174
174
  case "intranslation":
175
175
  return "in translated";
176
+ case "queued":
177
+ return "queued";
176
178
  default:
177
179
  return "";
178
180
  }
@@ -539,8 +541,7 @@ const TranslationMenu = () => {
539
541
  setIsLoadingMappings(true);
540
542
  setMappingsError(false);
541
543
  get("/translationstudio/getLicense").then((response) => {
542
- if (typeof response.data.license !== "string") return false;
543
- return response.data.license !== "";
544
+ return response.status === 204;
544
545
  }).then((hasLicense) => {
545
546
  setLicenseValid(hasLicense);
546
547
  if (!hasLicense) throw new Error("No license set");
@@ -692,17 +693,7 @@ const TranslationMenu = () => {
692
693
  fullWidth: true,
693
694
  onClick: handleTranslationRequest,
694
695
  disabled: !selectedOption,
695
- startIcon: /* @__PURE__ */ jsx(
696
- "svg",
697
- {
698
- width: "20",
699
- height: "20",
700
- viewBox: "0 0 24 24",
701
- fill: "none",
702
- xmlns: "http://www.w3.org/2000/svg",
703
- children: /* @__PURE__ */ jsx("path", { d: "M2,21L23,12L2,3V10L17,12L2,14V21Z", fill: "currentColor" })
704
- }
705
- ),
696
+ startIcon: /* @__PURE__ */ jsx(PaperPlane, {}),
706
697
  children: getSubmitLabel(1, isUrgent, isMachineTranslation)
707
698
  }
708
699
  )
@@ -758,7 +749,7 @@ const index = {
758
749
  defaultMessage: "translationstudio Settings"
759
750
  },
760
751
  Component: async () => {
761
- const { App } = await import("./App-CUYIBOWI.mjs");
752
+ const { App } = await import("./App-Dw8LkiAx.mjs");
762
753
  return App;
763
754
  }
764
755
  });
@@ -770,7 +761,7 @@ const index = {
770
761
  defaultMessage: "translationstudio Dashboard"
771
762
  },
772
763
  Component: async () => {
773
- const { HistoryPage } = await import("./HistoryPage-AhmPF4m4.mjs");
764
+ const { HistoryPage } = await import("./HistoryPage-Do_yIUdx.mjs");
774
765
  return HistoryPage;
775
766
  }
776
767
  });
@@ -808,22 +799,20 @@ const index = {
808
799
  export {
809
800
  GetStatusColor as G,
810
801
  TranslationstudioLogo as T,
811
- groupHistoryData as a,
812
- GetStatusText as b,
813
- getStoredEmail as c,
814
- getSubmitLabel as d,
815
- createEntryUid$1 as e,
802
+ GetStatusText as a,
803
+ getStoredEmail as b,
804
+ getSubmitLabel as c,
805
+ createEntryUid$1 as d,
806
+ determineEntryName$1 as e,
816
807
  formatDate as f,
817
808
  getThemeColors as g,
818
- handleHistoryResponse as h,
819
- determineEntryName$1 as i,
820
- createTranslationPayload as j,
821
- createSuccessMessage as k,
822
- createErrorMessage as l,
823
- createGeneralErrorMessage as m,
824
- getElementStatus as n,
825
- index as o,
809
+ createTranslationPayload as h,
810
+ createSuccessMessage as i,
811
+ createErrorMessage as j,
812
+ createGeneralErrorMessage as k,
813
+ handleHistoryResponse as l,
814
+ groupHistoryData as m,
815
+ index as n,
826
816
  setStoredEmail as s,
827
- useThemeMode as u,
828
817
  validateDueDate as v
829
818
  };
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-Dgpsawos.js");
2
+ const index = require("../_chunks/index-CgX-X1nF.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { o } from "../_chunks/index-Csx0xlBL.mjs";
1
+ import { n } from "../_chunks/index-DKeIuEy_.mjs";
2
2
  export {
3
- o as default
3
+ n as default
4
4
  };
@@ -1,3 +1,3 @@
1
1
  import { BulkTranslationMenuProps } from '../../../Types';
2
- declare const BulkTranslationMenu: ({ historyData, isLoadingHistory, onTranslationComplete, }: BulkTranslationMenuProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const BulkTranslationMenu: ({ groupedHistoryData, isLoadingHistory, onTranslationComplete, }: BulkTranslationMenuProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { BulkTranslationMenu };
@@ -1,3 +1,3 @@
1
1
  import { BulkTranslationPanelProps } from '../../../Types';
2
- declare const BulkTranslationPanel: ({ contentType, selectedEntries, onTranslationComplete, }: BulkTranslationPanelProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const BulkTranslationPanel: ({ contentType, selectedEntries, onClose, onTranslationComplete, }: BulkTranslationPanelProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default BulkTranslationPanel;
@@ -1,4 +1,4 @@
1
- import { GroupedHistoryItem } from "./utils/historyDataUtils";
1
+ import { GroupedHistoryItem } from "../../../Types";
2
2
  export default function DeleteHistoryEntryRequest({ item, onDeleted, onClose }: {
3
3
  item: GroupedHistoryItem;
4
4
  onClose: () => void;
@@ -1,2 +1,6 @@
1
- declare const HistoryMenu: () => import("react/jsx-runtime").JSX.Element;
1
+ import { GroupedHistoryItem } from '../../../Types';
2
+ declare const HistoryMenu: ({ groupedHistoryData, onRemoveHistoryItem }: {
3
+ groupedHistoryData: GroupedHistoryItem[];
4
+ onRemoveHistoryItem: (id: string) => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
2
6
  export { HistoryMenu };
@@ -1,12 +1,3 @@
1
- import { HistoryItem } from '../../../../Types';
2
- import { TranslationStatus } from './historyStatusUtils';
3
- export type GroupedHistoryItem = {
4
- "element-name": string;
5
- 'element-uid': string;
6
- timeUpdated: number;
7
- targetLanguage: string;
8
- status: TranslationStatus;
9
- id: string;
10
- };
1
+ import { GroupedHistoryItem, HistoryItem, TranslationStatus } from '../../../../Types';
11
2
  export declare function getElementStatus(elem: HistoryItem): TranslationStatus;
12
3
  export declare const groupHistoryData: (historyData: HistoryItem[]) => GroupedHistoryItem[];
@@ -1,4 +1,4 @@
1
+ import { TranslationStatus } from "../../../../Types";
1
2
  export type StatusVariant = 'success' | 'warning' | 'neutral';
2
- export type TranslationStatus = "translated" | "intranslation" | "queued";
3
3
  export declare function GetStatusColor(input: TranslationStatus | "mixed" | ""): StatusVariant;
4
- export declare function GetStatusText(input: TranslationStatus | "mixed" | ""): "" | "translated" | "mixed" | "in translated";
4
+ export declare function GetStatusText(input: TranslationStatus | "mixed" | ""): "translated" | "queued" | "" | "mixed" | "in translated";
@@ -1,5 +1,4 @@
1
- export type TranslationStatus = 'translated' | 'in_translation' | 'not_translated' | '';
2
- export declare const getTranslationStatus: (entryId: string, historyData: any[]) => TranslationStatus;
1
+ import { TranslationStatus } from '../../../../Types';
3
2
  export declare const getTargetLanguages: (entryId: string, historyData: any[]) => string[];
4
3
  export declare const getTranslationDate: (entryId: string, historyData: any[]) => string;
5
4
  export declare const getStatusBadgeVariant: (status: TranslationStatus) => string;
@@ -49,12 +49,12 @@ const controller = ({ strapi: strapi2 }) => ({
49
49
  },
50
50
  async getLicense(ctx) {
51
51
  const result = await strapi2.plugin(APP_NAME$1).service("service").getLicense();
52
- if (result.license) {
53
- ctx.status = 200;
52
+ if (typeof result.license === "string") {
53
+ ctx.status = 204;
54
54
  } else {
55
55
  ctx.status = 404;
56
+ ctx.body = result;
56
57
  }
57
- ctx.body = result;
58
58
  },
59
59
  async setLicense(ctx) {
60
60
  const license = ctx.request.body.license;
@@ -118,7 +118,7 @@ const controller = ({ strapi: strapi2 }) => ({
118
118
  },
119
119
  async getDevelopmentUrl(ctx) {
120
120
  const url = await strapi2.plugin(APP_NAME$1).service("service").getDevelopmentUrl();
121
- if (url) {
121
+ if (typeof url === "string") {
122
122
  ctx.status = 200;
123
123
  ctx.body = { url };
124
124
  } else {
@@ -30,12 +30,12 @@ const controller = ({ strapi: strapi2 }) => ({
30
30
  },
31
31
  async getLicense(ctx) {
32
32
  const result = await strapi2.plugin(APP_NAME$1).service("service").getLicense();
33
- if (result.license) {
34
- ctx.status = 200;
33
+ if (typeof result.license === "string") {
34
+ ctx.status = 204;
35
35
  } else {
36
36
  ctx.status = 404;
37
+ ctx.body = result;
37
38
  }
38
- ctx.body = result;
39
39
  },
40
40
  async setLicense(ctx) {
41
41
  const license = ctx.request.body.license;
@@ -99,7 +99,7 @@ const controller = ({ strapi: strapi2 }) => ({
99
99
  },
100
100
  async getDevelopmentUrl(ctx) {
101
101
  const url = await strapi2.plugin(APP_NAME$1).service("service").getDevelopmentUrl();
102
- if (url) {
102
+ if (typeof url === "string") {
103
103
  ctx.status = 200;
104
104
  ctx.body = { url };
105
105
  } else {
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  }
11
11
  ],
12
12
  "homepage": "https://translationstudio.tech",
13
- "version": "4.3.0",
13
+ "version": "5.0.1",
14
14
  "keywords": [
15
15
  "translationstudio",
16
16
  "strapi",