From 9eb139aaa98a295544d6782ea39db1bc0b38c193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Ka=C5=88ka?= Date: Sun, 20 Oct 2024 16:29:44 +0200 Subject: [PATCH] [Enhancement #520] Vocabulary activity term changes filter A design of filter inputs for term change records in vocabulary activity tab. --- .../vocabulary/TermChangeFrequencyUI.scss | 9 +++ .../vocabulary/TermChangeFrequencyUI.tsx | 69 ++++++++++++++++++- src/i18n/cs.ts | 2 + src/i18n/en.ts | 2 + 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/component/vocabulary/TermChangeFrequencyUI.scss diff --git a/src/component/vocabulary/TermChangeFrequencyUI.scss b/src/component/vocabulary/TermChangeFrequencyUI.scss new file mode 100644 index 00000000..8c71cc6e --- /dev/null +++ b/src/component/vocabulary/TermChangeFrequencyUI.scss @@ -0,0 +1,9 @@ +.cursor-pointer { + cursor: pointer; +} +.color-primary { + color: var(--primary); +} +#date-filter-col { + padding-left: 30px; +} diff --git a/src/component/vocabulary/TermChangeFrequencyUI.tsx b/src/component/vocabulary/TermChangeFrequencyUI.tsx index 6235d1f3..11963b4d 100644 --- a/src/component/vocabulary/TermChangeFrequencyUI.tsx +++ b/src/component/vocabulary/TermChangeFrequencyUI.tsx @@ -10,6 +10,10 @@ import VocabularyContentPersistRow from "../changetracking/VocabularyContentPers import VocabularyContentUpdateRow from "../changetracking/VocabularyContentUpdateRow"; import If from "../misc/If"; import SimplePagination from "../dashboard/widget/lastcommented/SimplePagination"; +import CustomInput from "../misc/CustomInput"; +import Select from "../misc/Select"; +import "./TermChangeFrequencyUI.scss"; +import classNames from "classnames"; interface TermChangeFrequencyUIProps { aggregatedRecords: AggregatedChangeInfo[] | null; @@ -67,6 +71,7 @@ const TermChangeFrequencyUI: React.FC = ({ itemCount, }) => { const { i18n, locale } = useI18n(); + const [showFilter, setShowFilter] = React.useState(false); if (!aggregatedRecords || !changeRecords) { return
 
; } @@ -154,12 +159,74 @@ const TermChangeFrequencyUI: React.FC = ({
+ + + + + - + + + + + + + + + {changeRecords.map((r) => diff --git a/src/i18n/cs.ts b/src/i18n/cs.ts index ebeb3399..00f7bf34 100644 --- a/src/i18n/cs.ts +++ b/src/i18n/cs.ts @@ -821,9 +821,11 @@ const cs = { "history.type": "Typ", "history.type.persist": "Vytvoření", "history.type.update": "Změna", + "history.type.delete": "Smazání", "history.changedAttribute": "Atribut", "history.originalValue": "Původní hodnota", "history.newValue": "Nová hodnota", + "history.filter.datetime": "Období", "changefrequency.label": "Aktivita", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index ea573359..0602ea6d 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -813,9 +813,11 @@ const en = { "history.type": "Type", "history.type.persist": "Creation", "history.type.update": "Update", + "history.type.delete": "Deletion", "history.changedAttribute": "Attribute", "history.originalValue": "Original value", "history.newValue": "New value", + "history.filter.datetime": "Time period", "changefrequency.label": "Activity",
+ {}} + /> +
{i18n("history.whenwho")} {i18n("type.term")} {i18n("history.type")}{i18n("history.changedAttribute")} + {i18n("history.changedAttribute")} + setShowFilter(!showFilter)} + title={i18n("main.nav.search")} + > + + +
+ + + + + + + +