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

MSCR-297 Comment off all console.log statements #36

Merged
merged 1 commit into from
Dec 7, 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
2 changes: 1 addition & 1 deletion mscr-ui/src/common/components/simple-api-service/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function PromisesTest() {
.then((data) => {
setState(data);
setResp(false);
console.log('data', data);
// console.log('data', data);
})
.catch((err) => {
console.error('Error:', err);
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/common/components/smart-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default function SmartHeader({
}

function renderDesktopAuthenticationPanel() {
console.log(user, fakeableUsers);
// console.log(user, fakeableUsers);
if (!isSmall) {
return (
<DesktopAuthenticationPanel user={user} fakeableUsers={fakeableUsers} />
Expand Down
6 changes: 3 additions & 3 deletions mscr-ui/src/common/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default function BasicTable() {
return crosswalk;
});

console.log('schemaData: ', schemaData);
console.log('schemas: ', schemas);
// console.log('schemaData: ', schemaData);
// console.log('schemas: ', schemas);

return (
<div>
Expand All @@ -50,7 +50,7 @@ export default function BasicTable() {
}}
deleteDisabled={false}
></SchemaList>

{'Crosswalks'}
<Separator isLarge />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function FileUpload({
if (importResponseData?.jobtoken || importResponseData?.jobToken) {
const timerId = setTimeout(() => {
if (importResponseData.jobToken) {
console.log(importResponseData.jobToken);
// console.log(importResponseData.jobToken);
}
}, 1000);
return () => clearTimeout(timerId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ export default function UpdateWithFileModal({
if (fileData) {
const formData = new FormData();
formData.append('file', fileData);
console.log('in file modal' + formData);
// console.log('in file modal' + formData);
//We need the file upload status to set the progress indication
//setStartFileUpload(true);
setUserPosted(true);
if (fileData.name.includes('.json')) {
setFileType('json');
console.log('start posting');
// console.log('start posting');
postSchemaFile({ pid: pid, file: formData });
} else if (fileData.name.includes('.csv')) {
setFileType('csv');
console.log('start posting');
// console.log('start posting');
postCrosswalkFile({ pid: pid, file: formData });
}
}
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/common/utils/create-getserversideprops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function createCommonGetServerSideProps<

if (process.env.ENV_TYPE !== 'production') {
store.dispatch(getFakeableUsers.initiate());
console.log('getting fake user');
// console.log('getting fake user');
await Promise.all(store.dispatch(getFakeableRunningQueriesThunk()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function CrosswalkSelectionModal({
}, [crosswalkFormInitialData]);

useEffect(() => {
console.log('BACK FROM EFFECT', result, userPosted, router);
// console.log('BACK FROM EFFECT', result, userPosted, router);

if (result.isSuccess && result?.originalArgs?.format === 'MSCR') {
// MSCR = to be edited with crosswalk editor
Expand All @@ -87,7 +87,7 @@ export default function CrosswalkSelectionModal({
if (Object.values(errors).includes(true)) {
return;
}
console.log('!!!! formData', formData);
// console.log('!!!! formData', formData);
const payload = generatePayload(formData);
handleClose();
putCrosswalk(payload);
Expand Down
8 changes: 4 additions & 4 deletions mscr-ui/src/modules/create-crosswalk/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export default function CrosswalkForm({
setDefaultSchemas(defaultSchemas2);
setDefaultInitValues();
setDataLoaded(true);
console.log('schemas', defaultSchemas);
// console.log('schemas', defaultSchemas);

}, [isSuccess]);

useEffect(() => {
console.log('!!!!!!!!! formData', formData);
// console.log('!!!!!!!!! formData', formData);
}, [formData]);

function setDefaultInitValues() {
Expand All @@ -77,7 +77,7 @@ export default function CrosswalkForm({
...formData,
sourceSchema: value.toString(),
});
console.log('SOURCE SET', formData);
// console.log('SOURCE SET', formData);
}
}

Expand All @@ -87,7 +87,7 @@ export default function CrosswalkForm({
...formData,
targetSchema: value.toString(),
});
console.log('TARGET SET', formData);
// console.log('TARGET SET', formData);
}
}

Expand Down
14 changes: 7 additions & 7 deletions mscr-ui/src/modules/crosswalk-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
};

const selectFromTree = (node: CrosswalkConnectionNew, isTargetTree: boolean) => {
console.log('SELECT FROM TREE CALLED', node);
// console.log('SELECT FROM TREE CALLED', node);
const nodeIds: React.SetStateAction<string[]> = [];
if (isTargetTree) {
nodeIds.push(node.target.id);
Expand Down Expand Up @@ -534,7 +534,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
};

function saveCroswalk() {
console.log('save clicked');
// console.log('save clicked');
}

function loadCroswalk() {
Expand Down Expand Up @@ -597,7 +597,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
if (isSourceTree) {
sourceTreeData.forEach(elem => {
if (jsonPathReady.includes(elem.elementPath)) {
console.log('final match', elem);
// console.log('final match', elem);
pathObjects.push(elem);
}
});
Expand All @@ -606,7 +606,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
} else {
targetTreeData.forEach(elem => {
if (jsonPathReady.includes(elem.elementPath)) {
console.log('final match', elem);
// console.log('final match', elem);
pathObjects.push(elem);
}
});
Expand All @@ -626,7 +626,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
}

function findElementPathsFromTree(tree: RenderTree[], itemToFind: string, results: string[]) {
console.log('FINDING FROM TREE', tree, itemToFind);
// console.log('FINDING FROM TREE', tree, itemToFind);
tree.forEach(item => {
if (item.elementPath && item.elementPath.toLowerCase().includes(itemToFind.toLowerCase())) {
results.push(item.elementPath);
Expand All @@ -637,7 +637,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
}
}
});
console.log('!!!! FIND RESULT', results);
// console.log('!!!! FIND RESULT', results);
return results;
}

Expand Down Expand Up @@ -684,7 +684,7 @@ export default function CrosswalkEditor({crosswalkId}: { crosswalkId: string })
// FOUND MATCHING SUBTREES
let filteredTreeData: RenderTree[] = [];

console.log('!!!!!! FILTERED TREE DATA', filteredTreeData);
// console.log('!!!!!! FILTERED TREE DATA', filteredTreeData);
buildNestedFilterTree(filterTreeData(isSourceTree ? sourceTreeData : targetTreeData, Array.from(nodesToProcessUnique), filteredTreeData));

if (treeDataNew && treeDataNew.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CrosswalkConnectionNew } from '@app/common/interfaces/crosswalk-connect
export default function validateMapping(input: CrosswalkConnectionNew) {
const validationErrors: string[] = [];
if (input.source.type === input.target.type) {
console.log('is valid');
// console.log('is valid');
} else {
validationErrors.push('Type mismatch');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export default function NodeInfo(props: { isAnySelectedLinked: boolean; isBothSe
let sourceSelectionInit = '';
let targetSelectionInit = '';

console.log('NODE INFO SOURCE', props.sourceData);
console.log('NODE INFO TARGET', props.targetData);
// console.log('NODE INFO SOURCE', props.sourceData);
// console.log('NODE INFO TARGET', props.targetData);

useEffect(() => {
if (props.sourceData && props.sourceData.length > 0) {
sourceSelectionInit = props.sourceData[0].id;
setSourceDropdownValue(props.sourceData[0].id);
console.log('props.sourceData');
// console.log('props.sourceData');
}
if (props.targetData && props.targetData.length > 0) {
targetSelectionInit = props.targetData[0].id;
Expand Down Expand Up @@ -198,4 +198,4 @@ export default function NodeInfo(props: { isAnySelectedLinked: boolean; isBothSe
)}
</div>
</>);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function SchemaTree({
const handleToggle = (event: React.SyntheticEvent, nodeIds: string[]) => {
performTreeAction(isSourceTree, 'treeToggle', event, nodeIds);
};
console.log('TREEVIEW DATA', nodes, treeSelectedArray);
// console.log('TREEVIEW DATA', nodes, treeSelectedArray);
return (
<TreeView
aria-label="controlled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ export default function MetadataAndFiles(props: { crosswalks: CrosswalkConnectio
const [inputValue, setInputValue] = useState(detailsInit);

useEffect(() => {
console.log('INPUT', inputValue);
// console.log('INPUT', inputValue);
}, [inputValue]);

function updateValue(paramName: string, value: any) {
console.log('!!! UPDATE CALLED', paramName, value);
// console.log('!!! UPDATE CALLED', paramName, value);
const val = value === undefined ? '' : value.toString();
const details = {...inputValue};
details[paramName] = val;
console.log('AFTER UPDATE', details)
// console.log('AFTER UPDATE', details)
setInputValue(details);
};

function updateValuesOnInit(prevDetails: any, paramName: string, value: any) {
console.log('!!! UPDATE CALLED', paramName, value);
// console.log('!!! UPDATE CALLED', paramName, value);
const val = value === undefined ? '' : value.toString();
const details = {...prevDetails};
details[paramName] = val;
console.log('AFTER UPDATE', details)
// console.log('AFTER UPDATE', details)
setInputValue(details);
return details;
};
Expand Down Expand Up @@ -174,4 +174,4 @@ export default function MetadataAndFiles(props: { crosswalks: CrosswalkConnectio
</div>
</div>
</>);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function CrosswalkFormModal({
}

const payload = generatePayload(formData);
console.log(formData);
// console.log(formData);
const crosswalkFormData = new FormData();
crosswalkFormData.append('metadata', JSON.stringify(payload));
if (fileData) {
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/modules/schema-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function SchemaForm({
if (!organizationsData) {
return [];
}
console.log(organizationsData[0].id);
// console.log(organizationsData[0].id);
return getOrganizations(organizationsData, i18n.language)
.map((o) => ({
labelText: o.label,
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/modules/schema-form/schema-form-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default function SchemaFormModal({ refetch }: SchemaFormModalProps) {
return [];
}

console.log(errors);
// console.log(errors);

const langsWithError = Object.entries(errors)
.filter(([_, value]) => Array.isArray(value))
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/modules/schema-form/validate-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function validateForm(
data: SchemaFormType,
fileData: File | null | undefined
) {
console.log(FormData);
// console.log(FormData);
const errors: FormErrors = {
languageAmount: false,
titleAmount: [],
Expand Down
6 changes: 3 additions & 3 deletions mscr-ui/src/modules/schema-view/metadata-and-files/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export default function MetadataAndFiles({
}: {
schemaDetails?: SchemaWithVersionInfo;
schemaFiles?: SchemaFileData[];





}) {
const { t } = useTranslation('common');
const lang = router.locale ?? '';

if (schemaDetails?.fileMetadata) {
console.log(schemaDetails.fileMetadata);
// console.log(schemaDetails.fileMetadata);
schemaFiles = schemaDetails.fileMetadata;
} else {
schemaFiles = [];
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/pages/crosswalk-view/[...pid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface IndexPageProps extends CommonContextState {
}

export default function SchemaPage(props: IndexPageProps) {
console.log('PAGE PROPS', props)
// console.log('PAGE PROPS', props)
const { query, asPath } = useRouter();
const crosswalkId = (query?.pid ?? '') as string;
let crosswalk: Crosswalk;
Expand Down