Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed lint issues. #177

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@
},
"optionalDependencies": {
"bufferutil": "^4.0.6",
"react-icons": "4.10.1",
"scripture-resources-rcl": "5.1.0",
"utf-8-validate": "^5.0.9",
"react-icons": "4.10.1"
"utf-8-validate": "^5.0.9"
},
"overrides": {
"react": "$react",
Expand All @@ -204,4 +204,4 @@
"word-aligner": "$word-aligner",
"@mui/lab": "$@mui/lab"
}
}
}
10 changes: 0 additions & 10 deletions renderer/src/components/EditorPage/BookMarks/Bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ export default function Bookmarks() {
}).finally(() => setIsLoading(false));
};

// useEffect(() => {
// console.log('tempChapter', tempChapter, chapter);
// timeout(2000).then(async () => {
// setIsLoading(true);
// onChangeChapter(tempChapter);
// onChangeVerse('1');
// }).then(() => setIsLoading(false));
// // eslint-disable-next-line react-hooks/exhaustive-deps
// }, [tempChapter]);

return (
<>
<div className="bg-gray-800 uppercase text-white text-xs p-2 tracking-wider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ const { t } = useTranslation();
if (window?.navigator?.onLine) {
await checkandDownloadObsImages(window?.navigator?.onLine);
}
// else {
// console.log('No internet connection');
// }
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Expand Down
4 changes: 0 additions & 4 deletions renderer/src/components/EditorPage/ObsEditor/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
return content;
// Do something with the content
} catch (error) {
console.error('Error reading blob:', error);

Check warning on line 57 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 57 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
}
}

Expand All @@ -62,8 +62,7 @@
const filePath = `${newPath}/${username}/resources/${projectName}/content/${file}.md`;
const { data } = await sbStorageDownload(filePath);
const parsedData = readBlobAsync(data);
console.log({ filePath, data, parsedData });

Check warning on line 65 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 65 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
if (parsedData) {
return parsedData;
}
Expand Down Expand Up @@ -151,15 +150,13 @@
};

const webCore = async (num, projectName, username) => {
console.log({ num, projectName, username });
const stories = [];
// eslint-disable-next-line prefer-const

Check warning on line 154 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 154 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
let id = 1; let footer = false;
const data = await loadWebData(num.toString().padStart(2, 0), projectName, username);
console.log({ data });
const allLines = data.split(/\r\n|\n/);
// Reading line by line
allLines.forEach((line) => {

Check warning on line 159 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 159 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
// To avoid the values after footer, we have added id=0
if (line && id !== 0) {
if (line.match(/^(\s)*#/gm)) {
Expand Down Expand Up @@ -230,8 +227,7 @@
}
}
});
console.log({ stories });
return stories;
};

export { core, webCore };

Check warning on line 233 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 233 in renderer/src/components/EditorPage/ObsEditor/core.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function MultiComboBox({
.toLowerCase()
.replace(/\s+/g, '')
.includes(query.toLowerCase().replace(/\s+/g, '')));
// console.log({ options, selectedOption });

useEffect(() => {
if (selectedOption === null && options.length > 0) {
Expand Down
40 changes: 2 additions & 38 deletions renderer/src/components/EditorPage/Scribex/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReferenceContext } from '@/components/context/ReferenceContext';
import { ProjectContext } from '@/components/context/ProjectContext';
import EmptyScreen from '@/components/Loading/EmptySrceen';
import {
insertVerseNumber, insertChapterNumber, insertFootnote, insertXRef,
insertVerseNumber, insertChapterNumber, insertFootnote, insertXRef,
} from '@/util/cursorUtils';
import RecursiveBlock from './RecursiveBlock';

Expand Down Expand Up @@ -134,45 +134,9 @@ export default function Editor(props) {
if (insertVerseRChapter === 'Cross Reference') {
insertXRef(caretPosition, newVerChapNumber, selectedText);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [triggerVerseInsert]);

// useEffect(() => {
// let pressedKeys = [];
// const handleKeyDown = (e) => {
// const copyKeys = ['Control', 'c'];
// const pasteKeys = ['Control', 'v'];
// pressedKeys.push(e.key);
// if (pressedKeys.join('+') === copyKeys.join('+')) {
// e.preventDefault();
// copyText();
// pressedKeys = [];
// }
// if (pressedKeys.join('+') === pasteKeys.join('+')) {
// e.preventDefault();
// pasteText();
// pressedKeys = [];
// }
// // if (e.key === 's') { console.log("savingssssssssss") }
// // if (e.key === 'Control' && e.key === 'c') {
// // console.log("copying")
// // e.preventDefault();
// // // Call your custom copy function
// // copyText();
// // } else if (e.metaKey && e.key === 'v') {
// // console.log("pasting")
// // e.preventDefault();
// // // Call your custom paste function
// // pasteText();
// // }
// };

// document.addEventListener('keydown', handleKeyDown);
// return () => {
// document.removeEventListener('keydown', handleKeyDown);
// };
// }, []);

const scrollReference = (chapterNumber) => {
const refEditors = document.getElementsByClassName('ref-editor');
refEditors.length > 0 && Array.prototype.filter.call(refEditors, (refEditor) => {
Expand Down
1 change: 0 additions & 1 deletion renderer/src/components/EditorPage/Scribex/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const Popup = ({
handleClose, handleButtonClick, title, isPopupOpen, selectedText,
}) => {
const [number, setNumber] = useState('');
// console.log({ title }, "title");
const handleInputChange = (event) => {
setNumber(event.target.value);
};
Expand Down
2 changes: 0 additions & 2 deletions renderer/src/components/EditorPage/Scribex/RecursiveBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ export default function RecursiveBlock({
const checkCurrentVerse = () => {
if (document.getSelection().rangeCount >= 1 && onReferenceSelected) {
const range = document.getSelection().getRangeAt(0);
// console.log({ range })
const selectedNode = range.startContainer;
// console.log({ selectedNode })
const verse = getCurrentVerse(selectedNode);
const chapter = getCurrentChapter(selectedNode);
// if (onReferenceSelected) {
Expand Down
2 changes: 0 additions & 2 deletions renderer/src/components/Login/Signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@
password,
});
if (data.session) {
console.log('sign in success', data);
await localforage.setItem('userProfile', data);

Check warning on line 22 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 22 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
const userData = await localforage.getItem('userProfile');
console.log({ userData });
router.push('/projects');

Check warning on line 25 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 25 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
setLoading(false);
} else {
setError(signInError);
setLoading(false);
console.log('sign in error', signInError);
}
};

Check warning on line 31 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 31 in renderer/src/components/Login/Signin.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

return (
<div className="flex items-center justify-center h-screen">
Expand Down
1 change: 1 addition & 0 deletions renderer/src/components/Profile/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
// if(!process.env.NEXT_PUBLIC_IS_ELECTRON){
const { error } = await supabaseSignout();
localforage.removeItem('userProfile');
// eslint-disable-next-line no-console

Check warning on line 29 in renderer/src/components/Profile/UserProfile.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 29 in renderer/src/components/Profile/UserProfile.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
error ? console.log({ error }) : router.push('/login');
};
// }
Expand Down
1 change: 0 additions & 1 deletion renderer/src/components/Projects/NewWebProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@
setLoading(true);
if (newProjectFields.projectName && newProjectFields.abbreviation) {
const value = await createSupabaseProject(call, metadata, update, headerDropDown);
console.log({ value });

Check warning on line 180 in renderer/src/components/Projects/NewWebProject.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement

Check warning on line 180 in renderer/src/components/Projects/NewWebProject.js

View workflow job for this annotation

GitHub Actions / Lint Run

Unexpected console statement
const status = value[0];
logger.debug('NewProject.js', status.value);
setLoading(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const downloadImageAndSave = async (url, savePath, fs) => {
const blob = await response.blob();
const arrayBuffer = await blob.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
console.log({ blob, arrayBuffer, buffer });
if (blob.type.includes('image')) {
await fs.createWriteStream(savePath).write(buffer);
}
Expand All @@ -33,12 +32,12 @@ async function downloadImageAndSaveSupabase(url) {
const img = document.createElement('img');
img.src = imageUrl;
document.body.appendChild(img);
const { data, error } = await sbStorageUpload(`${packageInfo.name}/common/${environment.OBS_IMAGE_DIR}`, blob);
const { error } = await sbStorageUpload(`${packageInfo.name}/common/${environment.OBS_IMAGE_DIR}`, blob);
if (error) {
// eslint-disable-next-line no-console
console.log('error uploading images to supabase', { error });
throw error;
}
console.log(data);
} catch (error) {
console.error('Error fetching image:', error);
}
Expand Down Expand Up @@ -74,7 +73,6 @@ export const checkandDownloadObsImages = async () => {
await createDirectory({ path: obsImagePath });
}
const { data: filesInDir } = await sbStorageDownload(obsImagePath);
console.log({ filesInDir });
Object.values(OBSData).forEach(async (storyObj) => {
Object.values(storyObj.story).forEach(async (story) => {
let fileName = story.url.split('/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ const DownloadCreateSBforHelps = async (projectResource, setLoading, update = fa
const userProfile = await localForage.getItem('userProfile');
const username = userProfile?.user?.email;
try {
console.log('DownloadCreateSBforHelps.js', 'In helps-resource download');
setLoading(true);
const folder = `${newPath}/${username}/resources`;
const { data: existingResource } = await sbStorageDownload(folder);
console.log(existingResource);
const downloadProjectName = `${projectResource?.name}_${projectResource?.owner}_${projectResource?.release?.tag_name}`;
existingResource?.forEach((element) => {
if (downloadProjectName === element.name) {
Expand All @@ -151,7 +149,6 @@ const DownloadCreateSBforHelps = async (projectResource, setLoading, update = fa

await fetch(projectResource?.zipball_url).then((res) => res.arrayBuffer()).then(async (blob) => {
const { data: folderExist } = await sbStorageList(folder);
console.log({ folderExist });
if (!folderExist) {
await createDirectory({ path: folder });
}
Expand All @@ -161,6 +158,7 @@ const DownloadCreateSBforHelps = async (projectResource, setLoading, update = fa
// extract zip
const { data: filecontent, error: fileContentError } = await sbStorageDownload(`${folder}/${projectResource?.name}.zip}`);
if (fileContentError) {
// eslint-disable-next-line no-console
console.log('Failed to download zip file', fileContentError);
}

Expand All @@ -183,14 +181,12 @@ const DownloadCreateSBforHelps = async (projectResource, setLoading, update = fa
data.lastUpdatedAg = moment().format();
await createDirectory({ path: `${folder}/${projectResource?.name}/metadata.json`, payload: JSON.stringify(data) });
}).catch((err) => {
// eslint-disable-next-line no-console
console.log('DownloadCreateSBforHelps.js', 'failed to save yml metadata.json : ', err);
});

// finally remove zip and rename base folder to projectname_id
console.log('DownloadCreateSBforHelps.js', 'deleting zip file - rename project with project + id in ag format');
if (folderExist) {
console.log('DownloadCreateSBforHelps.js', 'deleting zip file - rename project with project + id in ag format');

if (update && update?.status) {
// if updation delete old resource
console.log({ projectOld: `${projectResource?.name}_${projectResource?.owner}_${update?.prevVersion}` });
Expand All @@ -207,7 +203,6 @@ const DownloadCreateSBforHelps = async (projectResource, setLoading, update = fa
});
} catch (error) {
setLoading(false);
console.log('DownloadCreateSBforHelps.js', error);
}
}
};
Expand Down
Loading
Loading