Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
(feature) Redacted page (#357)
Browse files Browse the repository at this point in the history
* added 'redacted page' support

* added 'redacted page' support for filters
  • Loading branch information
Blaumaus authored Sep 5, 2023
1 parent fe2d579 commit 9af9366
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/pages/Captcha/View/components/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const Filter = ({
displayFilter = countries.getName(filter, language)
}

if (column === 'pg') {
displayFilter = filter || t('project.redactedPage')
}

displayFilter = _truncate(displayFilter)

return (
Expand Down
25 changes: 25 additions & 0 deletions app/pages/Project/View/ViewProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2443,6 +2443,10 @@ const ViewProject = ({
id={type}
onFilter={filterHandler}
onFragmentChange={setPgActiveFragment}
rowMapper={({ name: entryName }) => {
// todo: add uppercase
return entryName || t('project.redactedPage')
}}
name={pgPanelNameMapping[pgActiveFragment]}
data={panelsData.data[type]}
customTabs={customTabs}
Expand Down Expand Up @@ -2571,6 +2575,27 @@ const ViewProject = ({
)
}

if (type === 'pg') {
return (
<Panel
t={t}
key={type}
icon={panelIcon}
id={type}
activeTab={activeTab}
onFilter={filterHandler}
name={panelName}
data={panelsDataPerf.data[type]}
customTabs={customTabs}
valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}
rowMapper={({ name: entryName }) => {
// todo: add uppercase
return entryName || t('project.redactedPage')
}}
/>
)
}

return (
<Panel
t={t}
Expand Down
4 changes: 4 additions & 0 deletions app/pages/Project/View/components/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const Filter = ({
displayFilter = countries.getName(filter, language)
}

if (column === 'pg') {
displayFilter = filter || t('project.redactedPage')
}

displayFilter = _truncate(displayFilter)

return (
Expand Down
1 change: 1 addition & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@
"br": "Browser",
"os": "OS name"
},
"redactedPage": "Redacted page",
"overview": "Overview",
"weeklyStats": "Weekly stats",
"statsFor": "Stats for",
Expand Down

0 comments on commit 9af9366

Please sign in to comment.