rename opened document history
This commit is contained in:
@@ -63,6 +63,16 @@ export function TrackingHistoryView() {
|
||||
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>[]>(
|
||||
() => [
|
||||
{
|
||||
@@ -103,7 +113,7 @@ export function TrackingHistoryView() {
|
||||
header: ({ column }) => (
|
||||
<div className="column">
|
||||
<span>
|
||||
Дата / время
|
||||
{t('date')} / {t('time')}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
@@ -148,7 +158,7 @@ export function TrackingHistoryView() {
|
||||
header: ({ column }) => (
|
||||
<div className="column">
|
||||
<span>
|
||||
viewer
|
||||
{t('who-opened')}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
@@ -183,7 +193,7 @@ export function TrackingHistoryView() {
|
||||
header: ({ column }) => (
|
||||
<div className="column">
|
||||
<span>
|
||||
Местоположение
|
||||
{t('location')}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
|
||||
@@ -208,7 +218,11 @@ export function TrackingHistoryView() {
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<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>
|
||||
)
|
||||
},
|
||||
@@ -254,7 +268,7 @@ export function TrackingHistoryView() {
|
||||
<h3
|
||||
className="tanstak-table-title"
|
||||
>
|
||||
История открытий
|
||||
{t('history-of-opened')}
|
||||
</h3>
|
||||
{/* Фильтры */}
|
||||
<div className="tanstak-table-filtres">
|
||||
|
||||
@@ -467,7 +467,14 @@
|
||||
"please-enter-template-name": "Please enter template name",
|
||||
"template-saved-successfully": "Template saved successfully",
|
||||
"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": {
|
||||
"and": "and",
|
||||
|
||||
@@ -467,7 +467,14 @@
|
||||
"please-enter-template-name": "Пожалуйста, введите название шаблона",
|
||||
"template-saved-successfully": "Шаблон успешно сохранен",
|
||||
"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": {
|
||||
"and": "и",
|
||||
|
||||
Reference in New Issue
Block a user