Skip to content

Commit

Permalink
remove logs and testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
jalowe13 committed Nov 22, 2024
1 parent fae17f1 commit cb765f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
33 changes: 7 additions & 26 deletions client/src/components/Submissions/Submissions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const SubmissionsUpload = () => {
};

const { data: allSystems } = useSystems();
console.log('Systems are', allSystems);
let submissionSystem = allSystems.find((s) => s.type === 'submission');
submissionSystem = allSystems.find((s) => s.name === 'My Data (Work)');
const uploadPath = '';

const { status, upload } = useUpload();
Expand All @@ -31,26 +31,13 @@ export const SubmissionsUpload = () => {
const filteredFiles = uploadedFiles.filter(
(f) => status[f.id] !== 'SUCCESS' && !rejectedFiles.includes(f)
);
console.log('Trying to upload with');
console.log('Path', uploadPath);
console.log('FilteredFiles', filteredFiles);

submissionSystem = allSystems.find((s) => s.name === 'My Data (Work)');

if (!submissionSystem || !submissionSystem.system) {
const msg = "System 'submission' does not exist in submission systems";
throw new Error(msg, submissionSystem);
}
console.log('Submission System', submissionSystem);
if (filteredFiles.length > 0) {
let result = upload({
filteredFiles.length > 0 &&
upload({
system: submissionSystem.system,
path: uploadPath,
files: filteredFiles,
reloadCallback,
});
console.log('RESULT', result);
}
};

const dropZoneDisabled = uploadedFiles.length > 0;
Expand Down Expand Up @@ -138,15 +125,10 @@ export const SubmissionsUpload = () => {

const Submissions = () => {
const getSubmitterRole = async () => {
// let response = await fetchUtil({
// url: '/submissions/check-submitter-role/',
// });
// Override for now with fake data
const fakeResponse = {
is_submitter: true,
isLoading: false,
};
return fakeResponse;
let response = await fetchUtil({
url: '/submissions/check-submitter-role/',
});
return response;
};

const useSubmitterRole = () => {
Expand All @@ -159,7 +141,6 @@ const Submissions = () => {

const { data, isLoading } = useSubmitterRole();

console.log('The data is ', data);
const is_submitter = data?.is_submitter;

const Unauthorized = () => (
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Workbench/Workbench.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ function Workbench() {
dispatch({ type: 'PROJECTS_GET_LISTING' });
}
}, [setupComplete]);
console.log('Submissions', showSubmissions);
console.log('Current path:', path, ROUTES.SUBMISSIONS);
return (
<div className="workbench-wrapper">
<NotificationToast />
Expand Down
7 changes: 0 additions & 7 deletions client/src/redux/sagas/datafiles.sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,6 @@ export function* uploadFiles(action) {
}

export function* uploadFile(api, scheme, system, path, file, index) {
console.log('Need to upload at ');
console.log('System', system);
console.log('Path', path);
console.log('File', file);
yield put({
type: 'DATA_FILES_SET_OPERATION_STATUS_BY_KEY',
payload: { status: 'UPLOADING', key: index, operation: 'upload' },
Expand All @@ -551,13 +547,10 @@ export function* uploadFile(api, scheme, system, path, file, index) {
payload: { status: 'SUCCESS', key: index, operation: 'upload' },
});
} catch (e) {
console.log('Found an error of', e);
yield put({
type: 'DATA_FILES_SET_OPERATION_STATUS_BY_KEY',
payload: { status: 'ERROR', key: index, operation: 'upload' },
});
// Add description of error to the state with some kind of put to a reducer

yield put({
type: 'DATA_FILES_SET_ERROR',
payload: { message: e.toString() },
Expand Down
2 changes: 1 addition & 1 deletion server/portal/settings/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"makePublic": True,
"hideApps": False,
"hideDataFiles": False,
"showSubmissions": True,
"showSubmissions": False,
"hideAllocations": False,
"hideManageAccount": False,
"hideSystemStatus": False,
Expand Down

0 comments on commit cb765f5

Please sign in to comment.