delete unnecessary things (console.log, commented out, folder)

detail note:

1. brandActions.js
2. mainActions.js
3. myPageActions.js
4.FeaturedCreatorsContents.jsx
5. LiveChannelsHorizontalProductList.jsx
6. RandomUnit.jsx
7. ImagePanel.jsx
8. OnSalePanel.jsx
9. FeautredVideoPlayer (folder)
This commit is contained in:
younghoon100.park
2024-07-30 18:34:23 +09:00
parent 73da969558
commit 1b532609bf
11 changed files with 5 additions and 304 deletions

View File

@@ -184,43 +184,6 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
const onSuccess = (response) => {
// console.log("getBrandRecommendedShowInfo onSuccess", response.data);
// pyh, delete later
// const brandRecommendedShowCategoryInfo =
// response.data.data?.brandRecommendedShowCategoryInfo;
// const brandRecommendedShowInfo =
// response.data.data?.brandRecommendedShowInfo;
// const firstCatCd = brandRecommendedShowCategoryInfo[0]?.catCd.toString();
// let filteredBrandRecommendedShowInfo;
// if (
// brandRecommendedShowCategoryInfo &&
// brandRecommendedShowInfo &&
// firstCatCd
// ) {
// if (catCd === undefined) {
// filteredBrandRecommendedShowInfo = brandRecommendedShowInfo
// .filter((showInfo) => firstCatCd === showInfo?.catCd)
// .slice(0, 10);
// } else {
// filteredBrandRecommendedShowInfo = brandRecommendedShowInfo
// .filter((showInfo) => catCd === showInfo?.catCd)
// .slice(0, 10);
// }
// }
// const data = {
// brandRecommendedShowCategoryInfo,
// brandRecommendedShowInfo: filteredBrandRecommendedShowInfo,
// };
// dispatch({
// type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
// payload: {
// data,
// },
// });
dispatch({
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
payload: {

View File

@@ -64,14 +64,6 @@ export const setMainLiveUpcomingAlarm = (props) => (dispatch, getState) => {
hour: new Date(convertedStrtDt).getHours(),
minute: new Date(convertedStrtDt).getMinutes(),
second: new Date(convertedStrtDt).getSeconds(),
// pyh, delete test case
// year: new Date(testStrtDt).getFullYear(),
// month: new Date(testStrtDt).getMonth() + 1,
// day: new Date(testStrtDt).getDate(),
// hour: new Date(testStrtDt).getHours(),
// minute: new Date(testStrtDt).getMinutes(),
// second: new Date(testStrtDt).getSeconds(),
},
params: {
message: `[${patncNm}] ${showNm}\n${HelperMethods.$L("Watch Now!")}`,

View File

@@ -272,7 +272,6 @@ export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
payload: response.data,
});
// pyh test, deleted
for (let index = showList.length; index--; ) {
dispatch(deleteReservation(showList[index].showId));
}

View File

@@ -122,7 +122,7 @@ export default memo(function FeaturedCreatorsContents({
data-wheel-point
>
<TItemCard
catNm={hstNm} // pyh Todo, no catNm exists
catNm={hstNm}
data-video-card={"featured-creators-video-card-" + contentsIndex}
imageAlt={showNm}
imageSource={thumbnailUrl}

View File

@@ -1,162 +0,0 @@
import React, { memo, useCallback } from "react";
import ReactPlayer from "react-player";
// eslint-disable-next-line
import VideoPlayer from "../../../components/VideoPlayer/VideoPlayer";
import { scaleH, scaleW } from "../../../utils/helperMethods";
export default memo(function FeaturedVideoPlayer({
className,
errorCb,
readyCb,
src,
shouldPlay,
width,
height,
}) {
const handleError = useCallback(
(_, data, hlsInstance, hlsGlobal) => {
// if (typeof window === window.PalmSystem) {
// if (errorCb) {
// errorCb(true);
// }
// return;
// } else {
// if (!hlsGlobal) {
// // Probably not a HLS error
// return;
// }
// console.log("pyh", data);
// switch (data.type) {
// case hlsGlobal.ErrorTypes.NETWORK_ERROR:
// // hls: fatal network error encountered, trying to recover
// if (errorCb) {
// errorCb(true);
// }
// break;
// case hlsGlobal.ErrorTypes.MEDIA_ERROR:
// // hls: fatal media error encountered, trying to recover
// if (errorCb) {
// errorCb(true);
// }
// break;
// default:
// // cannot recover
// hlsInstance.destroy();
// break;
// }
// }
if (!hlsGlobal) {
// Probably not a HLS error
return;
}
switch (data.type) {
case hlsGlobal.ErrorTypes.NETWORK_ERROR:
// hls: fatal network error encountered, trying to recover
if (errorCb) {
errorCb(true);
}
break;
case hlsGlobal.ErrorTypes.MEDIA_ERROR:
// hls: fatal media error encountered, trying to recover
if (errorCb) {
errorCb(false);
}
break;
default:
// cannot recover
hlsInstance.destroy();
break;
}
},
[errorCb]
);
const handleReady = useCallback(() => {
if (readyCb) {
readyCb(true);
}
}, [readyCb]);
// VideoPlayer
// eslint-disable-next-line
const mediainfoHandler = useCallback((e) => {
const type = e.type;
console.log("pyh type", type);
if (type !== "timeupdate") {
console.log("[mediaInfoHandler].....", type);
}
switch (type) {
case "loadeddata":
console.log("[mediaInfoHandler] loaded data");
break;
case "durationchange":
console.log("[mediaInfoHandler] duration", e.currentTarget.duration);
break;
}
}, []);
return (
<div>
{/* <VideoPlayer
className={className}
noAutoShowMediaControls
onError={handleError}
onLoadedData={mediainfoHandler}
onDurationChange={mediainfoHandler}
spotlightDisabled
>
{shouldPlay && (
<source
src={
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"
}
type="video/mp4"
/>
)}
</VideoPlayer> */}
<ReactPlayer
className={className}
onError={handleError}
onReady={handleReady}
playing={shouldPlay}
url={shouldPlay ? src : ""}
width={scaleW(width)}
height={scaleH(height)}
/>
{/* {typeof window === window.PalmSystem ? (
<VideoPlayer
className={className}
noAutoShowMediaControls
onError={handleError}
// onLoadedData={handleReady}
onLoadedData={mediainfoHandler}
onDurationChange={mediainfoHandler}
spotlightDisabled
>
{shouldPlay && <source src={src} type="application/mpegurl" />}
</VideoPlayer>
) : (
<ReactPlayer
className={className}
onError={handleError}
onReady={handleReady}
playing={shouldPlay}
url={shouldPlay ? src : ""}
width={scaleW(width)}
height={scaleH(height)}
/>
)} */}
</div>
);
});

View File

@@ -1,6 +0,0 @@
{
"main": "FeaturedVideoPlayer.jsx",
"style": [
"FeaturedVideoPlayer.module.less"
]
}

View File

@@ -162,7 +162,6 @@ export default memo(function LiveChannelsHorizontalProductList({
);
return (
// pyh, ver. TVirtualGridList
<div className={css.container}>
{brandProductInfo && (
<TVirtualGridList
@@ -177,27 +176,5 @@ export default memo(function LiveChannelsHorizontalProductList({
/>
)}
</div>
// pyh, ver. TScroller
// <div className={css.container}>
// <TScroller
// cbScrollTo={getScrollTo}
// direction="horizontal"
// noScrollByWheel
// >
// <ul>
// {brandProductInfo.map((brandProductInfoItem, itemIndex) => (
// <LiveChannelsHPListItem
// brandProductInfoItem={brandProductInfoItem}
// index={index}
// itemIndex={itemIndex}
// key={"brand-product-info-" + itemIndex}
// patnrId={patnrId}
// showId={showId}
// />
// ))}
// </ul>
// </TScroller>
// </div>
);
});

View File

@@ -18,6 +18,7 @@ import emptyHorImage from "../../../../assets/images/img-home-banner-empty-hor.p
import emptyVerImage from "../../../../assets/images/img-home-banner-empty-ver.png";
import defaultImageItem from "../../../../assets/images/img-thumb-empty-product@3x.png";
import liveShow from "../../../../assets/images/tag-liveshow.png";
import { changeAppStatus } from "../../../actions/commonActions";
import { sendLogTopContents } from "../../../actions/logActions";
import { pushPanel } from "../../../actions/panelActions";
import {
@@ -29,7 +30,6 @@ import usePriceInfo from "../../../hooks/usePriceInfo";
import { LOG_MENU, LOG_TP_NO, panel_names } from "../../../utils/Config";
import { $L, formatGMTString } from "../../../utils/helperMethods";
import css from "./RandomUnit.module.less";
import { changeAppStatus } from "../../../actions/commonActions";
const SpottableComponent = Spottable("div");
@@ -107,7 +107,7 @@ export default function RandomUnit({
contTpNm: currentRandomData?.shptmBanrTpNm ?? "",
dspyTpNm: bannerDataRef.current?.shptmDspyTpNm ?? "",
expsOrd: bannerDataRef.current?.banrLctnNo ?? "",
linkTpCd: "", // pyh todo, get linkTpCd
linkTpCd: "",
patncNm: currentRandomData?.patncNm ?? "",
patnrId: currentRandomData?.patnrId ?? "",
tmplCd: shptmTmplCd,

View File

@@ -122,17 +122,6 @@ export default function ImagePanel({ panelInfo, spotlightId, ...rest }) {
useEffect(() => {
if (panelInfo) {
// console.log(
// "%c pyh panelInfo",
// "background: orange; color:black ",
// panelInfo
// );
// console.log(
// "%c pyh panelInfo length",
// "background: orange; color:black ",
// Object.keys(panelInfo)?.length
// );
setOtherRoomThemeInfos(
brandShowroomInfo
.find(({ roomId }) => roomId === panelInfo?.roomId)
@@ -196,11 +185,6 @@ export default function ImagePanel({ panelInfo, spotlightId, ...rest }) {
setSpotlightDisabled(false);
// console.log(
// "%c pyh initial focus effect",
// "background: green; color: white "
// );
if (initialFocusTarget) {
Spotlight.focus(initialFocusTarget);
}

View File

@@ -7,6 +7,7 @@ import Spotlight from "@enact/spotlight";
import { types } from "../../actions/actionTypes";
import { changeAppStatus } from "../../actions/commonActions";
import { sendLogCuration, sendLogGNB } from "../../actions/logActions";
import { copyCategoryInfos, getOnSaleInfo } from "../../actions/onSaleActions";
import { updatePanel } from "../../actions/panelActions";
import TBody from "../../components/TBody/TBody";
@@ -18,7 +19,6 @@ import { LOG_MENU, LOG_TP_NO, panel_names } from "../../utils/Config";
import OnSaleContents from "./OnSaleContents/OnSaleContents";
import OnSaleNav from "./OnSaleNav/OnSaleNav";
import css from "./OnSalePanel.module.less";
import { sendLogCuration, sendLogGNB } from "../../actions/logActions";
const getExpsOrdByLgCatCd = (array, value) => {
const expsOrd = array.findIndex(({ lgCatCd }) => value === lgCatCd) + 1;
@@ -26,7 +26,6 @@ const getExpsOrdByLgCatCd = (array, value) => {
};
export default function OnSalePanel({ panelInfo, spotlightId }) {
const dispatch = useDispatch();
const categoryInfos = useSelector(
@@ -60,15 +59,6 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
const initialFocusTimeoutJob = useRef(new Job((func) => func(), 100));
const timerRef = useRef(null);
// useEffect(() => {
// console.log(
// "%c pyh panelInfo",
// "background: dodgerblue; color: white ",
// panelInfo,
// Object.keys(panelInfo)?.length
// );
// }, [panelInfo]);
useEffect(() => {
dispatch(sendLogGNB(LOG_MENU.ON_SALE));
}, []);
@@ -107,17 +97,10 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
useEffect(() => {
if (!categories) {
if (previousPanelIsDetail) {
// console.log(
// "%c pyh copied category effect",
// "background: pink; color: black"
// );
return setCategories(copiedCategoryInfos);
}
if (categoryInfos) {
// console.log("%c pyh category effect", "background: pink; color: black");
dispatch(copyCategoryInfos(categoryInfos));
setCategories(categoryInfos);
}
@@ -132,11 +115,6 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
useEffect(() => {
if (selectedLgCatCd) {
// console.log(
// "%c pyh change LgCatCd effect",
// "background: pink; color: black"
// );
dispatch(
getOnSaleInfo({ lgCatCd: selectedLgCatCd, saleInfosIncFlag: "Y" })
);
@@ -145,11 +123,6 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
useEffect(() => {
if (categories && saleInfos) {
// console.log(
// "%c pyh saleInfos effect, first focusable target is ready",
// "background: pink; color: black"
// );
const prdtId = saleInfos[0]?.saleProductInfos[0]?.prdtId;
if (prdtId) {
@@ -184,25 +157,9 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
setSpotlightDisabled(false);
// console.log(
// "%c pyh initial focus effect",
// "background: pink; color: black"
// );
if (initialFocusTarget) {
// console.log(
// "%c pyh initialFocusTarget",
// "background: pink; color: black",
// initialFocusTarget
// );
Spotlight.focus(initialFocusTarget);
} else {
// console.log(
// "%c pyh initial focus target, not exist",
// "background: red; color: white"
// );
if (previousPanelIsHome) {
Spotlight.focus("sale-info-0");
}
@@ -281,7 +238,7 @@ export default function OnSalePanel({ panelInfo, spotlightId }) {
previousPanelIsHome,
previousPanelIsDetail,
selectedLgCatCd,
selectedLgCatNm
selectedLgCatNm,
]);
useEffect(() => {