diff --git a/src/components/dashboard/users/BlockedTagList.tsx b/src/components/dashboard/users/BlockedTagList.tsx index b8ae5081cf..b5cf44d0a8 100644 --- a/src/components/dashboard/users/BlockedTagList.tsx +++ b/src/components/dashboard/users/BlockedTagList.tsx @@ -12,7 +12,7 @@ const createButtonElement = ({tag}) => ({ }); type IProps = { - tag: any; + tag?: string; } const BlockedTagList: FunctionComponent = ({tag}: IProps) => { diff --git a/src/components/dashboard/users/CheckBoxListItem.tsx b/src/components/dashboard/users/CheckBoxListItem.tsx index af15769e47..c26b4f5335 100644 --- a/src/components/dashboard/users/CheckBoxListItem.tsx +++ b/src/components/dashboard/users/CheckBoxListItem.tsx @@ -4,30 +4,31 @@ type IProps = { className?: string; Name?: string; Id?: string; + ItemType?: string; AppName?: string; checkedAttribute?: string; } -const createCheckBoxElement = ({className, Name, Id, AppName, checkedAttribute}) => ({ +const createCheckBoxElement = ({className, Name, dataAttributes, AppName, checkedAttribute}) => ({ __html: `` }); -const CheckBoxListItem: FunctionComponent = ({className, Name, Id, AppName, checkedAttribute}: IProps) => { +const CheckBoxListItem: FunctionComponent = ({className, Name, Id, ItemType, AppName, checkedAttribute}: IProps) => { return (
({ ` }); +type RatingsArr = { + Name: string; + Value: number; +} + type IProps = { className?: string; label?: string; - parentalRatings: any + parentalRatings: RatingsArr[]; } const SelectMaxParentalRating: FunctionComponent = ({ className, label, parentalRatings }: IProps) => { - const renderOption = ratings => { + const renderOption = () => { let content = ''; - for (const rating of ratings) { + for (const rating of parentalRatings) { content += ``; } return content; @@ -32,7 +37,7 @@ const SelectMaxParentalRating: FunctionComponent = ({ className, label, dangerouslySetInnerHTML={createSelectElement({ className: className, label: globalize.translate(label), - option: renderOption(parentalRatings) + option: renderOption() })} /> ); diff --git a/src/components/pages/UserParentalControl.tsx b/src/components/pages/UserParentalControl.tsx index 98e3dba548..81418a588d 100644 --- a/src/components/pages/UserParentalControl.tsx +++ b/src/components/pages/UserParentalControl.tsx @@ -13,9 +13,9 @@ import SectionTabs from '../dashboard/users/SectionTabs'; import loading from '../loading/loading'; import toast from '../toast/toast'; -type Ratings = { +type RatingsArr = { Name: string; - Value: string; + Value: number; } type ItemsArr = { @@ -35,7 +35,7 @@ const UserParentalControl: FunctionComponent = () => { const populateRatings = useCallback((allParentalRatings) => { let rating; - const ratings: Ratings[] = []; + const ratings: RatingsArr[] = []; for (let i = 0, length = allParentalRatings.length; i < length; i++) { rating = allParentalRatings[i]; @@ -186,7 +186,7 @@ const UserParentalControl: FunctionComponent = () => { user.Policy.BlockUnratedItems = Array.prototype.filter.call(element?.current?.querySelectorAll('.chkUnratedItem'), function (i) { return i.checked; }).map(function (i) { - return i.getAttribute('data-id'); + return i.getAttribute('data-itemtype'); }); user.Policy.AccessSchedules = getSchedulesFromPage(); user.Policy.BlockedTags = getBlockedTagsFromPage(); @@ -303,7 +303,7 @@ const UserParentalControl: FunctionComponent = () => { return ;