rename opened document history
This commit is contained in:
@@ -63,6 +63,16 @@ export function TrackingHistoryView() {
|
|||||||
return nameWithoutExtension.substring(0, maxNameLength) + '...';
|
return nameWithoutExtension.substring(0, maxNameLength) + '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const editLocationName = (location: string | undefined | null, place: 'city' | 'country') => {
|
||||||
|
let notDefinedPlace = (place === 'city') ? t('not-defined-city') : t('not-defined-country');
|
||||||
|
location === 'UNKNOWN' ? notDefinedPlace : location;
|
||||||
|
let response = notDefinedPlace;
|
||||||
|
if (location !== 'UNKNOWN' && location !== undefined && location !== null) {
|
||||||
|
response = location;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
const columns = useMemo<ColumnDef<HistoryViewItem>[]>(
|
const columns = useMemo<ColumnDef<HistoryViewItem>[]>(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
@@ -103,7 +113,7 @@ export function TrackingHistoryView() {
|
|||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column">
|
||||||
<span>
|
<span>
|
||||||
Дата / время
|
{t('date')} / {t('time')}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||||
@@ -148,7 +158,7 @@ export function TrackingHistoryView() {
|
|||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column">
|
||||||
<span>
|
<span>
|
||||||
viewer
|
{t('who-opened')}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||||
@@ -183,7 +193,7 @@ export function TrackingHistoryView() {
|
|||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
<div className="column">
|
<div className="column">
|
||||||
<span>
|
<span>
|
||||||
Местоположение
|
{t('location')}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||||
@@ -208,7 +218,11 @@ export function TrackingHistoryView() {
|
|||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
return (
|
return (
|
||||||
<div className="text-center font-semibold table-item">
|
<div className="text-center font-semibold table-item">
|
||||||
{row.original.city} {row.original.country}
|
{row.original.city === 'UNKNOWN' && row.original.country === 'UNKNOWN' ? (
|
||||||
|
t('not-defined')
|
||||||
|
) : (
|
||||||
|
`${editLocationName(row.original.city, 'city')} / ${editLocationName(row.original.country, 'country')}`
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -254,7 +268,7 @@ export function TrackingHistoryView() {
|
|||||||
<h3
|
<h3
|
||||||
className="tanstak-table-title"
|
className="tanstak-table-title"
|
||||||
>
|
>
|
||||||
История открытий
|
{t('history-of-opened')}
|
||||||
</h3>
|
</h3>
|
||||||
{/* Фильтры */}
|
{/* Фильтры */}
|
||||||
<div className="tanstak-table-filtres">
|
<div className="tanstak-table-filtres">
|
||||||
|
|||||||
@@ -467,7 +467,14 @@
|
|||||||
"please-enter-template-name": "Please enter template name",
|
"please-enter-template-name": "Please enter template name",
|
||||||
"template-saved-successfully": "Template saved successfully",
|
"template-saved-successfully": "Template saved successfully",
|
||||||
"no-claims-complaints-found": "No complaints/claims found",
|
"no-claims-complaints-found": "No complaints/claims found",
|
||||||
"no-notifications": "No notifications"
|
"no-notifications": "No notifications",
|
||||||
|
"who-opened": "Who opened",
|
||||||
|
"time": "Time",
|
||||||
|
"location": "Location",
|
||||||
|
"history-of-opened": "History of opened",
|
||||||
|
"not-defined": "Not defined",
|
||||||
|
"not-defined-city": "The city is not defined",
|
||||||
|
"not-defined-country": "Country not defined"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "and",
|
"and": "and",
|
||||||
|
|||||||
@@ -467,7 +467,14 @@
|
|||||||
"please-enter-template-name": "Пожалуйста, введите название шаблона",
|
"please-enter-template-name": "Пожалуйста, введите название шаблона",
|
||||||
"template-saved-successfully": "Шаблон успешно сохранен",
|
"template-saved-successfully": "Шаблон успешно сохранен",
|
||||||
"no-claims-complaints-found": "Жалобы / претензии не найдены",
|
"no-claims-complaints-found": "Жалобы / претензии не найдены",
|
||||||
"no-notifications": "Нет уведомлений"
|
"no-notifications": "Нет уведомлений",
|
||||||
|
"who-opened": "Кто открыл",
|
||||||
|
"time": "Время",
|
||||||
|
"location": "Местоположение",
|
||||||
|
"history-of-opened": "История открытий",
|
||||||
|
"not-defined": "Не определено",
|
||||||
|
"not-defined-city": "Город не определен",
|
||||||
|
"not-defined-country": "Страна не определена"
|
||||||
},
|
},
|
||||||
"Login-register-form": {
|
"Login-register-form": {
|
||||||
"and": "и",
|
"and": "и",
|
||||||
|
|||||||
Reference in New Issue
Block a user