- client: Fix client tracker source links
Close #1813 Squashed commit of the following: commit 7f2286cb6e36f90ca19f2830b341d34af513c9a3 Merge: e9f2e08b9640752dAuthor: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 3 11:55:46 2020 +0300 Merge branch 'master' into fix/1813 commit e9f2e08b608ad14e5b327ab86d8faa66784bae44 Merge: ecee0977f5a1f311Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 3 11:49:52 2020 +0300 Merge branch 'master' into fix/1813 commit ecee0977ab5439d3be2a99447a771871f0340a2e Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri Jul 3 11:35:10 2020 +0300 Capitalize category names commit b4b47ce0177369fb4da5ad2e10a78b2d96bd81c6 Author: ArtemBaskal <a.baskal@adguard.com> Date: Thu Jul 2 18:11:40 2020 +0300 - client: Fix client tracker source links
This commit is contained in:
@@ -7,7 +7,8 @@ import {
|
||||
LONG_TIME_FORMAT,
|
||||
SCHEME_TO_PROTOCOL_MAP,
|
||||
} from '../../../helpers/constants';
|
||||
import { formatDateTime, formatTime } from '../../../helpers/helpers';
|
||||
import { captitalizeWords, formatDateTime, formatTime } from '../../../helpers/helpers';
|
||||
import { getSourceData } from '../../../helpers/trackers/trackers';
|
||||
|
||||
const getDomainCell = (props) => {
|
||||
const {
|
||||
@@ -20,8 +21,6 @@ const getDomainCell = (props) => {
|
||||
|
||||
const hasTracker = !!tracker;
|
||||
|
||||
const source = tracker && tracker.sourceData && tracker.sourceData.name;
|
||||
|
||||
const lockIconClass = classNames('icons', 'icon--small', 'd-none', 'd-sm-block', 'cursor--pointer', {
|
||||
'icon--active': answer_dnssec,
|
||||
'icon--disabled': !answer_dnssec,
|
||||
@@ -55,10 +54,14 @@ const getDomainCell = (props) => {
|
||||
protocol,
|
||||
};
|
||||
|
||||
const sourceData = getSourceData(tracker);
|
||||
|
||||
const knownTrackerDataObj = {
|
||||
name_table_header: tracker && tracker.name,
|
||||
category_label: tracker && tracker.category,
|
||||
source_label: source && <a href={`//${source}`} className="link--green">{source}</a>,
|
||||
category_label: tracker && captitalizeWords(tracker.category),
|
||||
source_label: sourceData
|
||||
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
|
||||
className="link--green">{sourceData.name}</a>,
|
||||
};
|
||||
|
||||
const renderGrid = (content, idx) => {
|
||||
@@ -71,7 +74,8 @@ const getDomainCell = (props) => {
|
||||
|
||||
const getGrid = (contentObj, title, className) => [
|
||||
<div key={title} className={classNames('pb-2 grid--title', className)}>{t(title)}</div>,
|
||||
<div key={`${title}-1`} className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
|
||||
<div key={`${title}-1`}
|
||||
className="grid grid--limited">{React.Children.map(Object.entries(contentObj), renderGrid)}</div>,
|
||||
];
|
||||
|
||||
const requestDetails = getGrid(requestDetailsObj, 'request_details');
|
||||
|
||||
Reference in New Issue
Block a user