From 5980e21ff5dbbbb6596f0866aa6b6d0f4266a11c Mon Sep 17 00:00:00 2001 From: ducica Date: Thu, 12 Sep 2024 16:23:57 +0200 Subject: [PATCH 1/6] testing one ui for communities --- .../CommunitySelector/CommunityItem.jsx | 27 +++++++--- .../CommunitySelector/SelectedCommunity.jsx | 54 +++++-------------- .../themes/default/elements/image.overrides | 4 +- .../themes/default/globals/site.overrides | 8 +++ 4 files changed, 44 insertions(+), 49 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx index f89e7501..4b94aed7 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx @@ -1,11 +1,12 @@ import React from "react"; -import { List, Header } from "semantic-ui-react"; +import { List, Header, Icon } from "semantic-ui-react"; import Overridable from "react-overridable"; import PropTypes from "prop-types"; import { i18next } from "@translations/oarepo_ui/i18next"; import { Image } from "react-invenio-forms"; export const CommunityItem = ({ community, handleClick }) => { + console.log(community); const { id, title, description, website, logo } = community; return ( { -
{title}
- {description &&

{description}

} - {website && ( +
e.stopPropagation()} + href={community.links.self_html} target="_blank" rel="noopener noreferrer" - onClick={(e) => e.stopPropagation()} - href={website} > - {i18next.t("Community website")} + {title} +
+ {description &&

{description}

} + {website && ( + + + e.stopPropagation()} + href={website} + > + {website} + + )}
diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx index bd6c2100..2551efc0 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx @@ -1,9 +1,9 @@ import React from "react"; import { useFormikContext, getIn } from "formik"; -import { useFormConfig } from "@js/oarepo_ui"; +import { useFormConfig, CommunityItem } from "@js/oarepo_ui"; import PropTypes from "prop-types"; import { i18next } from "@translations/oarepo_ui/i18next"; -import { Header, Message, Icon, Button } from "semantic-ui-react"; +import { Header, Message, Icon, Button, List } from "semantic-ui-react"; import { GenericCommunityMessage } from "./CommunitySelector"; export const SelectedCommunity = ({ fieldPath }) => { @@ -26,6 +26,7 @@ export const SelectedCommunity = ({ fieldPath }) => { const handleCommunityRemoval = () => { setFieldValue(fieldPath, ""); }; + console.log(selectedCommunity); return ( {values?.id ? ( @@ -41,45 +42,18 @@ export const SelectedCommunity = ({ fieldPath }) => { )}

)} -
-
- {/* TODO: the link is to the community landing page which is not yet ready */} - e.stopPropagation()} - href={selectedCommunity?.links?.self_html} - aria-label={i18next.t("Community home page")} - > - {selectedCommunity?.title} - -
- {!values?.id && - allowed_communities.length > 1 && - !preselected_community && ( - - )} -
- -

{selectedCommunity?.description}

- {selectedCommunity?.website && ( - - e.stopPropagation()} - href={selectedCommunity?.website} - > - {i18next.t("Community website.")} - - + {selectedCommunity && ( + + + )} + {!values?.id && + allowed_communities.length > 1 && + !preselected_community && ( + + )} {isGeneric ? ( diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides index 07b6a37f..93718688 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides @@ -1,6 +1,6 @@ .ui.image.community-image img { - max-height: 80px; - min-width: 80px; + max-height: 100px; + min-width: 100px; object-fit: contain; } diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides index 70af9627..ba7f1621 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides @@ -35,3 +35,11 @@ .visually-hidden { visibility: hidden; } + +// .inline-computer { +// display: inline-block; + +// @media all and (max-width: @largestMobileScreen) { +// display: block; +// } +// } From 839fd60ad6b3ec58fec808fcf99e641cdd931df7 Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 15 Sep 2024 21:37:45 +0200 Subject: [PATCH 2/6] unified community item with community subheader representation --- .../CommunitySelector/CommunityItem.jsx | 20 ++++++++----- .../CommunitySelector/SelectedCommunity.jsx | 30 +++++++++++-------- .../themes/default/elements/image.overrides | 6 ++-- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx index 4b94aed7..73a2b213 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/CommunityItem.jsx @@ -2,20 +2,21 @@ import React from "react"; import { List, Header, Icon } from "semantic-ui-react"; import Overridable from "react-overridable"; import PropTypes from "prop-types"; -import { i18next } from "@translations/oarepo_ui/i18next"; import { Image } from "react-invenio-forms"; export const CommunityItem = ({ community, handleClick }) => { - console.log(community); - const { id, title, description, website, logo } = community; + const { id, title, website, logo, organizations } = community; return ( - handleClick(id)} className="flex"> -
+ handleClick(id)} + className="flex align-items-center" + > +
@@ -29,7 +30,6 @@ export const CommunityItem = ({ community, handleClick }) => { {title} - {description &&

{description}

} {website && ( @@ -43,6 +43,12 @@ export const CommunityItem = ({ community, handleClick }) => { )} + {organizations && ( +
+ + {organizations.map((o) => o.name).join(", ")} +
+ )}
@@ -51,5 +57,5 @@ export const CommunityItem = ({ community, handleClick }) => { CommunityItem.propTypes = { community: PropTypes.object.isRequired, - handleClick: PropTypes.func.isRequired, + handleClick: PropTypes.func, }; diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx index 2551efc0..3935e299 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx @@ -3,8 +3,9 @@ import { useFormikContext, getIn } from "formik"; import { useFormConfig, CommunityItem } from "@js/oarepo_ui"; import PropTypes from "prop-types"; import { i18next } from "@translations/oarepo_ui/i18next"; -import { Header, Message, Icon, Button, List } from "semantic-ui-react"; +import { Message, Icon, Button, List } from "semantic-ui-react"; import { GenericCommunityMessage } from "./CommunitySelector"; +import { Trans } from "react-i18next"; export const SelectedCommunity = ({ fieldPath }) => { const { @@ -26,7 +27,6 @@ export const SelectedCommunity = ({ fieldPath }) => { const handleCommunityRemoval = () => { setFieldValue(fieldPath, ""); }; - console.log(selectedCommunity); return ( {values?.id ? ( @@ -36,24 +36,28 @@ export const SelectedCommunity = ({ fieldPath }) => { )}

) : ( -

- {i18next.t( - "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." + + 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. Click here to + {allowed_communities.length > 1 && !preselected_community && ( + )} -

+ the selection. + )} + {selectedCommunity && ( )} - {!values?.id && - allowed_communities.length > 1 && - !preselected_community && ( - - )} {isGeneric ? ( diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides index 93718688..e781882c 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/elements/image.overrides @@ -1,6 +1,6 @@ -.ui.image.community-image img { - max-height: 100px; - min-width: 100px; +.ui.image.community-selector-image img { + max-height: 80px; + min-width: 80px; object-fit: contain; } From 0845b41b164af41373361fb90d69c08df1ae8a8e Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 15 Sep 2024 21:52:23 +0200 Subject: [PATCH 3/6] fixed up translation --- .../CommunitySelector/SelectedCommunity.jsx | 28 ++++++------ .../messages/cs/LC_MESSAGES/translations.json | 2 +- .../translations/cs/LC_MESSAGES/messages.mo | Bin 11378 -> 11767 bytes .../translations/cs/LC_MESSAGES/messages.po | 36 +++++++++++++++ .../translations/en/LC_MESSAGES/messages.po | 33 ++++++++++++++ oarepo_ui/translations/messages.mo | Bin 395 -> 395 bytes oarepo_ui/translations/messages.pot | 41 ++++++++++++------ 7 files changed, 111 insertions(+), 29 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx index 3935e299..459912eb 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx @@ -3,7 +3,7 @@ import { useFormikContext, getIn } from "formik"; import { useFormConfig, CommunityItem } from "@js/oarepo_ui"; import PropTypes from "prop-types"; import { i18next } from "@translations/oarepo_ui/i18next"; -import { Message, Icon, Button, List } from "semantic-ui-react"; +import { Header, Message, Icon, Button, List } from "semantic-ui-react"; import { GenericCommunityMessage } from "./CommunitySelector"; import { Trans } from "react-i18next"; @@ -29,30 +29,30 @@ export const SelectedCommunity = ({ fieldPath }) => { }; return ( - {values?.id ? ( + {values?.id && (

{i18next.t( "Your record will be published in the following community:" )}

- ) : ( - - 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. Click here to - {allowed_communities.length > 1 && !preselected_community && ( + )} + {!values?.id && + allowed_communities.length > 1 && + !preselected_community && ( + + 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. Click - )} - the selection. - - )} - + to change the selection. + + )} {selectedCommunity && ( 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..d37fff7f 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","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. Click<1>hereto change the selection.":"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. Klikněte<1>zdepro změnu výběru."} \ 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..5015b4d4786e08bc7fa937d698381bd162aa5061 100644 GIT binary patch delta 2479 zcmYM!e@xX?7{~F4UxEUrm=Xkd4UsECf?5P#p@tcTB7+JObpc(2Kp+AZZ0%-Z(VVUV z4a3!HSsQC^b+?EX{u9w`&9NG*Ij6I+tXa-<)1l>hf4FChUGD3g^ZkC$d7kH-@4dGD zW=-IHLgW$S?=AjQ`2Q$Uz5oBR=bEjgn}hdYHEzW=d;?G6V^})RECS!eXdJ-1@woFd z%%neoUc7?YW&ul#HJii0MrWC`5(^lA8W&+d&c{zM4ZpwzIEDH68!p7OI5Xz9T-0;x zo!d~?>oEa4F`D(QZ?-|?n8bxaWG?$071$|^$8XVxKjEXefI;2=6gFWSZpCv*Q7nsS z705c&JjJMhH=&ALjZv&`J83A=I^<(re5r&7FarWECF?&2Q|Se*I$Qxte7ta zRDpVa2M%H#GNs){Z9yzwN-T9D^;c#k3_O7Qa4n9YCb*0wXV+anoQ*;DX5a?xPCEG zeXGDDVPuFa>Cf;GO-oN^U(ttCco3C&?Y*HNq+wL$P9iy45VZxTF-!0N@3Re}BD3sH>*Zfs1;etUPdK)43qT!57QuM z8%HgC0X6X@WKO$*s>mY3Rv;Ou39@k~Zoo!-7x`G^QnMaR#~OSOb^k4AtS7XkDHu>` zGihkzLR0{cpfcHv+PmGT>+P6{-B^qtpzgnjIvanW=9@uPD2|i73o~#F?nj-SNhB6K zw~YF0Z~kFGZ$a37p@pJR6`1c#MIEke)cpmhk`|#R+~WG%Q332hie}xY!}|`Z0w3Z* z45IEUP7j0{m2BYs4ERw$odeEa@Co`U%iWnkRiqm=@gdhAL@n?s>a7_=E%2S|pLI^7 zDs}~x;Eezco&Knd&|z7MDqTKmyaKh*^QeqF-Szz#L;pDHY@9$%IO3de*QZd2?!4>Y zaz?BO%@>HHk;4tisMA`CitriK9yK7lV}1BA4r3W!#z@T14BhWT1-cO{GS^aT!D{!tFH5mQT8a`AsevX1^ zMGKad+ln3+1_>9}V6{IS;Xe^;3v2A5SQ^C;iY|-A+}hrseh0eTdtc|A-}#;MJ>PSF zzrPw{>%2RG(VfQUAir#WUyN4m#V325*&M1lI0b8PHEzHT?7fds zp2Py`U*l}NgY(QhOPpYqKtqYM-1#b&(!LU3!rhpRM{pW`i7D8Rui!0A#pH=*jBP>G zeRG}FsOxnYz|EM*{I>mhfygnF3+>2Qb_x|(4<_M7tiUU{9M!1)D{u>Lz}0vSNs46= ztpdqIjZ=gQcrhx;H8_U(Z50JY8bQAHE`Lg4GtR;fu@X-*p^|1LZ3>EX2o>o=Q~*y~s`lX--nCj|z$k&Sa zQ$R~m_rH!uF@g+X!>BD7K`ksPmHcaEAzByVHVol8)BwLCi?ShCk0IH&zg>GG8>xWP zQSCXXzzR_d3!xTJit1N|I>gJd9N!L*e@*Zi4MFTit>7x^3=AN1+3%=2Piy1t-K}Ow+%JHUew-oqB3&U zwMS7a_!gCctEiR#gro2g60^lH2NSrc0P|2=5kj6G&&nt$rS+&(Z+7)oB+J&0opENL z;~eS>xl4Q4fNQV`Z{iiyio3G>7ttUpGxw3T*)S^gaZ@=T7#REEwWx7bD0LVrYJwL#3%^ZyS8O`JiV zH1Kq!$rhk8Qi}?t5jDUjd<&cLJ-mThSp|PPu>l+K7OH>obl)&)OY2dYU5}my{(yo4 z*nwKfN2t9!jJkdv3owe+_%o`1X3#$yxu^jbqB67$8?g~r;bqj>8OzD$R!c)|O-U~M zuhU;jgC?p*WnhK#4bj>rpH1Mr9<58o1xpe?U!e5B2msK~3^`0`}Dii!rryxijsP(GS&rp J>k7}r{||mG-N^s| diff --git a/oarepo_ui/translations/cs/LC_MESSAGES/messages.po b/oarepo_ui/translations/cs/LC_MESSAGES/messages.po index 3a651d56..ec282138 100644 --- a/oarepo_ui/translations/cs/LC_MESSAGES/messages.po +++ b/oarepo_ui/translations/cs/LC_MESSAGES/messages.po @@ -588,3 +588,39 @@ msgstr "" msgid "Change" msgstr "Změnit" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:7 +msgid "ORCID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:12 +msgid "Scopus ID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:17 +msgid "ROR profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:22 +msgid "WOS Researcher ID" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:27 +msgid "DOI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:32 +msgid "GND profile" +msgstr "" + +msgid "change" +msgstr "" + +msgid "" +"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. " +"Click<1>hereto change the selection." +msgstr "" +"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. Klikněte<1>zdepro " +"změnu výběru." diff --git a/oarepo_ui/translations/en/LC_MESSAGES/messages.po b/oarepo_ui/translations/en/LC_MESSAGES/messages.po index 99d6ed54..4001b53b 100644 --- a/oarepo_ui/translations/en/LC_MESSAGES/messages.po +++ b/oarepo_ui/translations/en/LC_MESSAGES/messages.po @@ -628,3 +628,36 @@ 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:7 +msgid "ORCID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:12 +msgid "Scopus ID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:17 +msgid "ROR profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:22 +msgid "WOS Researcher ID" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:27 +msgid "DOI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:32 +msgid "GND profile" +msgstr "" + +msgid "change" +msgstr "" + +msgid "" +"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. " +"Click<1>hereto change the selection." +msgstr "" diff --git a/oarepo_ui/translations/messages.mo b/oarepo_ui/translations/messages.mo index 28924e17d6f2a28f5665eb576e1efeabca222c6c..e27217d699b4a75e38b1b01cd2075448b33e5105 100644 GIT binary patch delta 20 bcmeBX?q;6Q$7QK&XsTdjXk}_RamHr=J2VDR 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..b5093cba 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-15 21:51+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -77,6 +77,30 @@ msgstr "" msgid "Edit item" msgstr "" +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:7 +msgid "ORCID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:12 +msgid "Scopus ID profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:17 +msgid "ROR profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:22 +msgid "WOS Researcher ID" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:27 +msgid "DOI profile" +msgstr "" + +#: /home/dusanst/oarepo-ui/oarepo-ui/oarepo_ui/templates/components/IdentifierBadge.jinja:32 +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" @@ -248,9 +272,6 @@ msgstr "" msgid "Remove field" msgstr "" -msgid "Community website" -msgstr "" - msgid "Community selection" msgstr "" @@ -276,16 +297,8 @@ msgstr "" msgid "" "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." -msgstr "" - -msgid "Community home page" -msgstr "" - -msgid "Change" -msgstr "" - -msgid "Community website." +"saving it will not be possible to transfer it to another community. " +"Click<1>hereto change the selection." msgstr "" msgid "Delete" From a93ce130f26361887776f2b3172892ab0c0c5804 Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 15 Sep 2024 21:54:40 +0200 Subject: [PATCH 4/6] removed unused styles --- .../less/oarepo_ui/themes/default/globals/site.overrides | 8 -------- 1 file changed, 8 deletions(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides index ba7f1621..70af9627 100644 --- a/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides +++ b/oarepo_ui/theme/assets/semantic-ui/less/oarepo_ui/themes/default/globals/site.overrides @@ -35,11 +35,3 @@ .visually-hidden { visibility: hidden; } - -// .inline-computer { -// display: inline-block; - -// @media all and (max-width: @largestMobileScreen) { -// display: block; -// } -// } From 86bab61cf9cf5886637002fab4146d13ae8ea742 Mon Sep 17 00:00:00 2001 From: ducica Date: Sun, 15 Sep 2024 21:55:33 +0200 Subject: [PATCH 5/6] removed unused import --- .../forms/components/CommunitySelector/SelectedCommunity.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx index 459912eb..6bd0e880 100644 --- a/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx +++ b/oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/forms/components/CommunitySelector/SelectedCommunity.jsx @@ -3,7 +3,7 @@ import { useFormikContext, getIn } from "formik"; import { useFormConfig, CommunityItem } from "@js/oarepo_ui"; import PropTypes from "prop-types"; import { i18next } from "@translations/oarepo_ui/i18next"; -import { Header, Message, Icon, Button, List } from "semantic-ui-react"; +import { Message, Icon, Button, List } from "semantic-ui-react"; import { GenericCommunityMessage } from "./CommunitySelector"; import { Trans } from "react-i18next"; From 36f5095c92e6784b181fbb4fb894d0a392ec328f Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Mon, 7 Oct 2024 16:00:45 +0200 Subject: [PATCH 6/6] Added signposting header --- oarepo_ui/resources/resource.py | 10 +++++++--- oarepo_ui/resources/signposting.py | 30 ++++++++++++++++++++++++++++++ setup.cfg | 2 +- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 oarepo_ui/resources/signposting.py diff --git a/oarepo_ui/resources/resource.py b/oarepo_ui/resources/resource.py index f6685149..3bc6d0f1 100644 --- a/oarepo_ui/resources/resource.py +++ b/oarepo_ui/resources/resource.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Iterator import deepmerge -from flask import abort, g, redirect, request +from flask import abort, g, redirect, request, Response from flask_principal import PermissionDenied from flask_resources import ( Resource, @@ -30,6 +30,7 @@ from werkzeug.exceptions import Forbidden from oarepo_ui.utils import dump_empty +from .signposting import response_header_signposting from .templating.data import FieldData @@ -187,6 +188,7 @@ def ui_model(self): # helper function to avoid duplicating code between detail and preview handler @request_read_args @request_view_args + @response_header_signposting def _detail(self, *, is_preview=False): if is_preview: api_record = self._get_record(resource_requestctx, allow_draft=is_preview) @@ -258,10 +260,12 @@ def _detail(self, *, is_preview=False): "is_preview": is_preview, } - return current_oarepo_ui.catalog.render( + response = Response(current_oarepo_ui.catalog.render( render_method, **render_kwargs, - ) + ), mimetype="text/html", status=200) + response._api_record = api_record + return response def detail(self): """Returns item detail page.""" diff --git a/oarepo_ui/resources/signposting.py b/oarepo_ui/resources/signposting.py new file mode 100644 index 00000000..31daa322 --- /dev/null +++ b/oarepo_ui/resources/signposting.py @@ -0,0 +1,30 @@ +from functools import wraps + + +def response_header_signposting(f): + """Add signposting link to view's reponse headers. + + :param headers: response headers + :type headers: dict + :return: updated response headers + :rtype: dict + """ + + @wraps(f) + def inner(*args, **kwargs): + response = f(*args, **kwargs) + if response.status_code != 200: + return response + if not hasattr(response, "_api_record"): + return response + + signposting_link = response._api_record.links['self'] + response.headers.update( + { + "Link": f'<{signposting_link}> ; rel="linkset" ; type="application/linkset+json"', # noqa + } + ) + + return response + + return inner diff --git a/setup.cfg b/setup.cfg index 0c219df5..1aceaa9b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-ui -version = 5.2.12 +version = 5.2.13 description = UI module for invenio 3.5+ long_description = file: README.md long_description_content_type = text/markdown