From 03d5259f604932e1abc62dd9b498aa0377b3ab6e Mon Sep 17 00:00:00 2001 From: ducica Date: Mon, 23 Sep 2024 15:22:21 +0200 Subject: [PATCH 01/12] not forcing validation for preview --- .../BaseFormLayout/BaseFormLayout.jsx | 32 +++++++++++++- .../semantic-ui/js/oarepo_ui/forms/hooks.js | 42 +++++++++---------- .../semantic-ui/js/oarepo_ui/forms/util.js | 27 ++++++++++++ .../assets/semantic-ui/js/oarepo_ui/util.js | 15 +++++++ 4 files changed, 93 insertions(+), 23 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx index 30cf9256..c1cd09ef 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect } from "react"; import PropTypes from "prop-types"; import { BaseForm } from "../BaseForm"; import { FormFeedback } from "../FormFeedback"; @@ -7,7 +7,11 @@ import { SaveButton } from "../SaveButton"; import { PublishButton } from "../PublishButton"; import { PreviewButton } from "../PreviewButton"; import { Grid, Ref, Sticky, Card, Header } from "semantic-ui-react"; -import { useFormConfig, getTitleFromMultilingualObject } from "@js/oarepo_ui"; +import { + useFormConfig, + getTitleFromMultilingualObject, + getItemWithExpiryFromLocalStorage, +} from "@js/oarepo_ui"; import { buildUID } from "react-searchkit"; import Overridable from "react-overridable"; import { CustomFields } from "react-invenio-forms"; @@ -32,6 +36,27 @@ export const BaseFormLayout = ({ formikProps }) => { const { formConfig: { custom_fields: customFields }, } = useFormConfig(); + const localStorageValidationErrorsPath = `validationErrors.${record.id}`; + // on chrome there is an annoying issue where after deletion you are redirected, and then + // if you click back on browser <-, it serves you the deleted page, which does not exist from the cache. + // on firefox it does not happen. + useEffect(() => { + const handleUnload = () => { + localStorage.removeItem(localStorageValidationErrorsPath); + }; + + const handleBeforeUnload = () => { + localStorage.removeItem(localStorageValidationErrorsPath); + }; + + window.addEventListener("unload", handleUnload); + window.addEventListener("beforeunload", handleBeforeUnload); + + return () => { + window.removeEventListener("unload", handleUnload); + window.removeEventListener("beforeunload", handleBeforeUnload); + }; + }, []); return ( {}} @@ -40,6 +65,9 @@ export const BaseFormLayout = ({ formikProps }) => { validateOnChange: false, validateOnBlur: false, enableReinitialize: true, + initialErrors: record.id + ? getItemWithExpiryFromLocalStorage(localStorageValidationErrorsPath) + : {}, ...formikProps, }} > diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js index 249d5d05..a18c0d60 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js @@ -354,27 +354,27 @@ export const useDepositApiClient = ({ async function preview() { setSubmitting(true); try { - const saveResult = await save(); - - if (!saveResult) { - setFieldError( - "BEvalidationErrors.errorMessage", - i18next.t( - "Your draft was saved. If you wish to preview it, please correct the following validation errors and click preview again:" - ) - ); - return; - } else { - const url = saveResult.links.self_html; - setFieldError( - "successMessage", - i18next.t("Your draft was saved. Redirecting to the preview page...") - ); - setTimeout(() => { - setFieldError("successMessage", ""); - window.location.href = url; - }, 1000); - } + const saveResult = await save(true); + + // if (!saveResult) { + // setFieldError( + // "BEvalidationErrors.errorMessage", + // i18next.t( + // "Your draft was saved. If you wish to preview it, please correct the following validation errors and click preview again:" + // ) + // ); + // return; + // } else { + const url = saveResult.links.self_html; + setFieldError( + "successMessage", + i18next.t("Your draft was saved. Redirecting to the preview page...") + ); + setTimeout(() => { + setFieldError("successMessage", ""); + window.location.href = url; + }, 1000); + // } return saveResult; } catch (error) { setFieldError( diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/util.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/util.js index c89b8991..b468d505 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/util.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/util.js @@ -16,6 +16,7 @@ import Overridable, { overrideStore, } from "react-overridable"; import { BaseFormLayout } from "./components/BaseFormLayout"; +import { setIn } from "formik"; export function parseFormAppConfig(rootElementId = "form-app") { const rootEl = document.getElementById(rootElementId); @@ -200,3 +201,29 @@ export const getValidTagsForEditor = (tags, attr) => { return result.join(","); }; + +export const serializeErrors = ( + errors, + message = i18next.t( + "Draft saved with validation errors. Fields listed below that failed validation were not saved to the server" + ) +) => { + if (errors?.length > 0) { + let errorsObj = {}; + const errorPaths = []; + for (const error of errors) { + errorsObj = setIn(errorsObj, error.field, error.messages.join(" ")); + errorPaths.push(error.field); + } + + errorsObj["BEvalidationErrors"] = { + errors: errors, + errorMessage: message, + errorPaths, + }; + + return errorsObj; + } else { + return {}; + } +}; diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js index 611bb315..a5d0932b 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js @@ -273,3 +273,18 @@ export const goBack = (fallBackURL = "/") => { window.location.href = fallBackURL; } }; + + +export const getItemWithExpiryFromLocalStorage = (key) => { + const itemStr = localStorage.getItem(key); + if (!itemStr) { + return null; + } + const item = JSON.parse(itemStr); + const now = new Date(); + if (now.getTime() > item.expiry) { + localStorage.removeItem(key); + return null; + } + return item.value; +}; From 344145e41af20aabf7b75848305c680ffd73279c Mon Sep 17 00:00:00 2001 From: ducica Date: Fri, 27 Sep 2024 15:14:17 +0200 Subject: [PATCH 02/12] allowing preview without filling minimum metadata --- .../BaseFormLayout/BaseFormLayout.jsx | 42 +++++++++++++------ .../EDTFDatePickerWrapper.jsx | 1 + .../EDTFDatePickerField/InputElement.jsx | 2 + .../semantic-ui/js/oarepo_ui/forms/hooks.js | 4 +- .../assets/semantic-ui/js/oarepo_ui/util.js | 31 ++++++++------ 5 files changed, 53 insertions(+), 27 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx index c1cd09ef..796a6fec 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx @@ -6,16 +6,19 @@ import { FormikStateLogger } from "../FormikStateLogger"; import { SaveButton } from "../SaveButton"; import { PublishButton } from "../PublishButton"; import { PreviewButton } from "../PreviewButton"; +import { DeleteButton } from "../DeleteButton"; import { Grid, Ref, Sticky, Card, Header } from "semantic-ui-react"; import { useFormConfig, getTitleFromMultilingualObject, - getItemWithExpiryFromLocalStorage, + serializeErrors, + decodeUnicodeBase64, } from "@js/oarepo_ui"; import { buildUID } from "react-searchkit"; import Overridable from "react-overridable"; import { CustomFields } from "react-invenio-forms"; import { getIn, useFormikContext } from "formik"; +import { i18next } from "@translations/oarepo_ui/i18next"; const FormTitle = () => { const { values } = useFormikContext(); @@ -36,18 +39,13 @@ export const BaseFormLayout = ({ formikProps }) => { const { formConfig: { custom_fields: customFields }, } = useFormConfig(); - const localStorageValidationErrorsPath = `validationErrors.${record.id}`; // on chrome there is an annoying issue where after deletion you are redirected, and then // if you click back on browser <-, it serves you the deleted page, which does not exist from the cache. // on firefox it does not happen. useEffect(() => { - const handleUnload = () => { - localStorage.removeItem(localStorageValidationErrorsPath); - }; + const handleUnload = () => {}; - const handleBeforeUnload = () => { - localStorage.removeItem(localStorageValidationErrorsPath); - }; + const handleBeforeUnload = () => {}; window.addEventListener("unload", handleUnload); window.addEventListener("beforeunload", handleBeforeUnload); @@ -57,6 +55,19 @@ export const BaseFormLayout = ({ formikProps }) => { window.removeEventListener("beforeunload", handleBeforeUnload); }; }, []); + + const urlHash = window.location.hash.substring(1); + let errorData; + if (urlHash) { + const decodedData = decodeUnicodeBase64(urlHash); + errorData = JSON.parse(decodedData); + window.history.replaceState( + null, + null, + window.location.pathname + window.location.search + ); + } + return ( {}} @@ -65,8 +76,13 @@ export const BaseFormLayout = ({ formikProps }) => { validateOnChange: false, validateOnBlur: false, enableReinitialize: true, - initialErrors: record.id - ? getItemWithExpiryFromLocalStorage(localStorageValidationErrorsPath) + initialErrors: urlHash + ? serializeErrors( + errorData.errors, + i18next.t( + "Your draft has validation errors. Please correct them and try again:" + ) + ) : {}, ...formikProps, }} @@ -136,9 +152,9 @@ export const BaseFormLayout = ({ formikProps }) => { {/* TODO:see if there is a way to provide URL here, seems that UI links are empty in the form */} - {/* - - */} + + + diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/EDTFDatePickerWrapper.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/EDTFDatePickerWrapper.jsx index 70d1ffbc..58ceb996 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/EDTFDatePickerWrapper.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/EDTFDatePickerWrapper.jsx @@ -40,6 +40,7 @@ export const EDTFDatePickerWrapper = ({ handleClear={handleClear} fieldPath={fieldPath} clearButtonClassName={clearButtonClassName} + autoComplete="off" {...customInputProps} /> } diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx index 6f6d3534..9daee7c7 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx @@ -15,6 +15,7 @@ export const InputElement = forwardRef( clearButtonClassName, handleClear, onKeyDown, + autoComplete, }, ref ) => { @@ -30,6 +31,7 @@ export const InputElement = forwardRef( placeholder={placeholder} className={className} id={fieldPath} + autoComplete={autoComplete} icon={ value ? ( { const context = useContext(FieldDataContext); if (!context) { throw new Error( - "useFormConfig must be used inside FieldDataContext .Provider" + "useFormConfig must be used inside FieldDataContext.Provider" ); } return context; @@ -336,7 +336,7 @@ export const useDepositApiClient = ({ setFieldError( "successMessage", i18next.t( - "Draft deleted successfully. Redirecting to the main page ..." + "Draft deleted successfully. Redirecting to your dashboard ..." ) ); return response; diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js index a5d0932b..63776611 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/util.js @@ -7,6 +7,7 @@ import _uniqBy from "lodash/uniqBy"; import * as Yup from "yup"; import { i18next } from "@translations/oarepo_ui/i18next"; import { format } from "date-fns"; +import axios from "axios"; export const getInputFromDOM = (elementName) => { const element = document.getElementsByName(elementName); @@ -274,17 +275,23 @@ export const goBack = (fallBackURL = "/") => { } }; +// until we start using v4 of react-invenio-forms. They switched to vnd zenodo accept header +const baseAxiosConfiguration = { + withCredentials: true, + xsrfCookieName: "csrftoken", + xsrfHeaderName: "X-CSRFToken", + headers: { + Accept: "application/vnd.inveniordm.v1+json", + "Content-Type": "application/json", + }, +}; -export const getItemWithExpiryFromLocalStorage = (key) => { - const itemStr = localStorage.getItem(key); - if (!itemStr) { - return null; - } - const item = JSON.parse(itemStr); - const now = new Date(); - if (now.getTime() > item.expiry) { - localStorage.removeItem(key); - return null; - } - return item.value; +export const http = axios.create(baseAxiosConfiguration); + +export const encodeUnicodeBase64 = (str) => { + return btoa(encodeURIComponent(str)); +}; + +export const decodeUnicodeBase64 = (base64) => { + return decodeURIComponent(atob(base64)); }; From 5b0bb41015de8b431a4f1bf9c427716be5434de2 Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 29 Sep 2024 13:51:40 +0200 Subject: [PATCH 03/12] added missing prop type --- .../BaseFormLayout/BaseFormLayout.jsx | 19 ++++++------ .../EDTFDatePickerField/InputElement.jsx | 1 + .../semantic-ui/js/oarepo_ui/forms/hooks.js | 30 +++++++------------ 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx index 796a6fec..de0e1cae 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/BaseFormLayout/BaseFormLayout.jsx @@ -76,14 +76,15 @@ export const BaseFormLayout = ({ formikProps }) => { validateOnChange: false, validateOnBlur: false, enableReinitialize: true, - initialErrors: urlHash - ? serializeErrors( - errorData.errors, - i18next.t( - "Your draft has validation errors. Please correct them and try again:" + initialErrors: + errorData?.errors?.length > 0 + ? serializeErrors( + errorData.errors, + i18next.t( + "Your draft has validation errors. Please correct them and try again:" + ) ) - ) - : {}, + : {}, ...formikProps, }} > @@ -152,9 +153,9 @@ export const BaseFormLayout = ({ formikProps }) => { {/* TODO:see if there is a way to provide URL here, seems that UI links are empty in the form */} - + {/* - + */} diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx index 9daee7c7..74a639da 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/EDTFDatePickerField/InputElement.jsx @@ -56,6 +56,7 @@ InputElement.propTypes = { className: PropTypes.string, placeholder: PropTypes.string, onKeyDown: PropTypes.func, + autoComplete: PropTypes.string, }; InputElement.defaultProps = { diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js index dc1877d6..c568bd03 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js @@ -356,25 +356,17 @@ export const useDepositApiClient = ({ try { const saveResult = await save(true); - // if (!saveResult) { - // setFieldError( - // "BEvalidationErrors.errorMessage", - // i18next.t( - // "Your draft was saved. If you wish to preview it, please correct the following validation errors and click preview again:" - // ) - // ); - // return; - // } else { - const url = saveResult.links.self_html; - setFieldError( - "successMessage", - i18next.t("Your draft was saved. Redirecting to the preview page...") - ); - setTimeout(() => { - setFieldError("successMessage", ""); - window.location.href = url; - }, 1000); - // } + if (saveResult?.links?.self_html) { + const url = saveResult.links.self_html; + setFieldError( + "successMessage", + i18next.t("Your draft was saved. Redirecting to the preview page...") + ); + setTimeout(() => { + setFieldError("successMessage", ""); + window.location.href = url; + }, 1000); + } return saveResult; } catch (error) { setFieldError( From 818aa8e4709ba394cb1d3b8d2123af32643a6bac Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 29 Sep 2024 14:05:35 +0200 Subject: [PATCH 04/12] added translations --- .../components/DeleteButton/DeleteButton.jsx | 4 +- .../messages/cs/LC_MESSAGES/translations.json | 2 +- .../translations/cs/LC_MESSAGES/messages.mo | Bin 11378 -> 12042 bytes .../translations/cs/LC_MESSAGES/messages.po | 38 +++++++++++++ .../translations/en/LC_MESSAGES/messages.po | 37 +++++++++++++ oarepo_ui/translations/messages.mo | Bin 395 -> 395 bytes oarepo_ui/translations/messages.pot | 52 +++++++++++++----- 7 files changed, 117 insertions(+), 16 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/DeleteButton/DeleteButton.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/DeleteButton/DeleteButton.jsx index 43573494..13ae2f8c 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/DeleteButton/DeleteButton.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/DeleteButton/DeleteButton.jsx @@ -36,7 +36,7 @@ export const DeleteButton = React.memo( onClick={openModal} icon="delete" labelPosition="left" - content={i18next.t("Delete")} + content={i18next.t("Delete draft")} type="button" disabled={isSubmitting} loading={isSubmitting} @@ -59,7 +59,7 @@ export const DeleteButton = React.memo( }} icon="delete" labelPosition="left" - content={i18next.t("Delete")} + content={i18next.t("Delete draft")} type="button" /> diff --git a/oarepo_ui/theme/assets/semantic-ui/translations/oarepo_ui/messages/cs/LC_MESSAGES/translations.json b/oarepo_ui/theme/assets/semantic-ui/translations/oarepo_ui/messages/cs/LC_MESSAGES/translations.json index aeebabb2..c876533e 100644 --- a/oarepo_ui/theme/assets/semantic-ui/translations/oarepo_ui/messages/cs/LC_MESSAGES/translations.json +++ b/oarepo_ui/theme/assets/semantic-ui/translations/oarepo_ui/messages/cs/LC_MESSAGES/translations.json @@ -1 +1 @@ -{"api.draft":"API pracovního záznamu","api.latest":"API poslední verze záznamu","api.latest_html":"Stránka poslední verze záznamu","api.publish":"API pro publikování záznamu","api.record":"API této verze záznamu","api.self_html":"Stránka této verze záznamu","api.versions":"API všech verzí záznamu","JSON":"JSON","Record details":"Detaily záznamu","\n Invenio":"\n Invenio","New item":"Nový záznam","Edit item ":"Editace záznamu","Menu":"Menu","Close menu":"Zavřít menu","Requests":"Žádosti","Inbox":"Příchozí","Log in":"Přihlásit se","Sign up":"Registrovat se","My account":"Můj účet","Log out":"Odhlásit se","Search results":"Výsledky vyhledávání","Powered by\n Invenio":"Založeno na repozitářové platformě\n Invenio","Remove field":"Odstranit položku","Language":"Jazyk","Search for a language by name (e.g \"eng\", \"fr\" or \"Polish\")":"Hledat jazyk dle jména","Add another language":"Přidat další jazyk","We couldn't find any matches for ":"Nenašli jsme žádné shody pro ","search":"hledat","Choose":"Vybrat","Selected records":"Vybrané záznamy","Something went wrong...":"Stala se nějaká chyba …","Search...":"Hledat …","No results found":"Nenalezeny žádné výsledky","Loading...":"Nahrávám …","Search External Database":"Hledat v externím zdroji","Search results from external API":"Hledat v externím zdroji","Draft saved with validation errors. Fields listed below that failed validation were not saved to the server":"Pracovní verze záznamu byla uložena s chybami. Následující pole nebyla uložena, prosím, opravte je a uložte znovu","Draft saved successfully.":"Pracovní záznam byl uložen.","Draft published successfully. Redirecting to record's detail page ...":"Pracovní záznam byl úspěšně publikován. Budete přesměrováni na stránku s detailem záznamu …","Draft deleted successfully. Redirecting to the main page ...":"Pracovní verze záznamu byla smazána. Za okamžik Vás přesměrujeme na hlavní stránku.","Draft was saved but could not be published due to following validation errors":"Koncept byl uložen, ale nemohl být publikován kvůli následujícím chybám ověření:","Start over":"Začít znovu","resultsPerPage":"Výsledků na stránku","Filters":"Filtry","Filter results":"Filtrovat výsledky","Sort by":"Řazení","Sort":"Řazení","Value":"Hodnota","totalResults_one":"{{count}} výsledek","totalResults_few":"{{count}} výsledky","totalResults_many":"{{count}} výsledků","totalResults_other":"{{count}} výsledků","Clear all filters":"Vymazat všechny filtry","totalResults_0":"{{count}} výsledek","totalResults_1":"{{count}} výsledky","totalResults_2":"{{count}} výsledků","Open definition":"Otevřít definici","YYYY":"RRRR","YYYY-MM":"RRRR-MM","YYYY-MM-DD":"RRRR-MM-DD","Format: YYYY-MM-DD/YYYY-MM-DD, YYYYY-MM/YYYY/MM or YYYY/YYYY.":"Formát: RRRR-MM-DD/RRRR-MM-DD, RRRR-MM/RRRR/MM nebo RRRR/RRRR.","Select date range":"Vyberte časové období","Format: YYYY-MM-DD, YYYYY-MM or YYYY.":"Formát: RRRR-MM-DD, RRRR-MM nebo RRRR.","Select date":"Vyberte datum","All document records":"Všechny záznamy s dokumentem","in":"v","Search":"Vyhledávání","Contact":"Kontakt","Powered by\n Invenio":"Založeno na technologii\n Invenio","Quick create":"Rychlé vytvoření","Actions":"Akce","Delete":"Smazat","Cancel":"Zrušit","Are you sure you wish delete this draft?":"Jste si jisti chcete tento koncept smazat?","If you delete the draft, the work you have done on it will be lost.":"Pokud koncept smažete, práce, kterou jste na něm vykonali, bude ztracena.","Previous Month":"Předchozí měsíc","Next Month":"Příští měsíc","Choose a date range":"Vyberte časové období","Write a date range or click on the calendar icon to select it":"Napište časové období nebo jej vyberte kliknutím na ikonu kalendáře.","Write a date or click on the calendar icon to select it":"Napište datum nebo jej vyberte kliknutím na ikonu kalendáře.","Preview":"Náhled","Publish":"Publikovat","Are you sure you wish to publish this draft?":"Jste si jisti že chcete tento koncept publikovat?","Save":"Uložit","Validate form":"Zkontrolovat formulář","api.files":"API souborů","Missing title":"Chybí název","Not set":"Není poskytnuto","Select: ":"Vybrat: ","Choose a date.":"Vyberte datum.","Date range.":"Časové období.","Single date.":"Jediné datum.","Choose the time interval in which the event took place.":"Vyberte časový interval, ve kterém se událost odehrála.","Choose one date.":"Vyberte jedno datum.","Choose date range (From - To).":"Vyberte časové období (Od - Do).","Choose a date from the calendar by clicking on the input.":"Vyberte datum z kalendáře kliknutím na vstup.","Year":"Rok","Year and month":"Rok a měsíc","Year, month and date":"Rok, měsíc a datum","is a required field":"je povinné pole","Items must be unique":"Položky musí být jedinečné","Gone":"Záznam smazán","\n The record you are trying to access was removed from %(sitename)s. The\n metadata of the record is kept for archival purposes.":"\n Záznam, který se snažíte zobrazit, byl smazán z repozitáře %(sitename)s.
Metadata\n záznamu jsou uložena pro archivní účely.
Potřebujete-li je, obraťte se na správce repozitáře.","You are previewing a new record version that has not yet been published.":"Prohlížíte si náhled nové verze záznamu, která ještě nebyla publikována.","Files":"Soubory","Your draft was saved. If you wish to preview it, please correct the following validation errors and click preview again:":"Váš koncept byl uložen. Pokud chcete zobrazit jeho náhled, opravte následující chyby ověření a znovu klikněte na náhled:","Once the record is published you will no longer be able to change record's files! However, you will still be able to update the record's metadata later.":"Jakmile bude záznam zveřejněn, již jej nebudete moci změnit soubory! Stále však budete moci aktualizovat metadata záznamu později.","Edit item":"Editace záznamu","File":"Soubor","Size":"Velikost","Your draft was saved. Redirecting to the preview page...":"Váš koncept byl uložen. Přesměrování na stránku náhledu...","Please provide an URL in valid format":"Zadejte prosím adresu URL v platném formátu","Identifiers and links":"Identifikátory a odkazy","metadata/originalRecord.label":"Odkaz na původní záznam","API":"API","Links":"Odkazy","Not found":"Nenalezeno","\n The record you are trying to access does not exist in this repository.":"\n Záznam, který se snažíte zobrazit, neexistuje v tomto repozitáři.","Permission denied":"Přístup odepřen","\n You do not have permissions to access this page on %(sitename)s.":"\n Nemáte oprávnění k zobrazení této stránky na %(sitename)s.","Copied!":"Zkopírováno!","Copy to clipboard failed!":"Kopírování se nezdařilo!","Export":"Exportovat","Export selection":"Exportovat výběr","Download file":"Stáhnout soubor","Remove":"Odstranit","Version: %(version)s":"Verze repozitáře: %(version)s","Filter data by date":"Filtrovat podle data","Reset":"Resetovat","You have no permission to create record in this community.":"Nemáte právo vytvořit záznam v této komunitě.","\n Reason: %(error)s":"\n Důvod: %(error)s","Type and press enter to search":"Zadejte a stiskněte Enter pro vyhledávání","Community website":"Webové stránky komunity","Community selection":"Výběr komunity","Please select community in which your work will be published:":"Vyberte prosím komunitu, ve které bude vaše práce publikována:","All records must belong to a community.":"Všechny záznamy musí patřit komunitě.","Go back":"Zpátky","Your record will be published in the following community:":"Váš záznam bude zveřejněn v následující komunitě:","Your work will be saved in the following community. Please note that after saving it will not be possible to transfer it to another community.":"Vaše práce bude uložena v následující komunitě. Vezměte prosím na vědomí, že po uložení nebude možné převést ji do jiné komunity.","Community website.":"Webové stránky komunity.","Community home page":"Domovská stránka komunity","genericCommunityMessage":"Nejste členem žádné komunity. Pokud se rozhodnete pokračovat, vaše práce bude publikována v \"generické\" komunitě. Důrazně doporučujeme, abyste se připojili k nějaké komunitě, abyste zvýšili viditelnost své práce a mohli snadněji spolupracovat s ostatními. Na dostupné komunity se můžete podívat <2>na naší stránce komunit. Pro více podrobností o tom, jak se připojit k nějaké komunitě, se prosím podívejte na instrukce <6>jak se připojit ke komunitě.","Home page":"Domovská stránka","If you are certain that you wish to proceed with the generic community, please click on it below.":"Pokud jste si jisti, že chcete pokračovat s generickou komunitou, klikněte na něj níže.","Change":"Změnit"} \ No newline at end of file +{"api.draft":"API pracovního záznamu","api.latest":"API poslední verze záznamu","api.latest_html":"Stránka poslední verze záznamu","api.publish":"API pro publikování záznamu","api.record":"API této verze záznamu","api.self_html":"Stránka této verze záznamu","api.versions":"API všech verzí záznamu","JSON":"JSON","Record details":"Detaily záznamu","\n Invenio":"\n Invenio","New item":"Nový záznam","Edit item ":"Editace záznamu","Menu":"Menu","Close menu":"Zavřít menu","Requests":"Žádosti","Inbox":"Příchozí","Log in":"Přihlásit se","Sign up":"Registrovat se","My account":"Můj účet","Log out":"Odhlásit se","Search results":"Výsledky vyhledávání","Powered by\n Invenio":"Založeno na repozitářové platformě\n Invenio","Remove field":"Odstranit položku","Language":"Jazyk","Search for a language by name (e.g \"eng\", \"fr\" or \"Polish\")":"Hledat jazyk dle jména","Add another language":"Přidat další jazyk","We couldn't find any matches for ":"Nenašli jsme žádné shody pro ","search":"hledat","Choose":"Vybrat","Selected records":"Vybrané záznamy","Something went wrong...":"Stala se nějaká chyba …","Search...":"Hledat …","No results found":"Nenalezeny žádné výsledky","Loading...":"Nahrávám …","Search External Database":"Hledat v externím zdroji","Search results from external API":"Hledat v externím zdroji","Draft saved with validation errors. Fields listed below that failed validation were not saved to the server":"Pracovní verze záznamu byla uložena s chybami. Následující pole nebyla uložena, prosím, opravte je a uložte znovu","Draft saved successfully.":"Pracovní záznam byl uložen.","Draft published successfully. Redirecting to record's detail page ...":"Pracovní záznam byl úspěšně publikován. Budete přesměrováni na stránku s detailem záznamu …","Draft deleted successfully. Redirecting to the main page ...":"Pracovní verze záznamu byla smazána. Za okamžik Vás přesměrujeme na hlavní stránku.","Draft was saved but could not be published due to following validation errors":"Koncept byl uložen, ale nemohl být publikován kvůli následujícím chybám ověření:","Start over":"Začít znovu","resultsPerPage":"Výsledků na stránku","Filters":"Filtry","Filter results":"Filtrovat výsledky","Sort by":"Řazení","Sort":"Řazení","Value":"Hodnota","totalResults_one":"{{count}} výsledek","totalResults_few":"{{count}} výsledky","totalResults_many":"{{count}} výsledků","totalResults_other":"{{count}} výsledků","Clear all filters":"Vymazat všechny filtry","totalResults_0":"{{count}} výsledek","totalResults_1":"{{count}} výsledky","totalResults_2":"{{count}} výsledků","Open definition":"Otevřít definici","YYYY":"RRRR","YYYY-MM":"RRRR-MM","YYYY-MM-DD":"RRRR-MM-DD","Format: YYYY-MM-DD/YYYY-MM-DD, YYYYY-MM/YYYY/MM or YYYY/YYYY.":"Formát: RRRR-MM-DD/RRRR-MM-DD, RRRR-MM/RRRR/MM nebo RRRR/RRRR.","Select date range":"Vyberte časové období","Format: YYYY-MM-DD, YYYYY-MM or YYYY.":"Formát: RRRR-MM-DD, RRRR-MM nebo RRRR.","Select date":"Vyberte datum","All document records":"Všechny záznamy s dokumentem","in":"v","Search":"Vyhledávání","Contact":"Kontakt","Powered by\n Invenio":"Založeno na technologii\n Invenio","Quick create":"Rychlé vytvoření","Actions":"Akce","Delete":"Smazat","Cancel":"Zrušit","Are you sure you wish delete this draft?":"Jste si jisti chcete tento koncept smazat?","If you delete the draft, the work you have done on it will be lost.":"Pokud koncept smažete, práce, kterou jste na něm vykonali, bude ztracena.","Previous Month":"Předchozí měsíc","Next Month":"Příští měsíc","Choose a date range":"Vyberte časové období","Write a date range or click on the calendar icon to select it":"Napište časové období nebo jej vyberte kliknutím na ikonu kalendáře.","Write a date or click on the calendar icon to select it":"Napište datum nebo jej vyberte kliknutím na ikonu kalendáře.","Preview":"Náhled","Publish":"Publikovat","Are you sure you wish to publish this draft?":"Jste si jisti že chcete tento koncept publikovat?","Save":"Uložit","Validate form":"Zkontrolovat formulář","api.files":"API souborů","Missing title":"Chybí název","Not set":"Není poskytnuto","Select: ":"Vybrat: ","Choose a date.":"Vyberte datum.","Date range.":"Časové období.","Single date.":"Jediné datum.","Choose the time interval in which the event took place.":"Vyberte časový interval, ve kterém se událost odehrála.","Choose one date.":"Vyberte jedno datum.","Choose date range (From - To).":"Vyberte časové období (Od - Do).","Choose a date from the calendar by clicking on the input.":"Vyberte datum z kalendáře kliknutím na vstup.","Year":"Rok","Year and month":"Rok a měsíc","Year, month and date":"Rok, měsíc a datum","is a required field":"je povinné pole","Items must be unique":"Položky musí být jedinečné","Gone":"Záznam smazán","\n The record you are trying to access was removed from %(sitename)s. The\n metadata of the record is kept for archival purposes.":"\n Záznam, který se snažíte zobrazit, byl smazán z repozitáře %(sitename)s.
Metadata\n záznamu jsou uložena pro archivní účely.
Potřebujete-li je, obraťte se na správce repozitáře.","You are previewing a new record version that has not yet been published.":"Prohlížíte si náhled nové verze záznamu, která ještě nebyla publikována.","Files":"Soubory","Your draft was saved. If you wish to preview it, please correct the following validation errors and click preview again:":"Váš koncept byl uložen. Pokud chcete zobrazit jeho náhled, opravte následující chyby ověření a znovu klikněte na náhled:","Once the record is published you will no longer be able to change record's files! However, you will still be able to update the record's metadata later.":"Jakmile bude záznam zveřejněn, již jej nebudete moci změnit soubory! Stále však budete moci aktualizovat metadata záznamu později.","Edit item":"Editace záznamu","File":"Soubor","Size":"Velikost","Your draft was saved. Redirecting to the preview page...":"Váš koncept byl uložen. Přesměrování na stránku náhledu...","Please provide an URL in valid format":"Zadejte prosím adresu URL v platném formátu","Identifiers and links":"Identifikátory a odkazy","metadata/originalRecord.label":"Odkaz na původní záznam","API":"API","Links":"Odkazy","Not found":"Nenalezeno","\n The record you are trying to access does not exist in this repository.":"\n Záznam, který se snažíte zobrazit, neexistuje v tomto repozitáři.","Permission denied":"Přístup odepřen","\n You do not have permissions to access this page on %(sitename)s.":"\n Nemáte oprávnění k zobrazení této stránky na %(sitename)s.","Copied!":"Zkopírováno!","Copy to clipboard failed!":"Kopírování se nezdařilo!","Export":"Exportovat","Export selection":"Exportovat výběr","Download file":"Stáhnout soubor","Remove":"Odstranit","Version: %(version)s":"Verze repozitáře: %(version)s","Filter data by date":"Filtrovat podle data","Reset":"Resetovat","You have no permission to create record in this community.":"Nemáte právo vytvořit záznam v této komunitě.","\n Reason: %(error)s":"\n Důvod: %(error)s","Type and press enter to search":"Zadejte a stiskněte Enter pro vyhledávání","Community website":"Webové stránky komunity","Community selection":"Výběr komunity","Please select community in which your work will be published:":"Vyberte prosím komunitu, ve které bude vaše práce publikována:","All records must belong to a community.":"Všechny záznamy musí patřit komunitě.","Go back":"Zpátky","Your record will be published in the following community:":"Váš záznam bude zveřejněn v následující komunitě:","Your work will be saved in the following community. Please note that after saving it will not be possible to transfer it to another community.":"Vaše práce bude uložena v následující komunitě. Vezměte prosím na vědomí, že po uložení nebude možné převést ji do jiné komunity.","Community website.":"Webové stránky komunity.","Community home page":"Domovská stránka komunity","genericCommunityMessage":"Nejste členem žádné komunity. Pokud se rozhodnete pokračovat, vaše práce bude publikována v \"generické\" komunitě. Důrazně doporučujeme, abyste se připojili k nějaké komunitě, abyste zvýšili viditelnost své práce a mohli snadněji spolupracovat s ostatními. Na dostupné komunity se můžete podívat <2>na naší stránce komunit. Pro více podrobností o tom, jak se připojit k nějaké komunitě, se prosím podívejte na instrukce <6>jak se připojit ke komunitě.","Home page":"Domovská stránka","If you are certain that you wish to proceed with the generic community, please click on it below.":"Pokud jste si jisti, že chcete pokračovat s generickou komunitou, klikněte na něj níže.","Change":"Změnit","ORCID profile":"ORCID profil","Scopus ID profile":"Scopus ID profil","ROR profile":"ROR profil","WOS Researcher ID":"WOS Researcher ID","ISNI profile":"ISNI profil","DOI profile":"DOI profil","GND profile":"GND profil","Your draft has validation errors. Please correct them and try again:":"Váš koncept obsahuje validační chyby. Opravte je prosím a zkuste to znovu.","Draft deleted successfully. Redirecting to your dashboard ...":"Koncept byl úspěšně smazán. Přesměrování na vaši nástěnku...","Delete draft":"Smazat koncept"} \ No newline at end of file diff --git a/oarepo_ui/translations/cs/LC_MESSAGES/messages.mo b/oarepo_ui/translations/cs/LC_MESSAGES/messages.mo index f4079fd3eab2971c035cc98700b90ebd6d06f14b..582b8b4974251c1f39447b6383a5eb2733d8725c 100644 GIT binary patch delta 3024 zcmZY932anF9LMolN`Wq=^q>lq;ww-nSLHGsf*dVJIa=Cs7_=tacFC5O-Lku_wkqp^ zQIsRNU<4$wi3Tr>x<rBu3scdHa39?!lS( zCu*E2L|cnXaRIg>$uns^;{j%27v?vEDQG1lQQ5x_6R`lbf+Ez)D^RJe!(0rbCfOheVkN$e^+>QLiH)LY`k+=k9JS(7 zyazYpSZqg)^A{>pF4CrYDr)7uQ5nibwU0(EU|I(GSBKd=P^61cnW#Xms0tN;5A{Mb z>J~hS_u@9xfXC3mv#6DIA&r_a74?2U)cE25TBfqAdf12AOWLuKNct-ERDc$h5Q;$kassP2DT-}s*X zj>UB7nq|!QxCFKG5quW)WotmCt_ewoS&iC?%{UBW))P2}dJ<78#gnats6glAC@ja` zy8mk^XeB#vAijf2{ZX8ZXHl6Lz--FUBqTO72er~_)XE!>HJFX4iQhtv`vDS@`5d(c zCs3I=j}b+5oq{@cx+^|l8a_yU04f6!tic0FS2M<8f3XxFz(c4&@;GsFB5IJzZxzyoy7p@5HHi1T|340r406q7Kgh)WBm<*K8)T&88G9a0SlC z1GYVrv=Y0?L2co5)UBB{Fk<(F2g*RXwGwp*SD{{5jY|E~s0laO`VLeeZzH>8_Mrm) z36+U+sBy003z#@4-hY$zwFrfL8g^p={%Re@=WY>oKPqLds7xJ1O>olIFWCAG)PzZc zzeerdG1LTCkz--HVK@(K zu`}*Qy|)(?a2qDz5!5{2q7L6FEYtnJN?|MyiiYy>!N+k89!70R*|7MR?6Lm`tqWWDxosEPM@#~p`mt9MNWM%u)L?C!1ehP_U8(6c-o z{V=&K`ekx%N>iXA=u~?`zRG|nSRK2be9q-AF6?;i=afF~^5TDoiCs;pa3z-&6m@in zm8R}?C6$!f7ov&jlX_MK>Kj5%N1xc_^eR_sNx4(z4S7AmDxWt_7;EJb|*y7))s%hv#@=uH?*>Cdoa*Qy>*x4 z_c)E7_LdsQ-`Wxiw{7>=Hst5Wj%F8ia?kEaLbSIt^7b4QIB&R;OKwX->_X1pE_d0j zB%B^NFSY!?Sr|De>PlPszclR6UE`V_s0?|04J*7vQ&&^%XbR580W>HIi$SjG5a?eW7C$NI{l{f)+V;UaCNAV=4V?WNrE0}?4qzE-mDJtN(s3g~5BJ54%t+xPUqXmyx;bXVkzWNbq(S z72r7bO%rFKCMv**==bW2QT?h=nX5$|-VLaXZjVw>q`Ogjv=0mLIOo~SLLpp@33QXTf{JCH2f zUOeKMy@SQnXLFbKa3ik8HvA6zP%G}tjlYPlqcZawvNjt+rQVsu`9R+T+5cJ!Wi+&- zQrqR(gNpQXd>ngG6aRr)$yi>OQ!od~sx3mjAA(4%_9iMrr;uChENY?OAhFtY%+>S% z4+Tv;kvwVOe5A=rP#LL31yYY1U^70A+wpn)7PYd4{O!VxxDl_Q`j_R$twL>S9V)ZW zU{nKdqo4p@LapRA)ZV>?x_%m`VGl0BA5i^seDSkUfEsW%DnrY#9_w*6o=2UX6izm` zS{7<+$_v`N29|rSM;)%ss2jGTQreChaF16%gbLs|k__uXt@IKq13%&c z976TmQ5biBVU#q}@E#3%WnT15XJhNA*P&M0g~~_|YT$ma{xxcXUr|rbZPWz+diBhr zczYgd96xG-C8#s7C`v(xA z>MV6)5YJ!$ooQ?v&cP}@|K}(ypy56q#)|3jOnimf`x~gI;ZIaR8N38^+5@PJ1yOt6 zj6CAD4@Vrcj}YwW%=i{{qOPAt-bvPvNmgohmBKmojI> zhI5nM;W6tIGD2-(-?q?}rf`WZ3%?L<3&&bggYLc5t4>zL*BE-X*=izN!nPvP685!* zn%t!HddJ@9XkK8aGE8`?^bPT}xK^ttI&RAJ-A=4wMw)xG HxFGRAx3&`L diff --git a/oarepo_ui/translations/cs/LC_MESSAGES/messages.po b/oarepo_ui/translations/cs/LC_MESSAGES/messages.po index 3a651d56..32d1d0c2 100644 --- a/oarepo_ui/translations/cs/LC_MESSAGES/messages.po +++ b/oarepo_ui/translations/cs/LC_MESSAGES/messages.po @@ -588,3 +588,41 @@ msgstr "" msgid "Change" msgstr "Změnit" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:9 +msgid "ORCID profile" +msgstr "ORCID profil" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:14 +msgid "Scopus ID profile" +msgstr "Scopus ID profil" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:19 +msgid "ROR profile" +msgstr "ROR profil" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:24 +msgid "WOS Researcher ID" +msgstr "WOS Researcher ID" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:29 +msgid "ISNI profile" +msgstr "ISNI profil" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:34 +msgid "DOI profile" +msgstr "DOI profil" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:39 +msgid "GND profile" +msgstr "GND profil" + +msgid "Your draft has validation errors. Please correct them and try again:" +msgstr "" +"Váš koncept obsahuje validační chyby. Opravte je prosím a zkuste to znovu." + +msgid "Draft deleted successfully. Redirecting to your dashboard ..." +msgstr "Koncept byl úspěšně smazán. Přesměrování na vaši nástěnku..." + +msgid "Delete draft" +msgstr "Smazat koncept" diff --git a/oarepo_ui/translations/en/LC_MESSAGES/messages.po b/oarepo_ui/translations/en/LC_MESSAGES/messages.po index 99d6ed54..2d3d9c92 100644 --- a/oarepo_ui/translations/en/LC_MESSAGES/messages.po +++ b/oarepo_ui/translations/en/LC_MESSAGES/messages.po @@ -628,3 +628,40 @@ msgid "" "If you are certain that you wish to proceed with the generic community, " "please click on it below." msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:9 +msgid "ORCID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:14 +msgid "Scopus ID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:19 +msgid "ROR profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:24 +msgid "WOS Researcher ID" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:29 +msgid "ISNI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:34 +msgid "DOI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:39 +msgid "GND profile" +msgstr "" + +msgid "Your draft has validation errors. Please correct them and try again:" +msgstr "" + +msgid "Draft deleted successfully. Redirecting to your dashboard ..." +msgstr "" + +msgid "Delete draft" +msgstr "" diff --git a/oarepo_ui/translations/messages.mo b/oarepo_ui/translations/messages.mo index 28924e17d6f2a28f5665eb576e1efeabca222c6c..b47a13773c4cf4ba171f74df12afd486d19da160 100644 GIT binary patch delta 20 bcmeBX?q;6Q$7QK&WT{|iVr5`DamHr=J8K43 delta 20 bcmeBX?q;6Q$7P{wWTs$fXk~0NamHr=J2nPU diff --git a/oarepo_ui/translations/messages.pot b/oarepo_ui/translations/messages.pot index 6a3c4062..cd1e1c38 100644 --- a/oarepo_ui/translations/messages.pot +++ b/oarepo_ui/translations/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-08-26 11:34+0200\n" +"POT-Creation-Date: 2024-09-29 14:05+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -49,7 +49,7 @@ msgstr "" msgid "api.versions" msgstr "" -#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/resources/config.py:126 +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/resources/config.py:140 msgid "JSON" msgstr "" @@ -77,6 +77,34 @@ msgstr "" msgid "Edit item" msgstr "" +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:9 +msgid "ORCID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:14 +msgid "Scopus ID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:19 +msgid "ROR profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:24 +msgid "WOS Researcher ID" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:29 +msgid "ISNI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:34 +msgid "DOI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:39 +msgid "GND profile" +msgstr "" + #: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifiersAndLinks.jinja:3 #: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifiersAndLinks.jinja:4 msgid "Identifiers and links" @@ -183,19 +211,19 @@ msgstr "" msgid "Version: %(version)s" msgstr "" -#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:45 +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:42 msgid "Menu" msgstr "" -#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:64 +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:61 msgid "Close menu" msgstr "" -#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:114 +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:111 msgid "Requests" msgstr "" -#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:116 +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/oarepo_ui/header.html:113 msgid "Inbox" msgstr "" @@ -248,6 +276,9 @@ msgstr "" msgid "Remove field" msgstr "" +msgid "Your draft has validation errors. Please correct them and try again:" +msgstr "" + msgid "Community website" msgstr "" @@ -288,7 +319,7 @@ msgstr "" msgid "Community website." msgstr "" -msgid "Delete" +msgid "Delete draft" msgstr "" msgid "Cancel" @@ -409,12 +440,7 @@ msgstr "" msgid "Draft published successfully. Redirecting to record's detail page ..." msgstr "" -msgid "Draft deleted successfully. Redirecting to the main page ..." -msgstr "" - -msgid "" -"Your draft was saved. If you wish to preview it, please correct the " -"following validation errors and click preview again:" +msgid "Draft deleted successfully. Redirecting to your dashboard ..." msgstr "" msgid "Your draft was saved. Redirecting to the preview page..." From a3929ad8e466eaad1ecc7e2bd2e601dcb43984c2 Mon Sep 17 00:00:00 2001 From: ducica Date: Tue, 1 Oct 2024 08:42:04 +0200 Subject: [PATCH 05/12] modified save --- .../semantic-ui/js/oarepo_ui/forms/hooks.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js index c568bd03..398b52b8 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/hooks.js @@ -178,7 +178,11 @@ export const useDepositApiClient = ({ ? new baseApiClient(createUrl, recordSerializer) : new OARepoDepositApiClient(createUrl, recordSerializer); - async function save(saveWithoutDisplayingValidationErrors = false) { + async function save({ + saveWithoutDisplayingValidationErrors = false, + errorMessage = null, + successMessage = null, + } = {}) { let response; let errorsObj = {}; const errorPaths = []; @@ -212,9 +216,11 @@ export const useDepositApiClient = ({ if (response.errors.length > 0) { errorsObj["BEvalidationErrors"] = { errors: response.errors, - errorMessage: i18next.t( - "Draft saved with validation errors. Fields listed below that failed validation were not saved to the server" - ), + errorMessage: + errorMessage || + i18next.t( + "Draft saved with validation errors. Fields listed below that failed validation were not saved to the server" + ), errorPaths, }; } @@ -222,7 +228,8 @@ export const useDepositApiClient = ({ return false; } if (!saveWithoutDisplayingValidationErrors) - errorsObj["successMessage"] = i18next.t("Draft saved successfully."); + errorsObj["successMessage"] = + successMessage || i18next.t("Draft saved successfully."); return response; } catch (error) { // handle 400 errors. Normally, axios would put messages in error.response. But for example @@ -354,7 +361,9 @@ export const useDepositApiClient = ({ async function preview() { setSubmitting(true); try { - const saveResult = await save(true); + const saveResult = await save({ + saveWithoutDisplayingValidationErrors: true, + }); if (saveResult?.links?.self_html) { const url = saveResult.links.self_html; From 4a655d2defa70391589c19b27eb5dc4bfb59636f Mon Sep 17 00:00:00 2001 From: ducica Date: Wed, 2 Oct 2024 09:07:28 +0200 Subject: [PATCH 06/12] removed too generic button override styles --- .../oarepo_ui/themes/default/elements/button.overrides | 7 ------- 1 file changed, 7 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/button.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/button.overrides index b1e8723e..cbee7dd3 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/button.overrides +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/button.overrides @@ -1,10 +1,3 @@ -.rel-mb-1 { - & .ui.button { - background: none; - padding: 5px; - } -} - .ui.button { &.clear-filters-button { color: black; From ed19fbbf9b013e1c8e62b76ae4a7f62e398fdd7f Mon Sep 17 00:00:00 2001 From: ducica Date: Wed, 2 Oct 2024 09:56:49 +0200 Subject: [PATCH 07/12] fixed file preview icons --- .../templates/components/datafields/files/FilesViewer.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oarepo_ui/templates/components/datafields/files/FilesViewer.jinja b/oarepo_ui/templates/components/datafields/files/FilesViewer.jinja index 6b21a9ca..075b3702 100644 --- a/oarepo_ui/templates/components/datafields/files/FilesViewer.jinja +++ b/oarepo_ui/templates/components/datafields/files/FilesViewer.jinja @@ -22,14 +22,14 @@ {{ file.size | filesizeformat }} {% if file.links.preview %} - {% endif %} -